bulletproof your data guard configuration 12.2 / 18cdays+2019... · evolution of data guard 30...
TRANSCRIPT
@ViscosityNAwww.viscosityna.com
Bulletproof Your Data Guard Configuration
12.2 / 18c
Charles Kim, CEO
Oracle ACE Director
UTOUG, March 2019
@ViscosityNA
• Oracle ACE Director
• Founder and CEO of Viscosity
• Over 27 years of Oracle Expertise: Mission Critical Databases,
RAC, Data Guard, ASM, RMAN, Shareplex/GoldenGate
• Specialize in “Complex Data Replication & Integration” with Shareplex & GG
• President - IOUG Cloud Computing SIG
• Oracle Management Cloud Certified
• Blog Sites: http://DBAExpert.com/blog
• Oracle Exadata Certified Implementation Specialist, (2014, 2016)
• Oracle Certified RAC Expert
Charles Kim @racdba
My Core Expertise:
Oracle Exadata Implementation Specialist, 2014, 2016Oracle RAC Certified ExpertAutomation – I am an Autonomous DBA ☺
What Happens Online in 60 Seconds?Why it is more important to have a DR Strategy
4
Quarterly Tech Deep DivesQ1 2017
Data Guard Book Website
DG Toolkit (Formerly Called DG Menu)
Get Up To Date Scripts: http://DBAExpert.com/dg
Also downloadable from: http://dataguardbook.com
We wrote the books
7
@ViscosityNA
The Cloud JourneyHybrid Cloud
@ViscosityNA
Oracle Release DatesOracle Database 11g Release 1 Aug 2007
Oracle Database 11g Release 2 Sept 2009
Oracle Database 12c Release 1 June 2013
Oracle Database 12c Release 1 (Patchset) - 12.1.0.2 June 2014
Oracle Database 12c Release 2 March 2017
Oracle Database 12c Release 2 First Bundled Patch
May 2017
Oracle Database 12c Release 2 RU (July 18)
July 2017
Oracle 18c - “Cloud First” February 2018
Oracle 18c – Available on Exadata February 2018
Oracle 18c – Available on ODA March 2018
Oracle 18c – On-Premise July 2018
Oracle 19c - Exadata On-Premise Feb 13, 2019
@ViscosityNA
Why Cloud? (IaaS, DBaaS & PaaS)Common Use Cases Cloud Database Provisioning – Easy as 1-2-3
• Data Guard to the Cloud (Disaster Recovery) • Backup to the Cloud (Backup) • Business Critical Workloads in the Cloud (Scale)
– Bursting Workloads into the Cloud
• Dev/QA/Test for 12c Database in the Cloud (Test) – Web Application Development Anywhere (Dev)
• Migration of On-Premise Apps to the Cloud (Migrate) – Lift & Shift of:
• Peoplesoft, • JD Edwards, • E-Business Suite
@ViscosityNA
DBaaS – Backup and Recovery ConfigurationPage 42
11
Cloud Storage Container:Storage-{IdentityDomain}/{Newcontainer}
#3
@ViscosityNA 12
For Standby Database Configuration (on the Service Details page), choose where you want the standby database placed in relation to the primary database:
• High Availability: The standby database is placed in a different availability domain from the primary database, thus providing isolation at the infrastructure level.
• Disaster Recovery: The standby database is placed in a different data center from the primary database, thus providing isolation at the infrastructure level and geographical separation to support availability despite catastrophic events.
Single Instance with Data Guard Standby
@ViscosityNA 13
Database Cloud Service
DR Options
Two options for DR to the cloud using Oracle Database Cloud Services:
» Data Guard utilizing Enterprise Edition Service or High Performance Service. » Active Data Guard utilizing the Extreme Performance Service or Exadata Service
• Active Data Guard is included in the Extreme Performance Database Cloud Service and Exadata Service
• When used in a hybrid configuration, Active Data Guard must also be licensed for the on-premises system
• The Virtual Image Service - Not recommended for DR as it is reduced level of automation and tooling included with this basic service.
Oracle 12cR2 introduced on the Cloud 9/18/2016On-Premise 12cR2 released just under 6 months later on 3/1/17
@ViscosityNA
Oracle Database 18cSimplified Version Number Timelines With RUs and RURs
• 3 digit format – Year.Update.Revision
• Year is the last 2 digits of year a release is delivered – e.g. 18 will be used for the release date ships in late 2017 or early 2018
• Update tracks Release Update (RU)
• Revision tracks the associated RU Revision levels (0,1,2)
@ViscosityNA
Oracle Database 18cSample Version Number Timelines With RUs and RURs
Production April July October January April
18.1.0 18.2.0 18.3.0 18.4.0 18.5.0 18.6.0
18.2.1 18.3.1 18.4.1 18.5.1
18.2.2 18.3.2 18.4.2
In 3 years, you may run either: • 18.12 • 19.5 • 20.1 with additional RU or RUR.
18cOracle
Database
18.1.0Production
18.2.0First Release
Update
18.2.1First Release
UpdateRevision
Oracle Database 19c Extended Support
12.2.0.2
12.2.0.3
@ViscosityNA
Oracle Autonomous Data Warehouse CloudOracle 18c & Exadata
Only need 5 things for provisioning
Self Data Loading Default Settings Load Data and Run
Database Name? Self-Driving From SQL*Net for small data sets
Init.ora optimized for Data Warehouse
Do not define Indexes
Which Data Center?
Self-Securing From Oracle Object Storage for large data
Result Cache is enabled by default
Do not create partitions
# of CPUs? Self-Repairing From AWS S3 Stats are gathered automatically for Direct Load
No Tuning
Size in TB? Self-Tuning Roadmap: Hadoop File Format
All Tables: EHCC (cannot be turned off)
No Database Expertise Needed
Admin Password? Self-Scaling Memory, parallelism, sessions set per OCPU
@ViscosityNA
Oracle Database 18c New Features
Sharded RAC Logically partition data across instances in RAC
Per-PDB Switchover
Transportable Backups Rolling patches for OJVM
Integration with Active Directory Authorization to database through Active Directory user/group mappings to database schema users and roles
Per PDB Key storage Password-less schema creation No default passwords
In-Memory for external tables Automatic propagation of nologging data to standby
Alter Table Merge Partition Online Private Temporary Tables
@ViscosityNA Text “12C” to 444999 for the session slides!
Oracle 18c Autonomous DatabaseExtra 9 from Data Guard
• Continuous Adaptive Performance Tuning • Fully Automated Hardware Resource Elasticity
• SLA: 99.995 % Uptime leveraging – Exadata/RAC/ASM– Active Data Guard– RAC Rolling Upgrade– Transient Logical Standby– Online and Edition Based Re-definiition – Flashback transaction, table, or database
– KSplice on the server side
20
@ViscosityNA
99.995% Uptime
Availability % Downtime per year Downtime per month
99.95% ("three and a half nines")
4.38 hours 21.56 minutes
99.99% ("four nines") 52.56 minutes 4.38 minutes
99.995% ("four and a half nines")
26.28 minutes 2.16 minutes
99.999% ("five nines") 5.26 minutes 25.9 seconds
@ViscosityNA
Data Guard DML Re-Direction
• RUN DML on ADG
• Re-Direct DML statement back to the primary database • Data changes will happen on the primary database • Changed blocks will ship to ADG • ADG wil be in sync to maintain redundancy
@ViscosityNA
Additional 19c New Features
Hybrid Partitioned tables Enables partitions to reside in both Oracle Database segments and in external files and sources. — Enhances functionality of partitioning for Big Data SQL where large portions of a table can reside in external partitions. — Move non-active partitions to external files, such as Oracle Data Pump files, for a cheaper storage solution — Move non-active partitions to Big Data
Propagate restore points to the standby Restore points and GRP is stored in the control file and not propagated to the standby site
With Failover, the standby becomes the new primary and restore point information is LOST
Now, the restore points are preserved after a failover
MIRA + In-Memory ADG
It its one or the other before
Now you can have best of both
@ViscosityNA
Additional 19c New Features
FSFO in “Test” Mode Configure it to Observe only creating a 'test mode' to see when a failover or other interaction would have occurred during the normal production processing - Can tune FSFO for finer granularity - Can see IF FSFO would have actually occurred without production impact - Improve failover validation
Flashback physical standby when the primary database is flashed back
In previous releases, getting the secondary to the same point in time as the primary requires a manual procedure to flash back standby databases. A new parameter is introduced which enables the standby database to be flashed back automatically when Flashback Database is performed on the primary database.
Dynamically Change FSFO target With 12.2, we can have multiple FSFO targets
With 19c, we can change the targets without FSFO being disabled
PDB Recovery Catalog PDBs are now supported as a target database
Can be used with Virtual Private Catalog (VPC)
R2
Upgrading / Patching Considerationsfor Data Guard
PSUs are Very Important for Data Guard (N-1)Note: 756671.1 - Oracle Recommended Patches - Oracle Databasehttp://www.dbaexpert.com/blog/master-reference-for-psus/
FYI: 12.2 Release Date - Release Schedule of Current Database Releases (Doc ID 742060.1)
12.1.0.2
11.2.0.4
Data Guard Standby - First Patch Apply (11.2) Doc ID 1265700.1 - Data Guard Standby-First Patch Apply
What is allowed:• 11.2.0.4 JulPSU to 11.2.0.4
OctPSU• 12.1.0.2 JulPSU to 12.1.02
OctPSU
What is NOT allowed:• 11.2.0.3 JulPSU to 11.2.0.4• 11.2.0.4 JulPSU to 12.1.0.2
28
Starting in Oracle Database 11.2.0.1 and later• Apply candidate patch(see below) first on the standby
database (Binary Only)• Evaluate candidate patch• Switchover• Apply patch(es) on old primary database including DataPatch• Switchover (Switch Back)
Candidates Patches:• Database home interim patches• Exadata bundle patches (e.g. Monthly and quarterly database
patches for Exadata)• Database patch set updates (PSUs)
Read the README.html file
R2
History
Evolution of Data Guard
30
Oracle Version Big Feature Added
Oracle 7.3 Hot Standby
Oracle 8i Read-Only Physical StandbyManaged Recovery
Oracle 9i Logical Standby, Switchover/FailoverAutomatic Gap ResolutionCascaded Redo
Oracle 10g Real-time applyStandby Redo Logs FSFOFlashback Database on DG
Oracle 11g Active Data GuardRedo CompressionSnapshot StandbyRolling Transient UpgradesRMAN Duplicate from Active Database
Oracle 12.1.0.1 Far SyncFast Sync (LOG_ARCHIVE_DEST_n attributes SYNC and NOAFFIRM)Data Guard Broker Switchover EnhancementsSYSDG RoleOnline Standby Database File RenameSignificantly Improved Rolling Upgrades (DBMS_ROLLING)
Evolution of Data Guard
31
Oracle Version Sequences in Oracle Active Data GuardOracle 12.1 Sequences on the primary database must be defined with:
• Cache • NoOrder•• Set Cache Size appropriately like we do in RAC• Goes back to the primary database when requesting next set•• Restriction
• Cannot use NoCache or Order for sequences
Evolution of Data Guard
32
Oracle Version Some Feature AddedMore 12c Release 1 Continued
Alter Database Move Datafile (New in 12c) • Does not impact the standby database• 1* alter database move datafile '+DATA/VCE/DATAFILE/mydata.301.932660559' to '+FRA’ SQL> /
Database altered.
SQL> select file_name from dba_data_files where tablespace_name='MYDATA';
FILE_NAME ----------------------------------------------------+FRA/VCE/DATAFILE/mydata.279.932660601
• DML Operations on Temporary Tables on Oracle Active Data Guard Instances
Additional DG 12.1 New Features Overview
• Resumeable Switchover
• Can do DML operations on Temporary tables on ADG instances
• Do not need using current logfile for real-time apply• DEFAULT: alter database recover managed standby database using current logfile
disconnect;
• Can move location of an online data file … moves on the primary database do not affect the standby
• Can do Incremental Updates over TNS from the standby database
• Can use sequences on ADG• Cache • NoOrder
33
Oracle 12.1: Far Sync InstanceCommon Use Case
Instance
Far Sync (12.1) Zero Data Loss
• SYSDG (12.1) • STARTUP• SHUTDOWN• ALTER DATABASE• ALTER SESSION• ALTER SYSTEM• CREATE RESTORE POINT (including
GUARANTEED Restore Points)• CREATE SESSION• DROP RESTORE POINT (including
GUARANTEED Restore Points)• FLASHBACK DATABASE• SELECT ANY DICTIONARY (DBA_ Views)• SELECT
• X$ Tables• V$ and GV$ Views• APPQOSSYS.WLM_CLASSIFIER_PLAN
• DELETE on APPQOSSYS.WLM_CLASSIFIER_PLAN• EXECUTE SYS.DBMS_DRS
• dgmgrl
35
SYNC NOAFFIRMLimited Distance
ASYNCAny DistanceFar Sync
InstanceStandby
DBTransport compression
Over WAN
PrimaryDB
alter database create far sync instance controlfile as ‘/tmp/farsync.ctl’;
Far Sync Zero Data Loss
36
SYNC NOAFFIRMLimited Distance
ASYNCAny
Distance
Far SyncInstance
StandbyDB
Transport com
pressionO
ver WA
N
PrimaryDB
Primary DB Server: vna85 - Primary DB Name: JIN01FS Server: vna84 - Far Sync Server: JIN01fsPhysical Standby server: ika82 - Physical Standby Name: JIN01_DR
• create configuration JIN01_DGCONFIG as primary database is "JIN01" connect identifier is JIN01;
• add database "JIN01_DR" as connect identifier is JIN01_DR maintained as physical;
• enable configuration;
• add far_sync "JIN01fs" as connect identifier is JIN01fs;• enable far_sync "JIN01fs";
Configure DR to receive from Far Sync using RedoRoutes• EDIT FAR_SYNC "JIN01fs" SET PROPERTY
RedoRoutes='(JIN01:JIN01_DR ASYNC)';
Configure primary to only ship to Far Sync and modify to SYNC• EDIT DATABASE "JIN01" SET PROPERTY RedoRoutes ='(LOCAL:JIN01fs
SYNC)';
R2
Evolution of Data Guard
38
Oracle Version Some Feature AddedOracle 12.2(Some of my favorites)
Block Comparison tool in DGMGRL
Multiple ObserversMultiple Automatic Failover TargetsFast-Start Failover in Max Protection ModeSupport for Transparent Destinations of Different Endianess • Cross Endian Data Guard (I.e AIX to ZDLRA)
In-Memory in Active Data Guard• Offload even more
Support for Diagnostic Pack (AWR) on Active DGSupport for Tuning Pack Features and SQL Plan Analyzer
OEM Support for Database Rolling UpgradesDG Broker Support for Active DG Rolling UpgradesDG Broker will take over session draining (switchover to DALLAS_DR wait;)
Evolution of Data Guard
39
Oracle Version Some Feature AddedOracle 12.2More Favorites
Create standby databases with DBCA
Multiple Instance Redo Apply (MIRA)
Subset Standby Databases* Can do GRP at PDB Level now•Password Automatic Sync
Duplicate Database command to create farsync instance with RMAN
Data Guard Broker can do Scripting like SQL*Plus
@ViscosityNA
Data Guarddbca
• Create standby databases with DBCA – Must use command line dbca interface– Can only create from Non Multi-tenant primary
database– Cannot do RAC– dbca -createDuplicateDB -gdbName global_database_name -primaryDBConnectionString easy_connect_string_to_primary -sid database_system_identifier [-createAsStandby [-dbUniqueName db_unique_name_for_standby]] [-customScripts scripts_list]
• -createAsStandby followed by dbUniqueName For Standby
• [-customScripts scripts_list]
• List of scripts to be executed• Oracle will execute the scripts in the
order they are listed
– No Need for TNSNAMES.ORA entry– Can use easy connect string– "host[:port][/service_name][:server][/instance_name]"
@ViscosityNA
Data Guarddbca
$ dbca -silent -createDuplicateDB \ -gdbName viscorcl \ -primaryDBConnectionString rac01:1521/viscorcl \ -sid viscorcl -createAsStandby \ -dbUniqueName sviscorc Enter SYS user password: Listener config step 33% complete Auxiliary instance creation 66% complete RMAN duplicate 100% complete Look at the log file "/u01/app/oracle/cfgtoollogs/dbca/sviscorc/viscorc.log" for further details.
@ViscosityNA
Data GuardNoLogging & MIRA
NoLogging on Primary • Nologging blocks are recorded in the control
file on the physical standby database • On the StandbyRMAN RECOVER DATABASE NONLOGGED BLOCK
• After switchover, the old primary database must be in a mounted state
Multiple Instance Redo Apply (MIRA) • Can run Redo Apply in some or all of the
standby instances • Redo Apply scales as wide as standby RAC
configuration • ALTER DATABASE RECOVER MANAGED
STANDBY DATABASE command now accepts a new INSTANCES [ ALL | integer] clause
• All the instances must be in the same mounted or open mode
• cannot specify which RAC instance(s) will perform the redo apply
Standby Nologging Standby Nologging tells the database not to log operations that qualify to be done without
logging. Standby Nologging tells the database to send the data blocks created by the
Nologging operation to each qualifying standby database in Data Guard configuration This typically results in those standbys NOT having invalid blocks. You can set standby no logging for load performance or data availability in the following
statements: ▪ALTER DATABASE ▪ALTER PLUGGABLE DATABASE ▪CREATE DATABASE ▪CREATE CONTROLFILE
!43
18c Oracle
Database
Standby Nologging Database nologging extended for better use with Oracle Active Data Guard environment
(without significantly increasing the amount of redo generated). There are two new nologging modes:
Standby Nologging for Load Performance – Standbys receive non-logged data changes (minimum impact on loading speed at). Non-logged blocks automatically resolved by managed standby recovery. Standby Nologging for Data Availability - Standbys have data when primary load commits
(at the cost of throttling the speed of loading data at the primary), which means the standbys never have any non-logged blocks to worry about. Nologging can be used when loading data into your production databases without
compromising the integrity of Data Guard standby databases, pick your level of synchronization between primary & standby databases.
!44
18c Oracle
Database
@ViscosityNA
Data GuardSubset Standbys
• In 12.1, ENABLED_PDBS_ON_STANDBY initialization parameter only supported two values: all PDBs or none
• The ENABLED_PDBS_ON_STANDBY parameter is only applicable on the physical standby database – can accept a list of PDB names or a glob pattern such as “VNAPDB?” or “VNAPDB*a”,
“VNAPDB2”– Glob pattern rules are similar to regular expression rules in common UNIX shells – asterisk (*) and question mark (?) wildcard characters are supported.
• The question mark (?) represents a single unknown character; – the asterisk (*) represents matches to any number of unknown characters. – This parameter also accepts a minus sign (-) which can be used as the first character in a
PDB name to designate that the PDB should be excluded on the standby database
@ViscosityNA
Data GuardBroker Support for Redo Transport of Different Endianness to ZDLRA
ZDLRA
• Can manage a remote redo destination that has a different endianess than the primary database
• Consider cross platform migrations with the ZDLRA and the ability to synchronize databases of heterogeneous configurations with different endianness
• Significantly improve the flexibility of migrating databases from one platform to another with the ZDLRA.
@ViscosityNA
Data GuardIn-Memory with Active Data Guard
In-Memory with Active Data Guard • IM option can be configured on the primary database, on
an ADG standby database, or on both the primary and the ADG standby databases
• The INMEMORY_ADG_ENABLED parameter needs to be enabled – By default, the INMEMORY_ADG_ENABLED parameter is
set to true. • For RAC configuration, this parameter must be set to the
same value across all the RAC instances
@ViscosityNA
PDB Switchover Clause
• Reverses the roles between a refreshable clone PDB and a primary PDB. • The former Refreshable clone PDB becomes the primary PDB, which can
now be opened in read write mode. • The formerly primary PDB now is the refreshable clone and can only be
opened in READ ONLY mode. • This command must be executed from the primary PDB. • The dblink must point to the root CDB where the refreshable clone PDB
resides.
alter pluggable database refresh mode auto every 2 minutes from new_pdb@dblink switchover;
June 11, 2018 48
18c Oracle
Database
49
My Top 12 Common Data Guard
Failures
That maycause
Data Guard failures & outages
Common Data Guard IssuesDay-To-Day Problems That DBAs Face
Common Data Guard FailuresRemoval of archivelogs by accident before applied on the physical standby
For RAC, databases, add datafile to ASM without the + sign for +DATA diskgroup
Primary DB file system or ASM Disk Group space exhaustion db_recovery_file_dest_size• Self inflicted outage
standby_file_management: Default: ManualDealing with UNNAMED datafiles
No PSUs applied
Primary Database Archive Log Destination 100% fullMore Common: Standby Archive Log Destination 100% full
Forget to re-start MRP after reboot or outage
SYS Password Change Broker changesAlter System changes
Other things to consider: Take GRPs before maintenance tasks
Other things to monitor:NOLOGGING transactions on the primary database
Bulletproof DG ConfigurationWhere Does It Start
51
Monitoring • Monitoring Alert Logs on both Primary
and Standby Databases • Monitoring Archive Gaps or Deviances • Monitoring Transport Lag • Monitoring Apply Lag
Proactive • File System Monitoring • ASM Disk Group Monitoring • DB_RECOVERY_FILE_DEST + DB_RECOVERY_FILE_DEST_SIZE
• Latest PSU Patches (N – 1 Consideration) • OEM Full Integration and Lights-out Monitoring • Quarterly Switchover Testing
OEM 13c Cloud Control to monitor and manage a Data Guard environment:
» Data Guard status» Transport Lag» Apply Lag» Estimated Database Role Transition Time » Primary or standby is or is not accessible
Send Alerts!
Best Practice for Monitoring DGOEM 13c Cloud Control Monitoring and Maintenance
52
OEM 13c Cloud Control to monitor and manage a Data Guard environment:
» Data Guard status» Transport Lag» Apply Lag» Estimated Database Role Transition Time » Primary or standby is or is not accessible
Send Alerts!
sysdg privileges (12.1)SQL> create user dgoper identified by oracle123 default tablespace users temporary tablespace temp; User created.
SQL> grant sysdg to dgoper; Grant succeeded.
53
JIN01_DR > dgmgrl dgoper/oracle123@JIN01 DGMGRL for Linux: Version 12.1.0.2.0 - 64bit Production
Copyright (c) 2000, 2013, Oracle. All rights reserved.
Welcome to DGMGRL, type "help" for information. Connected as SYSDG.
• STARTUP• SHUTDOWN• ALTER DATABASE• ALTER SESSION• ALTER SYSTEM• CREATE RESTORE POINT (including GUARANTEED restore points)• CREATE SESSION• DROP RESTORE POINT (including GUARANTEED restore points)• FLASHBACK DATABASE
SELECT ANY DICTIONARYSELECT
• X$ tables (that is, the fixed tables)• V$ and GV$ views (that is, the dynamic performance views)• APPQOSSYS.WLM_CLASSIFIER_PLAN
DELETE• APPQOSSYS.WLM_CLASSIFIER_PLAN
EXECUTE• SYS.DBMS_DRS
SYSDG privilege enables you to connect to the database even if it is not open.
Best Practice RecommendationsAnd General Guidelines
54
• Download DG Toolkit• DG Toolkit has all the best practices in-mind
Network Layer
SDU + BDP
• Set SDU to 32k (default 8k) for SYNC• No performance gain for ASYNC• Max Size = 64k (starting from 11.2.0.2)
• Calculate BDP- Set SEND_BUF_SIZE and RECV_BUF_SIZE
Oracle Net Parameters- Set net.ipv4.tcp_wmem and
net.ipv4.tcp_rmem kernel parameters - Script: dg_bdp.ksh from DG Toolkit
❖ dg_bdp.confOption #1: Set default SDU to be 32k in the SQLNET.ORADEFAULT_SDU_SIZE=32767
• Impacts all databases that share the Oracle Home
Option #2:Or in listener.ora and tnsnames.ora together
Bandwidth-Delay Product = Bandwidth * Latency * 3
cat dg_bdp.confWAN=OC3RTT_RESPONSE=44
$ ./dg_bdp.kshBANDWIDTH is: 155000000LATENCY is: .04400BDP = 2557500
TNSNAMES.ORA ENTRY
VISK_PRI = (DESCRIPTION = (SEND_BUF_SIZE=2557500) (RECV_BUF_SIZE=2557500) (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP) (HOST = rac561-vip) (PORT = 1521)) ) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = VISK) ) )
LISTENER.ORA ENTRY
LISTENER = (DESCRIPTION_LIST = (DESCRIPTION=(ADDRESS_LIST= (ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER))) (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP) (HOST = rac561-vip) (PORT = 1521) (SEND_BUF_SIZE=2557500) (RECV_BUF_SIZE=2557500))) ) SID_LIST_LISTENER = (SID_LIST = (SID_DESC = (ORACLE_HOME = /app/oracle/product/11.2.0/db) (SID_NAME = VISK1) ) )
FRA Best Practices
FRA Best PracticesLOG_ARCHIVE_DEST_1 ’LOCATION=USE_DB_RECOVERY_FILE_DEST’
Always enable Flashback Database on primary and standby database
MAA Best Practice: DB_FLASHBACK_RETENTION_TARGET
60 for just flashback re-instantiation
MAA Best Practices: DB_FLASHBACK_RETENTION_TARGET
Minimum 6 hours for protection from user errors, logical corruptions, and malicious users
Can also be used for Snapshot Standby
Block Change Tracking
Block Change Tracking
Enable Block Change Tracking alter database enable block change tracking using file '+DATA';
You can enable BCT on the standby database now
Does incur a license of Oracle Active Data Guard
View the size of the BCT File select filename, status, bytes from v$block_change_tracking;
“Disaster strikes without warning.> Data loss strikes without warning.”
SRL
Do not multiplex SRLBest practices equation for the number for SRL is:• # of SRL = (# of ORL + 1 ) X Threads
Recommend SRL for even Maximum PerformanceExecute: ./dg_generate_standby_redo.ksh Generates:
- Execute SQL Script: cr_standby_redo_p.sql on VISK- Execute SQL Script: cr_standby_redo_s.sql on VISK_DR
At Database Level – Best PracticeSQL> alter database force logging;
Some opt to enforce logging at tablespace level:- SQL> alter tablespace TS_NAME force logging;-MV tablespace- Temp tablespace for reports and stage data
Need to enable force logging monitoringExecute dg_check_force_logging.sql to check Force LoggingExecute dg_check_unrecoverable.sql to check Unrecoverable Activity
Logging
Date 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 ------- ---- ---- ---- ---- ---- ---- ---- --- --- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----
Feb 28 1 0 0 1 2 1 4 9 5 6 7 9 8 8 0 0 0 0 0 0 0 0 0 0
Feb 27 2 1 1 2 2 1 1 5 1 1 2 0 1 0 0 0 5 0 0 0 3 5 0 0
Feb 26 12 5 12 2 5 5 1 8 4 4 6 4 2 2 1 1 5 3 2 1 3 3 1 6
Feb 25 8 3 4 4 5 3 7 8 5 7 8 9 3 8 11 9 12 12 8 6 6 10 10 12
Feb 24 12 10 13 7 3 3 7 9 8 8 8 3 5 6 3 8 4 9 14 12 9 8 10 12
Feb 23 16 25 23 20 15 11 5 11 6 8 2 7 7 9 3 8 9 11 13 13 7 8 8 14
Feb 22 4 3 3 1 3 3 4 9 4 4 7 9 7 3 8 9 8 5 10 9 4 4 16 16
Feb 21 0 0 1 2 1 2 3 8 4 3 5 4 7 5 4 7 10 7 5 6 5 10 6 5
Feb 20 6 20 14 0 0 1 5 8 4 1 2 0 2 6 0 0 5 0 1 1 2 6 0 0
Feb 19 8 2 3 1 6 3 3 8 3 5 6 4 4 1 2 1 5 0 0 0 2 5 7 12
Feb 18 6 4 3 2 4 3 6 8 7 6 9 11 8 10 7 10 12 9 8 6 2 8 11 7
Know Your Archive Generation Rate
SELECT TO_CHAR(TRUNC(FIRST_TIME),'Mon DD') "Date", TO_CHAR(SUM(DECODE(TO_CHAR(FIRST_TIME,'HH24'),'00',1,0)),'9999') "00", TO_CHAR(SUM(DECODE(TO_CHAR(FIRST_TIME,'HH24'),'01',1,0)),'9999') "01", TO_CHAR(SUM(DECODE(TO_CHAR(FIRST_TIME,'HH24'),'02',1,0)),'9999') "02", TO_CHAR(SUM(DECODE(TO_CHAR(FIRST_TIME,'HH24'),'03',1,0)),'9999') "03", TO_CHAR(SUM(DECODE(TO_CHAR(FIRST_TIME,'HH24'),'04',1,0)),'9999') "04", TO_CHAR(SUM(DECODE(TO_CHAR(FIRST_TIME,'HH24'),'05',1,0)),'9999') "05", TO_CHAR(SUM(DECODE(TO_CHAR(FIRST_TIME,'HH24'),'06',1,0)),'9999') "06", TO_CHAR(SUM(DECODE(TO_CHAR(FIRST_TIME,'HH24'),'07',1,0)),'9999') "07", TO_CHAR(SUM(DECODE(TO_CHAR(FIRST_TIME,'HH24'),'08',1,0)),'9999') "08", TO_CHAR(SUM(DECODE(TO_CHAR(FIRST_TIME,'HH24'),'09',1,0)),'9999') "09", TO_CHAR(SUM(DECODE(TO_CHAR(FIRST_TIME,'HH24'),'10',1,0)),'9999') "10", TO_CHAR(SUM(DECODE(TO_CHAR(FIRST_TIME,'HH24'),'11',1,0)),'9999') "11", TO_CHAR(SUM(DECODE(TO_CHAR(FIRST_TIME,'HH24'),'12',1,0)),'9999') "12", TO_CHAR(SUM(DECODE(TO_CHAR(FIRST_TIME,'HH24'),'13',1,0)),'9999') "13", TO_CHAR(SUM(DECODE(TO_CHAR(FIRST_TIME,'HH24'),'14',1,0)),'9999') "14", ... TO_CHAR(SUM(DECODE(TO_CHAR(FIRST_TIME,'HH24'),'23',1,0)),'9999') "23" FROM V$LOG_HISTORY GROUP BY TRUNC(FIRST_TIME) ORDER BY TRUNC(FIRST_TIME) DESC;
Know Your Archive Generation Rate
RMAN Image Copy Backups* Duplicate Database for Standby Database
Daily Incremental Backups1. recover copy of database 2. backup incremental level 1 for
recover of copy3. Backup archivelogs
DB Server
DATA: Datafiles, Redo Log, Control File, BCT
RMAN Image Copy Backup StrategyDatabase Architecture
RECO: Redo Log, Control File, Archive Log, Flashback Logs, spfile, Datapump dumps,
Backups
ORAPRD
Updated copy of the database that is in sync
with PROD DB
Similar to EMC’s Sync and Split
DOCPRD
DWPRD ODSPRD
1st Sat/Sun of the month - RMAN Image Copy (Once Per month or
Quarter or Once Ever)
* backup as copy incremental level 0
/dNFS/bkup: L0 /dNFS/bkups: L1 /dNFS/bkups – Updated L0
/dNFS/10GigE Network
Replication
Storage that support snapshots
Backup files to Direct NFS1. Database Image Copy2. Incremental backups3. Archive Log backups4. Nightly No Rows Full database
exports5. Autobackup of controlfiles6. SPFILE backup
Daily Snapshots
6684
RMAN To Disk Backups
rman2disk.ksh from http://dbaexpert.com/rman2disk/
Cron Job Examples: ## RMAN backups ## 00 23 * * 0 /app/oracle/general/sh/rman2disk.ksh -d DATABASE -l 0 -n 2 -c catalog > /tmp/rman_full_DATABASE.log 2>&1 00 23 * * 1-6 /app/oracle/general/sh/rman2disk.ksh -d DATABASE -l 1 -n 2 -c catalog > /tmp/rman_incr_DATABASE.log 2>&1 01 12,18 * * 1-6 /app/oracle/general/sh/rman2disk.ksh -d DATABASE -a y > /tmp/rman_arch_DATABASE.log 2>&1
Usage Information for rman2disk.ksh:Regular Usage with RMAN Backupsets: 1. Perform a full level 0 backup: rman2disk.ksh -d DATABASE -l 0 -c catalog > /tmp/rman2disk_DATABASE.L0.log 2>&12. Perform an incremental backup: rman2disk.ksh -d DATABASE -l 1 -c catalog > /tmp/rman2disk_DATABASE.L1.log 2>&1
Compressed Backups with RMAN Backupsets1. Perform a full level 0 compressed backup: rman2disk.ksh -d DATABASE -l 0 -c catalog -z y > /tmp/rman2disk_DATABASE.L0Z.log 2>&12. Perform a compressed incremental backup: /rman2disk.ksh -d DATABASE -l 1 -c catalog -z y > /tmp/rman2disk_DATABASE.L1Z.log 2>&1
Advanced Usage with Database Copies: 1. Perform a baseline level 0 backup: rman2disk.ksh -d DATABASE -l baseline > /tmp/rman2disk_DATABASE.baseline.log 2>&12. Perform an incremental backup: rman2disk.ksh -d DATABASE -l 1 -r merge > /tmp/rman2disk_DATABASE.L1.log 2>&1
Archivelog only backups: rman2disk.ksh -d DATABASE-a y > /tmp/rman_arch_emrepos.log 2>&1
Notes: 1. -r option can only be used with Copy Backups2. -r must find a baseline tag in the $SH directory; otherwise, the script will perform a full level 0 copy
6785
RMAN To Disk Backups #2
rman2disk.ksh from http://dbaexpert.com/rman2disk/
Pertinent Information for each database being backed up:
1. Symbolic link for $ORACLE_BASE/admin/$ORACLE_SID/bkups must be created to a backup file system directory
2. $ORACLE_BASE/admin/$ORACLE_SID/log directory must be created3. For RMAN catalog backups, the .rman.pw file must exist in the $SH directory
RMAN To Disk Backup scripts:-rwxr-xr-x. 1 oracle oinstall 1018 Nov 6 10:49 rman2disk.arch.sql -rwxr-xr-x. 1 oracle oinstall 9978 Nov 26 09:12 rman2disk.ksh -rwxr-xr-x. 1 oracle oinstall 1963 Nov 26 09:43 rman2disk.sql -rwxr-xr-x. 1 oracle oinstall 1232 Jan 21 2015 rman2disk.sql.baseline -rwxr-xr-x. 1 oracle oinstall 1275 Jan 21 2015 rman2disk.sql.cold -rwxr-xr-x. 1 oracle oinstall 963 Jan 21 2015 rman2disk.sql.cold.noarchivelog -rwxr-xr-x. 1 oracle oinstall 1544 Nov 26 09:42 rman2disk.sql.compression -rwxr-xr-x. 1 oracle oinstall 1370 Jan 21 2015 rman2disk.sql.for_recover -rwxr-xr-x. 1 oracle oinstall 1506 Jan 21 2015 rman2disk.sql.nocompression -rwxr-xr-x. 1 oracle oinstall 227 Jan 21 2015 rman2disk.tag.history
Build Physical Standby Menu
Duplicate Database (From Active Database)
Execute ./dg_duplicate_database.ksh manually or from DG Toolkit
./dg_duplicate_database.ksh |tee dg_duplicate_database_out.ksh chmod 755 dg_duplicate_database_out.ksh ./dg_duplicate_database_out.ksh
echo ""; echo "# ------------------------------------------------------------- #” echo "# -- Scripts are generated in the /tmp/dba directory #"; echo "# ------------------------------------------------------------- #” ls -l /tmp/dba echo "";
Here’s what it generated: # ------------------------------------------------------------- # # -- Scripts are generated in the /tmp/dba directory # # ------------------------------------------------------------- # total 12 -rwxr-xr-x. 1 oracle oinstall 1594 Apr 12 03:41 01_dg_oratab_listener_ps.ksh -rwxr-x---. 1 oracle oinstall 881 Apr 12 03:41 02_dg_tnsnames_all.ksh -rw-r--r--. 1 oracle oinstall 3334 Apr 12 03:41 10_dg_duplicate_database_ps.ksh
Duplicate Database From Active Database #1
. /home/oracle/dg/dg.conf # --------------------------------------------------------------------------------------- # -- scp password file to the standby database server: # ika82 from primary server: vna85 # --------------------------------------------------------------------------------------- scp vna85:/u01/app/oracle/product/12.1.0/dbhome_1/dbs/orapwJIN01 /u01/app/oracle/product/12.1.0/dbhome_1/dbs/orapwJIN01_DR export TMPDIR=/tmp/dba [ ! -d "$TMPDIR" ] && mkdir -p /tmp/dba
# --------------------------------------------------------------------------------------- # -- Create the following initialization file for the JIN01_DR instance: # -- /u01/app/oracle/product/12.1.0/dbhome_1/dbs/initJIN01_DR.ora # --------------------------------------------------------------------------------------- cat <<EOF > /u01/app/oracle/product/12.1.0/dbhome_1/dbs/initJIN01_DR.ora db_name=JIN01 db_unique_name=JIN01_DR cluster_database=false EOF # --------------------------------------------------------------------------------------- # -- Execute the following RMAN script on the standby database server # -- # -- First startup nomount the database with either SQL*PLUS or RMAN> # --------------------------------------------------------------------------------------- echo "startup nomount; alter system register;" |sqlplus -s / as sysdba
rman <<EOF connect target sys/oracle123@JIN01; connect auxiliary sys/oracle123@JIN01_DR; run { allocate channel prmy1 type disk; allocate channel prmy2 type disk; allocate channel prmy3 type disk; allocate channel prmy4 type disk; allocate auxiliary channel stby type disk; duplicate target database for standby from active database dorecover spfile parameter_value_convert 'JIN01','JIN01_DR' set 'db_unique_name'='JIN01_DR' set control_files='+FRA' set log_archive_max_processes='5' set fal_client='JIN01_DR' set fal_server='JIN01' set standby_file_management='AUTO' set db_create_file_dest='+DATA' set db_create_online_log_dest_1='+DATA' set log_archive_config='dg_config=(JIN01,JIN01_DR)' set log_archive_dest_1='service=JIN01 LGWR ASYNC valid_for=(ONLINE_LOGFILES,PRIMARY_ROLE) db_unique_name=JIN01' set cluster_database='FALSE' set parallel_execution_message_size='8192' set db_lost_write_protect='TYPICAL' set db_block_checking='TRUE' set db_block_checksum='FULL' nofilenamecheck ;
Duplicate Database From Active Database #2
sql channel prmy1 "alter system set log_archive_config=''dg_config=(JIN01,JIN01_DR)''"; sql channel prmy1 "alter system set log_archive_dest_2= ''service=JIN01_DR LGWR ASYNC valid_for=(online_logfiles,primary_role) db_unique_name=JIN01_DR''"; sql channel prmy1 "alter system set log_archive_max_processes=5"; sql channel prmy1 "alter system set fal_client=JIN01"; sql channel prmy1 "alter system set fal_server=JIN01_DR"; sql channel prmy1 "alter system set standby_file_management=auto"; sql channel prmy1 "alter system set log_archive_dest_state_2=enable"; sql channel prmy1 "alter system set parallel_execution_message_size=8192 scope=spfile sid=''*''"; sql channel prmy1 "alter system archive log current"; sql channel stby "alter database recover managed standby database using current logfile disconnect"; } EOF
Duplicate Database From Active Database #3
Monitor Data Guard With Scripts
Monitoring
• Alert Log Monitoring• Monitoring MRP• Monitoring Archive Lag Gaps• Monitoring Transport and Apply Lag• Monitoring Apply Rate• How Far Are We Really Behind
75
Database Alert Log Monitoring
Oracle Database Alert Log Monitoring
2. wrapper_alertlog.ksh
1. prep_alertlog.ksh
oraping.ksh
blockmon.ksh
long_running_sql.ksh
alertlog.pl1. Leverages the Tiny.pm perl module
• This is located in the $SH/lib/Config directory (please note that Config is a Capital C)
• Must copy the contents of the lib subdirectory to every node
2. Leverages the alertlog.conf filecat alertlog.confORACLE_BASE=/app/oracle SH=/app/oracle/general/sh SQL=/app/oracle/general/sql
Note: • alertlog.conf file is leveraged by Tiny.pm perl module and
cannot have any variables• All parameters must be hard-coded
3. Add ORA- error messages that you want the alertlog.pl alerting to ignore to the $SH/ignore.dat file
vmstat.ksh
alertlog.pl
prep_alertlog.ksh:
From the $SH directory, invoke the prep_alertlog.ksh script for each database1. Change ORACLE_SID to database you want to setup alert log monitoring2. Execute prep_alertlog.ksh (checks v$diag_info to determine trace directory)3. Create the OFA directory structure: $ORACLE_BASE/admin/$ORACLE_SID/bdump4. Creates symbolic link for alert_$ORACLE_SID.log
export TRACE_DIR=$( sqlplus -s / as sysdba <<EOF set head off ver off lines 2000 trims on pages 0 feed off select value from v\$diag_info where name='Diag Trace' ; exit; EOF )
export ALERT_LOG=$TRACE_DIR/alert_$ORACLE_SID.log echo "Trace Dir: $TRACE_DIR" echo "-> Alert Log: $ALERT_LOG"
export BDUMP=$ORACLE_BASE/admin/$ORACLE_SID/bdump echo "-->BDUMP is: $BDUMP" if [ ! -d $BDUMP ]; then echo "$BDUMP directory does not exist! Creating directory: $BDUMP" mkdir $BDUMP fi
cd $BDUMP
if [ -h "alert_$ORACLE_SID.log" ]; then echo "--->Alert Log for Oracle SID Exists... removing symbolic link for $alert_$ORACLE_SID.log" rm alert_$ORACLE_SID.log fi ln -s $ALERT_LOG alert_$ORACLE_SID.log
[ ! -d "$SH/log" ] && ( echo "----> $SH/log directory does not exist.. making dir $SH/log"; mkdir -p $SH/log ) [ ! -f "$SH/ignore.dat" ] && ( echo "-----> $SH/ignore.dat file does not exist... touching $SH/ignore.dat"; touch $SH/ignore.dat ) [ ! -f "$SH/errLogAlert.dat" ] && ( echo "------> $SH/errLogAlert.dat file does not exist... touching $SH/errLogAlert.dat"; touch $SH/errLogAlert.dat )
wrapper_alertlog.ksh#!/bin/ksh
---------------------------------------------------------- . $HOME/.ORACLE_BASE . $ORACLE_BASE/general/sh/functions.ksh export PATH=/usr/local/bin:$PATH cd $SH
./alertlog.pl emrepos
Monitoring
• Alert Log Monitoring - Looks at entries in /etc/oratab - Can customize ignore list - Performs diff and compares since last
execution - Sends alerts based on Alert Notifications
Shell
- Downloadable from: http://dataguardbook.com
LogRotatefunction rotate {export LOGFILE=$1export CONFIG_FILE=$2
export PATH=$PATH:/usr/sbinexport CONF_DIR=$SH/logrotate[ ! -d "$CONF_DIR" ] && ( echo $CONF_DIR does not exist .. issuing mkdir; mkdir -p $CONF_DIR )
export CONF=$CONF_DIR/$CONFIG_FILE
cat <<!! >$CONF$LOGFILE {rotate 4dateextcopytruncatecompresssize 100M}!!
echo Executing: logrotate -s $CONF_DIR/log_rotate_status.$CONFIG_FILE -f $CONFlogrotate -s $CONF_DIR/log_rotate_status.$CONFIG_FILE -f $CONF}
Monitoring
• Monitoring MRP
dg_check_mrp.sql set time on set lines 132 set pagesize 9999 col client_pid format a12 SELECT PID, PROCESS, STATUS, CLIENT_PROCESS, CLIENT_PID, THREAD#, SEQUENCE#, BLOCK#, BLOCKS, DELAY_MINS FROM V$MANAGED_STANDBY;
Monitoring
• Monitoring Transport and Apply Lag
dg_lag.sql col name for a13 col value for a20 col unit for a30 set lines 122 SELECT NAME, VALUE, UNIT, TIME_COMPUTED FROM V$DATAGUARD_STATS WHERE NAME IN ('transport lag', 'apply lag');
• Need to be on the latest • PSU
Or • RU / RUR
Monitoring
• Monitoring Apply Rate
dg_apply_rate.sql col type for a15 set lines 122 set pages 33 col item for a20 col units for a15 select to_char(start_time, 'DD-MON-RR HH24:MI:SS') start_time, item, sofar, units from v$recovery_progress where (item='Active Apply Rate' or item='Average Apply Rate' or item='Redo Applied')
www.viscosityna.com
Poor Man’s EBS DR
RSYNCrsync -avz -e ssh --stats --progress /appsvr/CM applmgr@dr_app_server:/apps702 > $LOGFILE 2>&1
function rsync_appstmp { APPLCSF=/apps/tmp/PROD/APPLCSF rsync -avz -e ssh --del --stats --progress ${APPLCSF}/log applmgr@dr_app_server:/apps702 > $LOGFILE 2>&1 rsync -avz -e ssh --del --stats --progress ${APPLCSF}/out applmgr@dr_app_server:/apps702 > $LOGFILE 2>&1 }
Data Guard (Switchover)(P) ALTER DATABASE COMMIT TO SWITCHOVER TO PHYSICAL STANDBY WITH SESSION SHUTDOWN;
(S)ALTER DATABASE COMMIT TO SWITCHOVER TO PRIMARY WITH SESSION SHUTDOWN; (S) ALTER DATABASE OPEN;
(P)ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE DISCONNECT;
81
Broker
Broker ConfigurationSPFILE Setup
# -- Execute the following on the Primary Database: VISKalter system set dg_broker_config_file1='+DATA/VISK/broker1.dat' scope=both sid='*';alter system set dg_broker_config_file2='+FRA/VISK/broker2.dat' scope=both sid='*';alter system set dg_broker_start=true scope=both sid='*';
# -- Execute the following on the Standby Database: VISK_DRalter system set dg_broker_config_file1='+DATA2/VISK_DR/broker1.dat' scope=both sid='*';alter system set dg_broker_config_file2='+FRA/VISK_DR/broker2.dat' scope=both sid='*';
alter system set dg_broker_start=true scope=both sid='*';
Broker ConfigurationListener Setup
Broker Configuration – Listener Setup 2 # -- Primary Database Server # -- LISTENER_VISK = . .. SID_LIST_LISTENER_VISK = (SID_LIST = (SID_DESC = (SDU=32767) (GLOBAL_DBNAME = VISK_DGMGRL.DOMAIN) (ORACLE_HOME = /u01/app/oracle/product/11.2.0/db) (SID_NAME = VISK1)
Broker ConfigurationCreate Configuration
create configuration VISK_DGCONFIG as primary database is "VISK" connect identifier is VISK_PRI;add database "VISK_DR" as connect identifier is VISK_STDBY maintained as physical;enable configuration;
Broker Configuration – Create FSFOedit database 'VISK' set property 'LogXptMode'='SYNC';edit database 'VISK_DR' set property 'LogXptMode'='SYNC';edit database 'VISK' set property FastStartFailoverTarget='VISK_DR';edit database 'VISK_DR' set property FastStartFailoverTarget='VISK';edit configuration set protection mode as maxavailability;enable fast_start failover;show fast_start failover;
Broker ConfigurationCreate Configuration
DGMGRL> create configuration JIN01_DGCONFIG as primary database is "JIN01" connect identifier is JIN01; Configuration "jin01_dgconfig" created with primary database "JIN01" DGMGRL> add database "JIN01_DR" as connect identifier is JIN01_DR maintained as physical; Database "JIN01_DR" added DGMGRL> enable configuration; Enabled.
DGMGRL> show configuration Configuration - jin01_dgconfig
Protection Mode: MaxPerformance Members: JIN01 - Primary database Warning: ORA-16789: standby redo logs configured incorrectly
JIN01_DR - Physical standby database Warning: ORA-16809: multiple warnings detected for the database
Fast-Start Failover: DISABLED
Configuration Status: WARNING (status updated 45 seconds ago)
Observer
Start Observer
# -- # -- You can use the following script to start the observer #!/usr/bin/ksh dgmgrl <<___EOF >/tmp/observer_`hostname`.log connect sys/oracle123@VISK_PRI start observer ___EOF
Archive Log Retention
Archive Log Retention
Primary Database Standby Database
configure archivelog deletion policy to shipped to all standby;
------------------------ OR -----------------------------
configure archivelog deletion policy to applied on all standby;
configure archivelog deletion policy to applied on standby;
DG Toolkit
91
92
At the heart of it is the dg.conf configuration file
DG Toolkit SimplifiedSimplified Configuration File for non-RAC (12 Parameters To Instantiate Data Guard)
# --------------------------------------------------------------------------- # PRIMARY_HOST=vnadb01 PRIMARY_DB=VNA PRIMARY_PORT=1521 # --
STANDBY_HOST=vnadr01 STANDBY_DB=VNADR STANDBY_PORT=1523 # --------------------------------------------------------------------------- # # - File System information (for duplicate database, rman restore, dbca) # --------------------------------------------------------------------------- # PRIMARY_FS=/oradata01 PRIMARY_ARCH=/oraarch STANDBY_FS=/oradata01 STANDBY_ARCH=/oraarch # --------------------------------------------------------------------------- # PRIMARY_ORACLE_HOME=/u01/app/oracle/product/12.1.0/dbhome_1 STANDBY_ORACLE_HOME=/u01/app/oracle/product/12.1.0/dbhome_1
94
Useful DG Toolkit Scripts
Misc DG Toolkit Simple Built-Ins
On the Standby Database:• dg_start.sql Start MRP (with SRL) disconnectalter database recover managed standby database using current logfile disconnect;
• dg_stop.sql Stop MRPalter database recover managed standby database cancel;
On the Primary Database• dg_client_start.sql Enabled archive dest #2alter system set log_archive_dest_state_2='enable' sid='*’;
• dg_client_stop.sql Disable archive dest #2alter system set log_archive_dest_state_2='defer' sid='*';
SQL Script Description
dg_redo.sql Check Redo Log information
dg_sredo.sql Check Standby Redo Log information
dg_lag.sql Check transport and apply lag for the Data Guard environment
dg_check_mrp.sql Check MRP process and status
dg_client_start.sql Enabled archive dest #2
dg_client_stop.sql Disable archive dest #2
dg_register_archivelog_from_primary.sql Register archivelogs from primary
rman2disk.sql RMAN template to backup the database to FRA disk group
dg_database_info.sql PL/SQL to view DG related database information
dg_prim_diag.sql Troubleshooting script from Metalink ID: 241374.1
Shell Script Description
./dg Launches the DG Toolkit
dg_bdp.ksh Calculate Bandwidth Delay Product – leverages dg_bdp.conf
dg_adr_menu.ksh Submenu to setup Automatic Diagnostic Repository
dg_physical_standby_menu.ksh Submenu for checking/monitoring on the physical standby database
dg_prepare_standby_menu.ksh Primary Submenu for creating the physical standby database
dg_preliminary_check_menu.kshSubmenu for validating the environment prior to creating the physical standby database
dg_rman2disk_menu.ksh Submenu for launching RMAN backups and restore activities
rman2disk.ksh korn shell script to backup the database to the FRA or file system disk group
dg_broker_menu.ksh Submenu for Broker tasks
dg_logical_menu.kshFor old timers who are still using Logical Standby – Submenu for Logical Standby database maintenance and monitoring
Facebook.com/ViscosityNA
Linkedin.com/company/Viscosity-North-America
@ViscosityNA
Viscosity North America
Facebook.com/ViscosityNA
@Viscosity_NA
Follow Us Online!
99