Chinaunix首页 | 论坛 | 博客
  • 博客访问: 337990
  • 博文数量: 62
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 710
  • 用 户 组: 普通用户
  • 注册时间: 2013-05-14 14:12
个人简介

太懒

文章分类

全部博文(62)

文章存档

2015年(8)

2014年(20)

2013年(34)

我的朋友

分类: Oracle

2014-08-01 17:18:44

测试Active Database Duplication

source database

IP

SQL> select INST_ID,FILE#,STATUS,NAME from gv$datafile;

   INST_ID      FILE# STATUS  NAME
---------- ---------- ------- --------------------------------------------------
         1          1 SYSTEM  /u02/oradata/mydb1/system01.dbf
         1          2 ONLINE  /u02/oradata/mydb1/sysaux01.dbf
         1          3 ONLINE  /u02/oradata/mydb1/undotbs101.dbf
         1          4 ONLINE  /u02/oradata/mydb1/users01.dbf
         1          7 ONLINE  /u02/oradata/mydb1/zabbix101.dbf
         1          8 ONLINE  /u02/oradata/mydb1/hyperic0101.dbf

6 rows selected.

SQL> 
SQL> select INST_ID,INSTANCE_NUMBER,INSTANCE_NAME,HOST_NAME,VERSION,STATUS from gv$instance;

   INST_ID INSTANCE_NUMBER INSTANCE_NAME    HOST_NAME            VERSION           STATUS
---------- --------------- ---------------- -------------------- ----------------- ------------
         1               1 mydb1            my2950               11.2.0.3.0        OPEN

SQL> select INST_ID,FILE#,STATUS,NAME from gv$datafile;

   INST_ID      FILE# STATUS  NAME
---------- ---------- ------- --------------------------------------------------
         1          1 SYSTEM  /u02/oradata/mydb1/system01.dbf
         1          2 ONLINE  /u02/oradata/mydb1/sysaux01.dbf
         1          3 ONLINE  /u02/oradata/mydb1/undotbs101.dbf
         1          4 ONLINE  /u02/oradata/mydb1/users01.dbf
         1          7 ONLINE  /u02/oradata/mydb1/zabbix101.dbf
         1          8 ONLINE  /u02/oradata/mydb1/hyperic0101.dbf

6 rows selected.

SQL> 
SQL> select
  2  a.GROUP#,a.thread#,a.sequence#,a.bytes/1024/1024 "size(MB)",b.member
  3  from v$log a,v$logfile b
  4  where a.group#=b.GROUP#
  5  order by 1;

    GROUP#    THREAD#  SEQUENCE#   size(MB) MEMBER
---------- ---------- ---------- ---------- --------------------------------------------------
         3          2          0         50 /u03/oraredo/mydb1/onlinelog/redoa03.log
         4          2          0         50 /u03/oraredo/mydb1/onlinelog/redoa04.log
         5          3          0         50 /u03/oraredo/mydb1/onlinelog/redoa05.log
         6          3          0         50 /u03/oraredo/mydb1/onlinelog/redoa06.log
         7          1        110        100 /u03/oraredo/mydb1/onlinelog/redoaa01.log
         8          1        106        100 /u03/oraredo/mydb1/onlinelog/redoaa02.log
         9          1        107        100 /u03/oraredo/mydb1/onlinelog/redoaa03.log
        10          1        108        100 /u03/oraredo/mydb1/onlinelog/redoaa04.log
        11          1        109        100 /u03/oraredo/mydb1/onlinelog/redoaa05.log

9 rows selected.

SQL> 



destination database

只安装软件





SID:   dupdb
数据文件   /u01/data/oradata/dupdb
redolog   /u01/data/onlinelog/dupdb
flash        /u01/data/flash_recover_area

mkdir -p /u01/data/oradata/dupdb
mkdir -p /u01/data/onlinelog/dupdb
mkdir -p /u01/data/flash_recover_area
chown -R oracle:oinstall /u01/data/
chmod -R 775 /u01/data/


[oracle@node1 ~]$ pwd
/home/oracle
[oracle@node1 ~]$ ls
.bash_history  .bash_logout  .bash_profile  .bashrc  db_env  .gnome2/  grid_env  .kshrc  .mozilla/
[oracle@node1 ~]$ wget ftp://10.101.0.17/pub/kik/ora11203_rac_conf/db_sfonly_single.rsp
--2014-05-20 12:34:18--  ftp://10.101.0.17/pub/kik/ora11203_rac_conf/db_sfonly_single.rsp
           => “db_sfonly_single.rsp”
Connecting to 10.101.0.17:21... connected.
Logging in as anonymous ... Logged in!
==> SYST ... done.    ==> PWD ... done.
==> TYPE I ... done.  ==> CWD (1) /pub/kik/ora11203_rac_conf ... done.
==> SIZE db_sfonly_single.rsp ... 25069
==> PASV ... done.    ==> RETR db_sfonly_single.rsp ... done.
Length: 25069 (24K) (unauthoritative)

100%[=======================================================================================================================================>] 25,069      --.-K/s   in 0.002s

2014-05-20 12:34:18 (9.68 MB/s) - “db_sfonly_single.rsp” saved [25069]

[oracle@node1 ~]$ more db_sfonly_single.rsp |grep ^[^#$]
oracle.install.responseFileVersion=/oracle/install/rspfmt_dbinstall_response_schema_v11_2_0
oracle.install.option=INSTALL_DB_SWONLY
ORACLE_HOSTNAME=node1.momo.org
UNIX_GROUP_NAME=oinstall
INVENTORY_LOCATION=/u01/app/oracle/oraInventory
SELECTED_LANGUAGES=en,zh_CN
ORACLE_HOME=/u01/app/oracle/product/11.2.3/db_1
ORACLE_BASE=/u01/app/oracle
oracle.install.db.InstallEdition=EE
oracle.install.db.EEOptionsSelection=false
oracle.install.db.optionalComponents=
oracle.install.db.DBA_GROUP=dba
oracle.install.db.OPER_GROUP=oinstall
oracle.install.db.CLUSTER_NODES=
oracle.install.db.isRACOneInstall=false
oracle.install.db.racOneServiceName=
oracle.install.db.config.starterdb.type=GENERAL_PURPOSE
oracle.install.db.config.starterdb.globalDBName=
oracle.install.db.config.starterdb.SID=
oracle.install.db.config.starterdb.characterSet=
oracle.install.db.config.starterdb.memoryOption=false
oracle.install.db.config.starterdb.memoryLimit=
oracle.install.db.config.starterdb.installExampleSchemas=false
oracle.install.db.config.starterdb.enableSecuritySettings=true
oracle.install.db.config.starterdb.password.ALL=
oracle.install.db.config.starterdb.password.SYS=
oracle.install.db.config.starterdb.password.SYSTEM=
oracle.install.db.config.starterdb.password.SYSMAN=
oracle.install.db.config.starterdb.password.DBSNMP=
oracle.install.db.config.starterdb.control=DB_CONTROL
oracle.install.db.config.starterdb.gridcontrol.gridControlServiceURL=
oracle.install.db.config.starterdb.automatedBackup.enable=false
oracle.install.db.config.starterdb.automatedBackup.osuid=
oracle.install.db.config.starterdb.automatedBackup.ospwd=
oracle.install.db.config.starterdb.storageType=
oracle.install.db.config.starterdb.fileSystemStorage.dataLocation=
oracle.install.db.config.starterdb.fileSystemStorage.recoveryLocation=
oracle.install.db.config.asm.diskGroup=
oracle.install.db.config.asm.ASMSNMPPassword=
MYORACLESUPPORT_USERNAME=
MYORACLESUPPORT_PASSWORD=
SECURITY_UPDATES_VIA_MYORACLESUPPORT=false
DECLINE_SECURITY_UPDATES=true
PROXY_HOST=
PROXY_PORT=
PROXY_USER=
PROXY_PWD=
PROXY_REALM=
COLLECTOR_SUPPORTHUB_URL=
oracle.installer.autoupdates.option=SKIP_UPDATES
oracle.installer.autoupdates.downloadUpdatesLoc=
AUTOUPDATES_MYORACLESUPPORT_USERNAME=
AUTOUPDATES_MYORACLESUPPORT_PASSWORD=
[oracle@node1 ~]$

[oracle@node1 ~]$ cd /nfs/oracle11G/x86_64/112030/p10404530_112030_Linux-x86-64_1+2of7/
[oracle@node1 p10404530_112030_Linux-x86-64_1+2of7]$ cd /nfs/oracle11G/x86_64/112030/p10404530_112030_Linux-x86-64_1+2of7/database/
[oracle@node1 database]$ ls
doc/  install/  readme.html*  response/  rpm/  runInstaller*  sshsetup/  stage/  welcome.html*
[oracle@node1 database]$ ll
total 52
drwxr-xr-x 12 oracle oinstall  4096 Sep 19  2011 doc/
drwxr-xr-x  4 oracle oinstall  4096 Sep 22  2011 install/
-rwxr-xr-x  1 oracle oinstall 28122 Sep 22  2011 readme.html*
drwxr-xr-x  2 oracle oinstall    58 Sep 22  2011 response/
drwxr-xr-x  2 oracle oinstall    33 Sep 22  2011 rpm/
-rwxr-xr-x  1 oracle oinstall  3226 Sep 22  2011 runInstaller*
drwxr-xr-x  2 oracle oinstall    28 Sep 22  2011 sshsetup/
drwxr-xr-x 14 oracle oinstall  4096 Sep 22  2011 stage/
-rwxr-xr-x  1 oracle oinstall  5466 Aug 23  2011 welcome.html*
[oracle@node1 database]$


[oracle@node1 database]$ ./runInstaller -ignorePrereq -ignoreSysPrereqs -silent -responseFile /home/oracle/db_sfonly_single.rsp

[oracle@node1 database]$
[oracle@node1 database]$ [WARNING] [INS-35342] The specified group for Database Operator (OSOPER) may not be defined in the system.
   CAUSE: The OS group you specified as the OSOPER group may not be configured on the server, or in the Network Information Service (NIS).
   ACTION: Check the group name you selected, and specify a different group, or create the group on the server or in the Network Information Service.

[oracle@node1 database]$ You can find the log of this install session at:
 /u01/app/oracle/oraInventory/logs/installActions2014-05-20_12-37-46PM.log


The installation of Oracle Database 11g was successful.
Please check '/u01/app/oracle/oraInventory/logs/silentInstall2014-05-20_12-37-46PM.log' for more details.

As a root user, execute the following script(s):
        1. /u01/app/oracle/product/11.2.3/db_1/root.sh

少一个?

[root@node1 ~]# /u01/app/oracle/product/11.2.3/db_1/root.sh
Check /u01/app/oracle/product/11.2.3/db_1/install/root_node1_2014-05-20_12-52-25.log for the output of root script
[root@node1 ~]# more  /u01/app/oracle/product/11.2.3/db_1/install/root_node1_2014-05-20_12-52-25.log

Performing root user operation for Oracle 11g

The following environment variables are set as:
    ORACLE_OWNER= oracle
    ORACLE_HOME=  /u01/app/oracle/product/11.2.3/db_1

Creating /etc/oratab file...
Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root script.
Now product-specific root actions will be performed.
Finished product-specific root actions.
[root@node1 ~]#

[root@node1 ~]# more /etc/oraInst.loc
inventory_loc=/u01/app/oracle/oraInventory
inst_group=oinstall
[root@node1 ~]#




性能采集工具   OSWbb  Oracle OSWatcher Black Box 

[root@my2950 IO_Test_Tool]# pwd
/var/ftp/pub/software/IO_Test_Tool
[root@my2950 IO_Test_Tool]# ls
orion_linux_x86  oswbb  oswbb601.tar
[root@my2950 IO_Test_Tool]# 

scp /var/ftp/pub/software/IO_Test_Tool/oswbb601.tar root@10.101.5.91:/root





配置监听
destination database


[oracle@node1 admin]$ pwd
/u01/app/oracle/product/11.2.3/db_1/network/admin
[oracle@node1 admin]$ ll
total 4
drwxr-xr-x 2 oracle oinstall  61 May 20 12:39 samples/
-rw-r--r-- 1 oracle oinstall 205 May 11  2011 shrept.lst
[oracle@node1 admin]$
[oracle@node1 admin]$
[oracle@node1 admin]$ netca

Oracle Net Services Configuration:
Default local naming configuration complete.
    Created net service name: mydb1
Default local naming configuration complete.
    Created net service name: dupdb
Oracle Net Services configuration successful. The exit code is 0
[oracle@node1 admin]$ ll
total 8
drwxr-xr-x 2 oracle oinstall  61 May 20 12:39 samples/
-rw-r--r-- 1 oracle oinstall 205 May 11  2011 shrept.lst
-rw-r--r-- 1 oracle oinstall 508 May 20 13:44 tnsnames.ora
[oracle@node1 admin]$ more tnsnames.ora
# tnsnames.ora Network Configuration File: /u01/app/oracle/product/11.2.3/db_1/n
etwork/admin/tnsnames.ora
# Generated by Oracle configuration tools.

MYDB1 =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 10.101.0.17)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = mydb1)
    )
  )

