|
- [oracle@station87 ~]$ rman target /
- Recovery Manager: Release 11.2.0.1.0 - Production on Thu Jul 19 19:18:28 2018
- Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
- connected to target database: UTFORCL (DBID=454057935)
- RMAN> list incarnation of database;
- using target database control file instead of recovery catalog
- List of Database Incarnations
- DB Key Inc Key DB Name DB ID STATUS Reset SCN Reset Time
- ------- ------- -------- ---------------- --- ---------- ----------
- 1 1 UTFORCL 454057935 PARENT 940976 2013-06-29:23:35:45
- 2 2 UTFORCL 454057935 CURRENT 1037166 2018-07-17:21:42:43
- RMAN> exit
复制代码- [oracle@station87 dbs]$ nid target=sys/oracle_4U DBNAME=myorcl
- DBNEWID: Release 11.2.0.1.0 - Production on Thu Jul 19 19:24:26 2018
- Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
- Connected to database UTFORCL (DBID=454057935)
- NID-00121: Database should not be open
- Change of database name failed during validation - database is intact.
- DBNEWID - Completed with validation errors.
复制代码- [oracle@station87 dbs]$ sqlplus /nolog
- SQL*Plus: Release 11.2.0.1.0 Production on Thu Jul 19 19:24:32 2018
- Copyright (c) 1982, 2009, Oracle. All rights reserved.
- SQL> conn / as sysdba
- Connected.
- SQL> shutdown immediate
- Database closed.
- Database dismounted.
- ORACLE instance shut down.
- SQL> startup mount
- ORACLE instance started.
- Total System Global Area 857903104 bytes
- Fixed Size 1339880 bytes
- Variable Size 566234648 bytes
- Database Buffers 285212672 bytes
- Redo Buffers 5115904 bytes
- Database mounted.
复制代码- [oracle@station87 dbs]$ nid target=sys/oracle_4U DBNAME=myorcl
- DBNEWID: Release 11.2.0.1.0 - Production on Thu Jul 19 19:27:01 2018
- Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
- Connected to database UTFORCL (DBID=454057935)
- Connected to server version 11.2.0
- Control Files in database:
- /u01/app/oracle/oradata/utforcl/control01.ctl
- /u01/app/oracle/oradata/utforcl/control02.ctl
- /u01/app/oracle/oradata/utforcl/control03.ctl
- Change database ID and database name UTFORCL to MYORCL? (Y/[N]) => Y
- Proceeding with operation
- Changing database ID from 454057935 to 402450949
- Changing database name from UTFORCL to MYORCL
- Control File /u01/app/oracle/oradata/utforcl/control01.ctl - modified
- Control File /u01/app/oracle/oradata/utforcl/control02.ctl - modified
- Control File /u01/app/oracle/oradata/utforcl/control03.ctl - modified
- Datafile /u01/app/oracle/oradata/utforcl/system01.db - dbid changed, wrote new name
- Datafile /u01/app/oracle/oradata/utforcl/sysaux01.db - dbid changed, wrote new name
- Datafile /u01/app/oracle/oradata/utforcl/undotbs1.db - dbid changed, wrote new name
- Datafile /u01/app/oracle/oradata/utforcl/users01.db - dbid changed, wrote new name
- Datafile /u01/app/oracle/oradata/utforcl/example01.db - dbid changed, wrote new name
- Datafile /u01/app/oracle/oradata/utforcl/tbsutf8_11g.db - dbid changed, wrote new name
- Datafile /u01/app/oracle/oradata/utforcl/temp01.db - dbid changed, wrote new name
- Control File /u01/app/oracle/oradata/utforcl/control01.ctl - dbid changed, wrote new name
- Control File /u01/app/oracle/oradata/utforcl/control02.ctl - dbid changed, wrote new name
- Control File /u01/app/oracle/oradata/utforcl/control03.ctl - dbid changed, wrote new name
- Instance shut down
- Database name changed to MYORCL.
- Modify parameter file and generate a new password file before restarting.
- Database ID for database MYORCL changed to 402450949.
- All previous backups and archived redo logs for this database are unusable.
- Database is not aware of previous backups and archived logs in Recovery Area.
- Database has been shutdown, open database with RESETLOGS option.
- Succesfully changed database name and ID.
- DBNEWID - Completed succesfully.
- [oracle@station87 dbs]$
复制代码
准备新的spfile和orapw文件,
[oracle@station87 oracle]$ cd admin/
[oracle@station87 admin]$ ls
+ASM utforcl
[oracle@station87 admin]$ mkdir -p myorcl/adump
[oracle@station87 admin]$
启动myorcl实例:
- [oracle@station87 dbs]$ ps aux | grep ora_smon
- oracle 8380 0.0 0.0 4220 628 pts/1 S+ 19:28 0:00 grep ora_smon
- [oracle@station87 dbs]$ ls
- 1.txt hc_utforcl.dat init.ora initutforcl.ora lkUTFORCL orapwutforcl peshm_utforcl_0 spfileutforcl.ora
- [oracle@station87 dbs]$ . oraenv
- ORACLE_SID = [utforcl] ?
- The Oracle base for ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1 is /u01/app/oracle
- [oracle@station87 dbs]$ sqlplus /nolog
- SQL*Plus: Release 11.2.0.1.0 Production on Thu Jul 19 19:28:43 2018
- Copyright (c) 1982, 2009, Oracle. All rights reserved.
- SQL> conn / as sysdba
- Connected to an idle instance.
- SQL> create pfile from spfile;
- File created.
- SQL> exit
- Disconnected
- [oracle@station87 dbs]$ ls
- 1.txt hc_utforcl.dat init.ora initutforcl.ora lkUTFORCL orapwutforcl peshm_utforcl_0 spfileutforcl.ora
- [oracle@station87 dbs]$ mv initutforcl.ora initmyorcl.ora
- [oracle@station87 dbs]$ ls
- 1.txt hc_utforcl.dat initmyorcl.ora init.ora lkUTFORCL orapwutforcl peshm_utforcl_0 spfileutforcl.ora
- [oracle@station87 dbs]$ rm -f spfileutforcl.ora
- [oracle@station87 dbs]$ ls
- 1.txt hc_utforcl.dat initmyorcl.ora init.ora lkUTFORCL orapwutforcl peshm_utforcl_0
- [oracle@station87 dbs]$ mv orapwutforcl orapwmyorcl
- [oracle@station87 dbs]$ ls
- 1.txt hc_utforcl.dat initmyorcl.ora init.ora lkUTFORCL orapwmyorcl peshm_utforcl_0
- [oracle@station87 dbs]$ vim initmyorcl.ora
- [oracle@station87 dbs][ DISCUZ_CODE_65 ]nbsp;
复制代码 改一下/etc/oratab:
- +ASM:/u01/app/oracle/product/11.2.0/grid:N
- myorcl:/u01/app/oracle/product/11.2.0/dbhome_1:N # line added by Agent
复制代码 克隆的过程中,一定要注意:
1. auxiliary instance一定要带@连接。
2. auxiliary instance一定要静态注册监听器。
----------------------------------------------------------------------------
在克隆之前,先确保以下rman命令会成功:
- [oracle@station87 admin]$ rman target sys/oracle_4U@orcl auxiliary sys/oracle_4U@clonedb
- Recovery Manager: Release 11.2.0.1.0 - Production on Thu Jul 19 20:21:40 2018
- Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
- connected to target database: ORCL (DBID=1359978017)
- connected to auxiliary database: CLONEDB (not mounted)
- RMAN>
复制代码
注意一下,由于 OMF文件名写死的问题,块跟踪在克隆之前,要先停掉。
- [oracle@station87 ~]$ rman target sys/oracle_4U@orcl auxiliary sys/oracle_4U@clonedb
- Recovery Manager: Release 11.2.0.1.0 - Production on Thu Jul 19 20:31:31 2018
- Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
- connected to target database: ORCL (DBID=1359978017)
- connected to auxiliary database: CLONEDB (not mounted)
- RMAN> run {
- 2> allocate channel c1 device type disk;
- 3> allocate channel c2 device type disk;
- 4> allocate channel c3 device type disk;
- 5> allocate channel c4 device type disk;
- 6> allocate channel c5 device type disk;
- 7> allocate channel c6 device type disk;
- 8> allocate channel c7 device type disk;
- 9> allocate channel c8 device type disk;
- 10> allocate auxiliary channel c9 device type disk;
- 11> allocate auxiliary channel c10 device type disk;
- 12> allocate auxiliary channel c11 device type disk;
- 13> allocate auxiliary channel c12 device type disk;
- 14> allocate auxiliary channel c13 device type disk;
- 15> allocate auxiliary channel c14 device type disk;
- 16> allocate auxiliary channel c15 device type disk;
- 17> allocate auxiliary channel c16 device type disk;
- 18> duplicate target database to clonedb
- 19> from active database
- 20> nofilenamecheck
- 21> spfile
- 22> set
- 23> control_files='+DATA','+FRA'
- 24> set
- 25> db_file_name_convert='+DATA/orcl/','+DATA/clonedb/'
- 26> set
- 27> log_file_name_convert='+DATA/orcl','+DATA/clonedb/'
- 28> set
- 29> audit_file_dest='/u01/app/oracle/admin/clonedb/adump';
- 30> }
- using target database control file instead of recovery catalog
- allocated channel: c1
- channel c1: SID=143 device type=DISK
- allocated channel: c2
- channel c2: SID=14 device type=DISK
- allocated channel: c3
- channel c3: SID=54 device type=DISK
- allocated channel: c4
- channel c4: SID=12 device type=DISK
- allocated channel: c5
- channel c5: SID=55 device type=DISK
- allocated channel: c6
- channel c6: SID=99 device type=DISK
- allocated channel: c7
- channel c7: SID=141 device type=DISK
- allocated channel: c8
- channel c8: SID=10 device type=DISK
- allocated channel: c9
- channel c9: SID=47 device type=DISK
- allocated channel: c10
- channel c10: SID=5 device type=DISK
- allocated channel: c11
- channel c11: SID=48 device type=DISK
- allocated channel: c12
- channel c12: SID=92 device type=DISK
- allocated channel: c13
- channel c13: SID=136 device type=DISK
- allocated channel: c14
- channel c14: SID=6 device type=DISK
- allocated channel: c15
- channel c15: SID=49 device type=DISK
- allocated channel: c16
- channel c16: SID=93 device type=DISK
- Starting Duplicate Db at 2018-07-19:20:33:54
- contents of Memory Script:
- {
- backup as copy reuse
- targetfile '+DATA/orcl/spfileorcl.ora' auxiliary format
- '/u01/app/oracle/product/11.2.0/dbhome_1/dbs/spfileclonedb.ora' ;
- sql clone "alter system set spfile= ''/u01/app/oracle/product/11.2.0/dbhome_1/dbs/spfileclonedb.ora''";
- }
- executing Memory Script
- Starting backup at 2018-07-19:20:33:54
- Finished backup at 2018-07-19:20:33:55
- sql statement: alter system set spfile= ''/u01/app/oracle/product/11.2.0/dbhome_1/dbs/spfileclonedb.ora''
- contents of Memory Script:
- {
- sql clone "alter system set db_name =
- ''CLONEDB'' comment=
- ''duplicate'' scope=spfile";
- sql clone "alter system set control_files =
- ''+DATA'', ''+FRA'' comment=
- '''' scope=spfile";
- sql clone "alter system set db_file_name_convert =
- ''+DATA/orcl/'', ''+DATA/clonedb/'' comment=
- '''' scope=spfile";
- sql clone "alter system set log_file_name_convert =
- ''+DATA/orcl'', ''+DATA/clonedb/'' comment=
- '''' scope=spfile";
- sql clone "alter system set audit_file_dest =
- ''/u01/app/oracle/admin/clonedb/adump'' comment=
- '''' scope=spfile";
- shutdown clone immediate;
- startup clone nomount;
- }
- executing Memory Script
- sql statement: alter system set db_name = ''CLONEDB'' comment= ''duplicate'' scope=spfile
- sql statement: alter system set control_files = ''+DATA'', ''+FRA'' comment= '''' scope=spfile
- sql statement: alter system set db_file_name_convert = ''+DATA/orcl/'', ''+DATA/clonedb/'' comment= '''' scope=spfile
- sql statement: alter system set log_file_name_convert = ''+DATA/orcl'', ''+DATA/clonedb/'' comment= '''' scope=spfile
- sql statement: alter system set audit_file_dest = ''/u01/app/oracle/admin/clonedb/adump'' comment= '''' scope=spfile
- Oracle instance shut down
- connected to auxiliary database (not started)
- Oracle instance started
- Total System Global Area 1046224896 bytes
- Fixed Size 1341140 bytes
- Variable Size 603982124 bytes
- Database Buffers 436207616 bytes
- Redo Buffers 4694016 bytes
- allocated channel: c9
- channel c9: SID=92 device type=DISK
- allocated channel: c10
- channel c10: SID=130 device type=DISK
- allocated channel: c11
- channel c11: SID=6 device type=DISK
- allocated channel: c12
- channel c12: SID=50 device type=DISK
- allocated channel: c13
- channel c13: SID=93 device type=DISK
- allocated channel: c14
- channel c14: SID=137 device type=DISK
- allocated channel: c15
- channel c15: SID=7 device type=DISK
- allocated channel: c16
- channel c16: SID=51 device type=DISK
- contents of Memory Script:
- {
- sql clone "alter system set control_files =
- ''+DATA/clonedb/controlfile/current.269.981923651'', ''+FRA/clonedb/controlfile/current.358.981923651'' comment=
- ''Set by RMAN'' scope=spfile";
- sql clone "alter system set db_name =
- ''ORCL'' comment=
- ''Modified by RMAN duplicate'' scope=spfile";
- sql clone "alter system set db_unique_name =
- ''CLONEDB'' comment=
- ''Modified by RMAN duplicate'' scope=spfile";
- shutdown clone immediate;
- startup clone force nomount
- backup as copy current controlfile auxiliary format '+DATA/clonedb/controlfile/current.261.981923651';
- restore clone controlfile to '+FRA/clonedb/controlfile/current.349.981923651' from
- '+DATA/clonedb/controlfile/current.261.981923651';
- sql clone "alter system set control_files =
- ''+DATA/clonedb/controlfile/current.261.981923651'', ''+FRA/clonedb/controlfile/current.349.981923651'' comment=
- ''Set by RMAN'' scope=spfile";
- shutdown clone immediate;
- startup clone nomount;
- alter clone database mount;
- }
- executing Memory Script
- sql statement: alter system set control_files = ''+DATA/clonedb/controlfile/current.269.981923651'', ''+FRA/clonedb/controlfile/current.358.981923651'' comment= ''Set by RMAN'' scope=spfile
- sql statement: alter system set db_name = ''ORCL'' comment= ''Modified by RMAN duplicate'' scope=spfile
- sql statement: alter system set db_unique_name = ''CLONEDB'' comment= ''Modified by RMAN duplicate'' scope=spfile
- Oracle instance shut down
- Oracle instance started
- Total System Global Area 1046224896 bytes
- Fixed Size 1341140 bytes
- Variable Size 603982124 bytes
- Database Buffers 436207616 bytes
- Redo Buffers 4694016 bytes
- allocated channel: c9
- channel c9: SID=92 device type=DISK
- allocated channel: c10
- channel c10: SID=136 device type=DISK
- allocated channel: c11
- channel c11: SID=6 device type=DISK
- allocated channel: c12
- channel c12: SID=50 device type=DISK
- allocated channel: c13
- channel c13: SID=93 device type=DISK
- allocated channel: c14
- channel c14: SID=137 device type=DISK
- allocated channel: c15
- channel c15: SID=7 device type=DISK
- allocated channel: c16
- channel c16: SID=51 device type=DISK
- Starting backup at 2018-07-19:20:34:23
- channel c1: starting datafile copy
- copying current control file
- output file name=/u01/app/oracle/product/11.2.0/dbhome_1/dbs/snapcf_orcl.f tag=TAG20180719T203422 RECID=38 STAMP=981923663
- channel c1: datafile copy complete, elapsed time: 00:00:01
- Finished backup at 2018-07-19:20:34:24
- Starting restore at 2018-07-19:20:34:24
- channel c10: skipped, AUTOBACKUP already found
- channel c11: skipped, AUTOBACKUP already found
- channel c12: skipped, AUTOBACKUP already found
- channel c13: skipped, AUTOBACKUP already found
- channel c14: skipped, AUTOBACKUP already found
- channel c15: skipped, AUTOBACKUP already found
- channel c16: skipped, AUTOBACKUP already found
- channel c9: copied control file copy
- Finished restore at 2018-07-19:20:34:33
- sql statement: alter system set control_files = ''+DATA/clonedb/controlfile/current.261.981923651'', ''+FRA/clonedb/controlfile/current.349.981923651'' comment= ''Set by RMAN'' scope=spfile
- Oracle instance shut down
- connected to auxiliary database (not started)
- Oracle instance started
- Total System Global Area 1046224896 bytes
- Fixed Size 1341140 bytes
- Variable Size 603982124 bytes
- Database Buffers 436207616 bytes
- Redo Buffers 4694016 bytes
- allocated channel: c9
- channel c9: SID=49 device type=DISK
- allocated channel: c10
- channel c10: SID=136 device type=DISK
- allocated channel: c11
- channel c11: SID=6 device type=DISK
- allocated channel: c12
- channel c12: SID=50 device type=DISK
- allocated channel: c13
- channel c13: SID=137 device type=DISK
- allocated channel: c14
- channel c14: SID=93 device type=DISK
- allocated channel: c15
- channel c15: SID=7 device type=DISK
- allocated channel: c16
- channel c16: SID=51 device type=DISK
- database mounted
- RMAN-05529: WARNING: DB_FILE_NAME_CONVERT resulted in invalid ASM names; names changed to disk group only.
- datafile 4 not processed because file is OFFLINE IMMEDIATE
- contents of Memory Script:
- {
- set newname for datafile 1 to
- "+data";
- set newname for datafile 2 to
- "+data";
- set newname for datafile 3 to
- "+data";
- set newname for datafile 5 to
- "+data";
- set newname for datafile 6 to
- "+data";
- set newname for datafile 7 to
- "+data";
- backup as copy reuse
- datafile 1 auxiliary format
- "+data" datafile
- 2 auxiliary format
- "+data" datafile
- 3 auxiliary format
- "+data" datafile
- 5 auxiliary format
- "+data" datafile
- 6 auxiliary format
- "+data" datafile
- 7 auxiliary format
- "+data" ;
- sql 'alter system archive log current';
- }
- executing Memory Script
- 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 2018-07-19:20:35:00
- channel c1: starting datafile copy
- input datafile file number=00001 name=+DATA/orcl/datafile/system.268.979853699
- channel c2: starting datafile copy
- input datafile file number=00002 name=+DATA/orcl/datafile/sysaux.267.979847755
- channel c3: starting datafile copy
- input datafile file number=00005 name=+DATA/orcl/datafile/example.259.979847765
- channel c4: starting datafile copy
- input datafile file number=00003 name=+DATA/orcl/datafile/undotbs1.258.979847755
- channel c5: starting datafile copy
- input datafile file number=00006 name=+DATA/orcl/datafile/tbs1.256.979847755
- channel c6: starting datafile copy
- input datafile file number=00007 name=+DATA/orcl/datafile/tbs2.257.979847755
- output file name=+DATA/clonedb/datafile/system.262.981923705 tag=TAG20180719T203459
- channel c1: datafile copy complete, elapsed time: 00:00:33
- output file name=+DATA/clonedb/datafile/tbs1.257.981923731 tag=TAG20180719T203459
- channel c5: datafile copy complete, elapsed time: 00:00:18
- output file name=+DATA/clonedb/datafile/sysaux.259.981923707 tag=TAG20180719T203459
- channel c2: datafile copy complete, elapsed time: 00:00:40
- output file name=+DATA/clonedb/datafile/undotbs1.265.981923731 tag=TAG20180719T203459
- channel c4: datafile copy complete, elapsed time: 00:00:42
- output file name=+DATA/clonedb/datafile/tbs2.258.981923743 tag=TAG20180719T203459
- channel c6: datafile copy complete, elapsed time: 00:00:16
- output file name=+DATA/clonedb/datafile/example.256.981923747 tag=TAG20180719T203459
- channel c3: datafile copy complete, elapsed time: 00:00:54
- Finished backup at 2018-07-19:20:35:58
- sql statement: alter system archive log current
- contents of Memory Script:
- {
- backup as copy reuse
- archivelog like "+FRA/orcl/archivelog/2018_07_19/thread_1_seq_95.342.981923641" auxiliary format
- "+FRA" archivelog like
- "/home/oracle/1_95_978645051.dbf" auxiliary format
- "+FRA" archivelog like
- "+FRA/orcl/archivelog/2018_07_19/thread_1_seq_96.346.981923655" auxiliary format
- "+FRA" archivelog like
- "/home/oracle/1_96_978645051.dbf" auxiliary format
- "+FRA" archivelog like
- "+FRA/orcl/archivelog/2018_07_19/thread_1_seq_97.313.981923683" auxiliary format
- "+FRA" archivelog like
- "/home/oracle/1_97_978645051.dbf" auxiliary format
- "+FRA" archivelog like
- "+FRA/orcl/archivelog/2018_07_19/thread_1_seq_98.315.981923705" auxiliary format
- "+FRA" archivelog like
- "/home/oracle/1_98_978645051.dbf" auxiliary format
- "+FRA" archivelog like
- "+FRA/orcl/archivelog/2018_07_19/thread_1_seq_99.345.981923753" auxiliary format
- "+FRA" archivelog like
- "/home/oracle/1_99_978645051.dbf" auxiliary format
- "+FRA" archivelog like
- "+FRA/orcl/archivelog/2018_07_19/thread_1_seq_100.304.981923765" auxiliary format
- "+FRA" archivelog like
- "/home/oracle/1_100_978645051.dbf" auxiliary format
- "+FRA" ;
- catalog clone recovery area;
- switch clone datafile all;
- }
- executing Memory Script
- Starting backup at 2018-07-19:20:36:10
- channel c1: starting archived log copy
- input archived log thread=1 sequence=95 RECID=119 STAMP=981923647
- channel c2: starting archived log copy
- input archived log thread=1 sequence=95 RECID=120 STAMP=981923647
- channel c3: starting archived log copy
- input archived log thread=1 sequence=96 RECID=121 STAMP=981923659
- channel c4: starting archived log copy
- input archived log thread=1 sequence=96 RECID=122 STAMP=981923659
- channel c5: starting archived log copy
- input archived log thread=1 sequence=97 RECID=123 STAMP=981923691
- channel c6: starting archived log copy
- input archived log thread=1 sequence=97 RECID=124 STAMP=981923691
- channel c7: starting archived log copy
- input archived log thread=1 sequence=98 RECID=125 STAMP=981923721
- channel c8: starting archived log copy
- input archived log thread=1 sequence=98 RECID=126 STAMP=981923722
- output file name=+FRA/clonedb/archivelog/2018_07_19/thread_1_seq_95.350.981923771 RECID=0 STAMP=0
- channel c1: archived log copy complete, elapsed time: 00:00:01
- channel c1: starting archived log copy
- input archived log thread=1 sequence=99 RECID=127 STAMP=981923764
- output file name=+FRA/clonedb/archivelog/2018_07_19/thread_1_seq_95.320.981923771 RECID=0 STAMP=0
- channel c2: archived log copy complete, elapsed time: 00:00:01
- channel c2: starting archived log copy
- input archived log thread=1 sequence=99 RECID=128 STAMP=981923764
- output file name=+FRA/clonedb/archivelog/2018_07_19/thread_1_seq_96.294.981923771 RECID=0 STAMP=0
- channel c3: archived log copy complete, elapsed time: 00:00:05
- channel c3: starting archived log copy
- input archived log thread=1 sequence=100 RECID=129 STAMP=981923769
- output file name=+FRA/clonedb/archivelog/2018_07_19/thread_1_seq_96.328.981923771 RECID=0 STAMP=0
- channel c4: archived log copy complete, elapsed time: 00:00:07
- channel c4: starting archived log copy
- input archived log thread=1 sequence=100 RECID=130 STAMP=981923769
- output file name=+FRA/clonedb/archivelog/2018_07_19/thread_1_seq_99.355.981923773 RECID=0 STAMP=0
- channel c1: archived log copy complete, elapsed time: 00:00:08
- output file name=+FRA/clonedb/archivelog/2018_07_19/thread_1_seq_99.330.981923773 RECID=0 STAMP=0
- channel c2: archived log copy complete, elapsed time: 00:00:07
- output file name=+FRA/clonedb/archivelog/2018_07_19/thread_1_seq_100.338.981923779 RECID=0 STAMP=0
- channel c3: archived log copy complete, elapsed time: 00:00:02
- output file name=+FRA/clonedb/archivelog/2018_07_19/thread_1_seq_97.336.981923771 RECID=0 STAMP=0
- channel c5: archived log copy complete, elapsed time: 00:00:09
- output file name=+FRA/clonedb/archivelog/2018_07_19/thread_1_seq_97.259.981923773 RECID=0 STAMP=0
- channel c6: archived log copy complete, elapsed time: 00:00:09
- output file name=+FRA/clonedb/archivelog/2018_07_19/thread_1_seq_98.257.981923773 RECID=0 STAMP=0
- channel c7: archived log copy complete, elapsed time: 00:00:08
- output file name=+FRA/clonedb/archivelog/2018_07_19/thread_1_seq_98.286.981923773 RECID=0 STAMP=0
- channel c8: archived log copy complete, elapsed time: 00:00:08
- output file name=+FRA/clonedb/archivelog/2018_07_19/thread_1_seq_100.343.981923781 RECID=0 STAMP=0
- channel c4: archived log copy complete, elapsed time: 00:00:01
- Finished backup at 2018-07-19:20:36:21
- searching for all files in the recovery area
- List of Files Unknown to the Database
- =====================================
- File Name: +fra/CLONEDB/ARCHIVELOG/2018_07_19/thread_1_seq_95.350.981923771
- File Name: +fra/CLONEDB/ARCHIVELOG/2018_07_19/thread_1_seq_95.320.981923771
- File Name: +fra/CLONEDB/ARCHIVELOG/2018_07_19/thread_1_seq_96.294.981923771
- File Name: +fra/CLONEDB/ARCHIVELOG/2018_07_19/thread_1_seq_96.328.981923771
- File Name: +fra/CLONEDB/ARCHIVELOG/2018_07_19/thread_1_seq_97.336.981923771
- File Name: +fra/CLONEDB/ARCHIVELOG/2018_07_19/thread_1_seq_97.259.981923773
- File Name: +fra/CLONEDB/ARCHIVELOG/2018_07_19/thread_1_seq_98.257.981923773
- File Name: +fra/CLONEDB/ARCHIVELOG/2018_07_19/thread_1_seq_98.286.981923773
- File Name: +fra/CLONEDB/ARCHIVELOG/2018_07_19/thread_1_seq_99.355.981923773
- File Name: +fra/CLONEDB/ARCHIVELOG/2018_07_19/thread_1_seq_99.330.981923773
- File Name: +fra/CLONEDB/ARCHIVELOG/2018_07_19/thread_1_seq_100.338.981923779
- File Name: +fra/CLONEDB/ARCHIVELOG/2018_07_19/thread_1_seq_100.343.981923781
- File Name: +fra/CLONEDB/CONTROLFILE/Current.358.981923651
- cataloging files...
- cataloging done
- List of Cataloged Files
- =======================
- File Name: +fra/CLONEDB/ARCHIVELOG/2018_07_19/thread_1_seq_95.350.981923771
- File Name: +fra/CLONEDB/ARCHIVELOG/2018_07_19/thread_1_seq_95.320.981923771
- File Name: +fra/CLONEDB/ARCHIVELOG/2018_07_19/thread_1_seq_96.294.981923771
- File Name: +fra/CLONEDB/ARCHIVELOG/2018_07_19/thread_1_seq_96.328.981923771
- File Name: +fra/CLONEDB/ARCHIVELOG/2018_07_19/thread_1_seq_97.336.981923771
- File Name: +fra/CLONEDB/ARCHIVELOG/2018_07_19/thread_1_seq_97.259.981923773
- File Name: +fra/CLONEDB/ARCHIVELOG/2018_07_19/thread_1_seq_98.257.981923773
- File Name: +fra/CLONEDB/ARCHIVELOG/2018_07_19/thread_1_seq_98.286.981923773
- File Name: +fra/CLONEDB/ARCHIVELOG/2018_07_19/thread_1_seq_99.355.981923773
- File Name: +fra/CLONEDB/ARCHIVELOG/2018_07_19/thread_1_seq_99.330.981923773
- File Name: +fra/CLONEDB/ARCHIVELOG/2018_07_19/thread_1_seq_100.338.981923779
- File Name: +fra/CLONEDB/ARCHIVELOG/2018_07_19/thread_1_seq_100.343.981923781
- List of Files Which Where Not Cataloged
- =======================================
- File Name: +fra/CLONEDB/CONTROLFILE/Current.358.981923651
- RMAN-07517: Reason: The file header is corrupted
- datafile 1 switched to datafile copy
- input datafile copy RECID=38 STAMP=981923789 file name=+DATA/clonedb/datafile/system.262.981923705
- datafile 2 switched to datafile copy
- input datafile copy RECID=39 STAMP=981923789 file name=+DATA/clonedb/datafile/sysaux.259.981923707
- datafile 3 switched to datafile copy
- input datafile copy RECID=40 STAMP=981923789 file name=+DATA/clonedb/datafile/undotbs1.265.981923731
- datafile 5 switched to datafile copy
- input datafile copy RECID=41 STAMP=981923789 file name=+DATA/clonedb/datafile/example.256.981923747
- datafile 6 switched to datafile copy
- input datafile copy RECID=42 STAMP=981923789 file name=+DATA/clonedb/datafile/tbs1.257.981923731
- datafile 7 switched to datafile copy
- input datafile copy RECID=43 STAMP=981923789 file name=+DATA/clonedb/datafile/tbs2.258.981923743
- contents of Memory Script:
- {
- set until scn 1618281;
- recover
- clone database
- skip forever tablespace "USERS" delete archivelog
- ;
- }
- executing Memory Script
- executing command: SET until clause
- Starting recover at 2018-07-19:20:36:30
- Executing: alter database datafile 4 offline drop
- starting media recovery
- archived log for thread 1 with sequence 97 is already on disk as file +FRA/clonedb/archivelog/2018_07_19/thread_1_seq_97.336.981923771
- archived log for thread 1 with sequence 98 is already on disk as file +FRA/clonedb/archivelog/2018_07_19/thread_1_seq_98.257.981923773
- archived log for thread 1 with sequence 99 is already on disk as file +FRA/clonedb/archivelog/2018_07_19/thread_1_seq_99.355.981923773
- archived log for thread 1 with sequence 100 is already on disk as file +FRA/clonedb/archivelog/2018_07_19/thread_1_seq_100.338.981923779
- archived log file name=+FRA/clonedb/archivelog/2018_07_19/thread_1_seq_97.336.981923771 thread=1 sequence=97
- archived log file name=+FRA/clonedb/archivelog/2018_07_19/thread_1_seq_98.257.981923773 thread=1 sequence=98
- archived log file name=+FRA/clonedb/archivelog/2018_07_19/thread_1_seq_99.355.981923773 thread=1 sequence=99
- ORA-00279: change 1617151 generated at 07/19/2018 20:35:00 needed for thread 1
- ORA-00289: suggestion :
- +FRA/clonedb/archivelog/2018_07_19/thread_1_seq_99.330.981923773
- ORA-00280: change 1617151 for thread 1 is in sequence #99
- Specify log: {<RET>=suggested | filename | AUTO | CANCEL}
- ORA-00279: change 1617592 generated at 07/19/2018 20:35:49 needed for thread 1
- ORA-00289: suggestion :
- +FRA/clonedb/archivelog/2018_07_19/thread_1_seq_100.343.981923781
- ORA-00280: change 1617592 for thread 1 is in sequence #100
- ORA-00278: log file
- '+FRA/clonedb/archivelog/2018_07_19/thread_1_seq_99.330.981923773' no longer
- needed for this recovery
- alter database open resetlogs;
- released channel: c1
- released channel: c2
- released channel: c3
- released channel: c4
- released channel: c5
- released channel: c6
- released channel: c7
- released channel: c8
- released channel: c9
- released channel: c10
- released channel: c11
- released channel: c12
- released channel: c13
- released channel: c14
- released channel: c15
- released channel: c16
- RMAN>
复制代码
-------------------------------------------------------冷克隆:
- --源头把备份优化关掉,或用force语法
- run {
- allocate channel c1 device type disk format '/home/oracle/backup/%U';
- allocate channel c2 device type disk format '/home/oracle/backup/%U';
- allocate channel c3 device type disk format '/home/oracle/backup/%U';
- allocate channel c4 device type disk format '/home/oracle/backup/%U';
- allocate channel c5 device type disk format '/home/oracle/backup/%U';
- allocate channel c6 device type disk format '/home/oracle/backup/%U';
- allocate channel c7 device type disk format '/home/oracle/backup/%U';
- allocate channel c8 device type disk format '/home/oracle/backup/%U';
- backup database plus archivelog force;
- backup spfile;
- backup current controlfile;
- }
复制代码
把station86上的/home/oracle/backup/完整scp -rp到station87的/home/oracle/backup/
- run{
- allocate auxiliary channel c1 device type disk;
- allocate auxiliary channel c2 device type disk;
- allocate auxiliary channel c3 device type disk;
- allocate auxiliary channel c4 device type disk;
- allocate auxiliary channel c5 device type disk;
- allocate auxiliary channel c6 device type disk;
- allocate auxiliary channel c7 device type disk;
- allocate auxiliary channel c8 device type disk;
- duplicate target database to mydb
- backup location '/home/oracle/backup'
- nofilenamecheck
- spfile
- set
- control_files='/u01/app/oracle/oradata/mydb/control01.ctl','/u01/app/oracle/oradata/mydb/control02.ctl','/u01/app/oracle/oradata/mydb/control03.ctl'
- set
- db_file_name_convert='+DATA/orcl/datafile/example.258.880451611','/u01/app/oracle/oradata/mydb/example01.dbf','+DATA/orcl/datafile/users.259.880451615','/u01/app/oracle/oradata/mydb/users01.dbf','+DATA/orcl/datafile/undotbs1.256.880451607','/u01/app/oracle/oradata/mydb/undotbs01.dbf','+DATA/orcl/datafile/sysaux.257.880451605','/u01/app/oracle/oradata/mydb/sysaux01.dbf','+DATA/orcl/datafile/system.265.880451605','/u01/app/oracle/oradata/mydb/system01.dbf'
- set
- log_file_name_convert='+DATA/orcl/onlinelog/group_1.270.880453135','/u01/app/oracle/oradata/mydb/redo01a.log','+FRA/orcl/onlinelog/group_1.276.880453137','/u01/app/oracle/oradata/mydb/redo01b.log','+DATA/orcl/onlinelog/group_3.272.880453141','/u01/app/oracle/oradata/mydb/redo03a.log','+FRA/orcl/onlinelog/group_3.274.880453141','/u01/app/oracle/oradata/mydb/redo03b.log','+DATA/orcl/onlinelog/group_2.271.880453137','/u01/app/oracle/oradata/mydb/redo02a.log','+FRA/orcl/onlinelog/group_2.275.880453139','/u01/app/oracle/oradata/mydb/redo02b.log'
- set
- audit_file_dest='/u01/app/oracle/admin/mydb/adump'
- set
- db_create_file_dest=''
- set
- db_recovery_file_dest='/u01/app/oracle/flash_recovery_area'
- }
复制代码 物理坏块和逻辑坏块,其中物理坏块的制造脚本:
physical-block11.2.0.1.sh
(1.23 KB, 下载次数: 374)
|
|