1.查看主库ZDJS并使用RMAM进行备份

[oracle@std ~]$ sqlplus '/as sysdba'

SQL*Plus: Release  - 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  - 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 ::
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 ::
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 ::
channel c2: finished piece  at -JAN-
piece handle=/u01/rman_bak/ZDJS_7_868976952.bak tag=TAG20150114T142911 comment=NONE
channel c2: backup ::
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 ::
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 ::
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  - 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  - Production on Wed Jan  :: 

Copyright (c) , , Oracle.  All rights reserved.

Connected to:
Oracle Database 10g Enterprise Edition Release  - 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//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  - 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    ::     -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    ::     -JAN-
        BP Key:    Status: AVAILABLE  Compressed: NO  Tag: TAG20150114T142911
        Piece Name: /u01/rman_bak/ZDJS_6_868976951.bak
  List of Datafiles
  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    ::     -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    ::     -JAN-
        BP Key:    Status: AVAILABLE  Compressed: NO  Tag: TAG20150114T142911
        Piece Name: /u01/rman_bak/ZDJS_7_868976952.bak
  List of Datafiles
  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
------- ---------- ----------- ------------ ---------------
       ::     -JAN-
        BP Key:    Status: AVAILABLE  Compressed: NO  Tag: TAG20150114T143033
        Piece Name: /u01/rman_bak/arch_10.bak

  List of Archived Logs
  Thrd Seq     Low SCN    Low Time  Next SCN   Next Time
  ---- ------- ---------- --------- ---------- ---------
                -DEC-     -JAN-

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
       Full    ::     -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:
{
   ;
    to
 "/u02/app/oradata/clonedb/system01.dbf";
    to
 "/u02/app/oradata/clonedb/undotbs01.dbf";
    to
 "/u02/app/oradata/clonedb/sysaux01.dbf";
    to
 "/u02/app/oradata/clonedb/users01.dbf";
    to
 "/u02/app/oradata/clonedb/example01.dbf";
    to
 "/u02/app/oradata/clonedb/plat01.dbf";
    to
 "/u02/app/oradata/clonedb/rlst01.dbf";
    to
 "/u02/app/oradata/clonedb/rlsm01.dbf";
    to
 "/u02/app/oradata/clonedb/rlsc01.dbf";
    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   (  M  REUSE,
  GROUP   (  M  REUSE,
  GROUP   (  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:
{
   ;
   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   (  M  REUSE,
  GROUP   (  M  REUSE,
  GROUP   (  M  REUSE
 DATAFILE
  '/u02/app/oradata/clonedb/system01.dbf'
 CHARACTER SET ZHS16GBK

contents of Memory Script:
{
    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  - Production on Wed Jan  :: 

Copyright (c) , , Oracle.  All rights reserved.

Connected to:
Oracle Database 10g Enterprise Edition Release  - 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. linux tar.gz zip 解压缩 压缩命令

    http://apps.hi.baidu.com/share/detail/37384818 download ADT link http://dl.google.com/android/ADT-0. ...

  2. [Gauss]HDOJ3364 Lanterns

    题意:有n个灯笼,m个开关 每个开关可以控制k个灯笼, 然后分别列出控制的灯笼的编号(灯笼编号为1到n) 下面有Q个询问,每个询问会有一个最终状态(n个灯笼为一个状态)0代表关 1代表开 问到达这种状 ...

  3. [转]oracle性能调优之--Oracle 10g AWR 配置

    一.ASH和AWR的故事 1.1 关于ASH 我们都知道,用户在ORACLE数据库中执行操作时,必然要创建相应的连接和会话,其中,所有当前的会话信息都保存在动态性能视图V$SESSION中,通过该视图 ...

  4. javaScript中将时间戳转换成日期格式

    function DateFormt(time, format) { ); var o = { , "d+": testDate.getDate(), "h+" ...

  5. C# 反射相关的东西

     public class PlugingManager    {        //插件装载器        public ArrayList Plugins = new ArrayList();  ...

  6. 总结jq的一些特效

    Jquery代码总结 1.轮播图: <script src="jquery-1.8.3.min.js"></script><script>    ...

  7. 【Alpha】阶段 第七次 Scrum Meeting

    每日任务 1.本次会议为第一次 Meeting会议: 2.本次会议在下午14:45,课间休息时间在禹州楼召开,召开本次会议为10分钟,根据大家的讨论分析得出的总结,讨论下接下来版本的改进计划: 一.今 ...

  8. MACE移植要求

    MACE支持Tensorflow的depth_to_space和space_to_depth,以及strided_slice算子. 其中depth_to_space可以用来无平滑地进行上采样. spa ...

  9. linux上常见的压缩解压缩的命令

    压缩 tar -cvf jpg.tar *.jpg //将目录里所有jpg文件打包成tar.jpg tar -czf jpg.tar.gz *.jpg   //将目录里所有jpg文件打包成jpg.ta ...

  10. Python之正则表达式模块

    正则表达式符号: . ^ $ * + ? {} () | [] .一个点代表一个字符 ^代表开头 $代表结尾 *代表有0到无数个 [0,+00] ?代表有0到1个      [0,1] +代表有1到无 ...