千家信息网

Oracle 单实例文件系统转换为ASM

发表于:2024-11-26 作者:千家信息网编辑
千家信息网最后更新 2024年11月26日,copy 备份:[oraprod@ebsprod ~]$ rman target /Recovery Manager: Release 11.2.0.4.0 - Production on Mon J
千家信息网最后更新 2024年11月26日Oracle 单实例文件系统转换为ASM

copy 备份:

[oraprod@ebsprod ~]$ rman target /Recovery Manager: Release 11.2.0.4.0 - Production on Mon Jun 20 11:28:50 2016Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.connected to target database: PROD (DBID=325515888)RMAN> RUN{  ALLOCATE CHANNEL dev1 DEVICE TYPE DISK;  ALLOCATE CHANNEL dev2 DEVICE TYPE DISK;  ALLOCATE CHANNEL dev3 DEVICE TYPE DISK;  ALLOCATE CHANNEL dev4 DEVICE TYPE DISK;  BACKUP AS COPY    INCREMENTAL LEVEL 0    DATABASE    FORMAT '+DATA'    TAG 'ORA_ASM_MIGRATION';}2> 3> 4> 5> 6> 7> 8> 9> 10> 11> 12> using target database control file instead of recovery catalogallocated channel: dev1channel dev1: SID=109 device type=DISKallocated channel: dev2channel dev2: SID=205 device type=DISKallocated channel: dev3channel dev3: SID=306 device type=DISKallocated channel: dev4channel dev4: SID=12 device type=DISKStarting backup at 20-JUN-16channel dev1: starting datafile copyinput datafile file number=00013 name=/app/ora_prod/db/apps_st/data/system12.dbfchannel dev2: starting datafile copyinput datafile file number=00288 name=/app/ora_prod/db/apps_st/data/system10.dbfchannel dev3: starting datafile copyinput datafile file number=00402 name=/app/ora_prod/db/apps_st/data/a_txn_data03.dbfchannel dev4: starting datafile copyinput datafile file number=00014 name=/app/ora_prod/db/apps_st/data/a_txn_data04.dbfoutput file name=+DATA/prod/datafile/system.258.915017345 tag=ORA_ASM_MIGRATION RECID=1 STAMP=915019405channel dev2: datafile copy complete, elapsed time: 00:34:29channel dev2: starting datafile copyinput datafile file number=00401 name=/app/ora_prod/db/apps_st/data/a_txn_data02.dbfoutput file name=+DATA/prod/datafile/apps_ts_tx_data.257.915017345 tag=ORA_ASM_MIGRATION RECID=3 STAMP=915019416channel dev3: datafile copy complete, elapsed time: 00:34:33channel dev3: starting datafile copyinput datafile file number=00406 name=/app/ora_prod/db/apps_st/data/a_txn_ind05.dbfoutput file name=+DATA/prod/datafile/apps_ts_tx_data.256.915017345 tag=ORA_ASM_MIGRATION RECID=2 STAMP=915019415channel dev4: datafile copy complete, elapsed time: 00:34:34channel dev4: starting datafile copyinput datafile file number=00353 name=/app/ora_prod/db/apps_st/data/system08.dbfoutput file name=+DATA/prod/datafile/apps_ts_tx_idx.261.915019419 tag=ORA_ASM_MIGRATION RECID=4 STAMP=915020891channel dev3: datafile copy complete, elapsed time: 00:24:35channel dev3: starting datafile copyinput datafile file number=00405 name=/app/ora_prod/db/apps_st/data/a_txn_ind04.dbfoutput file name=+DATA/prod/datafile/system.262.915019421 tag=ORA_ASM_MIGRATION RECID=5 STAMP=915020917channel dev4: datafile copy complete, elapsed time: 00:24:60channel dev4: starting datafile copyinput datafile file number=00379 name=/app/ora_prod/db/apps_st/data/undo01.dbfoutput file name=+DATA/prod/datafile/apps_ts_tx_data.260.915019419 tag=ORA_ASM_MIGRATION RECID=6 STAMP=915020948channel dev2: datafile copy complete, elapsed time: 00:25:39channel dev2: starting datafile copyinput datafile file number=00394 name=/app/ora_prod/db/apps_st/data/a_ref01.dbfoutput file name=+DATA/prod/datafile/system.259.915017345 tag=ORA_ASM_MIGRATION RECID=7 STAMP=915021071channel dev1: datafile copy complete, elapsed time: 01:02:10channel dev1: starting datafile copyinput datafile file number=00403 name=/app/ora_prod/db/apps_st/data/a_txn_ind02.dbfoutput file name=+DATA/prod/datafile/apps_ts_seed.265.915020959 tag=ORA_ASM_MIGRATION RECID=8 STAMP=915022008channel dev2: datafile copy complete, elapsed time: 00:17:31channel dev2: starting datafile copyinput datafile file number=00392 name=/app/ora_prod/db/apps_st/data/a_txn_data01.dbfoutput file name=+DATA/prod/datafile/apps_undots1.264.915020925 tag=ORA_ASM_MIGRATION RECID=9 STAMP=915022032channel dev4: datafile copy complete, elapsed time: 00:18:35channel dev4: starting datafile copyinput datafile file number=00400 name=/app/ora_prod/db/apps_st/data/a_media01.dbfoutput file name=+DATA/prod/datafile/apps_ts_tx_idx.266.915021079 tag=ORA_ASM_MIGRATION RECID=10 STAMP=915022041channel dev1: datafile copy complete, elapsed time: 00:16:04channel dev1: starting datafile copyinput datafile file number=00407 name=/app/ora_prod/db/apps_st/data/a_ref02.dbfoutput file name=+DATA/prod/datafile/apps_ts_tx_idx.263.915020895 tag=ORA_ASM_MIGRATION RECID=11 STAMP=915022110channel dev3: datafile copy complete, elapsed time: 00:20:25channel dev3: starting datafile copyinput datafile file number=00396 name=/app/ora_prod/db/apps_st/data/a_summ01.dbfoutput file name=+DATA/prod/datafile/apps_ts_seed.269.915022045 tag=ORA_ASM_MIGRATION RECID=12 STAMP=915022812channel dev1: datafile copy complete, elapsed time: 00:12:57channel dev1: starting datafile copyinput datafile file number=00393 name=/app/ora_prod/db/apps_st/data/a_txn_ind01.dbfoutput file name=+DATA/prod/datafile/apps_ts_summary.270.915022123 tag=ORA_ASM_MIGRATION RECID=13 STAMP=915022828channel dev3: datafile copy complete, elapsed time: 00:11:50channel dev3: starting datafile copyinput datafile file number=00015 name=/app/ora_prod/db/apps_st/data/a_txn_ind06.dbfoutput file name=+DATA/prod/datafile/apps_ts_media.268.915022041 tag=ORA_ASM_MIGRATION RECID=14 STAMP=915022965channel dev4: datafile copy complete, elapsed time: 00:15:38channel dev4: starting datafile copyinput datafile file number=00404 name=/app/ora_prod/db/apps_st/data/a_txn_ind03.dbfoutput file name=+DATA/prod/datafile/apps_ts_tx_data.267.915022013 tag=ORA_ASM_MIGRATION RECID=15 STAMP=915023002channel dev2: datafile copy complete, elapsed time: 00:16:32channel dev2: starting datafile copyinput datafile file number=00395 name=/app/ora_prod/db/apps_st/data/a_int01.dbfoutput file name=+DATA/prod/datafile/apps_ts_tx_idx.272.915022833 tag=ORA_ASM_MIGRATION RECID=16 STAMP=915023669channel dev3: datafile copy complete, elapsed time: 00:14:04channel dev3: starting datafile copyinput datafile file number=00352 name=/app/ora_prod/db/apps_st/data/system09.dbfoutput file name=+DATA/prod/datafile/apps_ts_tx_idx.271.915022823 tag=ORA_ASM_MIGRATION RECID=17 STAMP=915023698channel dev1: datafile copy complete, elapsed time: 00:14:38channel dev1: starting datafile copyinput datafile file number=00001 name=/app/ora_prod/db/apps_st/data/system01.dbfoutput file name=+DATA/prod/datafile/apps_ts_interface.274.915023007 tag=ORA_ASM_MIGRATION RECID=18 STAMP=915023748channel dev2: datafile copy complete, elapsed time: 00:12:35channel dev2: starting datafile copyinput datafile file number=00002 name=/app/ora_prod/db/apps_st/data/system02.dbfoutput file name=+DATA/prod/datafile/apps_ts_tx_idx.273.915022981 tag=ORA_ASM_MIGRATION RECID=19 STAMP=915023787channel dev4: datafile copy complete, elapsed time: 00:13:38channel dev4: starting datafile copyinput datafile file number=00003 name=/app/ora_prod/db/apps_st/data/system03.dbfoutput file name=+DATA/prod/datafile/system.276.915023707 tag=ORA_ASM_MIGRATION RECID=21 STAMP=915024715channel dev1: datafile copy complete, elapsed time: 00:16:56channel dev1: starting datafile copyinput datafile file number=00004 name=/app/ora_prod/db/apps_st/data/system04.dbfoutput file name=+DATA/prod/datafile/system.275.915023677 tag=ORA_ASM_MIGRATION RECID=20 STAMP=915024710channel dev3: datafile copy complete, elapsed time: 00:17:25channel dev3: starting datafile copyinput datafile file number=00005 name=/app/ora_prod/db/apps_st/data/system05.dbfoutput file name=+DATA/prod/datafile/system.277.915023763 tag=ORA_ASM_MIGRATION RECID=22 STAMP=915024730channel dev2: datafile copy complete, elapsed time: 00:16:17channel dev2: starting datafile copyinput datafile file number=00398 name=/app/ora_prod/db/apps_st/data/a_archive01.dbfoutput file name=+DATA/prod/datafile/system.278.915023799 tag=ORA_ASM_MIGRATION RECID=23 STAMP=915024767channel dev4: datafile copy complete, elapsed time: 00:16:17channel dev4: starting datafile copyinput datafile file number=00295 name=/app/ora_prod/db/apps_st/data/system06.dbfoutput file name=+DATA/prod/datafile/apps_ts_archive.281.915024741 tag=ORA_ASM_MIGRATION RECID=24 STAMP=915025460channel dev2: datafile copy complete, elapsed time: 00:12:06channel dev2: starting datafile copyinput datafile file number=00351 name=/app/ora_prod/db/apps_st/data/system07.dbfoutput file name=+DATA/prod/datafile/system.282.915024777 tag=ORA_ASM_MIGRATION RECID=25 STAMP=915025475channel dev4: datafile copy complete, elapsed time: 00:11:47channel dev4: starting datafile copyinput datafile file number=00354 name=/app/ora_prod/db/apps_st/data/system11.dbfoutput file name=+DATA/prod/datafile/system.279.915024723 tag=ORA_ASM_MIGRATION RECID=26 STAMP=915025584channel dev1: datafile copy complete, elapsed time: 00:14:29channel dev1: starting datafile copyinput datafile file number=00008 name=/app/ora_prod/db/apps_st/data/a_queue02.dbfoutput file name=+DATA/prod/datafile/system.280.915024725 tag=ORA_ASM_MIGRATION RECID=27 STAMP=915025598channel dev3: datafile copy complete, elapsed time: 00:14:44channel dev3: starting datafile copyinput datafile file number=00012 name=/app/ora_prod/db/apps_st/data/apps_ts_tools01.dbfoutput file name=+DATA/prod/datafile/apps_ts_queues.285.915025591 tag=ORA_ASM_MIGRATION RECID=28 STAMP=915025942channel dev1: datafile copy complete, elapsed time: 00:05:54channel dev1: starting datafile copyinput datafile file number=00399 name=/app/ora_prod/db/apps_st/data/a_queue01.dbfoutput file name=+DATA/prod/datafile/apps_ts_tools.286.915025609 tag=ORA_ASM_MIGRATION RECID=29 STAMP=915025967channel dev3: datafile copy complete, elapsed time: 00:06:04channel dev3: starting datafile copyinput datafile file number=00016 name=/app/ora_prod/db/apps_st/data/a_ref03.dbfoutput file name=+DATA/prod/datafile/system.283.915025469 tag=ORA_ASM_MIGRATION RECID=30 STAMP=915026003channel dev2: datafile copy complete, elapsed time: 00:09:00channel dev2: starting datafile copyinput datafile file number=00011 name=/app/ora_prod/db/apps_st/data/sysaux01.dbfoutput file name=+DATA/prod/datafile/system.284.915025485 tag=ORA_ASM_MIGRATION RECID=31 STAMP=915026035channel dev4: datafile copy complete, elapsed time: 00:09:20channel dev4: starting datafile copyinput datafile file number=00018 name=/app/ora_prod/db/apps_st/data/sysaux02.dbfoutput file name=+DATA/prod/datafile/sysaux.290.915026047 tag=ORA_ASM_MIGRATION RECID=32 STAMP=915026220channel dev4: datafile copy complete, elapsed time: 00:03:00channel dev4: starting datafile copyinput datafile file number=00006 name=/app/ora_prod/db/apps_st/data/ctxd01.dbfoutput file name=+DATA/prod/datafile/apps_ts_seed.288.915025973 tag=ORA_ASM_MIGRATION RECID=33 STAMP=915026265channel dev3: datafile copy complete, elapsed time: 00:05:01channel dev3: starting datafile copyinput datafile file number=00314 name=/app/ora_prod/db/apps_st/data/portal01.dbfoutput file name=+DATA/prod/datafile/apps_ts_queues.287.915025947 tag=ORA_ASM_MIGRATION RECID=34 STAMP=915026275channel dev1: datafile copy complete, elapsed time: 00:05:34channel dev1: starting datafile copyinput datafile file number=00397 name=/app/ora_prod/db/apps_st/data/a_nolog01.dbfoutput file name=+DATA/prod/datafile/sysaux.289.915026009 tag=ORA_ASM_MIGRATION RECID=35 STAMP=915026280channel dev2: datafile copy complete, elapsed time: 00:04:34channel dev2: starting datafile copyinput datafile file number=00009 name=/app/ora_prod/db/apps_st/data/odm.dbfoutput file name=+DATA/prod/datafile/ctxd.291.915026227 tag=ORA_ASM_MIGRATION RECID=36 STAMP=915026294channel dev4: datafile copy complete, elapsed time: 00:01:11channel dev4: starting datafile copycopying current control fileoutput file name=+DATA/prod/datafile/odm.294.915026285 tag=ORA_ASM_MIGRATION RECID=37 STAMP=915026313channel dev2: datafile copy complete, elapsed time: 00:00:32channel dev2: starting datafile copyinput datafile file number=00010 name=/app/ora_prod/db/apps_st/data/olap.dbfoutput file name=+DATA/prod/datafile/apps_ts_nologging.293.915026283 tag=ORA_ASM_MIGRATION RECID=38 STAMP=915026314channel dev1: datafile copy complete, elapsed time: 00:00:35channel dev1: starting datafile copyinput datafile file number=00017 name=/app/ora_prod/db/apps_st/data/a_int02.dbfoutput file name=+DATA/prod/datafile/apps_ts_interface.297.915026319 tag=ORA_ASM_MIGRATION RECID=42 STAMP=915026328channel dev1: datafile copy complete, elapsed time: 00:00:15channel dev1: starting datafile copyinput datafile file number=00007 name=/app/ora_prod/db/apps_st/data/owad01.dbfoutput file name=+DATA/prod/datafile/olap.296.915026317 tag=ORA_ASM_MIGRATION RECID=40 STAMP=915026327channel dev2: datafile copy complete, elapsed time: 00:00:18channel dev2: starting incremental level 0 datafile backup setchannel dev2: specifying datafile(s) in backup setincluding current SPFILE in backup setchannel dev2: starting piece 1 at 20-JUN-16output file name=+DATA/prod/datafile/portal.292.915026277 tag=ORA_ASM_MIGRATION RECID=39 STAMP=915026327channel dev3: datafile copy complete, elapsed time: 00:01:01output file name=+DATA/prod/controlfile/backup.295.915026299 tag=ORA_ASM_MIGRATION RECID=41 STAMP=915026328channel dev4: datafile copy complete, elapsed time: 00:00:35output file name=+DATA/prod/datafile/owapub.298.915026333 tag=ORA_ASM_MIGRATION RECID=43 STAMP=915026335channel dev1: datafile copy complete, elapsed time: 00:00:04channel dev2: finished piece 1 at 20-JUN-16piece handle=+DATA/prod/backupset/2016_06_20/nnsnn0_ora_asm_migration_0.299.915026335 tag=ORA_ASM_MIGRATION comment=NONEchannel dev2: backup set complete, elapsed time: 00:00:03Finished backup at 20-JUN-16released channel: dev1released channel: dev2released channel: dev3released channel: dev4RMAN> BACKUP AS BACKUPSET SPFILE;Starting backup at 20-JUN-16allocated channel: ORA_DISK_1channel ORA_DISK_1: SID=109 device type=DISKchannel ORA_DISK_1: starting full datafile backup setchannel ORA_DISK_1: specifying datafile(s) in backup setincluding current SPFILE in backup setchannel ORA_DISK_1: starting piece 1 at 20-JUN-16channel ORA_DISK_1: finished piece 1 at 20-JUN-16piece handle=/app/ora_prod/db/tech_st/11.2.0/dbs/1hr8kcrg_1_1 tag=TAG20160620T140640 comment=NONEchannel ORA_DISK_1: backup set complete, elapsed time: 00:00:01Finished backup at 20-JUN-16RMAN> shutdown immediate;database closeddatabase dismountedOracle instance shut downRMAN> startup mount;connected to target database (not started)Oracle instance starteddatabase mountedTotal System Global Area    1068937216 bytesFixed Size                     2260088 bytesVariable Size                482345864 bytesDatabase Buffers             570425344 bytesRedo Buffers                  13905920 bytesRMAN> RESTORE SPFILE TO '+DATA/PROD/spfile/spfilePROD.ora';Starting restore at 20-JUN-16allocated channel: ORA_DISK_1channel ORA_DISK_1: SID=301 device type=DISKchannel ORA_DISK_1: starting datafile backup set restorechannel ORA_DISK_1: restoring SPFILEoutput file name=+DATA/PROD/spfile/spfilePROD.orachannel ORA_DISK_1: reading from backup piece /app/ora_prod/db/tech_st/11.2.0/dbs/1hr8kcrg_1_1channel ORA_DISK_1: piece handle=/app/ora_prod/db/tech_st/11.2.0/dbs/1hr8kcrg_1_1 tag=TAG20160620T140640channel ORA_DISK_1: restored backup piece 1channel ORA_DISK_1: restore complete, elapsed time: 00:00:07Finished restore at 20-JUN-16RMAN> STARTUP FORCE NOMOUNT;Oracle instance startedTotal System Global Area    1068937216 bytesFixed Size                     2260088 bytesVariable Size                482345864 bytesDatabase Buffers             570425344 bytesRedo Buffers                  13905920 bytes

