本实验的环境db_name都为orcl,SID不同,db_unique_name不同
环境: HOSTNAME SID db_name DB_Unique_Name TNS --------------------------------------------------------------------------------------------------------------------------------------------- target(rac): rac01/rac02 orcl orcl orcl TNS_ORCL auxiliary(singleDB): class113 vm orcl vm TNS_VM ---------------------------------------------------------------------------------------------------------------------------------------------
SQL>alter database archivelog; #RAC需要运行在归档模式 SQL> select file#,name,status,bytes,block_size from v$datafile; FILE# NAME STATUS BYTES BLOCK_SIZE ---------- -------------------------------------------------------------------------------- ------- ---------- ---------- 1 +DATA/orcl/datafile/system.256.1032463379 SYSTEM 723517440 8192 2 +DATA/orcl/datafile/sysaux.257.1032463383 ONLINE 597688320 8192 3 +DATA/orcl/datafile/undotbs1.258.1032463383 ONLINE 110100480 8192 4 +DATA/orcl/datafile/users.259.1032463383 ONLINE 5242880 8192 5 +DATA/orcl/datafile/example.261.1032463585 ONLINE 104857600 8192 6 +DATA/orcl/datafile/undotbs2.262.1032463963 ONLINE 52428800 8192 6 rows selected. SQL> archive log list; Database log mode Archive Mode Automatic archival Enabled Archive destination +ARCH Oldest online log sequence 13 Next log sequence to archive 14 Current log sequence 14 SQL> SQL> select group#,thread#,bytes from v$log; #通过查看thread#知道当前是2个线程,说明是2个节点的RAC,默认每个节点有2个日志文件 GROUP# THREAD# BYTES ---------- ---------- ---------- 1 1 52428800 2 1 52428800 3 2 52428800 4 2 52428800
#添加备用附加日志组文件 SQL> alter database add standby logfile thread 1 group 11 size 52428800; #因为RAC只有2个节点所有thread1代表节点1,thread2代表节点2 SQL> SQL> alter database add standby logfile thread 1 group 12 size 52428800; SQL> SQL> alter database add standby logfile thread 1 group 13 size 52428800; SQL> SQL> alter database add standby logfile thread 2 group 14 size 52428800; SQL> SQL> alter database add standby logfile thread 2 group 15 size 52428800; SQL> SQL> alter database add standby logfile thread 2 group 16 size 52428800; SQL> select * from v$logfile; GROUP# STATUS TYPE MEMBER IS_ ---------- ------- ------- -------------------------------------------------------------------------------- --- 2 ONLINE +FRA/orcl/onlinelog/group_2.258.1032463567 NO 1 ONLINE +FRA/orcl/onlinelog/group_1.257.1032463563 NO 3 ONLINE +FRA/orcl/onlinelog/group_3.259.1032464087 NO 4 ONLINE +FRA/orcl/onlinelog/group_4.260.1032464089 NO 12 STANDBY +FRA/orcl/onlinelog/group_12.261.1032657519 NO #上一步添加的日志组文件 13 STANDBY +FRA/orcl/onlinelog/group_13.262.1032657523 NO 14 STANDBY +FRA/orcl/onlinelog/group_14.263.1032657525 NO 15 STANDBY +FRA/orcl/onlinelog/group_15.264.1032657527 NO 16 STANDBY +FRA/orcl/onlinelog/group_16.265.1032657529 NO 11 STANDBY +FRA/orcl/onlinelog/group_11.266.1032657565 NO SQL> SQL> select group#,thread#,bytes,status from v$standby_log; GROUP# THREAD# BYTES STATUS ---------- ---------- ---------- ---------- 11 1 52428800 UNASSIGNED 12 1 52428800 UNASSIGNED 13 1 52428800 UNASSIGNED 14 2 52428800 UNASSIGNED 15 2 52428800 UNASSIGNED 16 2 52428800 UNASSIGNED SQL> alter database force logging; #target需要添加强制日志 SQL> select name,log_mode,force_logging from v$database; NAME LOG_MODE FOR --------- ------------ --- ORCL ARCHIVELOG YES SQL> SQL>alter system set log_archive_config='DG_CONFIG=(orcl,vm)' scope=both sid='*';
#orcl为target端的db_unique_name;vm为auxiliary的db_unique_name SQL>alter system set log_archive_dest_2='SERVICE=TNS_VM LGWR ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=vm' scope=both sid='*'; #TNS_VM为连接到auxiliary端的网络服务名;当本节点为primary_role的时候传递日志到目标端
SQL>alter system set log_archive_format='%t_%s_%r.arc' scope=spfile sid='*'; SQL>alter system set log_archive_max_processes=8 scope=both sid='*'; SQL>alter system set db_file_name_convert='/opt/oracle/oradata/orcl','+DATA/orcl/datafile/','/opt/oracle/oradata/orcl','+DATA/orcl/tempfile/' scope=spfile sid='*'; #设置从auxiliary端过来的数据文件进行转换
SQL>alter system set log_file_name_convert='/opt/oracle/oradata/orcl','+FRA/orcl/onlinelog' scope=spfile sid='*'; #设置从auxiliary端过来的日志文件进行转换
SQL>alter system set standby_file_management=AUTO scope=both sid='*'; SQL>alter system set fal_server='TNS_VM' scope=both sid='*'; #fal_server表示当本节点失败的时候,谁是你的主节点,用于连接到远程的网络服务名 set linesize 500 pages 0 col value for a90 col name for a50 select name, value from v$parameter where name in (
'db_name','db_unique_name','log_archive_config', 'log_archive_dest_1',
'log_archive_dest_2','log_archive_dest_state_1','log_archive_dest_state_2',
'remote_login_passwordfile','log_archive_format','log_archive_max_processes',
'fal_server','db_file_name_convert', 'log_file_name_convert', 'standby_file_management');
#target端更改后查看到的信息
db_file_name_convert /opt/oracle/oradata, +DATA/orcl/datafile, /opt/oracle/oradata, +DATA/orcl/tempfile log_file_name_convert /opt/oracle/oradata, +FRA/orcl/onlinelog log_archive_dest_1 LOCATION=+ARCH log_archive_dest_2 SERVICE=TNS_VM LGWR ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=vm log_archive_dest_state_1 enable log_archive_dest_state_2 ENABLE fal_server TNS_VM log_archive_config DG_CONFIG=(orcl,vm) log_archive_format %t_%s_%r.arc log_archive_max_processes 8 standby_file_management AUTO remote_login_passwordfile EXCLUSIVE db_name orcl db_unique_name orcl 14 rows selected. SQL>
#auxiliary端配置:
1. 复制密码文件到auxiliary端:
[oracle@rac01 ~]$ cd $ORACLE_HOME/dbs [oracle@rac01 dbs]$ ls hc_DBUA0.dat hc_orcl1.dat init.ora initorcl1.ora initorcl1.ora.bak.rac01 orapworcl1 snapcf_orcl1.f [oracle@rac01 dbs]$ scp orapworcl1 192.168.88.113:$ORACLE_HOME/dbs/orapwvm #复制节点的密码文件到auxiliary端,更改名为orapwvm
2.配置静态监听
[oracle@class113 trace]$ cd /opt/oracle/product/11.2/db_1/network/admin/ [oracle@class113 admin]$ ls listener.ora samples shrept.lst tnsnames.ora [oracle@class113 admin]$ more listener.ora # listener.ora Network Configuration File: /opt/oracle/product/11.2/db_1/network/admin/listener.ora # Generated by Oracle configuration tools. SID_LIST_LISTENER= #此处可以从samples里面复制样板来进行修改 (SID_LIST= (SID_DESC= (GLOBAL_DBNAME = vm) (ORACLE_HOME = /opt/oracle/product/11.2/db_1) (SID_NAME = vm) ) ) LISTENER = (DESCRIPTION_LIST = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.88.113)(PORT = 1521)) ) ) ADR_BASE_LISTENER = /opt/oracle [oracle@class113 admin]$
3. 根据target生成的参数文件进行修改如下:
[oracle@class113 dbs]$ cd $ORACLE_HOME/dbs
[oracle@class113 dbs]$ more initvm.ora
*.audit_file_dest='/opt/oracle/admin/vm/adump' #
*.audit_trail='db'
*.compatible='11.2.0.0.0'
*.control_files='/opt/oracle/oradata/control01.ctl','/opt/oracle/oradata/control02.ctl'
*.db_unique_name='vm'
*.db_file_name_convert='+DATA/orcl/datafile','/opt/oracle/oradata','+DATA/orcl/tempfile','/opt/oracle/oradata'
*.log_file_name_convert='+FRA/orcl/onlinelog','/opt/oracle/oradata'
*.db_block_size=8192
*.db_create_file_dest='/opt/oracle/oradata'
*.db_name='orcl'
*.db_recovery_file_dest='/opt/oracle/flash_recovery_area'
*.db_recovery_file_dest_size=9009600000
*.diagnostic_dest='/opt/oracle/diag'
*.fal_server='TNS_ORCL'
*.log_archive_config='DG_CONFIG=(vm,orcl)'
*.log_archive_dest_1='LOCATION=/opt/oracle/flash_recovery_area/arch'
*.log_archive_dest_2='SERVICE=TNS_ORCL LGWR ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=orcl'
*.log_archive_dest_state_2='enable'
*.log_archive_format='%t_%s_%r.arc'
*.log_archive_max_processes=8
#*.memory_target=15672864
*.open_cursors=300
*.processes=150
*.remote_login_passwordfile='exclusive'
*.standby_file_management='AUTO'
[oracle@class113 dbs]$
4. 创建数据库所需要的目录
mkdir -p /opt/oracle/admin/vm/adump
mkdir -p /opt/oracle/oradata
mkdir -p /opt/oracle/flash_recovery_area/arch
mkdir -p /opt/oracle/diag
5.启动监听;启动数据库到nomount状态
lsnrctl status
exit
startup nomount
exit
6.复制target数据到物理备库
[oracle@class113 ~]$ rman target sys/oracle@ORCL1 auxiliary sys/oracle@TNS_VM #从RAC01节点复制数据库到auxiliary端
Recovery Manager: Release 11.2.0.1.0 - Production on Tue Feb 18 16:41:31 2020
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
connected to target database: ORCL (DBID=1560244295)
connected to auxiliary database: ORCL (DBID=1560244295)
RMAN> duplicate target database for standby from active database dorecover nofilenamecheck;
Starting Duplicate Db at 18-FEB-20 using target database control file instead of recovery catalog allocated channel: ORA_AUX_DISK_1 channel ORA_AUX_DISK_1: SID=19 device type=DISK -------------------------------------------------------------------------------- contents of Memory Script: { backup as copy reuse targetfile '/u01/app/oracle/product/11.2.0/db_1/dbs/orapworcl2' auxiliary format '/opt/oracle/product/11.2/db_1/dbs/orapwvm' ; } executing Memory Script Starting backup at 18-FEB-20 allocated channel: ORA_DISK_1 channel ORA_DISK_1: SID=47 instance=orcl2 device type=DISK Finished backup at 18-FEB-20 -------------------------------------------------------------------------------- contents of Memory Script: { backup as copy current controlfile for standby auxiliary format '/opt/oracle/orad } executing Memory Script Starting backup at 18-FEB-20 using channel ORA_DISK_1 channel ORA_DISK_1: starting datafile copy copying standby control file output file name=/u01/app/oracle/product/11.2.0/db_1/dbs/snapcf_orcl2.f tag=TAG202002 channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:03 Finished backup at 18-FEB-20 -------------------------------------------------------------------------------- contents of Memory Script: { sql clone 'alter database mount standby database'; } executing Memory Script sql statement: alter database mount standby database contents of Memory Script: { set newname for tempfile 1 to "/opt/oracle/oradata/temp.260.1032463577"; switch clone tempfile all; set newname for datafile 1 to "/opt/oracle/oradata/system.256.1032463379"; set newname for datafile 2 to "/opt/oracle/oradata/sysaux.257.1032463383"; set newname for datafile 3 to "/opt/oracle/oradata/undotbs1.258.1032463383"; set newname for datafile 4 to "/opt/oracle/oradata/users.259.1032463383"; set newname for datafile 5 to "/opt/oracle/oradata/example.261.1032463585"; set newname for datafile 6 to "/opt/oracle/oradata/undotbs2.262.1032463963"; backup as copy reuse datafile 1 auxiliary format "/opt/oracle/oradata/system.256.1032463379" datafile 2 auxiliary format "/opt/oracle/oradata/sysaux.257.1032463383" datafile 3 auxiliary format "/opt/oracle/oradata/undotbs1.258.1032463383" datafile 4 auxiliary format "/opt/oracle/oradata/users.259.1032463383" datafile 5 auxiliary format "/opt/oracle/oradata/example.261.1032463585" datafile 6 auxiliary format "/opt/oracle/oradata/undotbs2.262.1032463963" ; sql 'alter system archive log current'; } executing Memory Script executing command: SET NEWNAME renamed tempfile 1 to /opt/oracle/oradata/temp.260.1032463577 in control file executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME Starting backup at 18-FEB-20 using channel ORA_DISK_1 channel ORA_DISK_1: starting datafile copy input datafile file number=00001 name=+DATA/orcl/datafile/system.256.1032463379 output file name=/opt/oracle/oradata/system.256.1032463379 tag=TAG20200218T203811 channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:25 channel ORA_DISK_1: starting datafile copy input datafile file number=00002 name=+DATA/orcl/datafile/sysaux.257.1032463383 output file name=/opt/oracle/oradata/sysaux.257.1032463383 tag=TAG20200218T203811 channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:25 channel ORA_DISK_1: starting datafile copy input datafile file number=00003 name=+DATA/orcl/datafile/undotbs1.258.1032463383 output file name=/opt/oracle/oradata/undotbs1.258.1032463383 tag=TAG20200218T203811 channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:07 channel ORA_DISK_1: starting datafile copy input datafile file number=00005 name=+DATA/orcl/datafile/example.261.1032463585 output file name=/opt/oracle/oradata/example.261.1032463585 tag=TAG20200218T203811 channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:03 channel ORA_DISK_1: starting datafile copy input datafile file number=00006 name=+DATA/orcl/datafile/undotbs2.262.1032463963 output file name=/opt/oracle/oradata/undotbs2.262.1032463963 tag=TAG20200218T203811 channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:03 channel ORA_DISK_1: starting datafile copy input datafile file number=00004 name=+DATA/orcl/datafile/users.259.1032463383 output file name=/opt/oracle/oradata/users.259.1032463383 tag=TAG20200218T203811 channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01 Finished backup at 18-FEB-20 sql statement: alter system archive log current contents of Memory Script: { backup as copy reuse archivelog like "+ARCH/orcl/archivelog/2020_02_18/thread_1_seq_31.310.1032725989" "/opt/oracle/flash_recovery_area/1_31_1032463563.arc" archivelog like "+ARCH/orcl/archivelog/2020_02_18/thread_1_seq_32.311.1032727093" auxiliary format "/opt/oracle/flash_recovery_area/1_32_1032463563.arc" archivelog like "+ARCH/orcl/archivelog/2020_02_18/thread_2_seq_29.312.1032727093" auxiliary format "/opt/oracle/flash_recovery_area/2_29_1032463563.arc" archivelog like "+ARCH/orcl/archivelog/2020_02_18/thread_2_seq_30.313.1032727159" auxiliary format "/opt/oracle/flash_recovery_area/2_30_1032463563.arc" archivelog like "+ARCH/orcl/archivelog/2020_02_18/thread_1_seq_33.314.1032727159" auxiliary format "/opt/oracle/flash_recovery_area/1_33_1032463563.arc" ; catalog clone archivelog "/opt/oracle/flash_recovery_area/1_31_1032463563.arc"; catalog clone archivelog "/opt/oracle/flash_recovery_area/1_32_1032463563.arc"; catalog clone archivelog "/opt/oracle/flash_recovery_area/2_29_1032463563.arc"; catalog clone archivelog "/opt/oracle/flash_recovery_area/2_30_1032463563.arc"; catalog clone archivelog "/opt/oracle/flash_recovery_area/1_33_1032463563.arc"; switch clone datafile all; } executing Memory Script Starting backup at 18-FEB-20 using channel ORA_DISK_1 channel ORA_DISK_1: starting archived log copy input archived log thread=1 sequence=31 RECID=55 STAMP=1032725988 output file name=/opt/oracle/flash_recovery_area/1_31_1032463563.arc RECID=0 STAMP=0 channel ORA_DISK_1: archived log copy complete, elapsed time: 00:00:01 channel ORA_DISK_1: starting archived log copy input archived log thread=1 sequence=32 RECID=56 STAMP=1032727093 output file name=/opt/oracle/flash_recovery_area/1_32_1032463563.arc RECID=0 STAMP=0 channel ORA_DISK_1: archived log copy complete, elapsed time: 00:00:01 channel ORA_DISK_1: starting archived log copy input archived log thread=2 sequence=29 RECID=57 STAMP=1032727094 output file name=/opt/oracle/flash_recovery_area/2_29_1032463563.arc RECID=0 STAMP=0 channel ORA_DISK_1: archived log copy complete, elapsed time: 00:00:01 channel ORA_DISK_1: starting archived log copy input archived log thread=2 sequence=30 RECID=58 STAMP=1032727158 output file name=/opt/oracle/flash_recovery_area/2_30_1032463563.arc RECID=0 STAMP=0 channel ORA_DISK_1: archived log copy complete, elapsed time: 00:00:02 channel ORA_DISK_1: starting archived log copy input archived log thread=1 sequence=33 RECID=59 STAMP=1032727159 output file name=/opt/oracle/flash_recovery_area/1_33_1032463563.arc RECID=0 STAMP=0 channel ORA_DISK_1: archived log copy complete, elapsed time: 00:00:01 Finished backup at 18-FEB-20 cataloged archived log archived log file name=/opt/oracle/flash_recovery_area/1_31_1032463563.arc RECID=1 ST cataloged archived log archived log file name=/opt/oracle/flash_recovery_area/1_32_1032463563.arc RECID=2 ST cataloged archived log archived log file name=/opt/oracle/flash_recovery_area/2_29_1032463563.arc RECID=3 ST cataloged archived log archived log file name=/opt/oracle/flash_recovery_area/2_30_1032463563.arc RECID=4 ST cataloged archived log archived log file name=/opt/oracle/flash_recovery_area/1_33_1032463563.arc RECID=5 ST datafile 1 switched to datafile copy input datafile copy RECID=15 STAMP=1032693214 file name=/opt/oracle/oradata/system.25 datafile 2 switched to datafile copy input datafile copy RECID=16 STAMP=1032693214 file name=/opt/oracle/oradata/sysaux.25 datafile 3 switched to datafile copy input datafile copy RECID=17 STAMP=1032693214 file name=/opt/oracle/oradata/undotbs1. datafile 4 switched to datafile copy input datafile copy RECID=18 STAMP=1032693214 file name=/opt/oracle/oradata/users.259 datafile 5 switched to datafile copy input datafile copy RECID=19 STAMP=1032693214 file name=/opt/oracle/oradata/example.2 datafile 6 switched to datafile copy input datafile copy RECID=20 STAMP=1032693214 file name=/opt/oracle/oradata/undotbs2. contents of Memory Script: { set until scn 1348806; recover standby clone database delete archivelog ; } executing Memory Script executing command: SET until clause Starting recover at 18-FEB-20 using channel ORA_AUX_DISK_1 starting media recovery archived log for thread 1 with sequence 32 is already on disk as file /opt/oracle/fla archived log for thread 1 with sequence 33 is already on disk as file /opt/oracle/fla archived log for thread 2 with sequence 29 is already on disk as file /opt/oracle/fla archived log for thread 2 with sequence 30 is already on disk as file /opt/oracle/fla archived log file name=/opt/oracle/flash_recovery_area/1_32_1032463563.arc thread=1 s archived log file name=/opt/oracle/flash_recovery_area/2_29_1032463563.arc thread=2 s archived log file name=/opt/oracle/flash_recovery_area/2_30_1032463563.arc thread=2 s archived log file name=/opt/oracle/flash_recovery_area/1_33_1032463563.arc thread=1 s media recovery complete, elapsed time: 00:00:00 Finished recover at 18-FEB-20 Finished Duplicate Db at 18-FEB-20 RMAN>
7.物理数据库在duplicate后变成mount状态
SQL> select open_mode from v$database;
OPEN_MODE
--------------------
mounted
SQL>
8. 将数据库打开
SQL> alter database open;
9. 启动恢复
SQL> alter database recover managed standby database disconnect from session;
SQL> select open_mode from v$database;
OPEN_MODE
--------------------
READ ONLY WITH APPLY
SQL>
10. 取消应用
SQL> alter database recover managed standby database cancel;
11. 启用实时恢复
SQL> alter database recover managed standby database using current logfile disconnect;
12. 测试
在target端新建数据库,在auxiliary端查询数据。
RAC01节点:
1 SQL> show parameter name; 2 3 NAME TYPE VALUE 4 ------------------------------------ ----------- ------------------------------ 5 db_file_name_convert string /opt/oracle/oradata, +DATA/orcl/datafile, /opt/oracle/oradata, +DATA/orcl/tempfile 8 db_name string orcl 9 db_unique_name string orcl 10 global_names boolean FALSE 11 instance_name string orcl1 12 lock_name_space string 13 log_file_name_convert string /opt/oracle/oradata, +FRA/orcl/onlinelog 15 service_names string orcl.vmsys.com 16 SQL>
RAC02节点:
1 SQL> show parameter name; 2 3 NAME TYPE VALUE 4 ------------------------------------ ----------- ------------------------------ 5 db_file_name_convert string /opt/oracle/oradata, +DATA/orcl/datafile, /opt/oracle/oradata, +DATA/orcl/tempfile 8 db_name string orcl 9 db_unique_name string orcl 10 global_names boolean FALSE 11 instance_name string orcl2 12 lock_name_space string 13 log_file_name_convert string /opt/oracle/oradata, +FRA/orcl/onlinelog 15 service_names string orcl.vmsys.com 16 SQL>
1 [root@rac01 ~]# more /etc/hosts 2 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 3 192.168.88.201 rac01.vmsys.com rac01 4 192.168.88.202 rac02.vmsys.com rac02 5 192.168.88.14 rac01-vip.vmsys.com rac01-vip 6 192.168.88.15 rac02-vip.vmsys.com rac02-vip 7 2.1.1.1 rac01-san.vmsys.com rac01-san 8 2.1.1.2 rac02-san.vmsys.com rac02-san 9 100.1.1.1 rac01-priv.vmsys.com rac01-priv 10 100.1.1.2 rac02-priv.vmsys.com rac02-priv 11 192.168.88.11 rac-scan.vmsys.com rac-scan 12 192.168.88.12 rac-scan.vmsys.com rac-scan 13 192.168.88.13 rac-scan.vmsys.com rac-scan 14 192.168.88.113 class113 15 [root@rac01 ~]# crs_stat -t -v 16 Name Type R/RA F/FT Target State Host 17 ---------------------------------------------------------------------- 18 ora.ARCH.dg ora....up.type 0/5 0/ ONLINE ONLINE rac01 19 ora.DATA.dg ora....up.type 0/5 0/ ONLINE ONLINE rac01 20 ora.FRA.dg ora....up.type 0/5 0/ ONLINE ONLINE rac01 21 ora....ER.lsnr ora....er.type 0/5 0/ ONLINE ONLINE rac01 22 ora....N1.lsnr ora....er.type 0/5 0/0 ONLINE ONLINE rac01 23 ora....N2.lsnr ora....er.type 0/5 0/0 ONLINE ONLINE rac02 24 ora....N3.lsnr ora....er.type 0/5 0/0 ONLINE ONLINE rac02 25 ora.OCR.dg ora....up.type 0/5 0/ ONLINE ONLINE rac01 26 ora.asm ora.asm.type 0/5 0/ ONLINE ONLINE rac01 27 ora.eons ora.eons.type 0/3 0/ ONLINE ONLINE rac01 28 ora.gsd ora.gsd.type 0/5 0/ OFFLINE OFFLINE 29 ora....network ora....rk.type 0/5 0/ ONLINE ONLINE rac01 30 ora.oc4j ora.oc4j.type 0/5 0/0 OFFLINE OFFLINE 31 ora.ons ora.ons.type 0/3 0/ ONLINE ONLINE rac01 32 ora.orcl.db ora....se.type 0/2 0/1 ONLINE ONLINE rac01 33 ora....SM1.asm application 0/5 0/0 ONLINE ONLINE rac01 34 ora....01.lsnr application 0/5 0/0 ONLINE ONLINE rac01 35 ora.rac01.gsd application 0/5 0/0 OFFLINE OFFLINE 36 ora.rac01.ons application 0/3 0/0 ONLINE ONLINE rac01 37 ora.rac01.vip ora....t1.type 0/0 0/0 ONLINE ONLINE rac01 38 ora....SM2.asm application 0/5 0/0 ONLINE ONLINE rac02 39 ora....02.lsnr application 0/5 0/0 ONLINE ONLINE rac02 40 ora.rac02.gsd application 0/5 0/0 OFFLINE OFFLINE 41 ora.rac02.ons application 0/3 0/0 ONLINE ONLINE rac02 42 ora.rac02.vip ora....t1.type 0/0 0/0 ONLINE ONLINE rac02 43 ora.scan1.vip ora....ip.type 0/0 0/0 ONLINE ONLINE rac01 44 ora.scan2.vip ora....ip.type 0/0 0/0 ONLINE ONLINE rac02 45 ora.scan3.vip ora....ip.type 0/0 0/0 ONLINE ONLINE rac02 46 [root@rac01 ~]#
#rac每个节点和物理备库的tnsname.ora需要一致 [oracle@rac02 admin]$ cd /u01/app/oracle/product/11.2.0/db_1/network/admin/ [oracle@rac02 admin]$ more tnsnames.ora # tnsnames.ora Network Configuration File: /u01/app/oracle/product/11.2.0/db_1/network/admin/tnsnames.ora # Generated by Oracle configuration tools. ORCL1 = #RAC01节点的网络服务名 (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.88.14)(PORT = 1521)) #192.168.88.14为rac01的vip地址 (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = orcl.vmsys.com) ) ) ORCL2 = #RAC02节点的网络服务名 (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.88.15)(PORT = 1521)) #192.168.88.15为rac02的vip地址 (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = orcl.vmsys.com) ) ) TNS_ORCL = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = rac-scan)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = orcl.vmsys.com) ) ) TNS_VM = #连接到物理备库的网络服务名 (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.88.113)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = vm) #与物理备库sid的名字一致,可以到物理备库,lsnrctl staus查看服务名 ) ) [oracle@rac02 admin]$
db_file_name_convert /opt/oracle/oradata, +DATA/orcl/datafile, /opt/oracle/oradata, +DATA/orcl/tempfilelog_file_name_convert /opt/oracle/oradata, +FRA/orcl/onlineloglog_archive_dest_1 LOCATION=+ARCHlog_archive_dest_2 SERVICE=TNS_VM LGWR ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=vmlog_archive_dest_state_1 enablelog_archive_dest_state_2 ENABLEfal_server TNS_VMlog_archive_config DG_CONFIG=(orcl,vm)log_archive_format %t_%s_%r.arclog_archive_max_processes 8standby_file_management AUTOremote_login_passwordfile EXCLUSIVEdb_name orcldb_unique_name orcl
14 rows selected.
SQL>