使用DUPLICATE 方式创建ORACLE 11G DG备库环境

时间:2022-12-04 17:45:10

我的最佳实践

① 手动创建好初始化参数文件:

*.audit_file_dest='E:\APP\XJXU\ADMIN\ORASTAND\ADUMP'
*.control_files='E:\APP\XJXU\ORADATA\ORASTAND\CONTROL01.CTL','E:\APP\XJXU\FLASH_RECOVERY_AREA\ORASTAND\CONTROL02.CTL'
*.core_dump_dest='e:\app\xjxu\diag\rdbms\orastand\orastand\cdump'
*.db_block_size=8192
*.db_domain=''
*.LOG_ARCHICE_CONFIG='DG_CONFIG=(ORA11G,ORASTAND)'
*.db_file_name_convert='E:\app\xjxu\oradata\ORA11G','E:\app\xjxu\oradata\ORASTAND'
*.db_name='ORA11G'
*.db_recovery_file_dest='E:\app\xjxu\flash_recovery_area'
*.db_recovery_file_dest_size=3912M
*.db_unique_name='ORASTAND'
*.diagnostic_dest='E:\APP\XJXU'
*.FAL_SERVER=ORA11G
*.FAL_CLIENT=ORASTAND
*.log_archive_dest_1='location=E:\app\xjxu\oradata\ORASTAND\arch valid_for=(ALL_LOGFILES,ALL_ROLES) db_unique_name=ORASTAND'
*.log_archive_dest_2='service=ORA11G lgwr valid_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) db_unique_name=ORA11G'
*.log_file_name_convert='E:\app\xjxu\oradata\ORA11G','E:\app\xjxu\oradata\ORASTAND','E:\app\xjxu\oradata\ORA11G\arch','E:\app\xjxu\oradata\ORASTAND\arch','E:\app\xjxu\oradata\ORA11G\standby','E:\app\xjxu\oradata\ORASTAND\standby'
*.memory_target=800M
*.nls_language='SIMPLIFIED CHINESE'
*.nls_territory='CHINA'
*.open_cursors=300
*.processes=150
*.remote_login_passwordfile='EXCLUSIVE'
*.undo_tablespace='UNDOTBS1'

上面黑粗体表明的,最好先设置好,省得在DUPLICATE命令时也一堆,烦。 当然如果目录结构一直的话,就不用烦了。

② RMAN

CONNECT TARGET sys/oracle@ORA11G  #连接到主库,必须用TNSname方式连接

CONNECT AUXILIARY sys/oracle@ORASTAND #连接到备库

DUPLICATE TARGET DATABASE FOR STANDBY FROM ACTIVE DATABASE dorecover

③ 执行完RMAN ,检查一下备库数据文件及日志文件的路径

V$DATAFILE,V$LOGFILE;

如有不符合要求的,ALTER DATABASE RENAME FILE   ****** TO ********;