Data Guard
Data Guard
Inderpal S. Johal
Principal Consultant
AGENDA
Standby Database enhancements
Data Guard and its Architecture
Background Process
Pre-requisite for Logical Standby
Database
Logical Standby Creation and DG
configuration
Switchover and Failover
Troubleshooting Tips
Questions & Answers
History of Standby Database [1]
Oracle 7/8 Manual Standby Database
Network
Broker
Logical Standby
Transform Database Open for
Redo to SQL Reports
SQL
Apply Additional
Indexes & MVs
Data Guard Components
Log Transport (LGWR, ARC, FAL, RFS)
Archive log permissions, destinations,
transmission, reception & transmission failure
LGWR or ARCH can write from primary to standby
Log Apply (MRP or LSP)
Managed recovery (not read-only) mode
SQL apply mode
Role Management
Primary or Standby
Switchovers, graceful or forced failover
Data Guard Broker (DMON)
Additional bgnd process [ Pxx, RSM0, NSV0 ]
SQL Apply Process
Oracle Net
Logical
Transactions Standby
Database
[ SYNC / ASYNC ]
LGWR RFS LSP
Transform
Redo to
Online SQL
Redo Logs for SQL
Primary Apply
Database Reports
ARCH
[SYNC]
Oracle Net
Transactions Logical
Standby
Database
Online Standby
Redo Redo
Primary Logs
Logs
Database
ARCH ARCH Real Time
Apply!
Mining Applying
Group LSP Group
PX PX PX PX
Redo SQL
RFS
Log
Transport
Services
Remote Archived Logical Standby
Logs Database
Protection Modes
ALTER DATABASE
SET STANDBY DATABASE TO MAXIMIZE
{PROTECTION | AVAILABILITY |PERFORMANCE};
Protection Mode Failure Protection Redo Shipping
Maximum Zero Data Loss LGWR using
Protection Double Failure Protection SYNC
Impact Performance
Maximum Zero Data Loss LGWR using
Availability Single Failure Protection SYNC
Impact Performance
Maximum Best Performance ARCH or LGWR
Performance Minimal Data Loss using ASYNC
Maximum Protection Mode
ALTER DATABASE SET STANDBY TO MAXIMIZE PROTECTION;
Use Spfile
SQL>show parameter spfile;
Verifying Primary Db Configuration [5]
Important Initialization parameters
Log_parallelism =1
Parallel_max_servers > 5
Shared_pool_size > 160M
Use Spfile
SQL>show parameter spfile;
SQL>create spfile from pfile;
SQL>shutdown immediate;
LOG_ARCHIVE_DEST_2 attributes
OPTIONAL
LGWR
ASYNC
NOAFFIRM
REOPEN
MAX_FAILURE
DELAY
NET_TIMEOUT
Logical Standby Creation
Manual Method
Backup the Primary Database
Backup the Primary Database
Create Standby Control File
SQL> ALTER DATABASE BACKUP CONTROLFILE
TO ‘/tmp/control01.ctl’;
Network
Redo Shipment
Reports Transaction
Transform Redo
to SQL and Apply Redo Shipment
Network
Redo Shipment
Network
Redo Shipment
Network
Redo Shipment
SQL>connect / as sysdba
SQL>GRANT execute ON dbms_logstdby TO hr;
SQL>connect hr/hr
SQL>execute dbms_logstdby.guard_bypass_on;
SQL>UPDATE departments SET location_id=2000;
27 rows updated
SQL>CREATE TABLE dept AS
SELECT * FROM departments;
Table Created
SQL>exec dbms_logstdby.guard_bypass_off;
SQL>UPDATE departments SET location_id=2000;
ORA-1031: insufficient privileges
SQL>DROP TABLE dept;
ORA-1031: insufficient privileges
New Guard Bypass Syntax
SQL>connect / as sysdba
SQL>ALTER DATABASE GUARD STANDBY ;
By Default it is ALL
SQL>connect hr/hr
SQL>UPDATE departments SET
location_id=2000;
Error at Line 1:
ORA-1031: insufficient privileges
Logical
Standby
Database
Redo
from
primary Restart
Skip Failed SQL
transaction Apply
Major
Version X Version X X X+1 Release
2
1 Primary-
Primary- logical standby Setup Upgrade node B to X+1 Upgrades
THANK YOU