oracle 12.2.0.1 使用 sqlplus 搭建 active dataguard
oracle 12.2.0.1 使用 sqlplus 搭建 active dataguard
数据库人生 2018-07-08 10:12:27 490 收藏
分类专栏: # oracle ha data guard 文章标签: active dataguard dataguard duplicate db_name db_unique_name
版权
postgresql ha patroni
patroni
数据库人生
¥9.90
os: centos 7.4
database:12.2.0.1 + dbf
本次是以 oracle database 12.2.0.1 + dbf 的形式部署的,后面会记录 rac + asm 的形式。
任何时候都要说下三种模式:
最大保护:maximize protection
最高性能:maximize performance
最高可用:maximize availability
alter database set standby to maximize protection;
alter database set standby to maximize performance;
atler database set standby to maximize availability;
规划如下
maser slave
$ORACLE_SID orcl orcl
db_name: orcl orcl
db_unique_name: orclp orcls1
1
2
3
4
5
6
acitive dataguard 要求所有成员的 db_name 必须保持一致,通过 db_unique_name 区分各成员。
下面这个图比较常见且经典.
在这里插入图片描述
oradb-node1 192.168.56.101 master
adb-node1 192.168.56.101 master
安装好了12.2.0.1 的软件,并创建了数据库
主库name相关
db_name: orcl
db_unique_name: orclp
net service name: tns_orclp
1
2
3
4
修改 db_unique_name
SQL> show parameter db_name;
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
db_name string orcl
SQL> alter system set db_unique_name="orclp" scope=spfile;
System altered.
1
2
3
4
5
6
7
8
9
10
增加静态监听
$ vi listener.ora
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = orcl)
(ORACLE_HOME = /u01/app/oracle/product/12.2.0/db_1)
(SID_NAME = orcl)
)
(SID_DESC =
(GLOBAL_DBNAME = orclp_DGMGRL)
(ORACLE_HOME = /u01/app/oracle/product/12.2.0/db_1)
(SID_NAME = orcl)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = oradb-node1)(PORT = 1521))
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
修改 net service name
$ vi tnsnames.ora
# for duplicate
tns_orclp_dgmgrl =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = oradb-node1)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orclp_dgmgrl)
)
)
# for duplicate
tns_orcls1_dgmgrl =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = oradb-node2)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcls1_dgmgrl)
)
)
tns_orclp =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = oradb-node1)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orclp)
)
)
tns_orcls1 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = oradb-node2)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcls1)
)
)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
主库启用 force logging
SQL> alter database force logging;
Database altered.
1
2
3
4
主库启用 archivelog
SQL> archive log list;
Database log mode No Archive Mode
Automatic archival Disabled
Archive destination /u01/app/oracle/product/12.2.0/db_1/dbs/arch
Oldest online log sequence 1
Current log sequence 2
SQL> alter system set log_archive_config="dg_config=(orclp,orcls1)" scope=spfile;
alter system set log_archive_dest_1="location=/u01/app/oracle/archivelog valid_for=(all_logfiles,all_roles) db_unique_name=orclp" scope=spfile;
alter system set log_archive_dest_2="service=tns_orcls1 valid_for=(online_logfiles,primary_role) lgwr affirm sync db_unique_name=orcls1" scope=spfile;
SQL> shutdown immediate;
SQL> startup mount;
SQL> alter database archivelog;
SQL> alter database open;
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
执行 open pdb,确保处于 read write
SQL> show pdbs;
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 ORCLPDB MOUNTED
SQL> alter pluggable database ORCLPDB open;
Pluggable database altered.
SQL> show pdbs;
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 ORCLPDB READ WRITE NO
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
主库创建 standby redo logfile
SQL> select * from v$log;
GROUP# THREAD# SEQUENCE# BYTES BLOCKSIZE MEMBERS ARC STATUS FIRST_CHANGE# FIRST_TIME NEXT_CHANGE# NEXT_TIME CON_ID
---------- ---------- ---------- ---------- ---------- ---------- --- ---------------- ------------- ------------------- ------------ ------------------- ----------
1 1 4 209715200 512 1 NO CURRENT 1572343 2018-07-07 14:47:20 1.8447E+19 0
2 1 2 209715200 512 1 YES INACTIVE 1429048 2018-07-07 11:45:32 1472300 2018-07-07 14:44:53 0
3 1 3 209715200 512 1 YES INACTIVE 1472300 2018-07-07 14:44:53 1572343 2018-07-07 14:47:20 0
SQL> col MEMBER format a40;
SQL> select * from v$logfile;
GROUP# STATUS TYPE MEMBER IS_ CON_ID
---------- ------- ------- ---------------------------------------- --- ----------
3 ONLINE /u01/app/oracle/oradata/orcl/redo03.log NO 0
2 ONLINE /u01/app/oracle/oradata/orcl/redo02.log NO 0
1 ONLINE /u01/app/oracle/oradata/orcl/redo01.log NO 0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
最少添加n+1个standby redo logfile,完全可以比n+1多,如下面
SQL> alter database add standby logfile "/u01/app/oracle/oradata/orcl/standby_redo01.log" size 200M;
alter database add standby logfile "/u01/app/oracle/oradata/orcl/standby_redo02.log" size 200M;
alter database add standby logfile "/u01/app/oracle/oradata/orcl/standby_redo03.log" size 200M;
alter database add standby logfile "/u01/app/oracle/oradata/orcl/standby_redo04.log" size 200M;
alter database add standby logfile "/u01/app/oracle/oradata/orcl/standby_redo05.log" size 200M;
1
2
3
4
5
6
主库创建 pfile,并修改
*.audit_file_dest="/u01/app/oracle/admin/orcl/adump"
*.audit_trail="db"
*.compatible="12.2.0"
*.control_files="/u01/app/oracle/oradata/orcl/control01.ctl","/u01/app/oracle/oradata/orcl/control02.ctl"
*.db_block_size=8192
*.diagnostic_dest="/u01/app/oracle"
*.dispatchers="(PROTOCOL=TCP) (SERVICE=orclXDB)"
*.enable_pluggable_database=true
*.local_listener="LISTENER_ORCL"
*.log_archive_dest_1="location=/u01/app/oracle/archivelog"
*.nls_language="AMERICAN"
*.nls_territory="AMERICA"
*.open_cursors=300
*.pga_aggregate_target=597m
*.processes=300
*.remote_login_passwordfile="EXCLUSIVE"
*.sga_target=1788m
*.undo_tablespace="UNDOTBS1"
*.db_name="orcl"
*.db_unique_name="orclp"
*.log_archive_config="dg_config=(orclp,orcls1)"
*.log_archive_dest_1="location=/u01/app/oracle/archivelog valid_for=(all_logfiles,all_roles) db_unique_name=orclp"
*.log_archive_dest_2="service=tns_orcls1 valid_for=(online_logfiles,primary_role) lgwr affirm sync db_unique_name=orcls1"
*.log_archive_dest_state_1=enable
*.log_archive_dest_state_2=enable
*.log_archive_format="%t_%s_%r.dbf"
*.standby_file_management="auto"
*.fal_server="orcls1"
*.fal_client="orclp"
*.db_file_name_convert="/u01/app/oracle/","/u01/app/oracle/"
*.log_file_name_convert="/u01/app/oracle/","/u01/app/oracle/"
*.remote_login_passwordfile="EXCLUSIVE"
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
oradb-node2 192.168.56.102 physical standby
安装好了12.2.0.1 的软件,不创建数据库,用duplicate命令从master拉过来
备库name相关
db_name: orcl
db_unique_name: orcls1
net service name: tns_orcls1
1
2
3
4
添加静态监听
$ vi listener.ora
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = orcl)
(ORACLE_HOME = /u01/app/oracle/product/12.2.0/db_1)
(SID_NAME = orcl)
)
(SID_DESC =
(GLOBAL_DBNAME = orcls1_DGMGRL)
(ORACLE_HOME = /u01/app/oracle/product/12.2.0/db_1)
(SID_NAME = orcl)
)
)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
修改 net service name
$ vi tnsnames.ora
# for duplicate
tns_orclp_dgmgrl =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = oradb-node1)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orclp_dgmgrl)
)
)
# for duplicate
tns_orcls1_dgmgrl =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = oradb-node2)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcls1_dgmgrl)
)
)
tns_orclp =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = oradb-node1)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orclp)
)
)
tns_orcls1 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = oradb-node2)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcls1)
)
)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
备库目录相关
参考主库创建必要的目录
$ mkdir -p $ORACLE_BASE/admin/orcl/adump;
mkdir -p $ORACLE_BASE/archivelog;
mkdir -p $ORACLE_BASE/audit;
mkdir -p $ORACLE_BASE/fast_recovery_area/orcl;
mkdir -p $ORACLE_BASE/oradata/orcl;
mkdir -p $ORACLE_BASE/oradata/orcl/pdbseed;
mkdir -p $ORACLE_BASE/oradata/orcl/orclpdb;
1
2
3
4
5
6
7
8
备库拷贝master 的password file、pfile
$ scp oracle@192.168.56.101:/u01/app/oracle/product/12.2.0/db_1/dbs/orapworcl ./
$ scp oracle@192.168.56.101:/u01/app/oracle/product/12.2.0/db_1/dbs/initorcl.ora ./
1
2
3
4
备库spfile内容如下
*.audit_file_dest="/u01/app/oracle/admin/orcl/adump"
*.audit_trail="db"
*.compatible="12.2.0"
*.control_files="/u01/app/oracle/oradata/orcl/control01.ctl","/u01/app/oracle/oradata/orcl/control02.ctl"
*.db_block_size=8192
*.diagnostic_dest="/u01/app/oracle"
*.dispatchers="(PROTOCOL=TCP) (SERVICE=orclXDB)"
*.enable_pluggable_database=true
*.local_listener="LISTENER_ORCL"
*.nls_language="AMERICAN"
*.nls_territory="AMERICA"
*.open_cursors=300
*.pga_aggregate_target=597m
*.processes=300
*.sga_target=1788m
*.undo_tablespace="UNDOTBS1"
*.db_name="orcl"
*.db_unique_name="orcls1"
*.log_archive_config="dg_config=(orclp,orcls1)"
*.log_archive_dest_1="location=/u01/app/oracle/archivelog valid_for=(all_logfiles,all_roles) db_unique_name=orcls1"
*.log_archive_dest_2="service=tns_orclp valid_for=(online_logfiles,primary_role) lgwr affirm sync db_unique_name=orclp"
*.log_archive_dest_state_1=enable
*.log_archive_dest_state_2=enable
*.log_archive_format="%t_%s_%r.dbf"
*.standby_file_management="auto"
*.fal_server="orclp"
*.fal_client="orcls1"
*.db_file_name_convert="/u01/app/oracle/","/u01/app/oracle/"
*.log_file_name_convert="/u01/app/oracle/","/u01/app/oracle/"
*.remote_login_passwordfile="EXCLUSIVE"
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
备库启动到nomount状态
SQL> startup nomount;
ORACLE instance started.
Total System Global Area 1879048192 bytes
Fixed Size 8794072 bytes
Variable Size 553648168 bytes
Database Buffers 1308622848 bytes
Redo Buffers 7983104 bytes
1
2
3
4
5
6
7
8
9
备库开始active duplicate
$ rman target sys/oracleoracle@tns_orclp auxiliary sys/oracleoracle@tns_orcls1
RMAN> duplicate target database for standby from active database nofilenamecheck dorecover;
1
2
3
4
备库打开
SQL> select open_mode from v$database;
OPEN_MODE
------------------------------------------------------------
MOUNTED
SQL> alter database open;
Database altered.
SQL> select open_mode,log_mode,open_mode ,database_role from v$database;
OPEN_MODE LOG_MODE OPEN_MODE DATABASE_ROLE
-------------------- ------------ -------------------- ----------------
READ ONLY ARCHIVELOG READ ONLY PHYSICAL STANDBY
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
此时查看 pdb
SQL> show pdbs;
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 ORCLPDB MOUNTED
SQL> alter pluggable database ORCLPDB open;
Pluggable database altered.
SQL> show pdbs;
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 ORCLPDB READ ONLY NO
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
备库开始real-time apply
SQL> alter database recover managed standby database using current logfile disconnect from session;
1
2
验证
备库查看日志
$ tail -f -n 1000 /u01/app/oracle/diag/rdbms/orcls1/orcl/trace/alert_orcl.log
1
2
主库查看
select
dbms_flashback.get_system_change_number() as master_current_scn,
ad.APPLIED_SCN,
ad.*
from v$archive_dest ad
where 1=1
;
select *
from v$archive_dest_status
;
select *
from v$archive_gap
;
select *
from v$archive_processes
;
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
此时可以把 tnsnames.ora 的 tns_orclp_dgmgrl、tns_orcls1_dgmgrl 屏蔽掉。
需要注意的是记得操作pdb
参考:
https://docs.oracle.com/en/database/oracle/oracle-database/12.2/high-availability.html
下面是 duplicate 时输出,自己分析,博友可以忽略
$ rman target sys/oracleoracle@tns_orclp auxiliary sys/oracleoracle@tns_orcls1
Recovery Manager: Release 12.2.0.1.0 - Production on Sat Jul 7 17:21:13 2018
Copyright (c) 1982, 2017, Oracle and/or its affiliates. All rights reserved.
connected to target database: ORCL (DBID=1508635741)
connected to auxiliary database: ORCL (not mounted)
RMAN> duplicate target database for standby from active database nofilenamecheck dorecover;
Starting Duplicate Db at 2018-07-07 17:21:30
using target database control file instead of recovery catalog
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=36 device type=DISK
current log archived
contents of Memory Script:
{
backup as copy reuse
targetfile "/u01/app/oracle/product/12.2.0/db_1/dbs/orapworcl" auxiliary format
"/u01/app/oracle/product/12.2.0/db_1/dbs/orapworcl" ;
}
executing Memory Script
Starting backup at 2018-07-07 17:21:31
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=69 device type=DISK
Finished backup at 2018-07-07 17:21:32
contents of Memory Script:
{
restore clone from service "tns_orclp" standby controlfile;
}
executing Memory Script
Starting restore at 2018-07-07 17:21:32
using channel ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service tns_orclp
channel ORA_AUX_DISK_1: restoring control file
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
output file name=/u01/app/oracle/oradata/orcl/control01.ctl
output file name=/u01/app/oracle/oradata/orcl/control02.ctl
Finished restore at 2018-07-07 17:21:34
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
"/u01/app/oracle/oradata/orcl/temp01.dbf";
set newname for tempfile 2 to
"/u01/app/oracle/oradata/orcl/pdbseed/temp012018-07-07_11-44-06-982-AM.dbf";
set newname for tempfile 3 to
"/u01/app/oracle/oradata/orcl/orclpdb/temp01.dbf";
switch clone tempfile all;
set newname for datafile 1 to
"/u01/app/oracle/oradata/orcl/system01.dbf";
set newname for datafile 3 to
"/u01/app/oracle/oradata/orcl/sysaux01.dbf";
set newname for datafile 4 to
"/u01/app/oracle/oradata/orcl/undotbs01.dbf";
set newname for datafile 5 to
"/u01/app/oracle/oradata/orcl/pdbseed/system01.dbf";
set newname for datafile 6 to
"/u01/app/oracle/oradata/orcl/pdbseed/sysaux01.dbf";
set newname for datafile 7 to
"/u01/app/oracle/oradata/orcl/users01.dbf";
set newname for datafile 8 to
"/u01/app/oracle/oradata/orcl/pdbseed/undotbs01.dbf";
set newname for datafile 9 to
"/u01/app/oracle/oradata/orcl/orclpdb/system01.dbf";
set newname for datafile 10 to
"/u01/app/oracle/oradata/orcl/orclpdb/sysaux01.dbf";
set newname for datafile 11 to
"/u01/app/oracle/oradata/orcl/orclpdb/undotbs01.dbf";
set newname for datafile 12 to
"/u01/app/oracle/oradata/orcl/orclpdb/users01.dbf";
restore
from nonsparse from service
"tns_orclp" clone database
;
sql "alter system archive log current";
}
executing Memory Script
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
renamed tempfile 1 to /u01/app/oracle/oradata/orcl/temp01.dbf in control file
renamed tempfile 2 to /u01/app/oracle/oradata/orcl/pdbseed/temp012018-07-07_11-44-06-982-AM.dbf in control file
renamed tempfile 3 to /u01/app/oracle/oradata/orcl/orclpdb/temp01.dbf 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
Starting restore at 2018-07-07 17:21:39
using channel ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service tns_orclp
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00001 to /u01/app/oracle/oradata/orcl/system01.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:15
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service tns_orclp
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00003 to /u01/app/oracle/oradata/orcl/sysaux01.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:07
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service tns_orclp
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00004 to /u01/app/oracle/oradata/orcl/undotbs01.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:02
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service tns_orclp
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00005 to /u01/app/oracle/oradata/orcl/pdbseed/system01.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:03
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service tns_orclp
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00006 to /u01/app/oracle/oradata/orcl/pdbseed/sysaux01.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:07
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service tns_orclp
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00007 to /u01/app/oracle/oradata/orcl/users01.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service tns_orclp
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00008 to /u01/app/oracle/oradata/orcl/pdbseed/undotbs01.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service tns_orclp
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00009 to /u01/app/oracle/oradata/orcl/orclpdb/system01.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:03
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service tns_orclp
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00010 to /u01/app/oracle/oradata/orcl/orclpdb/sysaux01.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:07
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service tns_orclp
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00011 to /u01/app/oracle/oradata/orcl/orclpdb/undotbs01.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:03
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service tns_orclp
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00012 to /u01/app/oracle/oradata/orcl/orclpdb/users01.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
Finished restore at 2018-07-07 17:22:29
sql statement: alter system archive log current
current log archived
contents of Memory Script:
{
restore clone force from service "tns_orclp"
archivelog from scn 1585893;
switch clone datafile all;
}
executing Memory Script
Starting restore at 2018-07-07 17:22:30
using channel ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: starting archived log restore to default destination
channel ORA_AUX_DISK_1: using network backup set from service tns_orclp
channel ORA_AUX_DISK_1: restoring archived log
archived log thread=1 sequence=6
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
channel ORA_AUX_DISK_1: starting archived log restore to default destination
channel ORA_AUX_DISK_1: using network backup set from service tns_orclp
channel ORA_AUX_DISK_1: restoring archived log
archived log thread=1 sequence=7
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
Finished restore at 2018-07-07 17:22:32
datafile 1 switched to datafile copy
input datafile copy RECID=4 STAMP=980875352 file name=/u01/app/oracle/oradata/orcl/system01.dbf
datafile 3 switched to datafile copy
input datafile copy RECID=5 STAMP=980875352 file name=/u01/app/oracle/oradata/orcl/sysaux01.dbf
datafile 4 switched to datafile copy
input datafile copy RECID=6 STAMP=980875352 file name=/u01/app/oracle/oradata/orcl/undotbs01.dbf
datafile 5 switched to datafile copy
input datafile copy RECID=7 STAMP=980875352 file name=/u01/app/oracle/oradata/orcl/pdbseed/system01.dbf
datafile 6 switched to datafile copy
input datafile copy RECID=8 STAMP=980875352 file name=/u01/app/oracle/oradata/orcl/pdbseed/sysaux01.dbf
datafile 7 switched to datafile copy
input datafile copy RECID=9 STAMP=980875352 file name=/u01/app/oracle/oradata/orcl/users01.dbf
datafile 8 switched to datafile copy
input datafile copy RECID=10 STAMP=980875352 file name=/u01/app/oracle/oradata/orcl/pdbseed/undotbs01.dbf
datafile 9 switched to datafile copy
input datafile copy RECID=11 STAMP=980875352 file name=/u01/app/oracle/oradata/orcl/orclpdb/system01.dbf
datafile 10 switched to datafile copy
input datafile copy RECID=12 STAMP=980875352 file name=/u01/app/oracle/oradata/orcl/orclpdb/sysaux01.dbf
datafile 11 switched to datafile copy
input datafile copy RECID=13 STAMP=980875353 file name=/u01/app/oracle/oradata/orcl/orclpdb/undotbs01.dbf
datafile 12 switched to datafile copy
input datafile copy RECID=14 STAMP=980875353 file name=/u01/app/oracle/oradata/orcl/orclpdb/users01.dbf
contents of Memory Script:
{
set until scn 1586097;
recover
standby
clone database
delete archivelog
;
}
executing Memory Script
executing command: SET until clause
Starting recover at 2018-07-07 17:22:33
using channel ORA_AUX_DISK_1
starting media recovery
archived log for thread 1 with sequence 6 is already on disk as file /u01/app/oracle/archivelog/1_6_980855007.dbf
archived log for thread 1 with sequence 7 is already on disk as file /u01/app/oracle/archivelog/1_7_980855007.dbf
archived log file name=/u01/app/oracle/archivelog/1_6_980855007.dbf thread=1 sequence=6
archived log file name=/u01/app/oracle/archivelog/1_7_980855007.dbf thread=1 sequence=7
media recovery complete, elapsed time: 00:00:00
Finished recover at 2018-07-07 17:22:34
Finished Duplicate Db at 2018-07-07 17:22:43
————————————————
版权声明:本文为CSDN博主「数据库人生」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/ctypyb2002/java/article/details/80957130
免责声明:
① 本站未注明“稿件来源”的信息均来自网络整理。其文字、图片和音视频稿件的所属权归原作者所有。本站收集整理出于非商业性的教育和科研之目的,并不意味着本站赞同其观点或证实其内容的真实性。仅作为临时的测试数据,供内部测试之用。本站并未授权任何人以任何方式主动获取本站任何信息。
② 本站未注明“稿件来源”的临时测试数据将在测试完成后最终做删除处理。有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341