DUPDB =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 10.101.5.91)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = dupdb)
    )
  )

[oracle@node1 admin]$

auxiliary instance必须配置成静态监听
[oracle@node1 admin]$ ll
total 8
drwxr-xr-x 2 oracle oinstall  61 May 20 12:39 samples/
-rw-r--r-- 1 oracle oinstall 205 May 11  2011 shrept.lst
-rw-r--r-- 1 oracle oinstall 508 May 20 13:44 tnsnames.ora
[oracle@node1 admin]$ lsnrctl status

LSNRCTL for Linux: Version 11.2.0.3.0 - Production on 20-MAY-2014 14:17:44

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

Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
TNS-12541: TNS:no listener
 TNS-12560: TNS:protocol adapter error
  TNS-00511: No listener
   Linux Error: 111: Connection refused
[oracle@node1 admin]$

[oracle@node1 admin]$ netca

Oracle Net Services Configuration:
Configuring Listener:LISTENER
Listener configuration complete.
Oracle Net Listener Startup:
    Running Listener Control:
      /u01/app/oracle/product/11.2.3/db_1/bin/lsnrctl start LISTENER
    Listener Control complete.
    Listener started successfully.
Oracle Net Services configuration successful. The exit code is 0
[oracle@node1 admin]$
[oracle@node1 admin]$
[oracle@node1 admin]$
[oracle@node1 admin]$
[oracle@node1 admin]$
[oracle@node1 admin]$ ll
total 16
-rw-r--r-- 1 oracle oinstall 375 May 20 14:18 listener.ora
drwxr-xr-x 2 oracle oinstall  61 May 20 12:39 samples/
-rw-r--r-- 1 oracle oinstall 205 May 11  2011 shrept.lst
-rw-r--r-- 1 oracle oinstall 508 May 20 14:18 tnsnames1405202PM1810.bak
-rw-r--r-- 1 oracle oinstall 508 May 20 13:44 tnsnames.ora
[oracle@node1 admin]$ more listener.ora
# listener.ora Network Configuration File: /u01/app/oracle/product/11.2.3/db_1/n
etwork/admin/listener.ora
# Generated by Oracle configuration tools.

LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = node1.momo.org)(PORT = 1521))
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
    )
  )

ADR_BASE_LISTENER = /u01/app/oracle

[oracle@node1 admin]$


修改一下

添加

SID_LIST_listener=
(SID_LIST=
 (SID_DESC=
  (SID_NAME=dupdb)
  (ORACLE_HOME=/u01/app/oracle/product/11.2.3/db_1)
  )
 )

[oracle@node1 admin]$ more listener.ora
# listener.ora Network Configuration File: /u01/app/oracle/product/11.2.3/db_1/n
etwork/admin/listener.ora
# Generated by Oracle configuration tools.

LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = node1.momo.org)(PORT = 1521))
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
    )
  )


SID_LIST_listener=
(SID_LIST=
 (SID_DESC=
  (SID_NAME=dupdb)
  (ORACLE_HOME=/u01/app/oracle/product/11.2.3/db_1)
  )
 )

ADR_BASE_LISTENER = /u01/app/oracle

[oracle@node1 admin]$







测试一下是不是正常登陆 

[oracle@node1 admin]$ sqlplus sys/111111@mydb1 as sysdba

SQL*Plus: Release 11.2.0.3.0 Production on Tue May 20 13:45:08 2014

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


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL>

[oracle@node1 admin]$ sqlplus sys/111111@dupdb as sysdba

SQL*Plus: Release 11.2.0.3.0 Production on Tue May 20 14:28:27 2014

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


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL>





auxiliary instance创建pfile

echo "DB_NAME=dupdb" >> $ORACLE_HOME/dbs/initMYDB1.ora

echo "DB_NAME=dupdb" >> $ORACLE_HOME/dbs/initDUPDB.ora

[oracle@node1 admin]$ pwd
/u01/app/oracle/product/11.2.3/db_1/network/admin
[oracle@node1 admin]$ cd ../../dbs/
[oracle@node1 dbs]$ ll
total 4
-rw-r--r-- 1 oracle oinstall 2851 May 15  2009 init.ora
[oracle@node1 dbs]$ echo "DB_NAME=dupdb" >> $ORACLE_HOME/dbs/initDUPDB.ora
[oracle@node1 dbs]$


Auxiliary Instance创建Password File


[oracle@node1 dbs]$ pwd
/u01/app/oracle/product/11.2.3/db_1/dbs
[oracle@node1 dbs]$ ll
total 8
-rw-r--r-- 1 oracle oinstall   14 May 20 13:46 initDUPDB.ora
-rw-r--r-- 1 oracle oinstall 2851 May 15  2009 init.ora
[oracle@node1 dbs]$ orap
orapipe  orapki   orapwd   orapwdO
[oracle@node1 dbs]$ orapwd file=?/dbs/orapwdupdb password=111111
[oracle@node1 dbs]$ ll
total 12
-rw-r--r-- 1 oracle oinstall   14 May 20 13:46 initDUPDB.ora
-rw-r--r-- 1 oracle oinstall 2851 May 15  2009 init.ora
-rw-r----- 1 oracle oinstall 1536 May 20 13:47 orapwdupdb
[oracle@node1 dbs]$




start the auxiliary instance 

sqlplus 到 nomount状态

[oracle@node1 dbs]$
[oracle@node1 dbs]$ sqlplus  / as sysdba

SQL*Plus: Release 11.2.0.3.0 Production on Tue May 20 13:49:14 2014

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

Connected to an idle instance.

SQL> startup nomount pfile=?/dbs/initDUPDB.ora
ORACLE instance started.

Total System Global Area  238034944 bytes
Fixed Size                  2227136 bytes
Variable Size             180356160 bytes
Database Buffers           50331648 bytes
Redo Buffers                5120000 bytes
SQL>




start RMAN and connect to the target and auxiliary instances

rman


先启动oswbb




检查source库
SELECT FILE#,NAME FROM V$DATAFILE;
    FILE# NAME                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            
---------- ----------------------------------------------------------
         1 /u02/oradata/mydb1/system01.dbf                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   
         2 /u02/oradata/mydb1/sysaux01.dbf                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   
         3 /u02/oradata/mydb1/undotbs101.dbf                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 
         4 /u02/oradata/mydb1/users01.dbf                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    
         7 /U02/ORADATA/MYDB1/ZABBIX101.DBF                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
         8 /u02/oradata/mydb1/hyperic0101.dbf   



开始duplicate

SID:   dupdb
数据文件   /u01/data/oradata/dupdb
redolog   /u01/data/onlinelog/dupdb
flash        /u01/data/flash_recover_area


rman target sys/111111@mydb1 auxiliary sys/111111@dupdb 

RUN
{
  SET NEWNAME FOR DATABASE TO '/udata/mydb1/%b'; 
  DUPLICATE TARGET DATABASE  TO dupbd
  from active database
    LOGFILE
      GROUP 1 ('/ulog/mydb1/redo01a.log', 
               '/ulog/mydb1/redo01b.log',
  '/ulog/mydb1/redo01c.log',
  '/ulog/mydb1/redo01d.log',
  '/ulog/mydb1/redo01e.log') SIZE 100M REUSE
PASSWORD FILE spfile;
}
  

[oracle@node1 admin]$ rman target sys/111111@mydb1 auxiliary sys/111111@dupdb

Recovery Manager: Release 11.2.0.3.0 - Production on Tue May 20 14:29:21 2014

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

connected to target database: MYDB1 (DBID=1497461080)
connected to auxiliary database: DUPDB (not mounted)

RMAN>

启动oswbba

[root@my2950 oswbb]# ./startOSWbb.sh 10 10
[root@my2950 oswbb]# Setting the archive log directory to/var/ftp/pub/software/IO_Test_Tool/oswbb/archive

Testing for discovery of OS Utilities...
VMSTAT found on your system.
IOSTAT found on your system.
MPSTAT found on your system.
NETSTAT found on your system.
TOP found on your system.

Testing for discovery of OS CPU COUNT
oswbb is looking for the CPU COUNT on your system
CPU COUNT will be used by oswbba to automatically look for cpu problems

CPU COUNT found on your system.
CPU COUNT = 2

Discovery completed.


[root@my2950 oswbb]# 


[root@node1 oswbb]# ./startOSWbb.sh 10 10
[root@node1 oswbb]# Setting the archive log directory to/root/oswbb/archive

Testing for discovery of OS Utilities...
VMSTAT found on your system.
IOSTAT found on your system.
MPSTAT found on your system.
NETSTAT found on your system.
TOP found on your system.

Testing for discovery of OS CPU COUNT
oswbb is looking for the CPU COUNT on your system
CPU COUNT will be used by oswbba to automatically look for cpu problems

CPU COUNT found on your system.
CPU COUNT = 2

Discovery completed.


[root@node1 oswbb]#


开始duplicate

RMAN> RUN
2> {
  SET NEWNAME FOR DATABASE TO '/u01/data/oradata/dupdb/%b';
  DUPLICATE TARGET DATABASE  TO dupdb
  from active database
    LOGFILE
      GROUP 1 ('/u01/data/onlinelog/dupdb/redo01a.log',
               '/u01/data/onlinelog/dupdb/redo01b.log',
   '/u01/data/onlinelog/dupdb/redo01c.log',
   '/u01/data/onlinelog/dupdb/redo01d.log',
   '/u01/data/onlinelog/dupdb/redo01e.log') SIZE 100M REUSE
PASSWORD FILE spfile
set db_recovery_file_dest 'location=/u01/data/flash_recover_area';
14> }

executing command: SET NEWNAME

Starting Duplicate Db at 20-MAY-2014 14:33:11
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of Duplicate Db command at 05/20/2014 14:33:11
RMAN-05501: aborting duplication of target database
RMAN-05557: Target instance not started with server parameter file

RMAN>


去source端看看

SQL> show parameter pfile

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
spfile                               string
SQL> create spfile from pfile;

File created.

SQL> host ll ?/dbs
/bin/bash: ll: command not found

SQL> host ls -l ?/dbs
ls: cannot access ?/dbs: No such file or directory

SQL> 
SQL> 
SQL> host ls -l $ORACLE_HOME/dbs
total 18468
drwxr-xr-x 2 oracle dba      137 May 16 10:43 bak
-rw-r----- 1 oracle dba 18890752 May 20 14:34 control02.ctl
-rw-rw---- 1 oracle dba     1544 May 16 10:50 hc_mydb1.dat
lrwxrwxrwx 1 oracle dba       22 May 16 10:44 initmydb1.ora -> initmydb1.ora.20140516
-rw-r--r-- 1 oracle dba     2315 May 16 10:45 initmydb1.ora.20140516
-rw-r----- 1 oracle dba       24 May 15 17:29 lkMYDB1
-rw-r----- 1 oracle dba     2560 May 15 17:27 orapwmydb1
-rw-r----- 1 oracle dba     2560 May 20 14:34 spfilemydb1.ora

SQL> 


SQL> show parameter pfile

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
spfile                               string
SQL> create spfile from pfile;

File created.

SQL> 
SQL> 
SQL> host ls -l $ORACLE_HOME/dbs
total 18468
drwxr-xr-x 2 oracle dba      137 May 16 10:43 bak
-rw-r----- 1 oracle dba 18890752 May 20 14:34 control02.ctl
-rw-rw---- 1 oracle dba     1544 May 16 10:50 hc_mydb1.dat
lrwxrwxrwx 1 oracle dba       22 May 16 10:44 initmydb1.ora -> initmydb1.ora.20140516
-rw-r--r-- 1 oracle dba     2315 May 16 10:45 initmydb1.ora.20140516
-rw-r----- 1 oracle dba       24 May 15 17:29 lkMYDB1
-rw-r----- 1 oracle dba     2560 May 15 17:27 orapwmydb1
-rw-r----- 1 oracle dba     2560 May 20 14:34 spfilemydb1.ora

