日期:2014-05-17  浏览次数:20970 次

Oracle 10G windows 平台 DataGuard 实例(二)

?

7. 在initorcl.ora添加以下内容:?-

*.log_archive_format='%T%S%r.ARC' -

*.DB_UNIQUE_NAME='primary' -

*.log_archive_config='DG_CONFIG=(primary,standby)' -

*.log_archive_dest_1='location=D:/oracle/product/10.2.0/oradata/arch VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=primary' -

*.log_archive_dest_2='SERVICE=standby arch ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=standby' -

*.STANDBY_FILE_MANAGEMENT=AUTO -

*.LOG_ARCHIVE_DEST_STATE_1=ENABLE -

*.LOG_ARCHIVE_DEST_STATE_2=ENABLE -

*.FAL_SERVER='standby' -

*.FAL_CLIENT='primary' -

?

关闭数据库,在用initorcl.ora重启,并创建spfile文件 -

SQL>startup pfile='$ORACLE_HOME/database/initorcl.ora' -

SQL>create spfile from pfile='$ORACLE_HOME/database/initorcl.ora' -

?

8.-

A. 拷贝数据文件,参数文件,控制文件,密码文件到备库上?-

initorcl.ora参数文件,PWDorcl.ora密码文件考到$ORACLE_HOME/database下的, -

controlbak.ctl 考到$ORACLE_base/oradata/orcl/下,并分别重命名为control01.ctl,control01.ctl,control01.ctl -

数据文件考到$ORACLE_base/oradata/orcl/下 -

?

B. 用Rman拷贝,不用停机-

$ rman target /-

RMAN> backup full format 'D:/FULL_%d_%T_%s.bak' database include current controlfile for standby;-

RMAN> sql 'alter system archive log current';-

RMAN> Backup ArchiveLog all format='D:/arch_%d_%T_%s.bak'; -

备份完后将备份文件拷到standby上同样的目录,强调:同样的目录,在standby进行rman 恢复即可-