【Oracle】RMAN duplicate复制库
基础环境:
- 172.17.4.60 操作系统:Linux 6.4 数据库:Oracle11gR2 (源数据库)
- 172.17.4.61 操作系统:Linux 6.4 数据库:Oracle11gR2 (测试库)
目的:从源数据库以RMAN的物理恢复的方式,恢复至测试库中。
如何验证,在源数据库,插入几条数据如下:
SYS@oradb> create user zsd identified by zsd;
User created.
SYS@oradb> grant dba to zsd;
Grant succeeded.
SYS@oradb> conn zsd/zsd;
Connected.
ZSD@oradb> create table t1(name varchar2(20));
Table created.
ZSD@oradb> insert into t1 values('zsd');
1 row created.
ZSD@oradb> insert into t1 values('lzh');
1 row created.
ZSD@oradb> insert into t1 values('zjf');
1 row created.
ZSD@oradb> commit;
Commit complete.
ZSD@oradb> select * from t1;
NAME
--------------------
zsd
lzh
zjf
Step 0.基础环境的host配置
两台服务器都需要做如下配置。
[oracle@db1 ~]$ cat /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
172.17.4.60 db1
172.17.4.61 db2
源数据库端(172.17.4.60):
[oracle@db1 ~]$ cat /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=db1
测试数据库端(172.17.4.61):
[oracle@db2 ~]$ cat /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=db2
Step 1.修改环境变量
[oracle@db dbs]$ cd ~
[oracle@db ~]$ vi .bash_profile
修改ORACLE_SID与源数据库一致,如下:
ORACLE_SID=oradb
Step 2.建立pfile dummy文件
[oracle@db ~]$ cd $ORACLE_HOME/dbs
[oracle@db dbs]$ vi dummy.ora
db_name='zsddummy'
Step 3.从源数据库(172.17.4.60)复制口令文件至测试库(172.17.4.61)。
[oracle@db dbs]$ pwd
/u01/app/product/11.2.0/db_1/dbs
[oracle@db dbs]$ scp 172.17.4.60:/u01/app/product/11.2.0/db_1/dbs/orapworadb ./
[oracle@db dbs]$ ls -lht
总用量 20K
-rw-r-----. 1 oracle oinstall 1.5K 12月 29 15:48 orapworadb
-rw-r--r--. 1 oracle oinstall 19 12月 29 15:44 dummy.ora
-rw-rw----. 1 oracle oinstall 1.6K 12月 29 15:27 hc_oradb.dat
-rw-r-----. 1 oracle oinstall 24 5月 15 2017 lkORADB
-rw-r--r--. 1 oracle oinstall 2.8K 5月 15 2009 init.ora
Step 4.创建相应目录
- 4.1 审计目录
源数据库端(172.17.4.60):
SYS@oradb> show parameter audit_file_dest
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
audit_file_dest string /u01/app/admin/oradb/adump
测试数据库端(172.17.4.61):
[oracle@db oradb]$ mkdir -p /u01/app/admin/oradb/adump
- 4.2 快速恢复区目录
源数据库端(172.17.4.60):
SYS@oradb> show parameter db_recovery_file_dest
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
db_recovery_file_dest string /u01/app/fast_recovery_area
db_recovery_file_dest_size big integer 4182M
测试数据库端(172.17.4.61):
[oracle@db oradb]$ mkdir -p /u01/app/fast_recovery_area
- 4.3 数据目录
源数据库端(172.17.4.60):
SYS@oradb> select name from v$dbfile;
NAME
--------------------------------------------------------------------------------
/u01/app/oradata/oradb/users01.dbf
/u01/app/oradata/oradb/undotbs01.dbf
/u01/app/oradata/oradb/sysaux01.dbf
/u01/app/oradata/oradb/system01.dbf
测试数据库端(172.17.4.61):
[oracle@db oradb]$ mkdir -p /u01/app/oradata/oradb/
[oracle@db oradb]$ ls -ld /u01/app/oradata/oradb/
drwxr-x---. 2 oracle oinstall 4096 12月 29 15:27 /u01/app/oradata/oradb/
Step 5.net服务
测试数据库端(172.17.4.61):
[oracle@db2 ~]$ cat /u01/app/product/11.2.0/db_1/network/admin/listener.ora
# listener.ora Network Configuration File: /u01/app/product/11.2.0/db_1/network/admin/listener.ora
# Generated by Oracle configuration tools.
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = db2)(PORT = 1521))
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
)
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = oradb.zsd.com)
(ORACLE_HOME=/u01/app/product/11.2.0/db_1)
(SID_NAME = oradb)
)
)
ADR_BASE_LISTENER = /u01/app
测试库的监听启动:
[oracle@db2 admin]$ lsnrctl start
LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 29-DEC-2018 16:03:01
Copyright (c) 1991, 2013, Oracle. All rights reserved.
Starting /u01/app/product/11.2.0/db_1/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 11.2.0.4.0 - Production
System parameter file is /u01/app/product/11.2.0/db_1/network/admin/listener.ora
Log messages written to /u01/app/diag/tnslsnr/db/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=db2)(PORT=1521)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=db2)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 11.2.0.4.0 - Production
Start Date 29-DEC-2018 16:03:01
Uptime 0 days 0 hr. 0 min. 10 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/product/11.2.0/db_1/network/admin/listener.ora
Listener Log File /u01/app/diag/tnslsnr/db/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=db2)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Services Summary...
Service "oradb.zsd.com" has 1 instance(s).
Instance "oradb", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
源数据端:172.17.4.60
[oracle@db1 ~]$ cat /u01/app/product/11.2.0/db_1/network/admin/listener.ora
# listener.ora Network Configuration File: /u01/app/product/11.2.0/db_1/network/admin/listener.ora
# Generated by Oracle configuration tools.
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = db1)(PORT = 1521))
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
)
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = oradb.zsd.com)
(SID_NAME = oradb)
)
)
ADR_BASE_LISTENER = /u01/app
源数据端的监听启动:
[oracle@db admin]$ lsnrctl start
LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 29-DEC-2018 16:06:02
Copyright (c) 1991, 2013, Oracle. All rights reserved.
Starting /u01/app/product/11.2.0/db_1/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 11.2.0.4.0 - Production
System parameter file is /u01/app/product/11.2.0/db_1/network/admin/listener.ora
Log messages written to /u01/app/diag/tnslsnr/db/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=db1)(PORT=1521)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=db1)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 11.2.0.4.0 - Production
Start Date 29-DEC-2018 16:06:03
Uptime 0 days 0 hr. 0 min. 11 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/product/11.2.0/db_1/network/admin/listener.ora
Listener Log File /u01/app/diag/tnslsnr/db/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=db1)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Services Summary...
Service "oradb.zsd.com" has 1 instance(s).
Instance "oradb", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
两端配置tns文件(60和61配置的相同)
vi $ORACLE_HOME/network/admin/tnsnames.ora
ZSDDB =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = db1)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = oradb.zsd.com)
)
)
aux =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = db2)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = oradb.zsd.com)
)
)
源数据端(172.17.4.60)连接测试库
[oracle@db1 ~]$ tnsping aux
TNS Ping Utility for Linux: Version 11.2.0.4.0 - Production on 29-DEC-2018 16:16:52
Copyright (c) 1997, 2013, Oracle. All rights reserved.
Used parameter files:
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = db2)(PORT = 1521))) (CONNECT_DATA =
(SERVICE_NAME = oradb.zsd.com)))
OK (0 msec)
[oracle@db1 ~]$ sqlplus sys/oracle@aux as sysdba
SQL*Plus: Release 11.2.0.4.0 Production on Sat Dec 29 16:17:06 2018
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Connected to an idle instance.
SYS@aux>
测试端(172.17.4.61):测试源数据库
[oracle@db2 ~]$ tnsping zsddb
TNS Ping Utility for Linux: Version 11.2.0.4.0 - Production on 29-DEC-2018 16:21:23
Copyright (c) 1997, 2013, Oracle. All rights reserved.
Used parameter files:
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = db1)(PORT = 1521))) (CONNECT_DATA =
(SERVICE_NAME = oradb.zsd.com)))
OK (70 msec)
[oracle@db2 ~]$ sqlplus sys/oracle@zsddb as sysdba
SQL*Plus: Release 11.2.0.4.0 Production on Sat Dec 29 16:21:47 2018
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SYS@zsddb>
Step 6.测试数据库(172.17.4.61)以nomout的格式打开。
[oracle@db2 ~]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.4.0 Production on Sat Dec 29 16:23:55 2018
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Connected to an idle instance.
SYS@oradb> startup nomount pfile=$ORACLE_HOME/dbs/dummy.ora
ORACLE instance started.
Total System Global Area 263090176 bytes
Fixed Size 2252256 bytes
Variable Size 205521440 bytes
Database Buffers 50331648 bytes
Redo Buffers 4984832 bytes
测试端(172.17.4.61)rman连接源数据库和辅助库:
[oracle@db2 ~]$ rman target sys/oracle@zsddb auxiliary sys/oracle@aux
Recovery Manager: Release 11.2.0.4.0 - Production on Sat Dec 29 16:25:33 2018
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
connected to target database: ORADB (DBID=2697310494)
connected to auxiliary database: ZSDDUMMY (not mounted)
Step 7.开始 RMAN duplicate通过网络复制数据库
测试端(172.17.4.61)开始 RMAN 通过网络复制数据库
RMAN> duplicate target database to zsddb from active database spfile nofilenamecheck;
日志如下:
Starting Duplicate Db at 02-JAN-19
using target database control file instead of recovery catalog
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=429 device type=DISK
contents of Memory Script:
{
backup as copy reuse
targetfile '/u01/app/product/11.2.0/db_1/dbs/spfileoradb.ora' auxiliary format
'/u01/app/product/11.2.0/db_1/dbs/spfileoradb.ora' ;
sql clone "alter system set spfile= ''/u01/app/product/11.2.0/db_1/dbs/spfileoradb.ora''";
}
executing Memory Script
Starting backup at 02-JAN-19
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=10 device type=DISK
Finished backup at 02-JAN-19
sql statement: alter system set spfile= ''/u01/app/product/11.2.0/db_1/dbs/spfileoradb.ora''
contents of Memory Script:
{
sql clone "alter system set db_name =
''ZSDDB'' comment=
''duplicate'' scope=spfile";
shutdown clone immediate;
startup clone nomount;
}
executing Memory Script
sql statement: alter system set db_name = ''ZSDDB'' comment= ''duplicate'' scope=spfile
Oracle instance shut down
connected to auxiliary database (not started)
Oracle instance started
Total System Global Area 1202556928 bytes
Fixed Size 2252704 bytes
Variable Size 419430496 bytes
Database Buffers 771751936 bytes
Redo Buffers 9121792 bytes
contents of Memory Script:
{
sql clone "alter system set db_name =
''ORADB'' comment=
''Modified by RMAN duplicate'' scope=spfile";
sql clone "alter system set db_unique_name =
''ZSDDB'' comment=
''Modified by RMAN duplicate'' scope=spfile";
shutdown clone immediate;
startup clone force nomount
backup as copy current controlfile auxiliary format '/u01/app/oradata/oradb/control01.ctl';
restore clone controlfile to '/u01/app/fast_recovery_area/oradb/control02.ctl' from
'/u01/app/oradata/oradb/control01.ctl';
alter clone database mount;
}
executing Memory Script
sql statement: alter system set db_name = ''ORADB'' comment= ''Modified by RMAN duplicate'' scope=spfile
sql statement: alter system set db_unique_name = ''ZSDDB'' comment= ''Modified by RMAN duplicate'' scope=spfile
Oracle instance shut down
Oracle instance started
Total System Global Area 1202556928 bytes
Fixed Size 2252704 bytes
Variable Size 419430496 bytes
Database Buffers 771751936 bytes
Redo Buffers 9121792 bytes
Starting backup at 02-JAN-19
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile copy
copying current control file
output file name=/u01/app/product/11.2.0/db_1/dbs/snapcf_oradb.f tag=TAG20190102T144945 RECID=2 STAMP=996504585
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01
Finished backup at 02-JAN-19
Starting restore at 02-JAN-19
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=85 device type=DISK
channel ORA_AUX_DISK_1: copied control file copy
Finished restore at 02-JAN-19
database mounted
RMAN-05538: WARNING: implicitly using DB_FILE_NAME_CONVERT
contents of Memory Script:
{
set newname for datafile 1 to
"/u01/app/oradata/oradb/system01.dbf";
set newname for datafile 2 to
"/u01/app/oradata/oradb/sysaux01.dbf";
set newname for datafile 3 to
"/u01/app/oradata/oradb/undotbs01.dbf";
set newname for datafile 4 to
"/u01/app/oradata/oradb/users01.dbf";
backup as copy reuse
datafile 1 auxiliary format
"/u01/app/oradata/oradb/system01.dbf" datafile
2 auxiliary format
"/u01/app/oradata/oradb/sysaux01.dbf" datafile
3 auxiliary format
"/u01/app/oradata/oradb/undotbs01.dbf" datafile
4 auxiliary format
"/u01/app/oradata/oradb/users01.dbf" ;
sql 'alter system archive log current';
}
executing Memory Script
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
Starting backup at 02-JAN-19
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile copy
input datafile file number=00001 name=/u01/app/oradata/oradb/system01.dbf
output file name=/u01/app/oradata/oradb/system01.dbf tag=TAG20190102T144953
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:35
channel ORA_DISK_1: starting datafile copy
input datafile file number=00002 name=/u01/app/oradata/oradb/sysaux01.dbf
output file name=/u01/app/oradata/oradb/sysaux01.dbf tag=TAG20190102T144953
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=/u01/app/oradata/oradb/undotbs01.dbf
output file name=/u01/app/oradata/oradb/undotbs01.dbf tag=TAG20190102T144953
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=/u01/app/oradata/oradb/users01.dbf
output file name=/u01/app/oradata/oradb/users01.dbf tag=TAG20190102T144953
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:03
Finished backup at 02-JAN-19
sql statement: alter system archive log current
contents of Memory Script:
{
backup as copy reuse
archivelog like "/u01/app/fast_recovery_area/ORADB/archivelog/2019_01_02/o1_mf_1_12_g2rqto2s_.arc" auxiliary format
"/u01/app/fast_recovery_area/ZSDDB/archivelog/2019_01_02/o1_mf_1_12_%u_.arc" ;
catalog clone recovery area;
switch clone datafile all;
}
executing Memory Script
Starting backup at 02-JAN-19
using channel ORA_DISK_1
channel ORA_DISK_1: starting archived log copy
input archived log thread=1 sequence=12 RECID=7 STAMP=996504662
output file name=/u01/app/fast_recovery_area/ZSDDB/archivelog/2019_01_02/o1_mf_1_12_0btmat2m_.arc RECID=0 STAMP=0
channel ORA_DISK_1: archived log copy complete, elapsed time: 00:00:01
Finished backup at 02-JAN-19
searching for all files in the recovery area
List of Files Unknown to the Database
=====================================
File Name: /u01/app/fast_recovery_area/ZSDDB/archivelog/2019_01_02/o1_mf_1_12_0btmat2m_.arc
cataloging files...
cataloging done
List of Cataloged Files
=======================
File Name: /u01/app/fast_recovery_area/ZSDDB/archivelog/2019_01_02/o1_mf_1_12_0btmat2m_.arc
datafile 1 switched to datafile copy
input datafile copy RECID=2 STAMP=996504659 file name=/u01/app/oradata/oradb/system01.dbf
datafile 2 switched to datafile copy
input datafile copy RECID=3 STAMP=996504659 file name=/u01/app/oradata/oradb/sysaux01.dbf
datafile 3 switched to datafile copy
input datafile copy RECID=4 STAMP=996504659 file name=/u01/app/oradata/oradb/undotbs01.dbf
datafile 4 switched to datafile copy
input datafile copy RECID=5 STAMP=996504659 file name=/u01/app/oradata/oradb/users01.dbf
contents of Memory Script:
{
set until scn 1150015;
recover
clone database
delete archivelog
;
}
executing Memory Script
executing command: SET until clause
Starting recover at 02-JAN-19
using channel ORA_AUX_DISK_1
starting media recovery
archived log for thread 1 with sequence 12 is already on disk as file /u01/app/fast_recovery_area/ZSDDB/archivelog/2019_01_02/o1_mf_1_12_0btmat2m_.arc
archived log file name=/u01/app/fast_recovery_area/ZSDDB/archivelog/2019_01_02/o1_mf_1_12_0btmat2m_.arc thread=1 sequence=12
media recovery complete, elapsed time: 00:00:00
Finished recover at 02-JAN-19
Oracle instance started
Total System Global Area 1202556928 bytes
Fixed Size 2252704 bytes
Variable Size 419430496 bytes
Database Buffers 771751936 bytes
Redo Buffers 9121792 bytes
contents of Memory Script:
{
sql clone "alter system set db_name =
''ZSDDB'' comment=
''Reset to original value by RMAN'' scope=spfile";
sql clone "alter system reset db_unique_name scope=spfile";
shutdown clone immediate;
startup clone nomount;
}
executing Memory Script
sql statement: alter system set db_name = ''ZSDDB'' comment= ''Reset to original value by RMAN'' scope=spfile
sql statement: alter system reset db_unique_name scope=spfile
Oracle instance shut down
connected to auxiliary database (not started)
Oracle instance started
Total System Global Area 1202556928 bytes
Fixed Size 2252704 bytes
Variable Size 419430496 bytes
Database Buffers 771751936 bytes
Redo Buffers 9121792 bytes
sql statement: CREATE CONTROLFILE REUSE SET DATABASE "ZSDDB" RESETLOGS ARCHIVELOG
MAXLOGFILES 16
MAXLOGMEMBERS 3
MAXDATAFILES 100
MAXINSTANCES 8
MAXLOGHISTORY 292
LOGFILE
GROUP 1 SIZE 50 M ,
GROUP 2 SIZE 50 M ,
GROUP 3 SIZE 50 M
DATAFILE
'/u01/app/oradata/oradb/system01.dbf'
CHARACTER SET ZHS16GBK
contents of Memory Script:
{
set newname for tempfile 1 to
"/u01/app/oradata/oradb/temp01.dbf";
switch clone tempfile all;
catalog clone datafilecopy "/u01/app/oradata/oradb/sysaux01.dbf",
"/u01/app/oradata/oradb/undotbs01.dbf",
"/u01/app/oradata/oradb/users01.dbf";
switch clone datafile all;
}
executing Memory Script
executing command: SET NEWNAME
renamed tempfile 1 to /u01/app/oradata/oradb/temp01.dbf in control file
cataloged datafile copy
datafile copy file name=/u01/app/oradata/oradb/sysaux01.dbf RECID=1 STAMP=996504682
cataloged datafile copy
datafile copy file name=/u01/app/oradata/oradb/undotbs01.dbf RECID=2 STAMP=996504682
cataloged datafile copy
datafile copy file name=/u01/app/oradata/oradb/users01.dbf RECID=3 STAMP=996504682
datafile 2 switched to datafile copy
input datafile copy RECID=1 STAMP=996504682 file name=/u01/app/oradata/oradb/sysaux01.dbf
datafile 3 switched to datafile copy
input datafile copy RECID=2 STAMP=996504682 file name=/u01/app/oradata/oradb/undotbs01.dbf
datafile 4 switched to datafile copy
input datafile copy RECID=3 STAMP=996504682 file name=/u01/app/oradata/oradb/users01.dbf
contents of Memory Script:
{
Alter clone database open resetlogs;
}
executing Memory Script
database opened
Finished Duplicate Db at 02-JAN-19
最后,在测试库中,验证我的rman duplicate是否成功,查询验证数据,如下:
[oracle@db2 ~]$ sqlplus "/as sysdba"
SQL*Plus: Release 11.2.0.4.0 Production on Wed Jan 2 14:55:14 2019
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SYS@oradb> conn zsd/zsd;
Connected.
ZSD@oradb> select * from t1;
NAME
--------------------
zsd
lzh
zjf
enjoy!just for fun
【Oracle】RMAN duplicate复制库的更多相关文章
- Oracle 11gR2 使用RMAN Duplicate复制数据库
Oracle 11gR2 使用RMAN Duplicate复制数据库 前言: 上周刚做完一个项目,用户要求RAC的数据库可以自己主动备份到另外一个单节点上,单节点可以正常拿起来就能用. ...
- Oracle 11gR2使用RMAN duplicate复制数据库
11g的RMAN duplicate 个人感觉比10g的先进了很多,10g需在rman备份的基础上进行复制,使用RMAN duplicate创建一个数据完全相同但DBID不同的数据库.而11g的RMA ...
- 11g 使用rman duplicate复制数据库,创建辅助实例
一,创建所需目录 1)创建审计文件目录 PROD1@dbrac1 /dsg/oracle11$ cd $ORACLE_BASE/admin PROD1@dbrac1 /u01/app/oracle/a ...
- 示例说明Oracle RMAN两种库增量备份的差别
1差异增量实验示例 1.1差异增量备份 为了演示增量备份的效果,我们在执行一次0级别的备份后,对数据库进行一些改变. 再执行一次1级别的差异增量备份: 执行完1级别的备份后再次对数据库进行更改: 再执 ...
- 使用RMAN创建复制数据库
我的实验环境: - 源数据库A机: RHEL6.4 + Oracle 11.2.0.4 IP地址:192.168.99.159 db_name=oradb 数据库已正常运行 - 复制数据库B机: RH ...
- 使用rman中的duplicate复制数据库
目标库和复制库环境: OS: Linux Red Hat AS 4 DB Version: 10.2.0.1 1.目标库和复制库信息 Rman 中的目标库(target database)指的是被 ...
- 利用rman duplicate重建oracle dataguard standby数据库
问题背景 适用情况: 操作系统: redhat 6.5 数据库: oracle 11g r2 问题描述: failover后原主库无法恢复和启动或者丢失主备关系 优点 不需要对primary数据库停机 ...
- oracle RMAN复制数据库
列出创建副本数据库的目的 • 选择用于复制数据库的方法 • 使用RMAN 复制数据库 • 使用RMAN 备份复制数据库 • 基于正在运行的实例复制数据库 使用副本数据库 • 使用副本数据库可执行以 ...
- oracle 11g 基于磁盘的备份rman duplicate
基于磁盘的备份rman duplicate 命令创建standby database 前提条件: 确保原始库数据库的备份.存档standby 结束是完全可见, 这里,如果原始文库和靶 - 侧数据文件, ...
随机推荐
- java自定义equals函数和hashCode函数
所有类都继承自Object类,他所有的非final方法:equals,hashCode, toString, clone 和 finalize,它们都有通用约定. 我们在覆盖这些方法的时候需要遵循这些 ...
- 拎壶学python3-----(3)python之while循环用法
一.下边我们看一个简单的while循环 那怎么计数呢就让输入三次三次后退出: 二. 关于计数这个问题我们一起看一下 (1)关于计数如下: 我们发现这个计数根本停不下来,怎么才能搞成我们想要的计数次数呢 ...
- 【计算机网络】如何让Ajax通信过程携带Cookie呢?
Ajax 1. 介绍一下ajax并代码实现 1.1 基本概念 JavaScript 和XML(Asynchronous JavaScript And XML).简单点说,就是使用 XMLHttpReq ...
- c# Winform 继承窗体 无法拖动修改控件大小
问题描述: 一个窗体集成父窗体,发现无法直接拖动修改的控件,比如修改大小等 特征: 不禁使父窗体控件,就算新加一个控件也会这样:鼠标放到控件移动手方块上会出现一个“继承的控件”的tooptip, 异常 ...
- ABAP 7.4 新语法-内嵌生命和内表操作(转)
转自:https://www.cnblogs.com/mingdashu/p/6744637.html ABAP 7.4 新语法-内嵌生命和内表操作 1.内嵌声明 2.内表操作 3.opensql ...
- asp.net core 新建area使用asp-action,asp-controller不管用
解决方法: 在新建的Area目录下,这里使用Admin,Admin/Views下新建_ViewImports.cshtml和_ViewStart.cshtml两个视图文件,复制项目自动生成的到对应的新 ...
- 面试官常问的Nginx的那几个问题?
什么是Nginx? Nginx是一个高性能的HTTP和反向代理服务器,也是一个IMAP/POP3/SMTP服务器 Nginx是一款轻量级的Web服务器/反向代理服务器及电子邮件(IMAP/POP3)代 ...
- SILK编码语音转WAV格式
- SILK编码 SILK采样率可为8.12.16或24 kHz,比特率可为6至40 kbit/s.对应到报文层面的直观印象,即SILK编码的语音数据每帧长度是不等的. SILK编码已经开源,目前可下 ...
- 微信小程序访问webservice(wsdl)+ axis2发布服务端(Java)
0.主要思路:使用axis2发布webservice服务端,微信小程序作为客户端访问.步骤如下: 1.服务端: 首先微信小程序仅支持访问https的url,且必须是已备案域名.因此前期的服务器端工作需 ...
- BayaiM__MySQL 常用函数
BayaiM__MySQL 常用函数 原创 作者:bayaim 时间:2016-06-16 09:11:13 122 0删除编辑 MySQL 常用函数 阅读(883430) | 评论(44543) ...