同一环境下新建Standby RAC库(2)

根据主库之前导出的参数文件修改备库的参数文件:
cp /tmp/pfile.ora /tmp/pfile_std.ora
vi /tmp/pfile_std.ora

*._high_priority_processes='LMS*' *.audit_file_dest='/u01/app/oracle/admin/jyzhaodg/adump' *.audit_trail='db' *.cluster_database=true *.compatible='11.2.0.4.0' *.control_files='+DATA/jyzhaodg/controlfile/current.260.931878631','+FRA/jyzhaodg/controlfile/current.256.931878631' *.db_block_size=8192 *.db_create_file_dest='+DATA' *.db_domain='' *.db_name='jyzhao' *.db_recovery_file_dest='+FRA' *.db_recovery_file_dest_size=4621074432 *.diagnostic_dest='/u01/app/oracle' *.dispatchers='(PROTOCOL=TCP) (SERVICE=jyzhaoXDB)' jyzhaodg2.instance_number=2 jyzhaodg1.instance_number=1 *.log_archive_format='%t_%s_%r.dbf' *.memory_target=313286272 *.open_cursors=300 *.processes=150 *.remote_listener='oradb-scan:1521' *.remote_login_passwordfile='exclusive' jyzhaodg2.thread=2 jyzhaodg1.thread=1 jyzhaodg2.undo_tablespace='UNDOTBS2' jyzhaodg1.undo_tablespace='UNDOTBS1' #add db_unique_name='jyzhaodg' log_archive_config='dg_config=(jyzhao,jyzhaodg)'#db_unique_name db_file_name_convert='+DATA/jyzhao','+DATA/jyzhaodg' log_file_name_convert='+DATA/jyzhao','+DATA/jyzhaodg' standby_file_management=auto fal_client='jyzhaodg'#tnsnames.ora fal_server='jyzhao'#salehrdb log_archive_dest_3='service=jyzhao valid_for=(online_logfiles,primary_role) db_unique_name=jyzhao'

主要是注意后面#add之后的内容。

3.3 在ASM中创建standby的spfile

在ASM中创建standby的spfile,并确定各节点的参数文件内容指向磁盘中的spfile。
节点1:

echo $ORACLE_SID export ORACLE_SID=jyzhaodg1 create spfile='+DATA/jyzhaodg/spfilejyzhaodg.ora' from pfile='/tmp/pfile_std.ora'; -- cat initjyzhaodg1.ora SPFILE='+DATA/jyzhaodg/spfilejyzhaodg.ora'

节点2:

echo $ORACLE_SID export ORACLE_SID=jyzhaodg2 cat initjyzhaodg2.ora SPFILE='+DATA/jyzhaodg/spfilejyzhaodg.ora'

创建adump目录(所有节点)

mkdir -p /u01/app/oracle/admin/jyzhaodg/adump 3.4 Standby RAC启动到nomount

节点1:

echo $ORACLE_SID export ORACLE_SID=jyzhaodg1 startup nomount

节点2:

echo $ORACLE_SID export ORACLE_SID=jyzhaodg2 startup nomount 第四章 rman恢复控制文件

在Primary RAC上创建备库使用的控制文件:

echo $ORACLE_SID export ORACLE_SID=jyzhao1 SQL> alter database create standby controlfile as '/tmp/control01.ctlbak';

在Standby RAC的节点1上恢复控制文件并启动到mount:

echo $ORACLE_SID export ORACLE_SID=jyzhaodg1 restore controlfile from '/tmp/control01.ctlbak'; alter database mount; crosscheck backupset; --如果是之前copy到磁盘组的备份没加载到控制文件中,可以手动catalog catalog start with '+data/jyzhaodg/DATAFILE'; --同样,如果是之前的备份集没加载到控制文件中,一样手动catalog catalog start with '/u01/orabak/';

查看此时standby记录的各文件路径是否符合预期:

SQL> select name from v$datafile; NAME -------------------------------------------------------------------------------- +DATA/jyzhaodg/datafile/system.256.931878537 +DATA/jyzhaodg/datafile/sysaux.257.931878537 +DATA/jyzhaodg/datafile/undotbs1.258.931878537 +DATA/jyzhaodg/datafile/users.259.931878537 +DATA/jyzhaodg/datafile/undotbs2.264.931878827 +DATA/jyzhaodg/datafile/dbs_d_jingyu.268.937515173 6 rows selected. SQL> select member from v$logfile; MEMBER -------------------------------------------------------------------------------- +DATA/jyzhaodg/onlinelog/group_2.262.931878637 +FRA/jyzhao/onlinelog/group_2.258.931878639 +DATA/jyzhaodg/onlinelog/group_1.261.931878635 +FRA/jyzhao/onlinelog/group_1.257.931878637 +DATA/jyzhaodg/onlinelog/group_3.265.931879021 +FRA/jyzhao/onlinelog/group_3.259.931879023 +DATA/jyzhaodg/onlinelog/group_4.266.931879027 +FRA/jyzhao/onlinelog/group_4.260.931879029 8 rows selected. SQL> select name from v$tempfile; NAME -------------------------------------------------------------------------------- +DATA/jyzhaodg/tempfile/temp.263.931878661 SQL> select name from v$controlfile; NAME -------------------------------------------------------------------------------- +DATA/jyzhaodg/controlfile/current.288.937645851 +FRA/jyzhaodg/controlfile/current.275.937645851

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/bda33f2a29ed4a9a6e9dfcc32fc104bd.html