Professional Documents
Culture Documents
Database altered.
--Verify
SQL> select force_logging from v$database;
FOR
---
YES
Step 2 Determine the appropriate number of standby redo log file groups
The minimal number should be 3+1=4
Step 3 Verify related database parameters and settings
Maxlogfiles
Maxlogmembers
Step 4 Create standby redo log file groups
Database altered.
Database altered.
Database altered.
Step 5 Verify the standby redo log file groups were created
SQL> select group#,thread#,sequence#,archived,status from v$standby_log;
FAL_SERVER=bsl01labdg
FAL_CLIENT=bsl01lab
DB_FILE_NAME_CONVERT='C:\data_guard\bsl01lab','D:\oracle\product\10.2.0\oradata\bsl
01lab'
LOG_FILE_NAME_CONVERT=
'C:\data_guard\bsl01lab','D:\oracle\product\10.2.0\oradata\bsl01lab'
STANDBY_FILE_MANAGEMENT=auto
STANDBY_ARCHIVE_DEST='C:\temp\priarch'
--create spfile
SQL> create spfile from pfile='d:\pfilebsl01lab.ora';
File created.
Database altered.
Database altered.
db_name='bsl01lab'
db_unique_name=bsl01labdg
log_archive_config='DG_CONFIG=(bsl01lab,bsl01labdg)'
control_files='C:\data_guard\bsl01lab\control01.ctl','C:\data_guard\bsl01lab\contro
l02.ctl','C:\data_guard\bsl01lab\control03.ctl'
log_archive_dest_1=
'LOCATION=C:\data_guard\arch
VALID_FOR=(all_logfiles,all_roles)
DB_UNIQUE_NAME=bsl01labdg'
log_archive_dest_2=
'SERVICE=bsl01lab LGWR ASYNC
VALID_FOR=(online_logfiles,primary_role)
DB_UNIQUE_NAME=bsl01lab'
LOG_ARCHIVE_DEST_STATE_1=enable
LOG_ARCHIVE_DEST_STATE_2=enable
REMOTE_LOGIN_PASSWORDFILE=EXCLUSIVE
LOG_ARCHIVE_FORMAT=%t_%s_%r.arc
LOG_ARCHIVE_MAX_PROCESSES=30
FAL_SERVER=bsl01lab
FAL_CLIENT=bsl01labdg
DB_FILE_NAME_CONVERT='D:\oracle\product\10.2.0\oradata\bsl01lab','C:\data_guard\bsl
01lab'
LOG_FILE_NAME_CONVERT=
'D:\oracle\product\10.2.0\oradata\bsl01lab','C:\data_guard\bsl01lab'
STANDBY_FILE_MANAGEMENT=auto
STANDBY_ARCHIVE_DEST='C:\temp\stdarch'
D:\oracle\product\10.2.0\db_1\database>sqlplus /nolog
--bsl01labdg window
D:\oracle\product\10.2.0\db_1\database>set oracle_sid=bsl01labdg
D:\oracle\product\10.2.0\db_1\database>sqlplus /nolog
SQL*Plus: Release 10.2.0.1.0 - Production on Wed Jul 26 03:34:15 2006
Copyright (c) 1982, 2005, Oracle. All rights reserved.
SQL> connect / as sysdba
Connected.
SQL> select instance_name,status from v$instance;
INSTANCE_NAME STATUS
---------------- ------------
bsl01labdg MOUNTED
Both instance status are OK
--bsl01labdg
SQL> select name,sequence# from v$archived_log order by 2;
NAME SEQUENCE#
-------------------------------------------------- ----------
����
C:\DATA_GUARD\ARCH\1_80_595473116.ARC 80
C:\DATA_GUARD\ARCH\1_81_595473116.ARC 81
C:\DATA_GUARD\ARCH\1_82_595473116.ARC 82
SQL> /
System altered.
Elapsed: 00:00:01.14
SQL> /
System altered.
Elapsed: 00:00:06.01
NAME SEQUENCE#
-------------------------------------------------- ----------
bsl01labdg 85
--bsl01labdg window
SQL> select name,sequence# from v$archived_log order by 2;
NAME SEQUENCE#
-------------------------------------------------- ----------
����
C:\DATA_GUARD\ARCH\1_84_595473116.ARC 84
C:\DATA_GUARD\ARCH\1_85_595473116.ARC 85
--To check whether the new archived logs have been applied
--bsl01labdg window
SQL> select sequence#,applied
2 from v$archived_log
3 order by sequence#;
SEQUENCE# APP
---------- ---
80 YES
81 YES
82 YES
83 YES
84 YES
85 YES
35 rows selected.
Switch-over Testing
System altered.
6 rows selected.
--To stop �emagent� and �OMS�, open another window, and in OS run
S:\>set oracle_sid=bsl01lab
S:\>emctl stop agent
Oracle Enterprise Manager 10g Database Control Release 10.2.0.1.0
Copyright (c) 1996, 2005 Oracle Corporation. All rights reserved.
This will stop the Oracle Enterprise Manager 10g Database Control process. Conti
nue [y/n] :y
The OracleDBConsolebsl01lab service is stopping............
The OracleDBConsolebsl01lab service was stopped successfully.
SWITCHOVER_STATUS
--------------------
TO PRIMARY
5. Switch the target physical standby database role to the primary role
--bsl01labdg window
SQL> ALTER DATABASE COMMIT TO SWITCHOVER TO PRIMARY;
Database altered.
Elapsed: 00:00:33.56
--bsl01labdg window
SQL> alter system switch logfile;
System altered.
SQL> /
System altered.
SQL> /
System altered.
--bsl01lab window
SQL> select sequence#,applied from v$archived_log order by 1;
SEQUENCE# APP
--------- ---
����
90 YES
91 YES
92 YES
successfully switched-over!