示例在同一台机器上使用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 ...
随机推荐
- 【File】递归删除文件夹中子级文件/夹,并删除文件夹
今天有这样一个需求,需要删除某一个文件夹,但是文件夹中还有子级的文件 或者还可能会有文件夹在里面,所以就需要使用一个简单的递归才能将文件夹删除成功,包括文件夹中的子级文件/夹.!!! 其实很简单,就一 ...
- 【前台页面 BUG】回车按钮后,页面自动跳转
点击回车按钮后,页面自动的迅速跳转 原因: 表单隐式提交了. 解决方法: 在方法执行完成后,加上return false; 代码如下: /** * 注册按钮的点击事件 */ $("#regi ...
- 【转】【异常处理】Incorrect string value: '\xF0\x90\x8D\x83...' for column... Emoji表情字符过滤的Java实现
http://blog.csdn.net/shootyou/article/details/44852639 Emoji表情字符现在在APP已经广泛支持了.但是MySQL的UTF8编码对Emoji字符 ...
- Uva 839 Not so Mobile
0.最后输出的yes no的大小写 1.注意 递归边界 一直到没有左右子树 即b1=b2=false的时候 才返回 是否 天平平衡. 2.注意重量是利用引用来传递的 #include <io ...
- POJ3084 Panic Room(最小割)
把某点与某几点分开的最小花费,当然想到最小割.具体怎么建图,可以画个简单的情况,然后就清楚了: 0到1不受控制,建立0->1容量为INF的边: 1到0受在0一边的一个控制面板的控制,建立1-&g ...
- Eclipse: Resource is out of sync with the file system when publishing to tomcat server on Eclipse
Link: http://stackoverflow.com/questions/4343735/avoiding-resource-is-out-of-sync-with-the-filesyste ...
- 熟悉熟悉常用的几个算法用JS的实现
(1)数组去重 原理:定义一个对象obj,然后把数组元素作为obj的属性名,利用属性名是否重复进行判重 1 var unique = function(arr){ 2 let obj = {}; 3 ...
- 51Nod 1002 数字三角形 Label:水水水 && 非学习区警告
一个高度为N的由正整数组成的三角形,从上走到下,求经过的数字和的最大值. 每次只能走到下一层相邻的数上,例如从第3层的6向下走,只能走到第4层的2或9上. 5 8 4 3 6 9 7 ...
- 洛谷 P1111 修复公路 Label:并查集
题目背景 A地区在地震过后,连接所有村庄的公路都造成了损坏而无法通车.政府派人修复这些公路. 题目描述 给出A地区的村庄数N,和公路数M,公路是双向的.并告诉你每条公路的连着哪两个村庄,并告诉你什么时 ...
- HDU 3720 Arranging Your Team(DFS)
题目链接 队内赛里,匆匆忙忙写的. #include <cstdio> #include <cstring> #include <iostream> #includ ...