Active Datagaurd Steps
Active Datagaurd Steps
Active Datagaurd Steps
Service_names='primary'
Step3:
Create password file using Shell prompt.
[oracle@linux1~]$ orapwd file=orapwprim password=manager entries=5
force=y ignorecase=y
Step4:
SQL>startup mount;
Step5:
Take the Primary database to Archive Log Mode.
SQL>alter database archiveLog;
Enable Force Logging.
SQL>alter database force logging;
Step6:
Now add standby Redo Log group to the PRIMARY site.
SQL>Alter database add standby group 5
(/u01/radha/prim/stand01.log,/u01/radha/prim/stand02.log) size 100m;
Step7:
Startup the database from pfile.
SQL>startup pfile;
Create spfile from pfile to startup the database with spfile.
It is necessary for primary database to use spfile in a dataguard environment.
SQL>Create spfile from pfile;
Now bounce the DB to take affect of new parameter from pfile.
Step8:
Step11:
Now check the TNS and Listener for Both side Primary and
Standby side
Primary side listener and TNS status
Step3:
RMAN>
duplicate target database for standby from active database
Run following command at primary site to check archive dest_1 for standby .
select status, error from v$archive_dest where dest_id=2;
On PRIMARY site enable Log_archive_dest_state_2 to start shipping archived redo logs.
SQL>Alter system set Log_archive_dest_state_2=ENABLE scope=both;
Once a standby database is configured, it can be opened in read-only mode to allow query
access. This is often used to offload reporting to the standby server, thereby freeing up
resources on the primary server. When open in read-only mode, archive log shipping
continues, but managed recovery is stopped, so the standby database becomes increasingly
out of date until managed recovery is resumed.
To switch the standby database into read-only mode, do the following.
SHUTDOWN IMMEDIATE;
STARTUP MOUNT;
ALTER DATABASE OPEN READ ONLY;
To resume managed recovery, do the following.
SHUTDOWN IMMEDIATE;
STARTUP MOUNT;
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT FROM
SESSION;
In 11g, Oracle introduced the Active Data Guard feature. This allows the standby database
to be open in read-only mode, but still apply redo information. This means a standby can be
available for querying, yet still be up to date. There are licensing implications for this
feature, but the following commands show how active data guard can be enabled.
SHUTDOWN IMMEDIATE;
STARTUP MOUNT;
ALTER DATABASE OPEN READ ONLY;
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT FROM
SESSION;
Step1:
Cancel the manager recovery.
SQL> recover managed standby database cancel;
Media recovery complete.
Step2:
Open the database in read-only mode.
SQL> alter database open read only;
Database altered.
Step3:
Restarts the Redo apply.
SQL> recover managed standby database disconnect using current logfile;
Media recovery complete.
------------------------------------------------------------------------------------------------------------------------------#######################################################
########################
Protection Mode:
least one standby location. If not suitable standby location is available, the primary
database shuts down.
By default, for a newly created standby database, the primary database is in maximum
performance mode.
SELECT protection_mode FROM v$database;
PROTECTION_MODE
-------------------MAXIMUM PERFORMANCE
SQL>
The mode can be switched using the following commands. Note the alterations in the redo
transport attributes.
-- Maximum Availability.
ALTER SYSTEM SET LOG_ARCHIVE_DEST_2='SERVICE=standby AFFIRM SYNC
VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=STANDBY';
ALTER DATABASE SET STANDBY DATABASE TO MAXIMIZE AVAILABILITY;
-- Maximum Performance.
ALTER SYSTEM SET LOG_ARCHIVE_DEST_2='SERVICE=standby NOAFFIRM ASYNC
VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=STANDBY';
ALTER DATABASE SET STANDBY DATABASE TO MAXIMIZE PERFORMANCE;
-- Maximum Protection.
ALTER SYSTEM SET LOG_ARCHIVE_DEST_2='SERVICE=standby AFFIRM SYNC
VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=STANDBY';
SHUTDOWN IMMEDIATE;
STARTUP MOUNT;
ALTER DATABASE SET STANDBY DATABASE TO MAXIMIZE PROTECTION;
ALTER DATABASE OPEN;