datafile 5 switched to datafile copy
input datafile copy recid=36 stamp=839460770 filename=/u01/app/oracle/oradata/standby/example01.dbf
datafile 6 switched to datafile copy
input datafile copy recid=37 stamp=839460770 filename=/u01/app/oracle/oradata/standby/zwc.dbf
Finished Duplicate Db at 13-FEB-14
released channel: c1
RMAN>
--查询primary online redo log
SQL> select group#,bytes from v$log;
GROUP# BYTES
---------- ----------
1 52428800
2 52428800
3 52428800
*********************************************
配置standby
--创建standby logfile
[oracle@dgstb ~]$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.4.0 - Production on Thu Feb 13 23:37:19 2014
Copyright (c) 1982, 2007, Oracle. All Rights Reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> select status from v$instance;
STATUS
------------------------
MOUNTED
SQL> alter database add standby logfile ('/u01/app/oracle/oradata/standby/standby01.log') size 50M;
Database altered.
SQL> alter database add standby logfile ('/u01/app/oracle/oradata/standby/standby02.log') size 50M;
Database altered.
SQL> alter database add standby logfile ('/u01/app/oracle/oradata/standby/standby03.log') size 50M;
Database altered.
SQL> alter database add standby logfile ('/u01/app/oracle/oradata/standby/standby04.log') size 50M;
Database altered.
--打开standby apply log,这里我创建了standby redo logfile,所以可以使用using current logfile来实时应用
--可以在standby db使用alter database recover managed standby database cancel命令停止apply日志来测试DG同步效果,之后再alter database recover managed standby database using current logfile disconnect from session应用日志
Database altered.
SQL> select sequence#,applied from v$archived_log;
SEQUENCE# APP
---------- ---
19 YES
20 YES
18 YES
21 YES
17 YES
22 YES
23 YES
24 YES
8 rows selected.
SQL> select sequence#,applied from v$archived_log where applied='YES';
SEQUENCE# APP
---------- ---
19 YES
20 YES
18 YES
21 YES
17 YES
22 YES
23 YES
24 YES
8 rows selected.
#至此物理DataGuard搭建完成
*********************************************
--primary状态
SQL> select database_role,protection_mode,switchover_status,name from v$database;
DATABASE_ROLE PROTECTION_MODE SWITCHOVER_STATUS NAME
---------------- -------------------- -------------------- ---------
PRIMARY MAXIMUM PERFORMANCE TO STANDBY DBSERVER
*********************************************
--standby状态
SQL> select database_role,protection_mode,switchover_status,name from v$database;
DATABASE_ROLE PROTECTION_MODE SWITCHOVER_STATUS NAME
---------------- -------------------- -------------------- ---------
PHYSICAL STANDBY MAXIMUM PERFORMANCE SESSIONS ACTIVE DBSERVER
*********************************************
--primary alert.log
[oracle@vzwc bdump]$ tail -f alert_ORCL.log
Thu Feb 13 23:42:25 2014
Thread 1 advanced to log sequence 24 (LGWR switch)
Current log# 1 seq# 24 mem# 0: /u01/app/oracle/oradata/dbserver/redo01.log
Thu Feb 13 23:42:25 2014
LNS: Standby r