示例在同一台机器上使用RMAN克隆数据库
1.查看主库ZDJS并使用RMAM进行备份
[oracle@std ~]$ sqlplus '/as sysdba' SQL*Plus: Release 10.2.0.1. - Production on Wed Jan :: Copyright (c) , , Oracle. All rights reserved. Connected to an idle instance. SQL> startup
ORACLE instance started. Total System Global Area bytes
Fixed Size bytes
Variable Size bytes
Database Buffers bytes
Redo Buffers bytes
Database mounted.
Database opened.
SQL> show parameter name NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
db_file_name_convert string
db_name string ZDJS
db_unique_name string ZDJS
global_names boolean FALSE
instance_name string ZDJS
lock_name_space string
log_file_name_convert string
service_names string ZDJS
[oracle@std ~]$ rman target /
Recovery Manager: Release 10.2.0.1. - Production on Wed Jan ::
Copyright (c) , , Oracle. All rights reserved.
connected to target database: ZDJS (DBID=)
RMAN> run {
> allocate channel c1 type disk;
> allocate channel c2 type disk;
> backup full database format '/u01/rman_bak/%d_%s_%t.bak';
> backup archivelog all format '/u01/rman_bak/arch_%s.bak';
> backup current controlfile format '/u01/rman_bak/ctl_%s.bak';
> }
using target database control file instead of recovery catalog
allocated channel: c1
channel c1: sid= devtype=DISK
allocated channel: c2
channel c2: sid= devtype=DISK
Starting backup at -JAN-
channel c1: starting full datafile backupset
channel c1: specifying datafile(s) in backupset
input datafile fno= name=/u02/app/oradata/ZDJS/system01.dbf
input datafile fno= name=/u02/app/oradata/ZDJS/plat01.dbf
input datafile fno= name=/u02/app/oradata/ZDJS/rlsm01.dbf
input datafile fno= name=/u02/app/oradata/ZDJS/undotbs01.dbf
input datafile fno= name=/u02/app/oradata/ZDJS/users01.dbf
channel c1: starting piece at -JAN-
channel c2: starting full datafile backupset
channel c2: specifying datafile(s) in backupset
input datafile fno= name=/u02/app/oradata/ZDJS/sysaux01.dbf
input datafile fno= name=/u02/app/oradata/ZDJS/qhrlst01.dbf
input datafile fno= name=/u02/app/oradata/ZDJS/example01.dbf
input datafile fno= name=/u02/app/oradata/ZDJS/rlst01.dbf
input datafile fno= name=/u02/app/oradata/ZDJS/rlsc01.dbf
channel c2: starting piece at -JAN-
channel c1: finished piece at -JAN-
piece handle=/u01/rman_bak/ZDJS_6_868976951.bak tag=TAG20150114T142911 comment=NONE
channel c1: backup set complete, elapsed time: ::
channel c1: starting full datafile backupset
channel c1: specifying datafile(s) in backupset
including current control file in backupset
channel c1: starting piece at -JAN-
channel c1: finished piece at -JAN-
piece handle=/u01/rman_bak/ZDJS_8_868977018.bak tag=TAG20150114T142911 comment=NONE
channel c1: backup set complete, elapsed time: ::
channel c1: starting full datafile backupset
channel c1: specifying datafile(s) in backupset
including current SPFILE in backupset
channel c1: starting piece at -JAN-
channel c1: finished piece at -JAN-
piece handle=/u01/rman_bak/ZDJS_9_868977021.bak tag=TAG20150114T142911 comment=NONE
channel c1: backup set complete, elapsed time: ::
channel c2: finished piece at -JAN-
piece handle=/u01/rman_bak/ZDJS_7_868976952.bak tag=TAG20150114T142911 comment=NONE
channel c2: backup set complete, elapsed time: ::
Finished backup at -JAN-
Starting backup at -JAN-
current log archived
channel c1: starting archive log backupset
channel c1: specifying archive log(s) in backup set
input archive log thread= sequence= recid= stamp=
channel c1: starting piece at -JAN-
channel c1: finished piece at -JAN-
piece handle=/u01/rman_bak/arch_10.bak tag=TAG20150114T143033 comment=NONE
channel c1: backup set complete, elapsed time: ::
Finished backup at -JAN-
Starting backup at -JAN-
channel c1: starting full datafile backupset
channel c1: specifying datafile(s) in backupset
including current control file in backupset
channel c1: starting piece at -JAN-
channel c1: finished piece at -JAN-
piece handle=/u01/rman_bak/ctl_11.bak tag=TAG20150114T143038 comment=NONE
channel c1: backup set complete, elapsed time: ::
Finished backup at -JAN-
released channel: c1
released channel: c2
SQL> col file_name for a50
SQL> select file_id,file_name,tablespace_name from dba_data_files; FILE_ID FILE_NAME TABLESPACE_NAME
---------- -------------------------------------------------- ------------------------------
/u02/app/oradata/ZDJS/users01.dbf USERS
/u02/app/oradata/ZDJS/sysaux01.dbf SYSAUX
/u02/app/oradata/ZDJS/undotbs01.dbf UNDOTBS1
/u02/app/oradata/ZDJS/system01.dbf SYSTEM
/u02/app/oradata/ZDJS/example01.dbf EXAMPLE
/u02/app/oradata/ZDJS/plat01.dbf PLAT
/u02/app/oradata/ZDJS/rlst01.dbf RLST
/u02/app/oradata/ZDJS/rlsm01.dbf RLSM
/u02/app/oradata/ZDJS/rlsc01.dbf RLSC
/u02/app/oradata/ZDJS/qhrlst01.dbf QHRLST rows selected.
2.建立pfile文件
SQL> create pfile from spfile; File created.
3.建立克隆库的目录
[oracle@std oradata]$ mkdir -p $ORACLE_BASE/admin/clonedb/{a,b,c,u}dump
[oracle@std oradata]$ mkdir -p $ORACLE_BASE/oradata/clonedb/
4.将主库pfile拷贝生成克隆库的pfile,并生成克隆库的口令文件
##红字部分是修改的部分,蓝字部分是需要增加的
[oracle@std dbs]$ cp initZDJS.ora initclonedb.ora
[oracle@std dbs]$ vi initclonedb.ora
[oracle@std dbs]$ cat initclonedb.ora
*.audit_file_dest='/u02/app/admin/clonedb/adump'
*.background_dump_dest='/u02/app/admin/clonedb/bdump'
*.compatible='10.2.0.1.0'
*.control_files='/u02/app/oradata/clonedb/control01.ctl','/u02/app/oradata/clonedb/control02.ctl','/u02/app/oradata/clonedb/control03.ctl'
*.core_dump_dest='/u02/app/admin/clonedb/cdump'
*.db_block_size=
*.db_domain=''
*.db_file_multiblock_read_count=
*.db_name='clonedb'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=ZDJSXDB)'
*.job_queue_processes=
*.log_archive_dest_1='location=/u01/clonedb_arch'
*.open_cursors=
*.pga_aggregate_target=
*.processes=
*.remote_login_passwordfile='EXCLUSIVE'
*.sga_target=
*.undo_management='AUTO'
*.undo_tablespace='UNDOTBS1'
*.user_dump_dest='/u02/app/admin/clonedb/udump'
db_file_name_convert=("/u02/app/oradata/ZDJS","/u02/app/oradata/clonedb")
log_file_name_convert=("/u02/app/oradata/ZDJS","/u02/app/oradata/clonedb")
[oracle@std dbs]$ orapwd file=orapwclonedb password=oracle
[oracle@std dbs]$ ls
hc_clonedb.dat hc_PROD.dat hc_ZDJS.dat initclonedb.ora initZDJS.ora lkZDJS orapwclonedb orapwZDJS snapcf_ZDJS.f spfileZDJS.ora
5.将克隆库启动到nomount状态
[oracle@std dbs]$ export ORACLE_SID=clonedb
[oracle@std dbs]$ sqlplus '/as sysdba' SQL*Plus: Release 10.2.0.1. - Production on Wed Jan :: Copyright (c) , , Oracle. All rights reserved. Connected to an idle instance. SQL> startup nomount
ORACLE instance started. Total System Global Area bytes
Fixed Size bytes
Variable Size bytes
Database Buffers bytes
Redo Buffers bytes
SQL> show parameter name NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
db_file_name_convert string /u02/app/oradata/ZDJS, /u02/ap
p/oradata/clonedb
db_name string clonedb
db_unique_name string clonedb
global_names boolean FALSE
instance_name string clonedb
lock_name_space string
log_file_name_convert string /u02/app/oradata/ZDJS, /u02/ap
p/oradata/clonedb
service_names string clonedb
6.对主库的日志进行归档,并将归档日志拷贝到克隆库的归档目录下
[oracle@std dbs]$ export ORACLE_SID=ZDJS
[oracle@std dbs]$ sqlplus '/as sysdba' SQL*Plus: Release 10.2.0.1. - Production on Wed Jan :: Copyright (c) , , Oracle. All rights reserved. Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1. - Production
With the Partitioning, Oracle Label Security, OLAP and Data Mining options SQL> select group#,sequence#,status from v$log; GROUP# SEQUENCE# STATUS
---------- ---------- ----------------
CURRENT
INACTIVE
INACTIVE SQL> alter system archive log current; System altered. SQL> select group#,sequence#,status from v$log; GROUP# SEQUENCE# STATUS
---------- ---------- ----------------
ACTIVE
CURRENT
INACTIVE
[oracle@std dbs]$ cd /u01/ZDJS_ARCH/
[oracle@std ZDJS_ARCH]$ ls
1_49_854875280.dbf 1_50_854875280.dbf
[oracle@std ZDJS_ARCH]$ cp * ../clonedb_arch/
[oracle@std ZDJS_ARCH]$ ll ../clonedb_arch/
total
-rw-r----- oracle oinstall Jan : 1_49_854875280.dbf
-rw-r----- oracle oinstall Jan : 1_50_854875280.dbf
7.使用rman连接主库和clone库
[oracle@std admin]$ cat tnsnames.ora
# tnsnames.ora Network Configuration File: /u02/app/product/10.2./db_1/network/admin/tnsnames.ora
# Generated by Oracle configuration tools. EXTPROC_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
)
(CONNECT_DATA =
(SID = PLSExtProc)
(PRESENTATION = RO)
)
) ZDJS=
(DESCRIPTION=
(ADDRESS=(PROTOCOL=tcp)(HOST=std)(PORT=))
(CONNECT_DATA=
(SERVICE_NAME=ZDJS)
)
)
[oracle@std admin]$ export ORACLE_SID=clonedb
[oracle@std admin]$ target sys/oracle@zdjs auxiliary sys/oracle
-bash: target: command not found
[oracle@std admin]$ rman target sys/oracle@zdjs auxiliary sys/oracle Recovery Manager: Release 10.2.0.1. - Production on Wed Jan :: Copyright (c) , , Oracle. All rights reserved. connected to target database: ZDJS (DBID=)
connected to auxiliary database: CLONEDB (not mounted) RMAN> list backup; using target database control file instead of recovery catalog List of Backup Sets
=================== BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
Full 6.77M DISK :: -JAN-
BP Key: Status: AVAILABLE Compressed: NO Tag: TAG20150114T142445
Piece Name: /u01/rman_bak/ZDJS_3_868976686.bak
Control File Included: Ckp SCN: Ckp time: -JAN- BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
Full .00K DISK :: -JAN-
BP Key: Status: AVAILABLE Compressed: NO Tag: TAG20150114T142445
Piece Name: /u01/rman_bak/ZDJS_5_868976688.bak
SPFILE Included: Modification time: -JAN- BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
Full 514.59M DISK :: -JAN-
BP Key: Status: AVAILABLE Compressed: NO Tag: TAG20150114T142911
Piece Name: /u01/rman_bak/ZDJS_6_868976951.bak
List of Datafiles in backup set
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- --------- ----
Full -JAN- /u02/app/oradata/ZDJS/system01.dbf
Full -JAN- /u02/app/oradata/ZDJS/undotbs01.dbf
Full -JAN- /u02/app/oradata/ZDJS/users01.dbf
Full -JAN- /u02/app/oradata/ZDJS/plat01.dbf
Full -JAN- /u02/app/oradata/ZDJS/rlsm01.dbf BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
Full 6.77M DISK :: -JAN-
BP Key: Status: AVAILABLE Compressed: NO Tag: TAG20150114T142911
Piece Name: /u01/rman_bak/ZDJS_8_868977018.bak
Control File Included: Ckp SCN: Ckp time: -JAN- BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
Full .00K DISK :: -JAN-
BP Key: Status: AVAILABLE Compressed: NO Tag: TAG20150114T142911
Piece Name: /u01/rman_bak/ZDJS_9_868977021.bak
SPFILE Included: Modification time: -JAN- BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
Full 453.63M DISK :: -JAN-
BP Key: Status: AVAILABLE Compressed: NO Tag: TAG20150114T142911
Piece Name: /u01/rman_bak/ZDJS_7_868976952.bak
List of Datafiles in backup set
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- --------- ----
Full -JAN- /u02/app/oradata/ZDJS/sysaux01.dbf
Full -JAN- /u02/app/oradata/ZDJS/example01.dbf
Full -JAN- /u02/app/oradata/ZDJS/rlst01.dbf
Full -JAN- /u02/app/oradata/ZDJS/rlsc01.dbf
Full -JAN- /u02/app/oradata/ZDJS/qhrlst01.dbf BS Key Size Device Type Elapsed Time Completion Time
------- ---------- ----------- ------------ ---------------
18.94M DISK :: -JAN-
BP Key: Status: AVAILABLE Compressed: NO Tag: TAG20150114T143033
Piece Name: /u01/rman_bak/arch_10.bak List of Archived Logs in backup set
Thrd Seq Low SCN Low Time Next SCN Next Time
---- ------- ---------- --------- ---------- ---------
-DEC- -JAN- BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
Full 6.77M DISK :: -JAN-
BP Key: Status: AVAILABLE Compressed: NO Tag: TAG20150114T143038
Piece Name: /u01/rman_bak/ctl_11.bak
Control File Included: Ckp SCN: Ckp time: -JAN-
8.使用rman命令克隆数据库
RMAN> duplicate target database to clonedb; Starting Duplicate Db at -JAN-
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: sid= devtype=DISK contents of Memory Script:
{
set until scn ;
set newname for datafile to
"/u02/app/oradata/clonedb/system01.dbf";
set newname for datafile to
"/u02/app/oradata/clonedb/undotbs01.dbf";
set newname for datafile to
"/u02/app/oradata/clonedb/sysaux01.dbf";
set newname for datafile to
"/u02/app/oradata/clonedb/users01.dbf";
set newname for datafile to
"/u02/app/oradata/clonedb/example01.dbf";
set newname for datafile to
"/u02/app/oradata/clonedb/plat01.dbf";
set newname for datafile to
"/u02/app/oradata/clonedb/rlst01.dbf";
set newname for datafile to
"/u02/app/oradata/clonedb/rlsm01.dbf";
set newname for datafile to
"/u02/app/oradata/clonedb/rlsc01.dbf";
set newname for datafile to
"/u02/app/oradata/clonedb/qhrlst01.dbf";
restore
check readonly
clone database
;
}
executing Memory Script executing command: SET until clause 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 -JAN-
using channel ORA_AUX_DISK_1 channel ORA_AUX_DISK_1: starting datafile backupset restore
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
restoring datafile to /u02/app/oradata/clonedb/system01.dbf
restoring datafile to /u02/app/oradata/clonedb/undotbs01.dbf
restoring datafile to /u02/app/oradata/clonedb/users01.dbf
restoring datafile to /u02/app/oradata/clonedb/plat01.dbf
restoring datafile to /u02/app/oradata/clonedb/rlsm01.dbf
channel ORA_AUX_DISK_1: reading from backup piece /u01/rman_bak/ZDJS_6_868976951.bak
channel ORA_AUX_DISK_1: restored backup piece
piece handle=/u01/rman_bak/ZDJS_6_868976951.bak tag=TAG20150114T142911
channel ORA_AUX_DISK_1: restore complete, elapsed time: ::
channel ORA_AUX_DISK_1: starting datafile backupset restore
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
restoring datafile to /u02/app/oradata/clonedb/sysaux01.dbf
restoring datafile to /u02/app/oradata/clonedb/example01.dbf
restoring datafile to /u02/app/oradata/clonedb/rlst01.dbf
restoring datafile to /u02/app/oradata/clonedb/rlsc01.dbf
restoring datafile to /u02/app/oradata/clonedb/qhrlst01.dbf
channel ORA_AUX_DISK_1: reading from backup piece /u01/rman_bak/ZDJS_7_868976952.bak
channel ORA_AUX_DISK_1: restored backup piece
piece handle=/u01/rman_bak/ZDJS_7_868976952.bak tag=TAG20150114T142911
channel ORA_AUX_DISK_1: restore complete, elapsed time: ::
Finished restore at -JAN-
sql statement: CREATE CONTROLFILE REUSE SET DATABASE "CLONEDB" RESETLOGS ARCHIVELOG
MAXLOGFILES
MAXLOGMEMBERS
MAXDATAFILES
MAXINSTANCES
MAXLOGHISTORY
LOGFILE
GROUP ( '/u02/app/oradata/clonedb/redo01.log' ) SIZE M REUSE,
GROUP ( '/u02/app/oradata/clonedb/redo02.log' ) SIZE M REUSE,
GROUP ( '/u02/app/oradata/clonedb/redo03.log' ) SIZE M REUSE
DATAFILE
'/u02/app/oradata/clonedb/system01.dbf'
CHARACTER SET ZHS16GBK contents of Memory Script:
{
switch clone datafile all;
}
executing Memory Script released channel: ORA_AUX_DISK_1
datafile switched to datafile copy
input datafile copy recid= stamp= filename=/u02/app/oradata/clonedb/undotbs01.dbf
datafile switched to datafile copy
input datafile copy recid= stamp= filename=/u02/app/oradata/clonedb/sysaux01.dbf
datafile switched to datafile copy
input datafile copy recid= stamp= filename=/u02/app/oradata/clonedb/users01.dbf
datafile switched to datafile copy
input datafile copy recid= stamp= filename=/u02/app/oradata/clonedb/example01.dbf
datafile switched to datafile copy
input datafile copy recid= stamp= filename=/u02/app/oradata/clonedb/plat01.dbf
datafile switched to datafile copy
input datafile copy recid= stamp= filename=/u02/app/oradata/clonedb/rlst01.dbf
datafile switched to datafile copy
input datafile copy recid= stamp= filename=/u02/app/oradata/clonedb/rlsm01.dbf
datafile switched to datafile copy
input datafile copy recid= stamp= filename=/u02/app/oradata/clonedb/rlsc01.dbf
datafile switched to datafile copy
input datafile copy recid= stamp= filename=/u02/app/oradata/clonedb/qhrlst01.dbf contents of Memory Script:
{
set until scn ;
recover
clone database
delete archivelog
;
}
executing Memory Script executing command: SET until clause Starting recover at -JAN-
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: sid= devtype=DISK starting media recovery archive log thread sequence is already on disk as file /u01/ZDJS_ARCH/1_49_854875280.dbf
archive log thread sequence is already on disk as file /u01/ZDJS_ARCH/1_50_854875280.dbf
archive log filename=/u01/ZDJS_ARCH/1_49_854875280.dbf thread= sequence=
archive log filename=/u01/ZDJS_ARCH/1_50_854875280.dbf thread= sequence=
media recovery complete, elapsed time: ::
Finished recover at -JAN- contents of Memory Script:
{
shutdown clone;
startup clone nomount ;
}
executing Memory Script database dismounted
Oracle instance shut down connected to auxiliary database (not started)
Oracle instance started Total System Global Area bytes Fixed Size bytes
Variable Size bytes
Database Buffers bytes
Redo Buffers bytes
sql statement: CREATE CONTROLFILE REUSE SET DATABASE "CLONEDB" RESETLOGS ARCHIVELOG
MAXLOGFILES
MAXLOGMEMBERS
MAXDATAFILES
MAXINSTANCES
MAXLOGHISTORY
LOGFILE
GROUP ( '/u02/app/oradata/clonedb/redo01.log' ) SIZE M REUSE,
GROUP ( '/u02/app/oradata/clonedb/redo02.log' ) SIZE M REUSE,
GROUP ( '/u02/app/oradata/clonedb/redo03.log' ) SIZE M REUSE
DATAFILE
'/u02/app/oradata/clonedb/system01.dbf'
CHARACTER SET ZHS16GBK contents of Memory Script:
{
set newname for tempfile to
"/u02/app/oradata/clonedb/temp01.dbf";
switch clone tempfile all;
catalog clone datafilecopy "/u02/app/oradata/clonedb/undotbs01.dbf";
catalog clone datafilecopy "/u02/app/oradata/clonedb/sysaux01.dbf";
catalog clone datafilecopy "/u02/app/oradata/clonedb/users01.dbf";
catalog clone datafilecopy "/u02/app/oradata/clonedb/example01.dbf";
catalog clone datafilecopy "/u02/app/oradata/clonedb/plat01.dbf";
catalog clone datafilecopy "/u02/app/oradata/clonedb/rlst01.dbf";
catalog clone datafilecopy "/u02/app/oradata/clonedb/rlsm01.dbf";
catalog clone datafilecopy "/u02/app/oradata/clonedb/rlsc01.dbf";
catalog clone datafilecopy "/u02/app/oradata/clonedb/qhrlst01.dbf";
switch clone datafile all;
}
executing Memory Script executing command: SET NEWNAME renamed temporary file to /u02/app/oradata/clonedb/temp01.dbf in control file cataloged datafile copy
datafile copy filename=/u02/app/oradata/clonedb/undotbs01.dbf recid= stamp= cataloged datafile copy
datafile copy filename=/u02/app/oradata/clonedb/sysaux01.dbf recid= stamp= cataloged datafile copy
datafile copy filename=/u02/app/oradata/clonedb/users01.dbf recid= stamp= cataloged datafile copy
datafile copy filename=/u02/app/oradata/clonedb/example01.dbf recid= stamp= cataloged datafile copy
datafile copy filename=/u02/app/oradata/clonedb/plat01.dbf recid= stamp= cataloged datafile copy
datafile copy filename=/u02/app/oradata/clonedb/rlst01.dbf recid= stamp= cataloged datafile copy
datafile copy filename=/u02/app/oradata/clonedb/rlsm01.dbf recid= stamp= cataloged datafile copy
datafile copy filename=/u02/app/oradata/clonedb/rlsc01.dbf recid= stamp= cataloged datafile copy
datafile copy filename=/u02/app/oradata/clonedb/qhrlst01.dbf recid= stamp= datafile switched to datafile copy
input datafile copy recid= stamp= filename=/u02/app/oradata/clonedb/undotbs01.dbf
datafile switched to datafile copy
input datafile copy recid= stamp= filename=/u02/app/oradata/clonedb/sysaux01.dbf
datafile switched to datafile copy
input datafile copy recid= stamp= filename=/u02/app/oradata/clonedb/users01.dbf
datafile switched to datafile copy
input datafile copy recid= stamp= filename=/u02/app/oradata/clonedb/example01.dbf
datafile switched to datafile copy
input datafile copy recid= stamp= filename=/u02/app/oradata/clonedb/plat01.dbf
datafile switched to datafile copy
input datafile copy recid= stamp= filename=/u02/app/oradata/clonedb/rlst01.dbf
datafile switched to datafile copy
input datafile copy recid= stamp= filename=/u02/app/oradata/clonedb/rlsm01.dbf
datafile switched to datafile copy
input datafile copy recid= stamp= filename=/u02/app/oradata/clonedb/rlsc01.dbf
datafile switched to datafile copy
input datafile copy recid= stamp= filename=/u02/app/oradata/clonedb/qhrlst01.dbf contents of Memory Script:
{
Alter clone database open resetlogs;
}
executing Memory Script database opened
Finished Duplicate Db at -JAN-
9.打开克隆库,确认克隆成功
[oracle@std admin]$ sqlplus '/as sysdba' SQL*Plus: Release 10.2.0.1. - Production on Wed Jan :: Copyright (c) , , Oracle. All rights reserved. Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1. - Production
With the Partitioning, Oracle Label Security, OLAP and Data Mining options SQL> select status from v$instance; STATUS
------------
OPEN SQL> select name from v$datafile; NAME
--------------------------------------------------------------------------------
/u02/app/oradata/clonedb/system01.dbf
/u02/app/oradata/clonedb/undotbs01.dbf
/u02/app/oradata/clonedb/sysaux01.dbf
/u02/app/oradata/clonedb/users01.dbf
/u02/app/oradata/clonedb/example01.dbf
/u02/app/oradata/clonedb/plat01.dbf
/u02/app/oradata/clonedb/rlst01.dbf
/u02/app/oradata/clonedb/rlsm01.dbf
/u02/app/oradata/clonedb/rlsc01.dbf
/u02/app/oradata/clonedb/qhrlst01.dbf rows selected. SQL> select group#,sequence#,status from v$log; GROUP# SEQUENCE# STATUS
---------- ---------- ----------------
UNUSED
UNUSED
CURRENT SQL> alter system switch logfile; System altered. SQL> / System altered. SQL> / System altered. SQL> select group#,sequence#,status from v$log; GROUP# SEQUENCE# STATUS
---------- ---------- ----------------
INACTIVE
ACTIVE
CURRENT
SQL> show parameter name NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
db_file_name_convert string /u02/app/oradata/ZDJS, /u02/ap
p/oradata/clonedb
db_name string clonedb
db_unique_name string clonedb
global_names boolean FALSE
instance_name string clonedb
lock_name_space string
log_file_name_convert string /u02/app/oradata/ZDJS, /u02/ap
p/oradata/clonedb
service_names string clonedb
示例在同一台机器上使用RMAN克隆数据库的更多相关文章
- window下在同一台机器上安装多个版本jdk,修改环境变量不生效问题处理办法
window下在同一台机器上安装多个版本jdk,修改环境变量不生效问题处理办法 本机已经安装了jdk1.7,而比较早期的项目需要依赖jdk1.6,于是同时在本机安装了jdk1.6和jdk1.7. 安装 ...
- 不要将缓存服务器与Tomcat放在单台机器上,否则出现竞争内存问题
缓存分为本地缓存和远程分布式缓存,本地缓存访问速度更快但缓存数据量有限,同时存在与应用程序争用内存的情况. 1.不要将缓存服务器与Tomcat放在单台机器上,否则出现竞争内存问题 2.不要将缓存服务器 ...
- 通过Mouse Without Borders在多台机器上共享键盘鼠标
博客搬到了fresky.github.io - Dawei XU,请各位看官挪步.最新的一篇是:通过Mouse Without Borders在多台机器上共享键盘鼠标.
- 在同一台机器上让Microsoft SQL Server 2000/ SQL2005/ SQL2008共存
可能很多朋友都遇到想同时在自己的机器上运行Microsoft SQL Server 2000以及Microsoft SQL Server 2005和Microsoft SQL Server 2008. ...
- 一台机器上运行多个ActiveMq
由于业务需要一台机器上运行多个ActiveMq,这里主要说一下有什么地方不重复: 1.brokerName名称不能重复 2.端口号不能重复uri = tcp://localhost:50509 3.k ...
- 如何在同一台机器上安装多个MySQL的实例
转自:'http://www.cnblogs.com/shangzekai/p/4375271.html 最近由于工作的需要,需要在同一台机器上搭建两个MySQL的实例,(注:已经存在了一个3306的 ...
- Nginx一台机器上负载均衡多个Tomcat
默认你的机器上安装了Java环境,解压了Tomcat,安装了Nginx.默认这几个tomcat都部署在一台机器上. 对于Tomcat需要改三个地方[你部署的所有tomcat这三个地方都不能一样,如果你 ...
- Hexo博客系列(二)-在多台机器上利用Hexo发布博客
[原文链接]:https://www.tecchen.xyz/blog-hexo-env-02.html 我的个人博客:https://www.tecchen.xyz,博文同步发布到博客园. 由于精力 ...
- 如何在同一台机器上安装多个MySQL的实例 转
https://www.cnblogs.com/shangzekai/p/4375271.html 最近由于工作的需要,需要在同一台机器上搭建两个MySQL的实例,(注:已经存在了一个3306的MyS ...
随机推荐
- 【转】Struts2国际化
原文章:http://www.cnblogs.com/hellokitty1/p/5083663.html 简单理解 国际化简称i18n,其来源是英文单词 internationalizati ...
- c语言二维数组传递
c语言二维数组传递,目前我总结三种方法,以及纠正一个不能使用的方法 /********************************* * 方法1: 第一维的长度可以不指定 * * 但必须指定第二维 ...
- 编解码-marshalling
JBoss的Marshalling序列化框架,它是JBoss内部使用的序列化框架,Netty提供了Marshalling编码和解码器,方便用户在Netty中使用Marshalling. JBoss M ...
- hdu2191 多重背包
题目链接:http://acm.split.hdu.edu.cn/showproblem.php?pid=2191 多重背包:有N种物品和一个容量为V的背包.第i种物品最多有n[i]件可用,每件费用是 ...
- poj1251 最小生成树
Description The Head Elder of the tropical island of Lagrishan has a problem. A burst of foreign aid ...
- POJ 3693 后缀数组
题目链接:http://poj.org/problem?id=3693 题意:首先定义了一个字符串的重复度.即一个字符串由一个子串重复k次构成.那么最大的k即是该字符串的重复度.现在给定一个长度为n的 ...
- js整理3
函数 call: fun.call(a), a会转化成相应的对象,函数内的this即指向它; function foo() { console.log(this); } foo.call(null); ...
- Hadoop 2.0安装以及不停集群加datanode
Hadoop2.0是对Hadoop1.0全面升级,针对Namenode单点问题,提出了HDFS Federation,让多个NameNode分管不同的目录进而实现访问隔离和横向扩展.诞生了通用的计算框 ...
- HTML DOM Document
Document 对象 每个载入浏览器的 HTML 文档都会成为 Document 对象. Document 对象使我们可以从脚本中对 HTML 页面中的所有元素进行访问. 提示:Document 对 ...
- WPF ComboBox Binding
public ConnectionViewModel { private readonly CollectionView _phonebookEntries; private string _phon ...