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克隆数据库的更多相关文章

  1. window下在同一台机器上安装多个版本jdk,修改环境变量不生效问题处理办法

    window下在同一台机器上安装多个版本jdk,修改环境变量不生效问题处理办法 本机已经安装了jdk1.7,而比较早期的项目需要依赖jdk1.6,于是同时在本机安装了jdk1.6和jdk1.7. 安装 ...

  2. 不要将缓存服务器与Tomcat放在单台机器上,否则出现竞争内存问题

    缓存分为本地缓存和远程分布式缓存,本地缓存访问速度更快但缓存数据量有限,同时存在与应用程序争用内存的情况. 1.不要将缓存服务器与Tomcat放在单台机器上,否则出现竞争内存问题 2.不要将缓存服务器 ...

  3. 通过Mouse Without Borders在多台机器上共享键盘鼠标

    博客搬到了fresky.github.io - Dawei XU,请各位看官挪步.最新的一篇是:通过Mouse Without Borders在多台机器上共享键盘鼠标.

  4. 在同一台机器上让Microsoft SQL Server 2000/ SQL2005/ SQL2008共存

    可能很多朋友都遇到想同时在自己的机器上运行Microsoft SQL Server 2000以及Microsoft SQL Server 2005和Microsoft SQL Server 2008. ...

  5. 一台机器上运行多个ActiveMq

    由于业务需要一台机器上运行多个ActiveMq,这里主要说一下有什么地方不重复: 1.brokerName名称不能重复 2.端口号不能重复uri = tcp://localhost:50509 3.k ...

  6. 如何在同一台机器上安装多个MySQL的实例

    转自:'http://www.cnblogs.com/shangzekai/p/4375271.html 最近由于工作的需要,需要在同一台机器上搭建两个MySQL的实例,(注:已经存在了一个3306的 ...

  7. Nginx一台机器上负载均衡多个Tomcat

    默认你的机器上安装了Java环境,解压了Tomcat,安装了Nginx.默认这几个tomcat都部署在一台机器上. 对于Tomcat需要改三个地方[你部署的所有tomcat这三个地方都不能一样,如果你 ...

  8. Hexo博客系列(二)-在多台机器上利用Hexo发布博客

    [原文链接]:https://www.tecchen.xyz/blog-hexo-env-02.html 我的个人博客:https://www.tecchen.xyz,博文同步发布到博客园. 由于精力 ...

  9. 如何在同一台机器上安装多个MySQL的实例 转

    https://www.cnblogs.com/shangzekai/p/4375271.html 最近由于工作的需要,需要在同一台机器上搭建两个MySQL的实例,(注:已经存在了一个3306的MyS ...

随机推荐

  1. zookeeper源码分析(一) 工作原理

    来自:http://www.codedump.info/?p=207 阅读zookeeper代码一段时间(注:是很长一段时间,断断续续得有半年了吧?)之后,我要开始将一些积累下来的东西写下来了,鉴于我 ...

  2. JDK 伪异步编程(线程池)

    伪异步IO编程 BIO主要的问题在于每当有一个新的客户端请求接入时,服务端必须创建一个新的线程处理新接入的客户端链路,一个线程只能处理一个客户端连接.在高性能服务器应用领域,往往需要面向成千上万个客户 ...

  3. POJ 3415 后缀数组

    题目链接:http://poj.org/problem?id=3415 题意:给定2个串[A串和B串],求两个串公共子串长度大于等于k的个数. 思路:首先是两个字符串的问题.所以想用一个'#'把两个字 ...

  4. HDU 5769 后缀数组

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5769 [2016多校contest-4] 题意:给定一个字符,还有一个字符串,问这个字符串存在多少个不 ...

  5. mongodb学习03 操作详解

    插入文档 db.test.insert({"name":"jinks"}); 批量插入 db.test.insert([{}, {}, {}]); 一次批量插入 ...

  6. JS操作select下拉框动态变动(创建/删除/获取)

    1.动态创建select function createSelect(){ var mySelect = document.createElement_x("select"); m ...

  7. json数据实际应用

    JSON序列化输出 var xiaoming = { name: '小明', age: 14, gender: true, height: 1.65, grade: null, 'middle-sch ...

  8. struts2总结二:第一个简单的struts2程序

    到struts2官网上面下载struts2的jar包,然后解压. struts2的入门程序,实现简单的用户登录,struts2里面的helllo world.利用eclipse的开发工作如下: 1.首 ...

  9. Jenkins控制台中文输出乱码解决方法

    1. 设置jenkins所在服务器环境变量,右键我的电脑→属性→高级系统设置→环境变量,添加JAVA_TOOL_OPTIONS 2.修改Tomcat配置,进入apache_tomcat/conf文件夹 ...

  10. win dos命令行设置ip和dns

    首先以管理员身份运行cmd,保证之后在黑框中输入的命令都有管理员权限 C:\Windows\system32>netsh netsh>int netsh interface>ip n ...