修改控制文件路径:

[oraprod@ebsprod ~]$ sqlplus / as sysdbaSQL*Plus: Release 11.2.0.4.0 Production on Mon Jun 20 14:13:26 2016Copyright (c) 1982, 2013, Oracle.  All rights reserved.Connected to:Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit ProductionWith the Partitioning, OLAP, Data Mining and Real Application Testing optionsSQL> ALTER SYSTEM SET DB_CREATE_FILE_DEST='+DATA' SID='*';System altered.SQL> ALTER SYSTEM SET DB_RECOVERY_FILE_DEST_SIZE=100G SID='*';System altered.SQL> ALTER SYSTEM SET DB_RECOVERY_FILE_DEST='+FRA' SID='*';System altered.SQL> STARTUP FORCE NOMOUNT;ORACLE instance started.Total System Global Area 1068937216 bytesFixed Size    2260088 bytesVariable Size  482345864 bytesDatabase Buffers  570425344 bytesRedo Buffers   13905920 bytesSQL>  ALTER SYSTEM SET CONTROL_FILES='+DATA','+FRA' SCOPE=SPFILE SID='*';System altered.SQL> exitDisconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit ProductionWith the Partitioning, OLAP, Data Mining and Real Application Testing options

还原控制文件到ASM磁盘组上