SQL> 
SQL> 
SQL> startup force;
ORACLE instance started.

Total System Global Area  521936896 bytes
Fixed Size                  2229944 bytes
Variable Size             159385928 bytes
Database Buffers          352321536 bytes
Redo Buffers                7999488 bytes
Database mounted.
Database opened.
SQL> 
SQL> show parameter pfile

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
spfile                               string      /u01/app/oracle/product/11.2.3
                                                 /db_1/dbs/spfilemydb1.ora
SQL> 


再来一次

[oracle@node1 admin]$ rman target sys/234561@mydb1 auxiliary sys/234561@dupdb

Recovery Manager: Release 11.2.0.3.0 - Production on Tue May 20 14:36:35 2014

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

connected to target database: MYDB1 (DBID=1497461080)
connected to auxiliary database: DUPDB (not mounted)

RMAN>

RMAN> RUN
2> {
  SET NEWNAME FOR DATABASE TO '/u01/data/oradata/dupdb/%b';
  DUPLICATE TARGET DATABASE  TO dupdb
  from active database
    LOGFILE
      GROUP 1 ('/u01/data/onlinelog/dupdb/redo01a.log',
               '/u01/data/onlinelog/dupdb/redo01b.log',
   '/u01/data/onlinelog/dupdb/redo01c.log',
   '/u01/data/onlinelog/dupdb/redo01d.log',
   '/u01/data/onlinelog/dupdb/redo01e.log') SIZE 100M REUSE
PASSWORD FILE spfile
set db_recovery_file_dest 'location=/u01/data/flash_recover_area';
14> }

executing command: SET NEWNAME

Starting Duplicate Db at 20-MAY-2014 14:36:39
using target database control file instead of recovery catalog
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=111 device type=DISK

contents of Memory Script:
{
   backup as copy reuse
   targetfile  '/u01/app/oracle/product/11.2.3/db_1/dbs/orapwmydb1' auxiliary fo                                                                                                 rmat
 '/u01/app/oracle/product/11.2.3/db_1/dbs/orapwdupdb'   targetfile
 '/u01/app/oracle/product/11.2.3/db_1/dbs/spfilemydb1.ora' auxiliary format
 '/u01/app/oracle/product/11.2.3/db_1/dbs/spfiledupdb.ora'   ;
   sql clone "alter system set spfile= ''/u01/app/oracle/product/11.2.3/db_1/dbs                                                                                                 /spfiledupdb.ora''";
}
executing Memory Script

Starting backup at 20-MAY-2014 14:36:40
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=24 device type=DISK
RMAN-03009: failure of backup command on ORA_DISK_1 channel at 05/20/2014 14:36:                                                                                                 41
ORA-17629: Cannot connect to the remote database server
ORA-17627: ORA-12154: TNS:could not resolve the connect identifier specified
ORA-17629: Cannot connect to the remote database server
continuing other job steps, job failed will not be re-run
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of Duplicate Db command at 05/20/2014 14:36:42
RMAN-05501: aborting duplication of target database
RMAN-03015: error occurred in stored script Memory Script
RMAN-03009: failure of backup command on ORA_DISK_1 channel at 05/20/2014 14:36:                                                                                                 42
ORA-17629: Cannot connect to the remote database server
ORA-17627: ORA-12154: TNS:could not resolve the connect identifier specified
ORA-17629: Cannot connect to the remote database server

RMAN>


故意没有配置source端的tns服务

检查一下


[oracle@my2950 admin]$ pwd
/u01/app/oracle/product/11.2.3/db_1/network/admin
[oracle@my2950 admin]$ more tnsnames.ora 
# tnsnames.ora Network Configuration File: /u01/app/oracle/product/11.2.3/db_1/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.

MYDB1 =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 127.0.0.1)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = mydb1)
    )
  )

[oracle@my2950 admin]$ 
[oracle@my2950 admin]$ vi tnsnames.ora 
[oracle@my2950 admin]$ 

# tnsnames.ora Network Configuration File: /u01/app/oracle/product/11.2.3/db_1/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.

MYDB1 =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 127.0.0.1)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = mydb1)
    )
  )


DUPDB =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 10.101.5.91)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = dupdb)
    )
  )

同时也测试一下联通

[oracle@my2950 ~]$ sqlplus sys/111111@dupdb as sysdba

SQL*Plus: Release 11.2.0.3.0 Production on Tue May 20 14:40:46 2014

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


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@my2950 ~]$ sqlplus sys/111111@mydb1 as sysdba     

SQL*Plus: Release 11.2.0.3.0 Production on Tue May 20 14:40:53 2014

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


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@my2950 ~]$ 



退出rman,重新执行

RMAN> RUN
{
  SET NEWNAME FOR DATABASE TO '/u01/data/oradata/dupdb/%b';
  DUPLICATE TARGET DATABASE  TO dupdb
  from active database
    LOGFILE
      GROUP 1 ('/u01/data/onlinelog/dupdb/redo01a.log',
               '/u01/data/onlinelog/dupdb/redo01b.log',
   '/u01/data/onlinelog/dupdb/redo01c.log',
   '/u01/data/onlinelog/dupdb/redo01d.log',
   '/u01/data/onlinelog/dupdb/redo01e.log') SIZE 100M REUSE
PASSWORD FILE spfile
set db_recovery_file_dest 'location=/u01/data/flash_recover_area';
14> }

executing command: SET NEWNAME

Starting Duplicate Db at 20-MAY-2014 14:41:39
using target database control file instead of recovery catalog
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=102 device type=DISK

contents of Memory Script:
{
   backup as copy reuse
   targetfile  '/u01/app/oracle/product/11.2.3/db_1/dbs/orapwmydb1' auxiliary format
 '/u01/app/oracle/product/11.2.3/db_1/dbs/orapwdupdb'   targetfile
 '/u01/app/oracle/product/11.2.3/db_1/dbs/spfilemydb1.ora' auxiliary format
 '/u01/app/oracle/product/11.2.3/db_1/dbs/spfiledupdb.ora'   ;
   sql clone "alter system set spfile= ''/u01/app/oracle/product/11.2.3/db_1/dbs/spfiledupdb.ora''";
}
executing Memory Script

Starting backup at 20-MAY-2014 14:41:40
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=156 device type=DISK
Finished backup at 20-MAY-2014 14:41:43

sql statement: alter system set spfile= ''/u01/app/oracle/product/11.2.3/db_1/dbs/spfiledupdb.ora''

