Академический Документы
Профессиональный Документы
Культура Документы
Choose two instance names as abc01 and xyz01, db_name will remain same.
create a database make a cold backup, copy the pfile and edit as below.
the primary database should be archive log mode.
password file to be create
$ orapwd=$ORACLE_HOME/dbs/orapwxyz01 passwd=sys entries=5 and
$ orapwd=$ORACLE_HOME/dbs/orapwabc01 passwd=sys entries=5
parameter for Standby database xyz01
1. log_archive_dest_state_2='ENABLE'
2. log_archive_dest_1='LOCATION=/app/orcl/xyz01/arch01/'
3. standby_archive_dest='/app/orcl/xyz01/abcarch'
4. standby_file_management=auto
5. db_file_name_convert='/app/orcl/abc01/','/app/orcl/xyz01/'
6. log_file_name_convert='/app/orcl/abc01/','/app/orcl/xyz01/'
7. db_unique_name=xyz01
Parameter in Primary database abc01
log_archive_dest_2='service=xyz01'
At the primary database abc01:
1) Configure listener and tnsnames with 'xyz01' as connect string
2) # alter database set standby database to maximize performance; (default)
2) startup the Primary database abc01 to open.
3) create standby controlfile “ alter database create standby controlfile as '/app/orcl/xyz01/control01.ctl';
At the standby database xyz01:
1. sql> startup nomunt;
2. startup the standby database xyz01 to nomount.
sql> alter database mount standby database;
3. sql> alter database recover managed standby database disconnect from session;
Find if the standby database is performing managed recovery.
(If the MRP process exists it means the standby database is performing managed recovey.)
sql> select process, status from v$managed_standby;
Monitoring the process activityes:
sql> select process, client_process, sequence#, status from v$managed_standby;
PROCESS STATUS
------------- -------------------
ARCH CONNECTED
MRP0 WAIT_FOR_LOG / WAIT_FOR_GAP
RFS IDLE / ATTACHED / RECEIVING
#RECEIVING - process is receiving network communication
#ATTACHED - process is actively attached and communicating to a primary database client
# WAIT_FOR_LOG - process is waiting for the archived redolog to be completed
# WAIT_FOR_GAP - process is waiting for the archive gap to be resolved
OTHER QUERIES:
SQL> select max(sequence#) from v$log_history;
SQL> select sequence#, applied, registrar from v$archived_log;
SQL> select protection_mode from v$database;
SQL> select * from v$archive_gap;
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SWITCH OVER
xyz01 becomes PRIMARY and abc01becomes STANDBY
Description:
primary after giving the command “alter database commit to switchover to standby;” it converts its controlfile to standby
controlfile and closes. dismount the database and now its at nomount stage.
Now the results on primary would be
SQL> select database_role, switchover_status, open_mode from v$database;
select database_role, switchover_status, open_mode from v$database
ERROR at line 1:
ORA-01507: database not mounted
which is switching over to standby.
Note: At this stage both the servers are in standby
Note: Now the xyz01 is the primary and abc01 is the standby
1. log_archive_dest_state_2='ENABLE'
2. log_archive_dest_1='LOCATION=/app/orcl/abc01/arch01/'
3. standby_archive_dest='/app/orcl/xyz01/xyzarch'
4. standby_file_management=auto
5. db_file_name_convert='/app/orcl/xyz01/','/app/orcl/abc01/'
6. log_file_name_convert='/app/orcl/xyz01/','/app/orcl/abc01/'
7. db_unique_name=abc01