[oraprod@ebsprod ~]$ rman target /Recovery Manager: Release 11.2.0.4.0 - Production on Mon Jun 20 14:15:20 2016Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.connected to target database: PROD (not mounted)RMAN> STARTUP FORCE NOMOUNT;Oracle instance startedTotal System Global Area    1068937216 bytesFixed Size                     2260088 bytesVariable Size                482345864 bytesDatabase Buffers             570425344 bytesRedo Buffers                  13905920 bytesRMAN> RESTORE CONTROLFILE FROM '/app/ora_prod/db/apps_st/data/cntrl01.dbf';Starting restore at 20-JUN-16using target database control file instead of recovery catalogallocated channel: ORA_DISK_1channel ORA_DISK_1: SID=307 device type=DISKchannel ORA_DISK_1: copied control file copyoutput file name=+DATA/prod/controlfile/current.301.915027381output file name=+FRA/prod/controlfile/current.256.915027385Finished restore at 20-JUN-16RMAN> ALTER DATABASE MOUNT;database mountedreleased channel: ORA_DISK_1

切换datafile:

RMAN> SWITCH DATABASE TO COPY;RUN{  ALLOCATE CHANNEL dev1 DEVICE TYPE DISK;  ALLOCATE CHANNEL dev2 DEVICE TYPE DISK;  ALLOCATE CHANNEL dev3 DEVICE TYPE DISK;  ALLOCATE CHANNEL dev4 DEVICE TYPE DISK;  RECOVER DATABASE;}datafile 1 switched to datafile copy "+DATA/prod/datafile/system.276.915023707"datafile 2 switched to datafile copy "+DATA/prod/datafile/system.277.915023763"datafile 3 switched to datafile copy "+DATA/prod/datafile/system.278.915023799"datafile 4 switched to datafile copy "+DATA/prod/datafile/system.279.915024723"datafile 5 switched to datafile copy "+DATA/prod/datafile/system.280.915024725"datafile 6 switched to datafile copy "+DATA/prod/datafile/ctxd.291.915026227"datafile 7 switched to datafile copy "+DATA/prod/datafile/owapub.298.915026333"datafile 8 switched to datafile copy "+DATA/prod/datafile/apps_ts_queues.285.915025591"datafile 9 switched to datafile copy "+DATA/prod/datafile/odm.294.915026285"datafile 10 switched to datafile copy "+DATA/prod/datafile/olap.296.915026317"datafile 11 switched to datafile copy "+DATA/prod/datafile/sysaux.289.915026009"datafile 12 switched to datafile copy "+DATA/prod/datafile/apps_ts_tools.286.915025609"datafile 13 switched to datafile copy "+DATA/prod/datafile/system.259.915017345"datafile 14 switched to datafile copy "+DATA/prod/datafile/apps_ts_tx_data.256.915017345"datafile 15 switched to datafile copy "+DATA/prod/datafile/apps_ts_tx_idx.272.915022833"datafile 16 switched to datafile copy "+DATA/prod/datafile/apps_ts_seed.288.915025973"datafile 17 switched to datafile copy "+DATA/prod/datafile/apps_ts_interface.297.915026319"datafile 18 switched to datafile copy "+DATA/prod/datafile/sysaux.290.915026047"datafile 288 switched to datafile copy "+DATA/prod/datafile/system.258.915017345"datafile 295 switched to datafile copy "+DATA/prod/datafile/system.282.915024777"datafile 314 switched to datafile copy "+DATA/prod/datafile/portal.292.915026277"datafile 351 switched to datafile copy "+DATA/prod/datafile/system.283.915025469"datafile 352 switched to datafile copy "+DATA/prod/datafile/system.275.915023677"datafile 353 switched to datafile copy "+DATA/prod/datafile/system.262.915019421"datafile 354 switched to datafile copy "+DATA/prod/datafile/system.284.915025485"datafile 379 switched to datafile copy "+DATA/prod/datafile/apps_undots1.264.915020925"datafile 392 switched to datafile copy "+DATA/prod/datafile/apps_ts_tx_data.267.915022013"datafile 393 switched to datafile copy "+DATA/prod/datafile/apps_ts_tx_idx.271.915022823"datafile 394 switched to datafile copy "+DATA/prod/datafile/apps_ts_seed.265.915020959"datafile 395 switched to datafile copy "+DATA/prod/datafile/apps_ts_interface.274.915023007"datafile 396 switched to datafile copy "+DATA/prod/datafile/apps_ts_summary.270.915022123"datafile 397 switched to datafile copy "+DATA/prod/datafile/apps_ts_nologging.293.915026283"datafile 398 switched to datafile copy "+DATA/prod/datafile/apps_ts_archive.281.915024741"datafile 399 switched to datafile copy "+DATA/prod/datafile/apps_ts_queues.287.915025947"datafile 400 switched to datafile copy "+DATA/prod/datafile/apps_ts_media.268.915022041"datafile 401 switched to datafile copy "+DATA/prod/datafile/apps_ts_tx_data.260.915019419"datafile 402 switched to datafile copy "+DATA/prod/datafile/apps_ts_tx_data.257.915017345"datafile 403 switched to datafile copy "+DATA/prod/datafile/apps_ts_tx_idx.266.915021079"datafile 404 switched to datafile copy "+DATA/prod/datafile/apps_ts_tx_idx.273.915022981"datafile 405 switched to datafile copy "+DATA/prod/datafile/apps_ts_tx_idx.263.915020895"datafile 406 switched to datafile copy "+DATA/prod/datafile/apps_ts_tx_idx.261.915019419"datafile 407 switched to datafile copy "+DATA/prod/datafile/apps_ts_seed.269.915022045"RMAN> 2> 3> 4> 5> 6> 7> 8> allocated channel: dev1channel dev1: SID=107 device type=DISKallocated channel: dev2channel dev2: SID=207 device type=DISKallocated channel: dev3channel dev3: SID=308 device type=DISKallocated channel: dev4channel dev4: SID=7 device type=DISKStarting recover at 20-JUN-16starting media recovery557.dbf557.dbfarchived log file name=/app/ora_prod/db/tech_st/11.2.0/dbs/arch2_73_913677557.dbf thread=1 sequence=73media recovery complete, elapsed time: 00:00:16Finished recover at 20-JUN-16released channel: dev1released channel: dev2released channel: dev3released channel: dev4