contents of Memory Script:
{
   sql clone "alter system set  db_name =
 ''DUPDB'' comment=
 ''duplicate'' scope=spfile";
   sql clone "alter system set  db_recovery_file_dest =
 ''location=/u01/data/flash_recover_area'' comment=
 '''' scope=spfile";
   shutdown clone immediate;
   startup clone nomount;
}
executing Memory Script

sql statement: alter system set  db_name =  ''DUPDB'' comment= ''duplicate'' scope=spfile

sql statement: alter system set  db_recovery_file_dest =  ''location=/u01/data/flash_recover_area'' comment= '''' scope=spfile

Oracle instance shut down

connected to auxiliary database (not started)
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of Duplicate Db command at 05/20/2014 14:41:48
RMAN-05501: aborting duplication of target database
RMAN-03015: error occurred in stored script Memory Script
RMAN-04014: startup failed: ORA-01261: Parameter db_create_file_dest destination string cannot be translated
ORA-01262: Stat failed on a file destination directory
Linux-x86_64 Error: 2: No such file or directory

RMAN>


继续

RMAN> RUN
{
  SET NEWNAME FOR DATABASE TO '/u01/data/oradata/dupdb/%b';
  DUPLICATE TARGET DATABASE  TO dupdb
  from active database
    LOGFILE
      GROUP 1 ('/u01/data/onlinelog/dupdb/redo01a.log',
               '/u01/data/onlinelog/dupdb/redo01b.log',
   '/u01/data/onlinelog/dupdb/redo01c.log',
   '/u01/data/onlinelog/dupdb/redo01d.log',
   '/u01/data/onlinelog/dupdb/redo01e.log') SIZE 100M REUSE
PASSWORD FILE spfile
set db_recovery_file_dest '/u01/data/flash_recovery_area';
14> }

executing command: SET NEWNAME

Starting Duplicate Db at 20-MAY-2014 14:56:46
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of Duplicate Db command at 05/20/2014 14:56:46
RMAN-05501: aborting duplication of target database
RMAN-06403: could not obtain a fully authorized session
RMAN-04006: error from auxiliary database: ORA-01034: ORACLE not available
ORA-27101: shared memory realm does not exist
Linux-x86_64 Error: 2: No such file or directory

RMAN>


这次干脆,数据库宕啦?检查一下

[oracle@node1 ~]$
[oracle@node1 ~]$ ps -eaf|grep oracle
root      2861  1332  0 12:28 ?        00:00:00 sshd: oracle [priv]
oracle    2866  2861  0 12:28 ?        00:00:00 sshd: oracle@notty
root      6392  1332  0 13:37 ?        00:00:00 sshd: oracle [priv]
oracle    6397  6392  0 13:37 ?        00:00:00 sshd: oracle@pts/2
oracle    6404  6397  0 13:37 pts/2    00:00:00 -bash
oracle    7246     1  0 14:28 ?        00:00:00 /u01/app/oracle/product/11.2.3/db_1/bin/tnslsnr LISTENER -inherit
oracle   10960  6404  0 14:56 pts/2    00:00:00 rlwrap rman target sys/234561@mydb1 auxiliary sys/234561@dupdb
oracle   10961 10960  0 14:56 pts/0    00:00:00 rman target sys/234561@mydb1 auxiliary sys/234561@dupdb
oracle   10966     1  0 14:56 ?        00:00:00 oracledupdb (LOCAL=NO)
root     12501  1332  0 14:57 ?        00:00:00 sshd: oracle [priv]
oracle   12840 12501  0 14:57 ?        00:00:00 sshd: oracle@pts/3
oracle   12892 12840  0 14:57 pts/3    00:00:00 -bash
oracle   13030 12892  0 14:57 pts/3    00:00:00 ps -eaf
oracle   13031 12892  0 14:57 pts/3    00:00:00 grep oracle
[oracle@node1 ~]$
[oracle@node1 ~]$

果然没了,重新启动到nomount'下

[oracle@node1 db_1]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.3.0 Production on Tue May 20 14:59:03 2014

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

Connected to an idle instance.

SQL> startup nomount pfile=?/dbs/initdupdb.ora
LRM-00109: could not open parameter file '/u01/app/oracle/product/11.2.3/db_1/dbs/initdupdb.ora'
ORA-01078: failure in processing system parameters
SQL> startup nomount pfile=?/dbs/initDUPDB.ora
ORACLE instance started.

Total System Global Area  238034944 bytes
Fixed Size                  2227136 bytes
Variable Size             180356160 bytes
Database Buffers           50331648 bytes
Redo Buffers                5120000 bytes
SQL>

继续

有出错

RMAN> RUN
{
  SET NEWNAME FOR DATABASE TO '/u01/data/oradata/dupdb/%b';
  DUPLICATE TARGET DATABASE  TO dupdb
  from active database
    LOGFILE
      GROUP 1 ('/u01/data/onlinelog/dupdb/redo01a.log',
               '/u01/data/onlinelog/dupdb/redo01b.log',
   '/u01/data/onlinelog/dupdb/redo01c.log',
   '/u01/data/onlinelog/dupdb/redo01d.log',
   '/u01/data/onlinelog/dupdb/redo01e.log') SIZE 100M REUSE
PASSWORD FILE spfile
set db_recovery_file_dest '/u01/data/flash_recovery_area/';
14> }

executing command: SET NEWNAME

Starting Duplicate Db at 20-MAY-2014 15:02:03
using target database control file instead of recovery catalog
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=10 device type=DISK

contents of Memory Script:
{
   backup as copy reuse
   targetfile  '/u01/app/oracle/product/11.2.3/db_1/dbs/orapwmydb1' auxiliary format
 '/u01/app/oracle/product/11.2.3/db_1/dbs/orapwdupdb'   targetfile
 '/u01/app/oracle/product/11.2.3/db_1/dbs/spfilemydb1.ora' auxiliary format
 '/u01/app/oracle/product/11.2.3/db_1/dbs/spfiledupdb.ora'   ;
   sql clone "alter system set spfile= ''/u01/app/oracle/product/11.2.3/db_1/dbs/spfiledupdb.ora''";
}
executing Memory Script

Starting backup at 20-MAY-2014 15:02:04
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=156 device type=DISK
Finished backup at 20-MAY-2014 15:02:06

sql statement: alter system set spfile= ''/u01/app/oracle/product/11.2.3/db_1/dbs/spfiledupdb.ora''

contents of Memory Script:
{
   sql clone "alter system set  db_name =
 ''DUPDB'' comment=
 ''duplicate'' scope=spfile";
   sql clone "alter system set  db_recovery_file_dest =
 ''/u01/data/flash_recovery_area/'' comment=
 '''' scope=spfile";
   shutdown clone immediate;
   startup clone nomount;
}
executing Memory Script

sql statement: alter system set  db_name =  ''DUPDB'' comment= ''duplicate'' scope=spfile

sql statement: alter system set  db_recovery_file_dest =  ''/u01/data/flash_recovery_area/'' comment= '''' scope=spfile

Oracle instance shut down

connected to auxiliary database (not started)
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of Duplicate Db command at 05/20/2014 15:02:13
RMAN-05501: aborting duplication of target database
RMAN-03015: error occurred in stored script Memory Script
RMAN-04014: startup failed: ORA-01261: Parameter db_create_file_dest destination string cannot be translated
ORA-01262: Stat failed on a file destination directory
Linux-x86_64 Error: 2: No such file or directory

RMAN>


修改脚本加一条



又出错

RMAN> RUN
2> {
3>   SET NEWNAME FOR DATABASE TO '/u01/data/oradata/dupdb/%b';
  DUPLICATE TARGET DATABASE  TO dupdb
  from active database
    LOGFILE
      GROUP 1 ('/u01/data/onlinelog/dupdb/redo01a.log',
               '/u01/data/onlinelog/dupdb/redo01b.log',
   '/u01/data/onlinelog/dupdb/redo01c.log',
   '/u01/data/onlinelog/dupdb/redo01d.log',
   '/u01/data/onlinelog/dupdb/redo01e.log') SIZE 100M REUSE
PASSWORD FILE spfile
set db_recovery_file_dest '/u01/data/flash_recovery_area/'
set db_create_file_dest '/u01/data/oradata/dupdb/';
15> }

executing command: SET NEWNAME

Starting Duplicate Db at 20-MAY-2014 15:04:44
using target database control file instead of recovery catalog
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=10 device type=DISK

contents of Memory Script:
{
   backup as copy reuse
   targetfile  '/u01/app/oracle/product/11.2.3/db_1/dbs/orapwmydb1' auxiliary format
 '/u01/app/oracle/product/11.2.3/db_1/dbs/orapwdupdb'   targetfile
 '/u01/app/oracle/product/11.2.3/db_1/dbs/spfilemydb1.ora' auxiliary format
 '/u01/app/oracle/product/11.2.3/db_1/dbs/spfiledupdb.ora'   ;
   sql clone "alter system set spfile= ''/u01/app/oracle/product/11.2.3/db_1/dbs/spfiledupdb.ora''";
}
executing Memory Script

Starting backup at 20-MAY-2014 15:04:44
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=31 device type=DISK
Finished backup at 20-MAY-2014 15:04:47

sql statement: alter system set spfile= ''/u01/app/oracle/product/11.2.3/db_1/dbs/spfiledupdb.ora''

contents of Memory Script:
{
   sql clone "alter system set  db_name =
 ''DUPDB'' comment=
 ''duplicate'' scope=spfile";
   sql clone "alter system set  db_recovery_file_dest =
 ''/u01/data/flash_recovery_area/'' comment=
 '''' scope=spfile";
   sql clone "alter system set  db_create_file_dest =
 ''/u01/data/oradata/dupdb/'' comment=
 '''' scope=spfile";
   shutdown clone immediate;
   startup clone nomount;
}
executing Memory Script

sql statement: alter system set  db_name =  ''DUPDB'' comment= ''duplicate'' scope=spfile

sql statement: alter system set  db_recovery_file_dest =  ''/u01/data/flash_recovery_area/'' comment= '''' scope=spfile

sql statement: alter system set  db_create_file_dest =  ''/u01/data/oradata/dupdb/'' comment= '''' scope=spfile

Oracle instance shut down

connected to auxiliary database (not started)
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of Duplicate Db command at 05/20/2014 15:05:01
RMAN-05501: aborting duplication of target database
RMAN-03015: error occurred in stored script Memory Script
RMAN-04014: startup failed: ORA-09925: Unable to create audit trail file
Linux-x86_64 Error: 2: No such file or directory
Additional information: 9925

RMAN>

ls -l 
/u01/app/oracle/admin/mydb1/adump
mkdir -p /u01/app/oracle/admin/mydb1/adump

[oracle@node1 db_1]$ ls -l /u01/app/oracle/admin/mydb1/adump
ls: cannot access /u01/app/oracle/admin/mydb1/adump: No such file or directory
[oracle@node1 db_1]$ mkdir -p /u01/app/oracle/admin/mydb1/adump

继续

15:11开始


RMAN> RUN
2> {
  SET NEWNAME FOR DATABASE TO '/u01/data/oradata/dupdb/%b';
  DUPLICATE TARGET DATABASE  TO dupdb
  from active database
    LOGFILE
      GROUP 1 ('/u01/data/onlinelog/dupdb/redo01a.log',
               '/u01/data/onlinelog/dupdb/redo01b.log',
   '/u01/data/onlinelog/dupdb/redo01c.log',
   '/u01/data/onlinelog/dupdb/redo01d.log',
   '/u01/data/onlinelog/dupdb/redo01e.log') SIZE 100M REUSE
PASSWORD FILE spfile
set AUDIT_FILE_DEST '/u01/app/oracle/admin/mydb1/adump/'
set db_recovery_file_dest '/u01/data/flash_recovery_area/'
set db_create_file_dest '/u01/data/oradata/dupdb/';
16> }

executing command: SET NEWNAME

Starting Duplicate Db at 20-MAY-2014 15:10:56
using target database control file instead of recovery catalog
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=10 device type=DISK

contents of Memory Script:
{
   backup as copy reuse
   targetfile  '/u01/app/oracle/product/11.2.3/db_1/dbs/orapwmydb1' auxiliary format
 '/u01/app/oracle/product/11.2.3/db_1/dbs/orapwdupdb'   targetfile
 '/u01/app/oracle/product/11.2.3/db_1/dbs/spfilemydb1.ora' auxiliary format
 '/u01/app/oracle/product/11.2.3/db_1/dbs/spfiledupdb.ora'   ;
   sql clone "alter system set spfile= ''/u01/app/oracle/product/11.2.3/db_1/dbs/spfiledupdb.ora''";
}
executing Memory Script

Starting backup at 20-MAY-2014 15:10:57
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=161 device type=DISK
Finished backup at 20-MAY-2014 15:10:59

sql statement: alter system set spfile= ''/u01/app/oracle/product/11.2.3/db_1/dbs/spfiledupdb.ora''

contents of Memory Script:
{
   sql clone "alter system set  db_name =
 ''DUPDB'' comment=
 ''duplicate'' scope=spfile";
   sql clone "alter system set  AUDIT_FILE_DEST =
 ''/u01/app/oracle/admin/mydb1/adump/'' comment=
 '''' scope=spfile";
   sql clone "alter system set  db_recovery_file_dest =
 ''/u01/data/flash_recovery_area/'' comment=
 '''' scope=spfile";
   sql clone "alter system set  db_create_file_dest =
 ''/u01/data/oradata/dupdb/'' comment=
 '''' scope=spfile";
   shutdown clone immediate;
   startup clone nomount;
}
executing Memory Script


sql statement: alter system set  db_name =  ''DUPDB'' comment= ''duplicate'' scope=spfile

sql statement: alter system set  AUDIT_FILE_DEST =  ''/u01/app/oracle/admin/mydb1/adump/'' comment= '''' scope=spfile

sql statement: alter system set  db_recovery_file_dest =  ''/u01/data/flash_recovery_area/'' comment= '''' scope=spfile

sql statement: alter system set  db_create_file_dest =  ''/u01/data/oradata/dupdb/'' comment= '''' scope=spfile

Oracle instance shut down

connected to auxiliary database (not started)
Oracle instance started

Total System Global Area     521936896 bytes

Fixed Size                     2229944 bytes
Variable Size                159385928 bytes
Database Buffers             352321536 bytes
Redo Buffers                   7999488 bytes

contents of Memory Script:
{
   sql clone "alter system set  db_name =
 ''MYDB1'' comment=
 ''Modified by RMAN duplicate'' scope=spfile";
   sql clone "alter system set  db_unique_name =
 ''DUPDB'' comment=
 ''Modified by RMAN duplicate'' scope=spfile";
   shutdown clone immediate;
   startup clone force nomount
   backup as copy current controlfile auxiliary format  '/u02/oradata/mydb1/control01.ctl';
   restore clone controlfile to  '/u01/app/oracle/product/11.2.3/db_1/dbs/control02.ctl' from
 '/u02/oradata/mydb1/control01.ctl';
   alter clone database mount;
}
executing Memory Script

sql statement: alter system set  db_name =  ''MYDB1'' comment= ''Modified by RMAN duplicate'' scope=spfile

sql statement: alter system set  db_unique_name =  ''DUPDB'' comment= ''Modified by RMAN duplicate'' scope=spfile

Oracle instance shut down

Oracle instance started

Total System Global Area     521936896 bytes

Fixed Size                     2229944 bytes
Variable Size                159385928 bytes
Database Buffers             352321536 bytes
Redo Buffers                   7999488 bytes

Starting backup at 20-MAY-2014 15:11:16
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile copy
copying current control file
Oracle instance started

Total System Global Area     521936896 bytes

Fixed Size                     2229944 bytes
Variable Size                159385928 bytes
Database Buffers             352321536 bytes
Redo Buffers                   7999488 bytes

contents of Memory Script:
{
   sql clone "alter system set  db_name =
 ''DUPDB'' comment=
 ''Reset to original value by RMAN'' scope=spfile";
   sql clone "alter system reset  db_unique_name scope=spfile";
   shutdown clone immediate;
}
executing Memory Script

sql statement: alter system set  db_name =  ''DUPDB'' comment= ''Reset to original value by RMAN'' scope=spfile

sql statement: alter system reset  db_unique_name scope=spfile

Oracle instance shut down
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of Duplicate Db command at 05/20/2014 15:11:27
RMAN-05501: aborting duplication of target database
RMAN-03015: error occurred in stored script Memory Script
RMAN-03009: failure of backup command on ORA_DISK_1 channel at 05/20/2014 15:11:19
ORA-17628: Oracle error 19505 returned by remote Oracle server

RMAN>


12就报错......
RMAN> RUN
{
  SET NEWNAME FOR DATABASE TO '/u01/data/oradata/dupdb/%b';
  DUPLICATE TARGET DATABASE  TO dupdb
  from active database
    LOGFILE
      GROUP 1 ('/u01/data/onlinelog/dupdb/redo01a.log',
               '/u01/data/onlinelog/dupdb/redo01b.log',
   '/u01/data/onlinelog/dupdb/redo01c.log',
   '/u01/data/onlinelog/dupdb/redo01d.log',
   '/u01/data/onlinelog/dupdb/redo01e.log') SIZE 100M REUSE
PASSWORD FILE spfile
set AUDIT_FILE_DEST '/u01/app/oracle/admin/mydb1/adump/'
set db_recovery_file_dest '/u01/data/flash_recovery_area/'
set db_create_file_dest '/u01/data/oradata/dupdb/';
16> }

executing command: SET NEWNAME

Starting Duplicate Db at 20-MAY-2014 15:26:22
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of Duplicate Db command at 05/20/2014 15:26:22
RMAN-05501: aborting duplication of target database
RMAN-05537: DUPLICATE without TARGET connection when auxiliary instance is started with spfile cannot use SPFILE clause

RMAN>


娘希匹的


怀疑还是路径问题

source端检查一下

SQL> show parameter control

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
control_file_record_keep_time        integer     7
control_files                        string      /u02/oradata/mydb1/control01.c
                                                 tl, /u01/app/oracle/product/11
                                                 .2.3/db_1/dbs/control02.ctl
control_management_pack_access       string      DIAGNOSTIC+TUNING
SQL> 

duplicate脚本再添加一行

set control_files '/u01/data/oradata/dupdb/control01.ctl'


又出错...

RMAN> RUN
2> {
  SET NEWNAME FOR DATABASE TO '/u01/data/oradata/dupdb/%b';
  DUPLICATE TARGET DATABASE  TO 'dupdb'
  from active database
    LOGFILE
      GROUP 1 ('/u01/data/onlinelog/dupdb/redo01a.log',
               '/u01/data/onlinelog/dupdb/redo01b.log',
   '/u01/data/onlinelog/dupdb/redo01c.log',
   '/u01/data/onlinelog/dupdb/redo01d.log',
   '/u01/data/onlinelog/dupdb/redo01e.log') SIZE 100M REUSE
PASSWORD FILE spfile
set AUDIT_FILE_DEST '/u01/app/oracle/admin/mydb1/adump/'
set control_files '/u01/data/oradata/dupdb/control01.ctl'
set db_recovery_file_dest '/u01/data/flash_recovery_area/'
set db_create_file_dest '/u01/data/oradata/dupdb/';
17> }

executing command: SET NEWNAME

Starting Duplicate Db at 20-MAY-2014 15:42:24
using target database control file instead of recovery catalog
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=10 device type=DISK

contents of Memory Script:
{
   backup as copy reuse
   targetfile  '/u01/app/oracle/product/11.2.3/db_1/dbs/orapwmydb1' auxiliary format
 '/u01/app/oracle/product/11.2.3/db_1/dbs/orapwdupdb'   targetfile
 '/u01/app/oracle/product/11.2.3/db_1/dbs/spfilemydb1.ora' auxiliary format
 '/u01/app/oracle/product/11.2.3/db_1/dbs/spfiledupdb.ora'   ;
   sql clone "alter system set spfile= ''/u01/app/oracle/product/11.2.3/db_1/dbs/spfiledupdb.ora''";
}
executing Memory Script

Starting backup at 20-MAY-2014 15:42:24
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=24 device type=DISK
Finished backup at 20-MAY-2014 15:42:27

sql statement: alter system set spfile= ''/u01/app/oracle/product/11.2.3/db_1/dbs/spfiledupdb.ora''

contents of Memory Script:
{
   sql clone "alter system set  db_name =
 ''DUPDB'' comment=
 ''duplicate'' scope=spfile";
   sql clone "alter system set  AUDIT_FILE_DEST =
 ''/u01/app/oracle/admin/mydb1/adump/'' comment=
 '''' scope=spfile";
   sql clone "alter system set  control_files =
 ''/u01/data/oradata/dupdb/control01.ctl'' comment=
 '''' scope=spfile";
   sql clone "alter system set  db_recovery_file_dest =
 ''/u01/data/flash_recovery_area/'' comment=
 '''' scope=spfile";
   sql clone "alter system set  db_create_file_dest =
 ''/u01/data/oradata/dupdb/'' comment=
 '''' scope=spfile";
   shutdown clone immediate;
   startup clone nomount;
}
executing Memory Script

sql statement: alter system set  db_name =  ''DUPDB'' comment= ''duplicate'' scope=spfile

sql statement: alter system set  AUDIT_FILE_DEST =  ''/u01/app/oracle/admin/mydb1/adump/'' comment= '''' scope=spfile

sql statement: alter system set  control_files =  ''/u01/data/oradata/dupdb/control01.ctl'' comment= '''' scope=spfile

sql statement: alter system set  db_recovery_file_dest =  ''/u01/data/flash_recovery_area/'' comment= '''' scope=spfile

sql statement: alter system set  db_create_file_dest =  ''/u01/data/oradata/dupdb/'' comment= '''' scope=spfile

Oracle instance shut down

connected to auxiliary database (not started)
Oracle instance started

Total System Global Area     521936896 bytes

Fixed Size                     2229944 bytes
Variable Size                159385928 bytes
Database Buffers             352321536 bytes
Redo Buffers                   7999488 bytes

contents of Memory Script:
{
   sql clone "alter system set  db_name =
 ''MYDB1'' comment=
 ''Modified by RMAN duplicate'' scope=spfile";
   sql clone "alter system set  db_unique_name =
 ''DUPDB'' comment=
 ''Modified by RMAN duplicate'' scope=spfile";
   shutdown clone immediate;
   startup clone force nomount
   backup as copy current controlfile auxiliary format  '/u01/data/oradata/dupdb/control01.ctl';
   alter clone database mount;
}
executing Memory Script

sql statement: alter system set  db_name =  ''MYDB1'' comment= ''Modified by RMAN duplicate'' scope=spfile

sql statement: alter system set  db_unique_name =  ''DUPDB'' comment= ''Modified by RMAN duplicate'' scope=spfile

Oracle instance shut down

Oracle instance started

Total System Global Area     521936896 bytes

Fixed Size                     2229944 bytes
Variable Size                159385928 bytes
Database Buffers             352321536 bytes
Redo Buffers                   7999488 bytes

Starting backup at 20-MAY-2014 15:42:44
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile copy
copying current control file
output file name=/u01/app/oracle/product/11.2.3/db_1/dbs/snapcf_mydb1.f tag=TAG20140520T154241 RECID=21 STAMP=848072563
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:03
Finished backup at 20-MAY-2014 15:42:47

database mounted
Oracle instance started

Total System Global Area     521936896 bytes

Fixed Size                     2229944 bytes
Variable Size                159385928 bytes
Database Buffers             352321536 bytes
Redo Buffers                   7999488 bytes

contents of Memory Script:
{
   sql clone "alter system set  db_name =
 ''DUPDB'' comment=
 ''Reset to original value by RMAN'' scope=spfile";
   sql clone "alter system reset  db_unique_name scope=spfile";
   shutdown clone immediate;
}
executing Memory Script

sql statement: alter system set  db_name =  ''DUPDB'' comment= ''Reset to original value by RMAN'' scope=spfile

sql statement: alter system reset  db_unique_name scope=spfile

Oracle instance shut down
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of Duplicate Db command at 05/20/2014 15:43:01
RMAN-05501: aborting duplication of target database
RMAN-05504: at least two redo log files or groups must be specified for this command

RMAN> quit


Recovery Manager complete.
[oracle@node1 admin]$


再次修改

RUN
{
  SET NEWNAME FOR DATABASE TO '/u01/data/oradata/dupdb/%b'; 
  DUPLICATE TARGET DATABASE  TO 'dupdb'
  from active database
    LOGFILE
      GROUP 1 ('/u01/data/onlinelog/dupdb/redo01a.log') SIZE 100M REUSE, 
      GROUP 2 ('/u01/data/onlinelog/dupdb/redo01b.log') SIZE 100M REUSE,
 GROUP 3 ('/u01/data/onlinelog/dupdb/redo01c.log') SIZE 100M REUSE,
 GROUP 4 ('/u01/data/onlinelog/dupdb/redo01d.log') SIZE 100M REUSE,
 GROUP 5 ('/u01/data/onlinelog/dupdb/redo01e.log') SIZE 100M REUSE
PASSWORD FILE spfile
set AUDIT_FILE_DEST '/u01/app/oracle/admin/mydb1/adump/'
set control_files '/u01/data/oradata/dupdb/control01.ctl'
set db_recovery_file_dest '/u01/data/flash_recovery_area/'
set db_create_file_dest '/u01/data/oradata/dupdb/';
}



RMAN> RUN
{
  SET NEWNAME FOR DATABASE TO '/u01/data/oradata/dupdb/%b';
  DUPLICATE TARGET DATABASE  TO 'dupdb'
  from active database
    LOGFILE
      GROUP 1 ('/u01/data/onlinelog/dupdb/redo01a.log') SIZE 100M REUSE,
      GROUP 2 ('/u01/data/onlinelog/dupdb/redo01b.log') SIZE 100M REUSE,
  GROUP 3 ('/u01/data/onlinelog/dupdb/redo01c.log') SIZE 100M REUSE,
  GROUP 4 ('/u01/data/onlinelog/dupdb/redo01d.log') SIZE 100M REUSE,
  GROUP 5 ('/u01/data/onlinelog/dupdb/redo01e.log') SIZE 100M REUSE
PASSWORD FILE spfile
set AUDIT_FILE_DEST '/u01/app/oracle/admin/mydb1/adump/'
set control_files '/u01/data/oradata/dupdb/control01.ctl'
set db_recovery_file_dest '/u01/data/flash_recovery_area/'
set db_create_file_dest '/u01/data/oradata/dupdb/';
17> }

executing command: SET NEWNAME

Starting Duplicate Db at 20-MAY-2014 15:52:20
using target database control file instead of recovery catalog
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=10 device type=DISK

contents of Memory Script:
{
   backup as copy reuse
   targetfile  '/u01/app/oracle/product/11.2.3/db_1/dbs/orapwmydb1' auxiliary format
 '/u01/app/oracle/product/11.2.3/db_1/dbs/orapwdupdb'   targetfile
 '/u01/app/oracle/product/11.2.3/db_1/dbs/spfilemydb1.ora' auxiliary format
 '/u01/app/oracle/product/11.2.3/db_1/dbs/spfiledupdb.ora'   ;
   sql clone "alter system set spfile= ''/u01/app/oracle/product/11.2.3/db_1/dbs/spfiledupdb.ora''";
}
executing Memory Script

Starting backup at 20-MAY-2014 15:52:21
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=34 device type=DISK
Finished backup at 20-MAY-2014 15:52:23

sql statement: alter system set spfile= ''/u01/app/oracle/product/11.2.3/db_1/dbs/spfiledupdb.ora''

contents of Memory Script:
{
   sql clone "alter system set  db_name =
 ''DUPDB'' comment=
 ''duplicate'' scope=spfile";
   sql clone "alter system set  AUDIT_FILE_DEST =
 ''/u01/app/oracle/admin/mydb1/adump/'' comment=
 '''' scope=spfile";
   sql clone "alter system set  control_files =
 ''/u01/data/oradata/dupdb/control01.ctl'' comment=
 '''' scope=spfile";
   sql clone "alter system set  db_recovery_file_dest =
 ''/u01/data/flash_recovery_area/'' comment=
 '''' scope=spfile";
   sql clone "alter system set  db_create_file_dest =
 ''/u01/data/oradata/dupdb/'' comment=
 '''' scope=spfile";
   shutdown clone immediate;
   startup clone nomount;
}
executing Memory Script

sql statement: alter system set  db_name =  ''DUPDB'' comment= ''duplicate'' scope=spfile

sql statement: alter system set  AUDIT_FILE_DEST =  ''/u01/app/oracle/admin/mydb1/adump/'' comment= '''' scope=spfile

sql statement: alter system set  control_files =  ''/u01/data/oradata/dupdb/control01.ctl'' comment= '''' scope=spfile

sql statement: alter system set  db_recovery_file_dest =  ''/u01/data/flash_recovery_area/'' comment= '''' scope=spfile

sql statement: alter system set  db_create_file_dest =  ''/u01/data/oradata/dupdb/'' comment= '''' scope=spfile

Oracle instance shut down

connected to auxiliary database (not started)
Oracle instance started
Total System Global Area     521936896 bytes

Fixed Size                     2229944 bytes
Variable Size                159385928 bytes
Database Buffers             352321536 bytes
Redo Buffers                   7999488 bytes

contents of Memory Script:
{
   sql clone "alter system set  db_name =
 ''MYDB1'' comment=
 ''Modified by RMAN duplicate'' scope=spfile";
   sql clone "alter system set  db_unique_name =
 ''DUPDB'' comment=
 ''Modified by RMAN duplicate'' scope=spfile";
   shutdown clone immediate;
   startup clone force nomount
   backup as copy current controlfile auxiliary format  '/u01/data/oradata/dupdb/control01.ctl';
   alter clone database mount;
}
executing Memory Script

sql statement: alter system set  db_name =  ''MYDB1'' comment= ''Modified by RMAN duplicate'' scope=spfile

sql statement: alter system set  db_unique_name =  ''DUPDB'' comment= ''Modified by RMAN duplicate'' scope=spfile

Oracle instance shut down

Oracle instance started

Total System Global Area     521936896 bytes

Fixed Size                     2229944 bytes
Variable Size                159385928 bytes
Database Buffers             352321536 bytes
Redo Buffers                   7999488 bytes

Starting backup at 20-MAY-2014 15:52:39
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile copy
copying current control file
output file name=/u01/app/oracle/product/11.2.3/db_1/dbs/snapcf_mydb1.f tag=TAG20140520T155236 RECID=22 STAMP=848073157
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:07
Finished backup at 20-MAY-2014 15:52:46

database mounted

contents of Memory Script:
{
   sql clone 'alter database flashback off';
   set newname for datafile  1 to
 "/u01/data/oradata/dupdb/system01.dbf";
   set newname for datafile  2 to
 "/u01/data/oradata/dupdb/sysaux01.dbf";
   set newname for datafile  3 to
 "/u01/data/oradata/dupdb/undotbs101.dbf";
   set newname for datafile  4 to
 "/u01/data/oradata/dupdb/users01.dbf";
   set newname for datafile  7 to
 "/u01/data/oradata/dupdb/zabbix101.dbf";
   set newname for datafile  8 to
 "/u01/data/oradata/dupdb/hyperic0101.dbf";
   backup as copy reuse
   datafile  1 auxiliary format
 "/u01/data/oradata/dupdb/system01.dbf"   datafile
 2 auxiliary format
 "/u01/data/oradata/dupdb/sysaux01.dbf"   datafile
 3 auxiliary format
 "/u01/data/oradata/dupdb/undotbs101.dbf"   datafile
 4 auxiliary format
 "/u01/data/oradata/dupdb/users01.dbf"   datafile
 7 auxiliary format
 "/u01/data/oradata/dupdb/zabbix101.dbf"   datafile
 8 auxiliary format
 "/u01/data/oradata/dupdb/hyperic0101.dbf"   ;
   sql 'alter system archive log current';
}
executing Memory Script

sql statement: alter database flashback off

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 backup at 20-MAY-2014 15:52:53
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile copy
input datafile file number=00002 name=/u02/oradata/mydb1/sysaux01.dbf


output file name=/u01/data/oradata/dupdb/sysaux01.dbf tag=TAG20140520T155251
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:03:06
channel ORA_DISK_1: starting datafile copy
input datafile file number=00008 name=/u02/oradata/mydb1/hyperic0101.dbf

output file name=/u01/data/oradata/dupdb/hyperic0101.dbf tag=TAG20140520T155251
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:03:25
channel ORA_DISK_1: starting datafile copy
input datafile file number=00001 name=/u02/oradata/mydb1/system01.dbf
output file name=/u01/data/oradata/dupdb/system01.dbf tag=TAG20140520T155251
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:01:15
channel ORA_DISK_1: starting datafile copy
input datafile file number=00007 name=/u02/oradata/mydb1/zabbix101.dbf
output file name=/u01/data/oradata/dupdb/zabbix101.dbf tag=TAG20140520T155251
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:55
channel ORA_DISK_1: starting datafile copy
input datafile file number=00003 name=/u02/oradata/mydb1/undotbs101.dbf
output file name=/u01/data/oradata/dupdb/undotbs101.dbf tag=TAG20140520T155251
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:35
channel ORA_DISK_1: starting datafile copy
input datafile file number=00004 name=/u02/oradata/mydb1/users01.dbf
output file name=/u01/data/oradata/dupdb/users01.dbf tag=TAG20140520T155251
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01
Finished backup at 20-MAY-2014 16:02:12

sql statement: alter system archive log current

contents of Memory Script:
{
   backup as copy reuse
   archivelog like  "/u04/orafra/fast_recovery_area/mydb1/MYDB1/archivelog/2014_05_20/o1_mf_1_112_9qp302j7_.arc" auxiliary format
 "/u01/data/flash_recovery_area/DUPDB/archivelog/2014_05_20/o1_mf_1_112_%u_.arc"   ;
   catalog clone recovery area;
   switch clone datafile all;
}
executing Memory Script

Starting backup at 20-MAY-2014 16:02:14
using channel ORA_DISK_1
channel ORA_DISK_1: starting archived log copy
input archived log thread=1 sequence=112 RECID=684 STAMP=848073731
output file name=/u01/data/flash_recovery_area/DUPDB/archivelog/2014_05_20/o1_mf_1_112_22p8p504_.arc RECID=0 STAMP=0
channel ORA_DISK_1: archived log copy complete, elapsed time: 00:00:07
Finished backup at 20-MAY-2014 16:02:21

searching for all files in the recovery area

List of Files Unknown to the Database
=====================================
File Name: /u01/data/flash_recovery_area/DUPDB/flashback/o1_mf_9qp1vvnt_.flb
File Name: /u01/data/flash_recovery_area/DUPDB/archivelog/2014_05_20/o1_mf_1_112_22p8p504_.arc
cataloging files...
cataloging done

List of Cataloged Files
=======================
File Name: /u01/data/flash_recovery_area/DUPDB/archivelog/2014_05_20/o1_mf_1_112_22p8p504_.arc

List of Files Which Where Not Cataloged
=======================================
File Name: /u01/data/flash_recovery_area/DUPDB/flashback/o1_mf_9qp1vvnt_.flb
  RMAN-07529: Reason: catalog is not supported for this file type

datafile 1 switched to datafile copy
input datafile copy RECID=22 STAMP=848073742 file name=/u01/data/oradata/dupdb/system01.dbf
datafile 2 switched to datafile copy
input datafile copy RECID=23 STAMP=848073742 file name=/u01/data/oradata/dupdb/sysaux01.dbf
datafile 3 switched to datafile copy
input datafile copy RECID=24 STAMP=848073742 file name=/u01/data/oradata/dupdb/undotbs101.dbf
datafile 4 switched to datafile copy
input datafile copy RECID=25 STAMP=848073742 file name=/u01/data/oradata/dupdb/users01.dbf
datafile 7 switched to datafile copy
input datafile copy RECID=26 STAMP=848073742 file name=/u01/data/oradata/dupdb/zabbix101.dbf
datafile 8 switched to datafile copy
input datafile copy RECID=27 STAMP=848073742 file name=/u01/data/oradata/dupdb/hyperic0101.dbf

contents of Memory Script:
{
   set until scn  28113067;
   recover
   clone database
    delete archivelog
   ;
}
executing Memory Script

executing command: SET until clause

Starting recover at 20-MAY-2014 16:02:22
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=133 device type=DISK

starting media recovery

archived log for thread 1 with sequence 112 is already on disk as file /u01/data/flash_recovery_area/DUPDB/archivelog/2014_05_20/o1_mf_1_112_22p8p504_.arc
archived log file name=/u01/data/flash_recovery_area/DUPDB/archivelog/2014_05_20/o1_mf_1_112_22p8p504_.arc thread=1 sequence=112
media recovery complete, elapsed time: 00:00:04
Finished recover at 20-MAY-2014 16:02:28
Oracle instance started

Total System Global Area     521936896 bytes

Fixed Size                     2229944 bytes
Variable Size                159385928 bytes
Database Buffers             352321536 bytes
Redo Buffers                   7999488 bytes

contents of Memory Script:
{
   sql clone "alter system set  db_name =
 ''DUPDB'' comment=
 ''Reset to original value by RMAN'' scope=spfile";
   sql clone "alter system reset  db_unique_name scope=spfile";
   shutdown clone immediate;
   startup clone nomount;
}
executing Memory Script

sql statement: alter system set  db_name =  ''DUPDB'' comment= ''Reset to original value by RMAN'' scope=spfile

sql statement: alter system reset  db_unique_name scope=spfile

Oracle instance shut down

connected to auxiliary database (not started)
Oracle instance started

Total System Global Area     521936896 bytes

Fixed Size                     2229944 bytes
Variable Size                159385928 bytes
Database Buffers             352321536 bytes
Redo Buffers                   7999488 bytes
sql statement: CREATE CONTROLFILE REUSE SET DATABASE "DUPDB" RESETLOGS ARCHIVELOG
  MAXLOGFILES    192
  MAXLOGMEMBERS      3
  MAXDATAFILES     1024
  MAXINSTANCES    32
  MAXLOGHISTORY      292
 LOGFILE
  GROUP   1 ( '/u01/data/onlinelog/dupdb/redo01a.log' ) SIZE 100 M  REUSE,
  GROUP   2 ( '/u01/data/onlinelog/dupdb/redo01b.log' ) SIZE 100 M  REUSE,
  GROUP   3 ( '/u01/data/onlinelog/dupdb/redo01c.log' ) SIZE 100 M  REUSE,
  GROUP   4 ( '/u01/data/onlinelog/dupdb/redo01d.log' ) SIZE 100 M  REUSE,
  GROUP   5 ( '/u01/data/onlinelog/dupdb/redo01e.log' ) SIZE 100 M  REUSE
 DATAFILE
  '/u01/data/oradata/dupdb/system01.dbf'
 CHARACTER SET AL32UTF8


contents of Memory Script:
{
   set newname for tempfile  1 to
 "/u01/data/oradata/dupdb/temp01.dbf";
   switch clone tempfile all;
   catalog clone datafilecopy  "/u01/data/oradata/dupdb/sysaux01.dbf",
 "/u01/data/oradata/dupdb/undotbs101.dbf",
 "/u01/data/oradata/dupdb/users01.dbf",
 "/u01/data/oradata/dupdb/zabbix101.dbf",
 "/u01/data/oradata/dupdb/hyperic0101.dbf";
   switch clone datafile all;
}
executing Memory Script

executing command: SET NEWNAME

renamed tempfile 1 to /u01/data/oradata/dupdb/temp01.dbf in control file

cataloged datafile copy
datafile copy file name=/u01/data/oradata/dupdb/sysaux01.dbf RECID=1 STAMP=848073760
cataloged datafile copy
datafile copy file name=/u01/data/oradata/dupdb/undotbs101.dbf RECID=2 STAMP=848073760
cataloged datafile copy
datafile copy file name=/u01/data/oradata/dupdb/users01.dbf RECID=3 STAMP=848073760
cataloged datafile copy
datafile copy file name=/u01/data/oradata/dupdb/zabbix101.dbf RECID=4 STAMP=848073760
cataloged datafile copy
datafile copy file name=/u01/data/oradata/dupdb/hyperic0101.dbf RECID=5 STAMP=848073760

datafile 2 switched to datafile copy
input datafile copy RECID=1 STAMP=848073760 file name=/u01/data/oradata/dupdb/sysaux01.dbf
datafile 3 switched to datafile copy
input datafile copy RECID=2 STAMP=848073760 file name=/u01/data/oradata/dupdb/undotbs101.dbf
datafile 4 switched to datafile copy
input datafile copy RECID=3 STAMP=848073760 file name=/u01/data/oradata/dupdb/users01.dbf
datafile 7 switched to datafile copy
input datafile copy RECID=4 STAMP=848073760 file name=/u01/data/oradata/dupdb/zabbix101.dbf
datafile 8 switched to datafile copy
input datafile copy RECID=5 STAMP=848073760 file name=/u01/data/oradata/dupdb/hyperic0101.dbf

contents of Memory Script:
{
   Alter clone database open resetlogs;
}
executing Memory Script

database opened
Reenabling controlfile options for auxiliary database
Executing: alter database flashback on
Finished Duplicate Db at 20-MAY-2014 16:02:59

RMAN>




15:52开始执行,终于开始duplicate啦,期间登录source端看dm-16读操作比较多
datavg-lvoradate (dm-16)    253:16   0    20G  0 lvm  /u02

刚好是数据文件存放的分区.

结束以后,检查一下

SQL> select INSTANCE_NUMBER,INSTANCE_NAME,HOST_NAME,VERSION,STATUS from v$instance;

INSTANCE_NUMBER INSTANCE_NAME    HOST_NAME                                                        VERSION           STATUS
--------------- ---------------- ---------------------------------------------------------------- ----------------- ------------
              1 dupdb            node1                                                            11.2.0.3.0        OPEN

SQL>

SQL> select FILE#,BYTES/1024/1024,name from v$tempfile;

     FILE# BYTES/1024/1024 NAME
---------- --------------- --------------------------------------------------
         1              37 /u01/data/oradata/dupdb/temp01.dbf

SQL>
SQL> select file#,BYTES/1024/1024,name from v$datafile;

     FILE# BYTES/1024/1024 NAME
---------- --------------- --------------------------------------------------
         1             760 /u01/data/oradata/dupdb/system01.dbf
         2            1450 /u01/data/oradata/dupdb/sysaux01.dbf
         3             365 /u01/data/oradata/dupdb/undotbs101.dbf
         4               5 /u01/data/oradata/dupdb/users01.dbf
         7             500 /u01/data/oradata/dupdb/zabbix101.dbf
         8            2048 /u01/data/oradata/dupdb/hyperic0101.dbf

6 rows selected.

SQL>


SQL>
select name from v$datafile
union all
select name from v$tempfile
union all
select name from v$controlfile
union all
  7  select member from v$logfile;

NAME
--------------------------------------------------
/u01/data/oradata/dupdb/system01.dbf
/u01/data/oradata/dupdb/sysaux01.dbf
/u01/data/oradata/dupdb/undotbs101.dbf
/u01/data/oradata/dupdb/users01.dbf
/u01/data/oradata/dupdb/zabbix101.dbf
/u01/data/oradata/dupdb/hyperic0101.dbf
/u01/data/oradata/dupdb/temp01.dbf
/u01/data/oradata/dupdb/control01.ctl
/u01/data/onlinelog/dupdb/redo01e.log
/u01/data/onlinelog/dupdb/redo01d.log
/u01/data/onlinelog/dupdb/redo01c.log

NAME
--------------------------------------------------
/u01/data/onlinelog/dupdb/redo01b.log
/u01/data/onlinelog/dupdb/redo01a.log

13 rows selected.

SQL>



最终的脚本

RUN
{
  SET NEWNAME FOR DATABASE TO '/u01/data/oradata/dupdb/%b'; 
  DUPLICATE TARGET DATABASE  TO 'dupdb'
  from active database
    LOGFILE
      GROUP 1 ('/u01/data/onlinelog/dupdb/redo01a.log') SIZE 100M REUSE, 
      GROUP 2 ('/u01/data/onlinelog/dupdb/redo01b.log') SIZE 100M REUSE,
 GROUP 3 ('/u01/data/onlinelog/dupdb/redo01c.log') SIZE 100M REUSE,
 GROUP 4 ('/u01/data/onlinelog/dupdb/redo01d.log') SIZE 100M REUSE,
 GROUP 5 ('/u01/data/onlinelog/dupdb/redo01e.log') SIZE 100M REUSE
PASSWORD FILE spfile
set AUDIT_FILE_DEST '/u01/app/oracle/admin/mydb1/adump/'
set control_files '/u01/data/oradata/dupdb/control01.ctl'
set db_recovery_file_dest '/u01/data/flash_recovery_area/'
set db_create_file_dest '/u01/data/oradata/dupdb/';
}

修改一下也可以

RUN
{
  SET NEWNAME FOR DATAFILE 1 TO /u01/data/oradata/dupdb/system01.dbf;
  SET NEWNAME FOR DATAFILE 2 TO /u01/data/oradata/dupdb/sysaux01.dbf;
  SET NEWNAME FOR DATAFILE 3 TO /u01/data/oradata/dupdb/undotbs101.dbf;
  SET NEWNAME FOR DATAFILE 4 TO /u01/data/oradata/dupdb/users01.dbf;
  SET NEWNAME FOR DATAFILE 7 TO /u01/data/oradata/dupdb/zabbix101.dbf;
  SET NEWNAME FOR DATAFILE 8 TO /u01/data/oradata/dupdb/hyperic0101.dbf;
  SET NEWNAME FOR TEMPFILE 1 TO /u01/data/oradata/dupdb/temp01.dbf;  
  
  DUPLICATE TARGET DATABASE  TO 'dupdb'
  from active database
    LOGFILE
      GROUP 1 ('/u01/data/onlinelog/dupdb/redo01a.log') SIZE 100M REUSE, 
      GROUP 2 ('/u01/data/onlinelog/dupdb/redo01b.log') SIZE 100M REUSE,
 GROUP 3 ('/u01/data/onlinelog/dupdb/redo01c.log') SIZE 100M REUSE,
 GROUP 4 ('/u01/data/onlinelog/dupdb/redo01d.log') SIZE 100M REUSE,
 GROUP 5 ('/u01/data/onlinelog/dupdb/redo01e.log') SIZE 100M REUSE
PASSWORD FILE 
spfile
set AUDIT_FILE_DEST '/u01/app/oracle/admin/mydb1/adump/'
set control_files '/u01/data/oradata/dupdb/control01.ctl'
set db_recovery_file_dest '/u01/data/flash_recovery_area/'
set db_create_file_dest '/u01/data/oradata/dupdb/';
}

测试一下


清理掉以后再来一次

[oracle@node1 data]$
[oracle@node1 data]$ pwd
/u01/data
[oracle@node1 data]$ ll
total 0
drwxrwxr-x 3 oracle oinstall 18 May 20 15:42 flash_recovery_area/
drwxrwxr-x 3 oracle oinstall 18 May 20 12:29 onlinelog/
drwxrwxr-x 3 oracle oinstall 18 May 20 12:29 oradata/
[oracle@node1 data]$ du -sh *
0       flash_recovery_area
0       onlinelog
0       oradata
[oracle@node1 data]$

audit_file_dest

 mkdir -p /u01/app/oracle/admin/mydb1/adump

开始前准备工作

auxiliary端
软件装好,最好跟source端版本一致

listener 配置好,必须静态注册的

修改listener.ora

添加

SID_LIST_listener=
(SID_LIST=
 (SID_DESC=
  (SID_NAME=dupdb)
  (ORACLE_HOME=/u01/app/oracle/product/11.2.3/db_1)
  )
 )


准备password文件

[oracle@node1 db_1]$ cd $ORACLE_HOME/dbs
[oracle@node1 dbs]$ pwd
/u01/app/oracle/product/11.2.3/db_1/dbs
[oracle@node1 dbs]$ ll
total 0
drwxr-xr-x 2 oracle oinstall 26 May 26 15:34 bak/
[oracle@node1 dbs]$
[oracle@node1 dbs]$ orapwd file=orapwdupdb entries=20

Enter password for SYS:
[oracle@node1 dbs]$ ll
total 4
drwxr-xr-x 2 oracle oinstall   26 May 26 15:34 bak/
-rw-r----- 1 oracle oinstall 3584 May 26 16:53 orapwdupdb
[oracle@node1 dbs]$

准备 pfile 一行 db_name=dupdb

[oracle@node1 dbs]$ set|grep SID
ORACLE_SID=dupdb
[oracle@node1 dbs]$ echo "DB_NAME=dupdb" >> initdupdb.ora
[oracle@node1 dbs]$ ll
total 8
drwxr-xr-x 2 oracle oinstall   26 May 26 15:34 bak/
-rw-r--r-- 1 oracle oinstall   14 May 26 17:01 initdupdb.ora
-rw-r----- 1 oracle oinstall 3584 May 26 16:53 orapwdupdb
[oracle@node1 dbs]$


[oracle@node1 data]$ rman target sys/111111@mydb1 auxiliary sys/111111@dupdb

Recovery Manager: Release 11.2.0.3.0 - Production on Mon May 26 17:03:24 2014

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

connected to target database: MYDB1 (DBID=1497461080)
connected to auxiliary database: DUPDB (not mounted)

RMAN>











Oracle instance started

Total System Global Area     521936896 bytes

Fixed Size                     2229944 bytes
Variable Size                159385928 bytes
Database Buffers             352321536 bytes
Redo Buffers                   7999488 bytes

Starting backup at 26-MAY-2014 17:04:31
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile copy
copying current control file
output file name=/u01/app/oracle/product/11.2.3/db_1/dbs/snapcf_mydb1.f tag=TAG20140526T170429 RECID=23 STAMP=848595870
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:03
Finished backup at 26-MAY-2014 17:04:35

database mounted

contents of Memory Script:
{
   sql clone 'alter database flashback off';
   set newname for clone datafile  1 to new;
   set newname for clone datafile  2 to new;
   set newname for clone datafile  3 to new;
   set newname for clone datafile  4 to new;
   set newname for clone datafile  7 to new;
   set newname for clone datafile  8 to new;
   backup as copy reuse
   datafile  1 auxiliary format new
   datafile  2 auxiliary format new
   datafile  3 auxiliary format new
   datafile  4 auxiliary format new
   datafile  7 auxiliary format new
   datafile  8 auxiliary format new
   ;
   sql 'alter system archive log current';
}
executing Memory Script

sql statement: alter database flashback off

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 backup at 26-MAY-2014 17:04:42

using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile copy
input datafile file number=00002 name=/u02/oradata/mydb1/sysaux01.dbf
output file name=/u01/data/oradata/dupdb/DUPDB/datafile/o1_mf_sysaux_38p992t7_.dbf tag=TAG20140526T170439
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:02:16
channel ORA_DISK_1: starting datafile copy
input datafile file number=00008 name=/u02/oradata/mydb1/hyperic0101.dbf
output file name=/u01/data/oradata/dupdb/DUPDB/datafile/o1_mf_ts_hqdb_39p9931f_.dbf tag=TAG20140526T170439
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:03:16
channel ORA_DISK_1: starting datafile copy
input datafile file number=00001 name=/u02/oradata/mydb1/system01.dbf
output file name=/u01/data/oradata/dupdb/DUPDB/datafile/o1_mf_system_3ap9937j_.dbf tag=TAG20140526T170439
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:01:16
channel ORA_DISK_1: starting datafile copy
input datafile file number=00007 name=/u02/oradata/mydb1/zabbix101.dbf
output file name=/u01/data/oradata/dupdb/DUPDB/datafile/o1_mf_zabbix_3bp9939v_.dbf tag=TAG20140526T170439
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:01:05
channel ORA_DISK_1: starting datafile copy
input datafile file number=00003 name=/u02/oradata/mydb1/undotbs101.dbf
output file name=/u01/data/oradata/dupdb/DUPDB/datafile/o1_mf_undotbs1_3cp993c0_.dbf tag=TAG20140526T170439
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:35
channel ORA_DISK_1: starting datafile copy
input datafile file number=00004 name=/u02/oradata/mydb1/users01.dbf
output file name=/u01/data/oradata/dupdb/DUPDB/datafile/o1_mf_users_3dp993d3_.dbf tag=TAG20140526T170439
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01
Finished backup at 26-MAY-2014 17:13:11

sql statement: alter system archive log current

contents of Memory Script:
{
   backup as copy reuse
   archivelog like  "/u04/orafra/fast_recovery_area/mydb1/MYDB1/archivelog/2014_05_26/o1_mf_1_185_9r61f52d_.arc" auxiliary format
 "/u01/data/flash_recovery_area/DUPDB/archivelog/2014_05_26/o1_mf_1_185_%u_.arc"   ;
   catalog clone recovery area;
   switch clone datafile all;
}
executing Memory Script

Starting backup at 26-MAY-2014 17:13:12
using channel ORA_DISK_1
channel ORA_DISK_1: starting archived log copy
input archived log thread=1 sequence=185 RECID=757 STAMP=848596389
output file name=/u01/data/flash_recovery_area/DUPDB/archivelog/2014_05_26/o1_mf_1_185_3ep993d6_.arc RECID=0 STAMP=0
channel ORA_DISK_1: archived log copy complete, elapsed time: 00:00:07
Finished backup at 26-MAY-2014 17:13:20

searching for all files in the recovery area

List of Files Unknown to the Database
=====================================
File Name: /u01/data/flash_recovery_area/DUPDB/archivelog/2014_05_26/o1_mf_1_185_3ep993d6_.arc
cataloging files...
cataloging done

List of Cataloged Files
=======================
File Name: /u01/data/flash_recovery_area/DUPDB/archivelog/2014_05_26/o1_mf_1_185_3ep993d6_.arc

datafile 1 switched to datafile copy
input datafile copy RECID=23 STAMP=848596400 file name=/u01/data/oradata/dupdb/DUPDB/datafile/o1_mf_system_3ap9937j_.dbf
datafile 2 switched to datafile copy
input datafile copy RECID=24 STAMP=848596400 file name=/u01/data/oradata/dupdb/DUPDB/datafile/o1_mf_sysaux_38p992t7_.dbf
datafile 3 switched to datafile copy
input datafile copy RECID=25 STAMP=848596400 file name=/u01/data/oradata/dupdb/DUPDB/datafile/o1_mf_undotbs1_3cp993c0_.dbf
datafile 4 switched to datafile copy
input datafile copy RECID=26 STAMP=848596400 file name=/u01/data/oradata/dupdb/DUPDB/datafile/o1_mf_users_3dp993d3_.dbf
datafile 7 switched to datafile copy
input datafile copy RECID=27 STAMP=848596400 file name=/u01/data/oradata/dupdb/DUPDB/datafile/o1_mf_zabbix_3bp9939v_.dbf
datafile 8 switched to datafile copy
input datafile copy RECID=28 STAMP=848596400 file name=/u01/data/oradata/dupdb/DUPDB/datafile/o1_mf_ts_hqdb_39p9931f_.dbf

contents of Memory Script:
{
   set until scn  29374294;
   recover
   clone database
    delete archivelog
   ;
}
executing Memory Script

executing command: SET until clause

Starting recover at 26-MAY-2014 17:13:21
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=133 device type=DISK

starting media recovery

archived log for thread 1 with sequence 185 is already on disk as file /u01/data/flash_recovery_area/DUPDB/archivelog/2014_05_26/o1_mf_1_185_3ep993d6_.arc
archived log file name=/u01/data/flash_recovery_area/DUPDB/archivelog/2014_05_26/o1_mf_1_185_3ep993d6_.arc thread=1 sequence=185
media recovery complete, elapsed time: 00:00:01
Finished recover at 26-MAY-2014 17:13:24
Oracle instance started

Total System Global Area     521936896 bytes

Fixed Size                     2229944 bytes
Variable Size                159385928 bytes
Database Buffers             352321536 bytes
Redo Buffers                   7999488 bytes

contents of Memory Script:
{
   sql clone "alter system set  db_name =
 ''DUPDB'' comment=
 ''Reset to original value by RMAN'' scope=spfile";
   sql clone "alter system reset  db_unique_name scope=spfile";
   shutdown clone immediate;
   startup clone nomount;
}
executing Memory Script

sql statement: alter system set  db_name =  ''DUPDB'' comment= ''Reset to original value by RMAN'' scope=spfile

sql statement: alter system reset  db_unique_name scope=spfile

Oracle instance shut down

connected to auxiliary database (not started)
Oracle instance started

Total System Global Area     521936896 bytes

Fixed Size                     2229944 bytes
Variable Size                159385928 bytes
Database Buffers             352321536 bytes
Redo Buffers                   7999488 bytes
sql statement: CREATE CONTROLFILE REUSE SET DATABASE "DUPDB" RESETLOGS ARCHIVELOG
  MAXLOGFILES    192
  MAXLOGMEMBERS      3
  MAXDATAFILES     1024
  MAXINSTANCES    32
  MAXLOGHISTORY      292

 LOGFILE
  GROUP   1 ( '/u01/data/onlinelog/dupdb/redo01a.log' ) SIZE 100 M  REUSE,
  GROUP   2 ( '/u01/data/onlinelog/dupdb/redo01b.log' ) SIZE 100 M  REUSE,
  GROUP   3 ( '/u01/data/onlinelog/dupdb/redo01c.log' ) SIZE 100 M  REUSE,
  GROUP   4 ( '/u01/data/onlinelog/dupdb/redo01d.log' ) SIZE 100 M  REUSE,
  GROUP   5 ( '/u01/data/onlinelog/dupdb/redo01e.log' ) SIZE 100 M  REUSE
 DATAFILE
  '/u01/data/oradata/dupdb/DUPDB/datafile/o1_mf_system_3ap9937j_.dbf'
 CHARACTER SET AL32UTF8


contents of Memory Script:
{
   set newname for clone tempfile  1 to new;
   switch clone tempfile all;
   catalog clone datafilecopy  "/u01/data/oradata/dupdb/DUPDB/datafile/o1_mf_sysaux_38p992t7_.dbf",
 "/u01/data/oradata/dupdb/DUPDB/datafile/o1_mf_undotbs1_3cp993c0_.dbf",
 "/u01/data/oradata/dupdb/DUPDB/datafile/o1_mf_users_3dp993d3_.dbf",
 "/u01/data/oradata/dupdb/DUPDB/datafile/o1_mf_zabbix_3bp9939v_.dbf",
 "/u01/data/oradata/dupdb/DUPDB/datafile/o1_mf_ts_hqdb_39p9931f_.dbf";
   switch clone datafile all;
}
executing Memory Script

executing command: SET NEWNAME

renamed tempfile 1 to /u01/data/oradata/dupdb/DUPDB/datafile/o1_mf_temp_%u_.tmp in control file

cataloged datafile copy
datafile copy file name=/u01/data/oradata/dupdb/DUPDB/datafile/o1_mf_sysaux_38p992t7_.dbf RECID=1 STAMP=848596416
cataloged datafile copy
datafile copy file name=/u01/data/oradata/dupdb/DUPDB/datafile/o1_mf_undotbs1_3cp993c0_.dbf RECID=2 STAMP=848596416
cataloged datafile copy
datafile copy file name=/u01/data/oradata/dupdb/DUPDB/datafile/o1_mf_users_3dp993d3_.dbf RECID=3 STAMP=848596416
cataloged datafile copy
datafile copy file name=/u01/data/oradata/dupdb/DUPDB/datafile/o1_mf_zabbix_3bp9939v_.dbf RECID=4 STAMP=848596416
cataloged datafile copy
datafile copy file name=/u01/data/oradata/dupdb/DUPDB/datafile/o1_mf_ts_hqdb_39p9931f_.dbf RECID=5 STAMP=848596416

datafile 2 switched to datafile copy
input datafile copy RECID=1 STAMP=848596416 file name=/u01/data/oradata/dupdb/DUPDB/datafile/o1_mf_sysaux_38p992t7_.dbf
datafile 3 switched to datafile copy
input datafile copy RECID=2 STAMP=848596416 file name=/u01/data/oradata/dupdb/DUPDB/datafile/o1_mf_undotbs1_3cp993c0_.dbf
datafile 4 switched to datafile copy
input datafile copy RECID=3 STAMP=848596416 file name=/u01/data/oradata/dupdb/DUPDB/datafile/o1_mf_users_3dp993d3_.dbf
datafile 7 switched to datafile copy
input datafile copy RECID=4 STAMP=848596416 file name=/u01/data/oradata/dupdb/DUPDB/datafile/o1_mf_zabbix_3bp9939v_.dbf
datafile 8 switched to datafile copy
input datafile copy RECID=5 STAMP=848596416 file name=/u01/data/oradata/dupdb/DUPDB/datafile/o1_mf_ts_hqdb_39p9931f_.dbf

contents of Memory Script:
{
   Alter clone database open resetlogs;
}
executing Memory Script

database opened
Reenabling controlfile options for auxiliary database
Executing: alter database flashback on
Finished Duplicate Db at 26-MAY-2014 17:13:52

RMAN>

结束以后检查

SQL> select INSTANCE_NUMBER,INSTANCE_NAME,HOST_NAME,STATUS from v$instance;

INSTANCE_NUMBER INSTANCE_NAME    HOST_NAME                                                        STATUS
--------------- ---------------- ---------------------------------------------------------------- ------------
              1 dupdb            node1                                                            OPEN

SQL>

反倒不如第一个脚本? 怎么回事...





3>   SET NEWNAME FOR DATAFILE 1 TO /u01/data/oradata/dupdb/system01.dbf;



 
  SET NEWNAME FOR DATAFILE 1 TO /u01/data/oradata/dupdb/system01.dbf;






 
RMAN-00571: ===========================================================

RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============

RMAN-00571: ===========================================================

RMAN-00558: error encountered while parsing input commands

RMAN-01006: error signaled during parse

RMAN-02001: unrecognized punctuation symbol "/"




  SET NEWNAME FOR DATAFILE 2 TO /u01/data/oradata/dupdb/sysaux01.dbf;



 
  SET NEWNAME FOR DATAFILE 2 TO /u01/data/oradata/dupdb/sysaux01.dbf;




  SET NEWNAME FOR DATAFILE 3 TO /u01/data/oradata/dupdb/undotbs101.dbf;



 
  SET NEWNAME FOR DATAFILE 3 TO /u01/data/oradata/dupdb/undotbs101.dbf;




 





 
RMAN> 




 
RMAN-00571: ===========================================================

RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============

RMAN-00571: ===========================================================

RMAN-00558: error encountered while parsing input commands

RMAN-01006: error signaled during parse

RMAN-02001: unrecognized punctuation symbol "/"




  SET NEWNAME FOR DATAFILE 4 TO /u01/data/oradata/dupdb/users01.dbf;



 
  SET NEWNAME FOR DATAFILE 4 TO /u01/data/oradata/dupdb/users01.dbf;




  SET NEWNAME FOR DATAFILE 7 TO /





  SET NEWNAME FOR DATAFILE 7 TO /
RMAN> 




  SET NEWNAME FOR DATAFILE 7 TO /
RMAN-00571: ===========================================================

RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============

RMAN-00571: ===========================================================

RMAN-00558: error encountered while parsing input commands

RMAN-01006: error signaled during parse

RMAN-02001: unrecognized punctuation symbol "/"




  SET NEWNAME FOR DATAFILE 7 TO /u01/data/oradata/dupdb/zabbix101.dbf;



 
  SET NEWNAME FOR DATAFILE 7 TO /u01/data/oradata/dupdb/zabbix101.dbf;




  SET NEWNAME FOR DATAFILE 8 TO /u01/data/oradata/dupdb/hyperic01





  SET NEWNAME FOR DATAFILE 8 TO /u01/data/oradata/dupdb/hyperic010
RMAN> 


RMAN>   SET NEWNAME FOR DATAFILE 8 TO /u01/data/oradata/dupdb/hyperic010



RMAN> 




  SET NEWNAME FOR DATAFILE 8 TO /u01/data/oradata/dupdb/hyperic010
RMAN-00571: ===========================================================

RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============

RMAN-00571: ===========================================================

RMAN-00558: error encountered while parsing input commands

RMAN-01006: error signaled during parse

RMAN-02001: unrecognized punctuation symbol "/"




  SET NEWNAME FOR DATAFILE 8 TO /u01/data/oradata/dupdb/hyperic0101.dbf;



  SET NEWNAME FOR DATAFILE 8 TO /u01/data/oradata/dupdb/hyperic0101.dbf;




  SET NEWNAME FOR TEMPFILE 1 TO /u01/data/o





  SET NEWNAME FOR TEMPFILE 1 TO /u01/data/o
RMAN> 




  SET NEWNAME FOR TEMPFILE 1 TO /u01/data/o
RMAN-00571: ===========================================================

RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============

RMAN-00571: ===========================================================

RMAN-00558: error encountered while parsing input commands

RMAN-01006: error signaled during parse

RMAN-02001: unrecognized punctuation symbol "/"




  SET NEWNAME FOR TEMPFILE 1 TO /u01/data/oradata/dupdb/temp01.dbf;  



 
  SET NEWNAME FOR TEMPFILE 1 TO /u01/data/oradata/dupdb/temp01.dbf;  




  



 
  




 


RMAN> 




  
RMAN-00571: ===========================================================

RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============

RMAN-00571: ===========================================================

RMAN-00558: error encountered while parsing input commands

RMAN-01006: error signaled during parse

RMAN-02001: unrecognized punctuation symbol "/"




  DUPLICATE TARGET DATABASE  TO 'dupdb'



 
  DUPLICATE TARGET DATABASE  TO 'dupdb'




  from active database



 
  from active database




 





 
RMAN> 




 
RMAN-00571: ===========================================================

RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============

RMAN-00571: ===========================================================

RMAN-00558: error encountered while parsing input commands

RMAN-01006: error signaled during parse

RMAN-02001: unrecognized punctuation symbol "/"




    LOGFILE



 
    LOGFILE




      GROUP 1 ('/u01/data/onlinelog/dupdb/redo01a.log')
 SIZE 100M REUSE, 



 
      GROUP 1 ('/u01/data/onlinelog/dupdb/redo01a.log') SIZE 100M REUSE, 



RMAN> 




 
RMAN> 2> 3> 4> 
  








阅读(2976) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~