某项目RAC环境DG方式迁移到异机RAC
主备rac一共4台、硬件配置相同
cpu
:16
memory
:64G
数据文件
:515G
网络带宽
:1000Mbps
RMAN
:primary 12 channel+auxiliary 12 channel
迁移耗时:1h 30min
一、环境配置
1、主库、备库规划
主库
dbname
:zjedb
db_unique_name
:zjedb
#public ip ent0
192.168.137.3 zjerac1
192.168.137.4 zjerac2
#priv ip ent1
10.0.0.3 zjerac1-prv
10.0.0.4 zjerac2-prv
#vip ip
192.168.137.6 zjerac1-vip
192.168.137.7 zjerac2-vip
#scan ip
192.168.137.8 rac-scan
备库
dbname
:zjedb
db_unique_name
:zjedbstd
#public ip ent0
192.168.137.30 ebs1
192.168.137.31 ebs2
#vip ip
192.168.137.32 ebs1-vip
192.168.137.33 ebs2-vip
#priv ip ent1
10.10.10.30 ebs1-prv
10.10.10.31 ebs2-prv
#scan ip
192.168.137.34 rac-scan
2、主库仅需修改如下参数:
alter database force logging;
alter system set LOG_ARCHIVE_CONFIG='DG_CONFIG=(zjedb,zjedbstd)' sid='*';
alter system set LOG_ARCHIVE_DEST_2='SERVICE=zjedbstd LGWR ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=zjedbstd' sid='*';
3、主库备库所有节点编辑为相同的tnsnames
[grid@ebs1:/u01/app/oracle/product/11.2.0/db_1/network/admin]$vi tnsnames.ora
zjedb =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.137.8)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = zjedb)
)
)
zjedb1 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.137.6)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = zjedb)
)
)
zjedb2 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.137.7)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = zjedb)
)
)
zjedbstd =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.137.34)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = zjedbstd)
)
)
zjedbstd1 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.137.32)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = zjedbstd)
)
)
zjedbstd2 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.137.33)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = zjedbstd)
)
)
4、备库拷贝主库的密码文件到本地
节点1
scp oracle@192.168.137.3:/u01/app/oracle/product/11.2.0/db_1/dbs/orapwzjedb1 /u01/app/oracle/product/11.2.0/db_1/dbs/orapwzjedbstd1
节点2
scp oracle@192.168.137.4:/u01/app/oracle/product/11.2.0/db_1/dbs/orapwzjedb2 /u01/app/oracle/product/11.2.0/db_1/dbs/orapwzjedbstd2
5、在备库其中一个节点编辑pfile
[oracle@orcldb:/u01/app/oracle/product/11.2.0/db_1/dbs]$vi initzjedbstd1.ora
*.audit_trail='NONE'
*.cluster_database=true
*.compatible='11.2.0.4.0'
*.control_files='+DATA/zjedbstd/controlfile/current.274.980502673'
*.db_block_size=8192
*.db_domain=''
*.db_name='zjedb'
*.db_unique_name='zjedbstd'
*.diagnostic_dest='/u01/app/oracle'
*.log_archive_format='%t_%s_%r.arc'
*.open_cursors=1000
*.pga_aggregate_target=11284M
*.processes=1000
*.remote_login_passwordfile='exclusive'
*.sga_target=33920M
*.LOG_ARCHIVE_CONFIG='DG_CONFIG=(zjedbstd,zjedb)'
*.LOG_ARCHIVE_DEST_1='LOCATION=+data VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=zjedbstd'
*.LOG_ARCHIVE_DEST_2='SERVICE=zjedb LGWR ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=zjedb'
*.log_archive_format='%t_%s_%r.arc'
*.FAL_SERVER='zjedb'
*.fal_client='zjedbstd'
*.DB_FILE_NAME_CONVERT='+DATA/zjedb/datafile/','+DATA/zjedbstd/datafile/','+DATA/zjedb/tempfile/','+DATA/zjedbstd/tempfile/'
*.LOG_FILE_NAME_CONVERT='+DATA/zjedb/onlinelog/','+DATA/zjedbstd/onlinelog/'
*.standby_file_management=AUTO
*.remote_listener='rac-scan:1521'
zjedbstd1.instance_number=1
zjedbstd2.instance_number=2
zjedbstd1.thread=1
zjedbstd2.thread=2
zjedbstd1.undo_tablespace='UNDOTBS1'
zjedbstd2.undo_tablespace='UNDOTBS2'
6、增加备库节点1静态监听
[grid@orcldb:/u01]$vi /u01/app/11.2.0/grid/network/admin/listener.ora
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME= zjedbstd)
(ORACLE_HOME = /u01/app/oracle/product/11.2.0/db_1)
(SID_NAME = zjedbstd1)
)
)
重新启动监听
[grid@ebs1:/u01/app/11.2.0/grid/network/admin]$srvctl stop listener -n ebs1
[grid@ebs1:/u01/app/11.2.0/grid/network/admin]$srvctl start listener -n ebs1
7、仅安装oracle软件时需要可执行文件授权
[root@rac1-std ~]# chown oracle:asmadmin /u01/app/oracle/product/11.2.0/db_1/bin/oracle
[root@rac1-std ~]# chmod 6751 /u01/app/oracle/product/11.2.0/db_1/bin/oracle
8、备库启动nomount
SQL> startup nomount;
9、在主库1节点连接辅助实例
[oracle@zjbs1:/home/oracle]$rman target sys/oracle@zjedb1 auxiliary sys/oracle@zjedbstd1
Recovery Manager: Release 11.2.0.4.0 - Production on Fri May 17 19:54:28 2019
connected to target database: ZJEDB (DBID=3626390995)
connected to auxiliary database: ZJEDB (not mounted)
10、主备传输备库duplicate dg、
RMAN>
run{
allocate channel c1 type disk;
allocate channel c2 type disk;
allocate channel c3 type disk;
allocate channel c4 type disk;
allocate channel c5 type disk;
allocate channel c6 type disk;
allocate channel c7 type disk;
allocate channel c8 type disk;
allocate channel c9 type disk;
allocate channel c10 type disk;
allocate channel c11 type disk;
allocate channel c12 type disk;
allocate AUXILIARY channel c13 type disk;
allocate AUXILIARY channel c14 type disk;
allocate AUXILIARY channel c15 type disk;
allocate AUXILIARY channel c16 type disk;
allocate AUXILIARY channel c17 type disk;
allocate AUXILIARY channel c18 type disk;
allocate AUXILIARY channel c19 type disk;
allocate AUXILIARY channel c20 type disk;
allocate AUXILIARY channel c21 type disk;
allocate AUXILIARY channel c22 type disk;
allocate AUXILIARY channel c23 type disk;
allocate AUXILIARY channel c24 type disk;
DUPLICATE TARGET DATABASE FOR STANDBY FROM ACTIVE DATABASE DORECOVER
NOFILENAMECHECK;
release channel c1;
release channel c2;
release channel c3;
release channel c4;
release channel c5;
release channel c6;
release channel c7;
release channel c8;
release channel c9;
release channel c10;
release channel c11;
release channel c12;
release channel c13;
release channel c14;
release channel c15;
release channel c16;
release channel c17;
release channel c18;
release channel c19;
release channel c20;
release channel c21;
release channel c22;
release channel c23;
release channel c24;
}
输出日志:
using target database control file instead of recovery catalog
allocated channel: c1
channel c1: SID=1522 instance=zjedb1 device type=DISK
allocated channel: c2
channel c2: SID=1898 instance=zjedb1 device type=DISK
allocated channel: c3
channel c3: SID=760 instance=zjedb1 device type=DISK
allocated channel: c4
channel c4: SID=763 instance=zjedb1 device type=DISK
allocated channel: c5
channel c5: SID=2087 instance=zjedb1 device type=DISK
allocated channel: c6
channel c6: SID=2274 instance=zjedb1 device type=DISK
allocated channel: c7
channel c7: SID=8 instance=zjedb1 device type=DISK
allocated channel: c8
channel c8: SID=384 instance=zjedb1 device type=DISK
allocated channel: c9
channel c9: SID=2842 instance=zjedb1 device type=DISK
allocated channel: c10
channel c10: SID=765 instance=zjedb1 device type=DISK
allocated channel: c11
channel c11: SID=2653 instance=zjedb1 device type=DISK
allocated channel: c12
channel c12: SID=1896 instance=zjedb1 device type=DISK
allocated channel: c13
channel c13: SID=98 instance=zjedbstd1 device type=DISK
allocated channel: c14
channel c14: SID=195 instance=zjedbstd1 device type=DISK
allocated channel: c15
channel c15: SID=291 instance=zjedbstd1 device type=DISK
allocated channel: c16
channel c16: SID=387 instance=zjedbstd1 device type=DISK
allocated channel: c17
channel c17: SID=483 instance=zjedbstd1 device type=DISK
allocated channel: c18
channel c18: SID=579 instance=zjedbstd1 device type=DISK
allocated channel: c19
channel c19: SID=673 instance=zjedbstd1 device type=DISK
allocated channel: c20
channel c20: SID=771 instance=zjedbstd1 device type=DISK
allocated channel: c21
channel c21: SID=867 instance=zjedbstd1 device type=DISK
allocated channel: c22
channel c22: SID=964 instance=zjedbstd1 device type=DISK
allocated channel: c23
channel c23: SID=1059 instance=zjedbstd1 device type=DISK
allocated channel: c24
channel c24: SID=1156 instance=zjedbstd1 device type=DISK
Starting Duplicate Db at 2019-05-17 19:54:51
contents of Memory Script:
{
backup as copy reuse
targetfile '/u01/app/oracle/product/11.2.0/db_1/dbs/orapwzjedb1' auxiliary format
'/u01/app/oracle/product/11.2.0/db_1/dbs/orapwzjedbstd1' ;
}
executing Memory Script
Starting backup at 2019-05-17 19:55:55
Finished backup at 2019-05-17 19:55:56
contents of Memory Script:
{
backup as copy current controlfile for standby auxiliary format '+DATA/zjedbstd/controlfile/current.256.1008532547';
sql clone "create spfile from memory";
shutdown clone immediate;
startup clone nomount;
sql clone "alter system set control_files =
''+DATA/zjedbstd/controlfile/current.256.1008532547'' comment=
''Set by RMAN'' scope=spfile";
shutdown clone immediate;
startup clone nomount;
}
executing Memory Script
Starting backup at 2019-05-17 19:55:57
channel c1: starting datafile copy
copying standby control file
output file name=/u01/app/oracle/product/11.2.0/db_1/dbs/snapcf_zjedb1.f tag=TAG20190517T195557 RECID=1 STAMP=1008532559
channel c1: datafile copy complete, elapsed time: 00:00:03
Finished backup at 2019-05-17 19:56:01
sql statement: create spfile from memory
Oracle instance shut down
connected to auxiliary database (not started)
Oracle instance started
Total System Global Area 35408904192 bytes
Fixed Size 2260448 bytes
Variable Size 4966056480 bytes
Database Buffers 30333206528 bytes
Redo Buffers 107380736 bytes
allocated channel: c13
channel c13: SID=195 instance=zjedbstd1 device type=DISK
allocated channel: c14
channel c14: SID=291 instance=zjedbstd1 device type=DISK
allocated channel: c15
channel c15: SID=387 instance=zjedbstd1 device type=DISK
allocated channel: c16
channel c16: SID=483 instance=zjedbstd1 device type=DISK
allocated channel: c17
channel c17: SID=579 instance=zjedbstd1 device type=DISK
allocated channel: c18
channel c18: SID=673 instance=zjedbstd1 device type=DISK
allocated channel: c19
channel c19: SID=771 instance=zjedbstd1 device type=DISK
allocated channel: c20
channel c20: SID=867 instance=zjedbstd1 device type=DISK
allocated channel: c21
channel c21: SID=964 instance=zjedbstd1 device type=DISK
allocated channel: c22
channel c22: SID=1059 instance=zjedbstd1 device type=DISK
allocated channel: c23
channel c23: SID=1156 instance=zjedbstd1 device type=DISK
allocated channel: c24
channel c24: SID=1252 instance=zjedbstd1 device type=DISK
sql statement: alter system set control_files = ''+DATA/zjedbstd/controlfile/current.256.1008532547'' comment= ''Set by RMAN'' scope=spfile
Oracle instance shut down
connected to auxiliary database (not started)
Oracle instance started
Total System Global Area 35408904192 bytes
Fixed Size 2260448 bytes
Variable Size 4966056480 bytes
Database Buffers 30333206528 bytes
Redo Buffers 107380736 bytes
allocated channel: c13
channel c13: SID=195 instance=zjedbstd1 device type=DISK
allocated channel: c14
channel c14: SID=291 instance=zjedbstd1 device type=DISK
allocated channel: c15
channel c15: SID=387 instance=zjedbstd1 device type=DISK
allocated channel: c16
channel c16: SID=483 instance=zjedbstd1 device type=DISK
allocated channel: c17
channel c17: SID=579 instance=zjedbstd1 device type=DISK
allocated channel: c18
channel c18: SID=673 instance=zjedbstd1 device type=DISK
allocated channel: c19
channel c19: SID=771 instance=zjedbstd1 device type=DISK
allocated channel: c20
channel c20: SID=867 instance=zjedbstd1 device type=DISK
allocated channel: c21
channel c21: SID=964 instance=zjedbstd1 device type=DISK
allocated channel: c22
channel c22: SID=1059 instance=zjedbstd1 device type=DISK
allocated channel: c23
channel c23: SID=1156 instance=zjedbstd1 device type=DISK
allocated channel: c24
channel c24: SID=1252 instance=zjedbstd1 device type=DISK
contents of Memory Script:
{
sql clone 'alter database mount standby database';
}
executing Memory Script
sql statement: alter database mount standby database
RMAN-05529: WARNING: DB_FILE_NAME_CONVERT resulted in invalid ASM names; names changed to disk group only.
contents of Memory Script:
{
set newname for tempfile 1 to
"+data";
switch clone tempfile all;
set newname for datafile 1 to
"+data";
set newname for datafile 2 to
"+data";
set newname for datafile 3 to
"+data";
set newname for datafile 4 to
"+data";
set newname for datafile 5 to
"+data";
set newname for datafile 6 to
"+DATA/zjedbstd/datafile/zjzwfw01.dbf";
set newname for datafile 7 to
"+DATA/zjedbstd/datafile/zjzwfw02.dbf";
set newname for datafile 8 to
"+DATA/zjedbstd/datafile/zjzwfw03.dbf";
set newname for datafile 9 to
"+DATA/zjedbstd/datafile/zjzwfw04.dbf";
set newname for datafile 10 to
"+DATA/zjedbstd/datafile/zjzwfw05.dbf";
set newname for datafile 11 to
"+DATA/zjedbstd/datafile/zjzwfw06.dbf";
set newname for datafile 12 to
"+DATA/zjedbstd/datafile/zjzwfw07.dbf";
set newname for datafile 13 to
"+DATA/zjedbstd/datafile/zjzwfw08.dbf";
set newname for datafile 14 to
"+DATA/zjedbstd/datafile/zjzwfw09.dbf";
set newname for datafile 15 to
"+DATA/zjedbstd/datafile/zjzwfw10.dbf";
set newname for datafile 16 to
"+data";
set newname for datafile 17 to
"+DATA/zjedbstd/datafile/zjzwfw11.dbf";
set newname for datafile 18 to
"+DATA/zjedbstd/datafile/zjzwfw12.dbf";
set newname for datafile 19 to
"+DATA/zjedbstd/datafile/zjzwfw13.ora";
set newname for datafile 20 to
"+DATA/zjedbstd/datafile/zjzwfw14.dbf";
set newname for datafile 21 to
"+DATA/zjedbstd/datafile/zjzwfw15.dbf";
backup as copy reuse
datafile 1 auxiliary format
"+data" datafile
2 auxiliary format
"+data" datafile
3 auxiliary format
"+data" datafile
4 auxiliary format
"+data" datafile
5 auxiliary format
"+data" datafile
6 auxiliary format
"+DATA/zjedbstd/datafile/zjzwfw01.dbf" datafile
7 auxiliary format
"+DATA/zjedbstd/datafile/zjzwfw02.dbf" datafile
8 auxiliary format
"+DATA/zjedbstd/datafile/zjzwfw03.dbf" datafile
9 auxiliary format
"+DATA/zjedbstd/datafile/zjzwfw04.dbf" datafile
10 auxiliary format
"+DATA/zjedbstd/datafile/zjzwfw05.dbf" datafile
11 auxiliary format
"+DATA/zjedbstd/datafile/zjzwfw06.dbf" datafile
12 auxiliary format
"+DATA/zjedbstd/datafile/zjzwfw07.dbf" datafile
13 auxiliary format
"+DATA/zjedbstd/datafile/zjzwfw08.dbf" datafile
14 auxiliary format
"+DATA/zjedbstd/datafile/zjzwfw09.dbf" datafile
15 auxiliary format
"+DATA/zjedbstd/datafile/zjzwfw10.dbf" datafile
16 auxiliary format
"+data" datafile
17 auxiliary format
"+DATA/zjedbstd/datafile/zjzwfw11.dbf" datafile
18 auxiliary format
"+DATA/zjedbstd/datafile/zjzwfw12.dbf" datafile
19 auxiliary format
"+DATA/zjedbstd/datafile/zjzwfw13.ora" datafile
20 auxiliary format
"+DATA/zjedbstd/datafile/zjzwfw14.dbf" datafile
21 auxiliary format
"+DATA/zjedbstd/datafile/zjzwfw15.dbf" ;
sql 'alter system archive log current';
}
executing Memory Script
executing command: SET NEWNAME
renamed tempfile 1 to +data 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
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
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 2019-05-17 19:57:00
channel c1: starting datafile copy
input datafile file number=00006 name=+DATA/zjedb/datafile/zjzwfw01.dbf
channel c2: starting datafile copy
input datafile file number=00007 name=+DATA/zjedb/datafile/zjzwfw02.dbf
channel c3: starting datafile copy
input datafile file number=00008 name=+DATA/zjedb/datafile/zjzwfw03.dbf
channel c4: starting datafile copy
input datafile file number=00009 name=+DATA/zjedb/datafile/zjzwfw04.dbf
channel c5: starting datafile copy
input datafile file number=00010 name=+DATA/zjedb/datafile/zjzwfw05.dbf
channel c6: starting datafile copy
input datafile file number=00011 name=+DATA/zjedb/datafile/zjzwfw06.dbf
channel c7: starting datafile copy
input datafile file number=00012 name=+DATA/zjedb/datafile/zjzwfw07.dbf
channel c8: starting datafile copy
input datafile file number=00013 name=+DATA/zjedb/datafile/zjzwfw08.dbf
channel c9: starting datafile copy
input datafile file number=00014 name=+DATA/zjedb/datafile/zjzwfw09.dbf
channel c10: starting datafile copy
input datafile file number=00015 name=+DATA/zjedb/datafile/zjzwfw10.dbf
channel c11: starting datafile copy
input datafile file number=00018 name=+DATA/zjedb/datafile/zjzwfw12.dbf
channel c12: starting datafile copy
input datafile file number=00001 name=+DATA/zjedb/datafile/system.259.966869851
output file name=+DATA/zjedbstd/datafile/zjzwfw08.dbf tag=TAG20190517T195700
channel c8: datafile copy complete, elapsed time: 00:57:07
channel c8: starting datafile copy
input datafile file number=00017 name=+DATA/zjedb/datafile/zjzwfw11.dbf
output file name=+DATA/zjedbstd/datafile/zjzwfw02.dbf tag=TAG20190517T195700
channel c2: datafile copy complete, elapsed time: 00:57:14
channel c2: starting datafile copy
input datafile file number=00016 name=+DATA/zjedb/datafile/system.278.980416325
output file name=+DATA/zjedbstd/datafile/zjzwfw10.dbf tag=TAG20190517T195700
channel c10: datafile copy complete, elapsed time: 00:57:21
channel c10: starting datafile copy
input datafile file number=00002 name=+DATA/zjedb/datafile/sysaux.260.966869955
output file name=+DATA/zjedbstd/datafile/zjzwfw04.dbf tag=TAG20190517T195700
channel c4: datafile copy complete, elapsed time: 00:57:46
channel c4: starting datafile copy
input datafile file number=00003 name=+DATA/zjedb/datafile/undotbs1.261.966870103
output file name=+DATA/zjedbstd/datafile/zjzwfw06.dbf tag=TAG20190517T195700
channel c6: datafile copy complete, elapsed time: 00:57:47
channel c6: starting datafile copy
input datafile file number=00004 name=+DATA/zjedb/datafile/undotbs2.263.966870261
output file name=+DATA/zjedbstd/datafile/zjzwfw05.dbf tag=TAG20190517T195700
channel c5: datafile copy complete, elapsed time: 00:58:12
channel c5: starting datafile copy
input datafile file number=00019 name=+DATA/zjedb/datafile/zjzwfw13.ora
output file name=+DATA/zjedbstd/datafile/zjzwfw07.dbf tag=TAG20190517T195700
channel c7: datafile copy complete, elapsed time: 00:58:47
channel c7: starting datafile copy
input datafile file number=00020 name=+DATA/zjedb/datafile/zjzwfw14.dbf
output file name=+DATA/zjedbstd/datafile/zjzwfw09.dbf tag=TAG20190517T195700
channel c9: datafile copy complete, elapsed time: 00:58:48
channel c9: starting datafile copy
input datafile file number=00021 name=+DATA/zjedb/datafile/zjzwfw15.dbf
output file name=+DATA/zjedbstd/datafile/zjzwfw01.dbf tag=TAG20190517T195700
channel c1: datafile copy complete, elapsed time: 01:00:13
channel c1: starting datafile copy
input datafile file number=00005 name=+DATA/zjedb/datafile/users.264.966870411
output file name=+DATA/zjedbstd/datafile/users.277.1008536225 tag=TAG20190517T195700
channel c1: datafile copy complete, elapsed time: 00:02:16
output file name=+DATA/zjedbstd/datafile/zjzwfw12.dbf tag=TAG20190517T195700
channel c11: datafile copy complete, elapsed time: 01:04:09
output file name=+DATA/zjedbstd/datafile/system.268.1008532611 tag=TAG20190517T195700
channel c12: datafile copy complete, elapsed time: 01:04:39
output file name=+DATA/zjedbstd/datafile/zjzwfw03.dbf tag=TAG20190517T195700
channel c3: datafile copy complete, elapsed time: 01:11:09
output file name=+DATA/zjedbstd/datafile/undotbs1.272.1008536079 tag=TAG20190517T195700
channel c4: datafile copy complete, elapsed time: 00:14:42
output file name=+DATA/zjedbstd/datafile/undotbs2.273.1008536079 tag=TAG20190517T195700
channel c6: datafile copy complete, elapsed time: 00:15:12
output file name=+DATA/zjedbstd/datafile/zjzwfw13.ora tag=TAG20190517T195700
channel c5: datafile copy complete, elapsed time: 00:15:27
output file name=+DATA/zjedbstd/datafile/zjzwfw14.dbf tag=TAG20190517T195700
channel c7: datafile copy complete, elapsed time: 00:15:01
output file name=+DATA/zjedbstd/datafile/zjzwfw15.dbf tag=TAG20190517T195700
channel c9: datafile copy complete, elapsed time: 00:15:31
output file name=+DATA/zjedbstd/datafile/sysaux.271.1008536053 tag=TAG20190517T195700
channel c10: datafile copy complete, elapsed time: 00:18:18
output file name=+DATA/zjedbstd/datafile/zjzwfw11.dbf tag=TAG20190517T195700
channel c8: datafile copy complete, elapsed time: 00:23:42
output file name=+DATA/zjedbstd/datafile/system.270.1008536045 tag=TAG20190517T195700
channel c2: datafile copy complete, elapsed time: 00:24:15
Finished backup at 2019-05-17 21:18:30
sql statement: alter system archive log current
contents of Memory Script:
{
backup as copy reuse
archivelog like "+ARCH/zjedb/archivelog/2019_05_17/thread_2_seq_11219.7524.1008532429" auxiliary format
"+DATA" archivelog like
"+ARCH/zjedb/archivelog/2019_05_17/thread_2_seq_11220.7568.1008532623" auxiliary format
"+DATA" archivelog like
"+ARCH/zjedb/archivelog/2019_05_17/thread_2_seq_11221.8239.1008536737" auxiliary format
"+DATA" archivelog like
"+ARCH/zjedb/archivelog/2019_05_17/thread_1_seq_16765.8665.1008532625" auxiliary format
"+DATA" archivelog like
"+ARCH/zjedb/archivelog/2019_05_17/thread_1_seq_16766.8265.1008537513" auxiliary format
"+DATA" archivelog like
"+ARCH/zjedb/archivelog/2019_05_17/thread_2_seq_11222.8289.1008537513" auxiliary format
"+DATA" ;
catalog clone start with "+DATA";
switch clone datafile all;
}
executing Memory Script
Starting backup at 2019-05-17 21:19:40
channel c1: starting archived log copy
input archived log thread=2 sequence=11219 RECID=27924 STAMP=1008532428
channel c2: starting archived log copy
input archived log thread=2 sequence=11220 RECID=27925 STAMP=1008532623
channel c3: starting archived log copy
input archived log thread=2 sequence=11221 RECID=27927 STAMP=1008536739
channel c4: starting archived log copy
input archived log thread=1 sequence=16765 RECID=27926 STAMP=1008532624
channel c5: starting archived log copy
input archived log thread=1 sequence=16766 RECID=27928 STAMP=1008537513
channel c6: starting archived log copy
input archived log thread=2 sequence=11222 RECID=27929 STAMP=1008537513
output file name=+DATA/zjedbstd/archivelog/2019_05_17/thread_2_seq_11219.278.1008537571 RECID=0 STAMP=0
channel c1: archived log copy complete, elapsed time: 00:00:00
output file name=+DATA/zjedbstd/archivelog/2019_05_17/thread_2_seq_11220.279.1008537571 RECID=0 STAMP=0
channel c2: archived log copy complete, elapsed time: 00:00:01
output file name=+DATA/zjedbstd/archivelog/2019_05_17/thread_2_seq_11221.280.1008537571 RECID=0 STAMP=0
channel c3: archived log copy complete, elapsed time: 00:00:01
output file name=+DATA/zjedbstd/archivelog/2019_05_17/thread_1_seq_16765.281.1008537571 RECID=0 STAMP=0
channel c4: archived log copy complete, elapsed time: 00:00:01
output file name=+DATA/zjedbstd/archivelog/2019_05_17/thread_1_seq_16766.282.1008537571 RECID=0 STAMP=0
channel c5: archived log copy complete, elapsed time: 00:00:01
output file name=+DATA/zjedbstd/archivelog/2019_05_17/thread_2_seq_11222.283.1008537571 RECID=0 STAMP=0
channel c6: archived log copy complete, elapsed time: 00:00:01
Finished backup at 2019-05-17 21:19:43
searching for all files that match the pattern +DATA
List of Files Unknown to the Database
=====================================
File Name: +data/ZJEDBSTD/ARCHIVELOG/2019_05_17/thread_2_seq_11219.278.1008537571
File Name: +data/ZJEDBSTD/ARCHIVELOG/2019_05_17/thread_2_seq_11220.279.1008537571
File Name: +data/ZJEDBSTD/ARCHIVELOG/2019_05_17/thread_2_seq_11221.280.1008537571
File Name: +data/ZJEDBSTD/ARCHIVELOG/2019_05_17/thread_1_seq_16765.281.1008537571
File Name: +data/ZJEDBSTD/ARCHIVELOG/2019_05_17/thread_1_seq_16766.282.1008537571
File Name: +data/ZJEDBSTD/ARCHIVELOG/2019_05_17/thread_2_seq_11222.283.1008537571
File Name: +data/ZJEDBSTD/DATAFILE/SYSTEM.268.1008532611
File Name: +data/ZJEDBSTD/DATAFILE/SYSTEM.270.1008536045
File Name: +data/ZJEDBSTD/DATAFILE/SYSAUX.271.1008536053
File Name: +data/ZJEDBSTD/DATAFILE/UNDOTBS1.272.1008536079
File Name: +data/ZJEDBSTD/DATAFILE/UNDOTBS2.273.1008536079
File Name: +data/ZJEDBSTD/DATAFILE/USERS.277.1008536225
cataloging files...
cataloging done
List of Cataloged Files
=======================
File Name: +data/ZJEDBSTD/ARCHIVELOG/2019_05_17/thread_2_seq_11219.278.1008537571
File Name: +data/ZJEDBSTD/ARCHIVELOG/2019_05_17/thread_2_seq_11220.279.1008537571
File Name: +data/ZJEDBSTD/ARCHIVELOG/2019_05_17/thread_2_seq_11221.280.1008537571
File Name: +data/ZJEDBSTD/ARCHIVELOG/2019_05_17/thread_1_seq_16765.281.1008537571
File Name: +data/ZJEDBSTD/ARCHIVELOG/2019_05_17/thread_1_seq_16766.282.1008537571
File Name: +data/ZJEDBSTD/ARCHIVELOG/2019_05_17/thread_2_seq_11222.283.1008537571
File Name: +data/ZJEDBSTD/DATAFILE/SYSTEM.268.1008532611
File Name: +data/ZJEDBSTD/DATAFILE/SYSTEM.270.1008536045
File Name: +data/ZJEDBSTD/DATAFILE/SYSAUX.271.1008536053
File Name: +data/ZJEDBSTD/DATAFILE/UNDOTBS1.272.1008536079
File Name: +data/ZJEDBSTD/DATAFILE/UNDOTBS2.273.1008536079
File Name: +data/ZJEDBSTD/DATAFILE/USERS.277.1008536225
datafile 1 switched to datafile copy
input datafile copy RECID=7 STAMP=1008537573 file name=+DATA/zjedbstd/datafile/system.268.1008532611
datafile 2 switched to datafile copy
input datafile copy RECID=8 STAMP=1008537573 file name=+DATA/zjedbstd/datafile/sysaux.271.1008536053
datafile 3 switched to datafile copy
input datafile copy RECID=9 STAMP=1008537573 file name=+DATA/zjedbstd/datafile/undotbs1.272.1008536079
datafile 4 switched to datafile copy
input datafile copy RECID=10 STAMP=1008537573 file name=+DATA/zjedbstd/datafile/undotbs2.273.1008536079
datafile 5 switched to datafile copy
input datafile copy RECID=11 STAMP=1008537574 file name=+DATA/zjedbstd/datafile/users.277.1008536225
datafile 6 switched to datafile copy
input datafile copy RECID=12 STAMP=1008537574 file name=+DATA/zjedbstd/datafile/zjzwfw01.dbf
datafile 7 switched to datafile copy
input datafile copy RECID=13 STAMP=1008537574 file name=+DATA/zjedbstd/datafile/zjzwfw02.dbf
datafile 8 switched to datafile copy
input datafile copy RECID=14 STAMP=1008537574 file name=+DATA/zjedbstd/datafile/zjzwfw03.dbf
datafile 9 switched to datafile copy
input datafile copy RECID=15 STAMP=1008537574 file name=+DATA/zjedbstd/datafile/zjzwfw04.dbf
datafile 10 switched to datafile copy
input datafile copy RECID=16 STAMP=1008537574 file name=+DATA/zjedbstd/datafile/zjzwfw05.dbf
datafile 11 switched to datafile copy
input datafile copy RECID=17 STAMP=1008537574 file name=+DATA/zjedbstd/datafile/zjzwfw06.dbf
datafile 12 switched to datafile copy
input datafile copy RECID=18 STAMP=1008537574 file name=+DATA/zjedbstd/datafile/zjzwfw07.dbf
datafile 13 switched to datafile copy
input datafile copy RECID=19 STAMP=1008537574 file name=+DATA/zjedbstd/datafile/zjzwfw08.dbf
datafile 14 switched to datafile copy
input datafile copy RECID=20 STAMP=1008537574 file name=+DATA/zjedbstd/datafile/zjzwfw09.dbf
datafile 15 switched to datafile copy
input datafile copy RECID=21 STAMP=1008537574 file name=+DATA/zjedbstd/datafile/zjzwfw10.dbf
datafile 16 switched to datafile copy
input datafile copy RECID=22 STAMP=1008537574 file name=+DATA/zjedbstd/datafile/system.270.1008536045
datafile 17 switched to datafile copy
input datafile copy RECID=23 STAMP=1008537574 file name=+DATA/zjedbstd/datafile/zjzwfw11.dbf
datafile 18 switched to datafile copy
input datafile copy RECID=24 STAMP=1008537574 file name=+DATA/zjedbstd/datafile/zjzwfw12.dbf
datafile 19 switched to datafile copy
input datafile copy RECID=25 STAMP=1008537574 file name=+DATA/zjedbstd/datafile/zjzwfw13.ora
datafile 20 switched to datafile copy
input datafile copy RECID=26 STAMP=1008537574 file name=+DATA/zjedbstd/datafile/zjzwfw14.dbf
datafile 21 switched to datafile copy
input datafile copy RECID=27 STAMP=1008537574 file name=+DATA/zjedbstd/datafile/zjzwfw15.dbf
contents of Memory Script:
{
set until scn 1338603208;
recover
standby
clone database
delete archivelog
;
}
executing Memory Script
executing command: SET until clause
Starting recover at 2019-05-17 21:19:46
starting media recovery
archived log for thread 1 with sequence 16765 is already on disk as file +DATA/zjedbstd/archivelog/2019_05_17/thread_1_seq_16765.281.1008537571
archived log for thread 1 with sequence 16766 is already on disk as file +DATA/zjedbstd/archivelog/2019_05_17/thread_1_seq_16766.282.1008537571
archived log for thread 2 with sequence 11220 is already on disk as file +DATA/zjedbstd/archivelog/2019_05_17/thread_2_seq_11220.279.1008537571
archived log for thread 2 with sequence 11221 is already on disk as file +DATA/zjedbstd/archivelog/2019_05_17/thread_2_seq_11221.280.1008537571
archived log for thread 2 with sequence 11222 is already on disk as file +DATA/zjedbstd/archivelog/2019_05_17/thread_2_seq_11222.283.1008537571
archived log file name=+DATA/zjedbstd/archivelog/2019_05_17/thread_1_seq_16765.281.1008537571 thread=1 sequence=16765
archived log file name=+DATA/zjedbstd/archivelog/2019_05_17/thread_2_seq_11220.279.1008537571 thread=2 sequence=11220
archived log file name=+DATA/zjedbstd/archivelog/2019_05_17/thread_2_seq_11221.280.1008537571 thread=2 sequence=11221
archived log file name=+DATA/zjedbstd/archivelog/2019_05_17/thread_1_seq_16766.282.1008537571 thread=1 sequence=16766
archived log file name=+DATA/zjedbstd/archivelog/2019_05_17/thread_2_seq_11222.283.1008537571 thread=2 sequence=11222
media recovery complete, elapsed time: 00:00:03
Finished recover at 2019-05-17 21:19:52
Finished Duplicate Db at 2019-05-17 21:19:59
released channel: c1
released channel: c2
released channel: c3
released channel: c4
released channel: c5
released channel: c6
released channel: c7
released channel: c8
released channel: c9
released channel: c10
released channel: c11
released channel: c12
released channel: c13
released channel: c14
released channel: c15
released channel: c16
released channel: c17
released channel: c18
released channel: c19
released channel: c20
released channel: c21
released channel: c22
released channel: c23
released channel: c24
二、调整RAC DG备库参数
1、将dg生成的spfile拷贝到asm
cp /u01/app/oracle/product/11.2.0/db_1/dbs/spfilezjedbstd1.ora +data/zjedbstd/spfilezjedbstd.ora
2、修改pfile指向asm的spfile
vi /u01/app/oracle/product/11.2.0/db_1/dbs/initzjedbstd1.ora
spfile='+data/zjedbstd/spfilezjedbstd.ora'
shutdown immediate;
startup
3、修改集群参数、恢复二节点
alter system set cluster_database=true scope=spfile sid='*';
alter system set cluster_database_instances=2 scope=spfile sid='*';
alter system set instance_number=1 scope=spfile sid='zjedbstd1';
alter system set instance_number=2 scope=spfile sid='zjedbstd2';
alter system set thread=1 scope=spfile sid='zjedbstd1';
alter system set thread=2 scope=spfile sid='zjedbstd2';
alter system reset background_dump_dest;
alter system reset user_dump_dest;
alter system set LOG_ARCHIVE_CONFIG='' sid='*';
alter system set LOG_ARCHIVE_DEST_2='' sid='*';
alter system set undo_tablespace='UNDOTBS2' scope=spfile sid='zjedbstd2';
alter system set local_listener='(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.137.32)(PORT=1521))' sid='zjedbstd1' scope=both;
alter system set local_listener='(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.137.33)(PORT=1521))' sid='zjedbstd2' scope=both;
关闭数据库
shutdown immediate;
4、将备库注册到RAC资源
oracle用户下
srvctl add database -d zjedbstd -n zjedb -o $ORACLE_HOME -p +DATA/zjedbstd/spfilezjedbstd.ora
srvctl add instance -d zjedbstd -i zjedbstd1 -n ebs1
srvctl add instance -d zjedbstd -i zjedbstd2 -n ebs2
srvctl config database -d zjedbstd
启动数据库
srvctl start database -d zjedbstd
5、检查两个节点集群参数
查看如下参数
local_listener
节点1
SQL> show parameter local_listener;
NAME TYPE VALUE
------------------------------------ ---------- ------------------------------
local_listener string (ADDRESS=(PROTOCOL=TCP)(HOST=192.168.137.32)(PORT=1521))
节点2
SQL> show parameter local_listener;
NAME TYPE VALUE
------------------------------------ ---------- ------------------------------
local_listener string (ADDRESS=(PROTOCOL=TCP)(HOST=192.168.137.33)(PORT=1521))
remote_listener
节点1
SQL> show parameter remote_listener
NAME TYPE VALUE
------------------------------------ ---------- ------------------------------
remote_listener string rac-scan:1521
节点2
SQL> show parameter remote_listener
NAME TYPE VALUE
------------------------------------ ---------- ------------------------------
remote_listener string rac-scan:1521
thread
节点1
SQL> show parameter thread
NAME TYPE VALUE
------------------------------------ ---------- ------------------------------
thread integer 1
节点2
SQL> show parameter thread
NAME TYPE VALUE
------------------------------------ ---------- ------------------------------
thread integer 2
instance
节点1
SQL> show parameter instance
NAME TYPE VALUE
------------------------------------ ---------- ------------------------------
active_instance_count integer
cluster_database_instances integer 2
instance_groups string
instance_name string zjedbstd1
instance_number integer 1
instance_type string RDBMS
open_links_per_instance integer 4
parallel_instance_group string
parallel_server_instances integer 2
节点2
SQL> show parameter instance
NAME TYPE VALUE
------------------------------------ ---------- ------------------------------
active_instance_count integer
cluster_database_instances integer 2
instance_groups string
instance_name string zjedbstd2
instance_number integer 2
instance_type string RDBMS
open_links_per_instance integer 4
parallel_instance_group string
parallel_server_instances integer 2
6、检查主库、备库数据库一致性
三、备库脱离DG环境
1、取消dg参数
alter system set LOG_ARCHIVE_CONFIG='' scope=spfile;
alter system reset DB_FILE_NAME_CONVERT scope=spfile;
alter system reset LOG_FILE_NAME_CONVERT scope=spfile;
alter system reset LOG_ARCHIVE_DEST_2 scope=spfile;
alter system set STANDBY_FILE_MANAGEMENT='MANUAL' scope=spfile;
alter system set FAL_SERVER='' scope=spfile;
alter system set FAL_CLIENT='' scope=spfile;
ALTER DATABASE ACTIVATE PHYSICAL STANDBY DATABASE;
2、重启数据库
srvctl stop database -d zjedbstd
srvctl start database -d zjedbstd
3、测试rac读写、切换日志
create tablespace
alter system switch logfile;
4、检查vip、scanip连通性
ping vip
ping scanip