[oraprod@ebsprod ~]$ sqlplus / as sysdbaSQL*Plus: Release 11.2.0.4.0 Production on Mon Jun 20 14:19:54 2016Copyright (c) 1982, 2013, Oracle.  All rights reserved.Connected to:Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit ProductionWith the Partitioning, Automatic Storage Management, OLAP, Data Miningand Real Application Testing optionsSQL> ALTER DATABASE ENABLE BLOCK CHANGE TRACKING USING FILE '+DATA';Database altered.SQL> ALTER DATABASE FLASHBACK ON;Database altered.SQL> ALTER DATABASE OPEN;Database altered.

处理临时表空间:

SQL> select name from v$tempfile;SQL> ALTER DATABASE TEMPFILE '/app/ora_prod/db/apps_st/data/temp01.dbf' DROP;Database altered.SQL> ALTER DATABASE TEMPFILE '/app/ora_prod/db/apps_st/data/temp02.dbf' DROP;Database altered.SQL>  ALTER TABLESPACE TEMP1 ADD TEMPFILE;SQL>  ALTER TABLESPACE TEMP2 ADD TEMPFILE;


处理日志文件:

DECLARE   CURSOR rlc IS      SELECT GROUP# GRP, THREAD# THR, BYTES, 'NO' SRL      FROM   V$LOG      UNION      SELECT GROUP# GRP, THREAD# THR, BYTES, 'YES' SRL      FROM   V$STANDBY_LOG      ORDER BY 1;   stmt     VARCHAR2(2048);BEGIN   FOR rlcRec IN rlc LOOP      IF (rlcRec.srl = 'YES') THEN         stmt := 'ALTER DATABASE ADD STANDBY LOGFILE THREAD ' ||                 rlcRec.thr || ' SIZE ' || rlcRec.bytes;         EXECUTE IMMEDIATE stmt;         stmt := 'ALTER DATABASE DROP STANDBY LOGFILE GROUP ' || rlcRec.grp;         EXECUTE IMMEDIATE stmt;      ELSE         stmt := 'ALTER DATABASE ADD LOGFILE THREAD ' ||                 rlcRec.thr || ' SIZE ' ||  rlcRec.bytes;         EXECUTE IMMEDIATE stmt;         BEGIN            stmt := 'ALTER DATABASE DROP LOGFILE GROUP ' || rlcRec.grp;            DBMS_OUTPUT.PUT_LINE(stmt);            EXECUTE IMMEDIATE stmt;         EXCEPTION            WHEN OTHERS THEN               EXECUTE IMMEDIATE 'ALTER SYSTEM SWITCH LOGFILE';               EXECUTE IMMEDIATE 'ALTER SYSTEM CHECKPOINT GLOBAL';               EXECUTE IMMEDIATE stmt;         END;      END IF;   END LOOP;END;


0