示例在同一台机器上使用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 ...
随机推荐
- Liferay 6.2 改造系列之二十三:修改Liferay原始主题中"技术支持:Liferay"字样
1.修改主题模板文件,具体位置如下 (1) portal-master\portal-web\docroot\html\themes\_unstyled\templates\portal_normal ...
- 2016.9.13 JavaScript入门之六基础函数
1.Math.random()函数: 2.math.floor(x)返回小于参数x的最大整数,即对浮点数向下取整. 例如:random本身只产生(0~1)之间的小数,random()*10 意思是产生 ...
- 《DSP using MATLAB》示例Example4.15
代码: b = [1/3, 1/3, 1/3]; a = [1, -0.95, 0.9025]; % x(n) y(n) coefficient [R, p, C] = residuez(b,a) M ...
- 07 JavaWeb
软件开发的两种架构:c/s和b/s * C/S client/server 客户端/服务器 例子:QQ 快播 暴风影音... ...
- hdu 4000Fruit Ninja 树状数组
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission( ...
- Java与.NET随笔
.NET与Java,因这两种技术的相似性,总是会让人拿来做比较,并且总有人想让二者一分高下,最后得出孰优孰劣的结论.由于本人先用.NET,后转Java,现在.NET与Java二者并用,所以对二者间的差 ...
- Codeforces Round #333 (Div. 2)
水 A - Two Bases 水题,但是pow的精度不高,应该是转换成long long精度丢失了干脆直接double就可以了.被hack掉了.用long long能存的下 #include < ...
- linux 添加新硬盘的方法
在服务器上把硬盘接好,启动linux,以root登陆. 比如我新加一块SCSI硬盘,需要将其分成三个区: #fdisk /dev/sdb 进入fdisk模式: Command (m for help) ...
- 【原】iOS多线程之NSThread、NSOperationQueue、NSObject和GCD的区别
区别: Thread: 是这几种方式里面相对轻量级的,但也是使用起来最负责的,你需要自己管理thread的生命周期,线程之间的同步.线程共享同一应用程序的部分内存空间, 它们拥有对数据相同的访问权限. ...
- ccc progressbar
cc.Class({ extends: cc.Component, properties: { progressBar: { default:null, type:cc.ProgressBar }, ...