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

前端之家收集整理的这篇文章主要介绍了Oracle 单实例文件系统转换为ASM前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

copy 备份:

[oraprod@ebsprod~]$rmantarget/
RecoveryManager:Release11.2.0.4.0-ProductiononMonJun2011:28:502016
Copyright(c)1982,2011,Oracleand/oritsaffiliates.Allrightsreserved.
connectedtotargetdatabase:PROD(DBID=325515888)
RMAN>RUN
{
ALLOCATECHANNELdev1DEVICETYPEDISK;
ALLOCATECHANNELdev2DEVICETYPEDISK;
ALLOCATECHANNELdev3DEVICETYPEDISK;
ALLOCATECHANNELdev4DEVICETYPEDISK;
BACKUPASCOPY
INCREMENTALLEVEL0
DATABASE
FORMAT'+DATA'
TAG'ORA_ASM_MIGRATION';
}2>3>4>5>6>7>8>9>10>11>12>
usingtargetdatabasecontrolfileinsteadofrecoverycatalog
allocatedchannel:dev1
channeldev1:SID=109devicetype=DISK
allocatedchannel:dev2
channeldev2:SID=205devicetype=DISK
allocatedchannel:dev3
channeldev3:SID=306devicetype=DISK
allocatedchannel:dev4
channeldev4:SID=12devicetype=DISK
Startingbackupat20-JUN-16
channeldev1:startingdatafilecopy
inputdatafilefilenumber=00013name=/app/ora_prod/db/apps_st/data/system12.dbf
channeldev2:startingdatafilecopy
inputdatafilefilenumber=00288name=/app/ora_prod/db/apps_st/data/system10.dbf
channeldev3:startingdatafilecopy
inputdatafilefilenumber=00402name=/app/ora_prod/db/apps_st/data/a_txn_data03.dbf
channeldev4:startingdatafilecopy
inputdatafilefilenumber=00014name=/app/ora_prod/db/apps_st/data/a_txn_data04.dbf
outputfilename=+DATA/prod/datafile/system.258.915017345tag=ORA_ASM_MIGRATIONRECID=1STAMP=915019405
channeldev2:datafilecopycomplete,elapsedtime:00:34:29
channeldev2:startingdatafilecopy
inputdatafilefilenumber=00401name=/app/ora_prod/db/apps_st/data/a_txn_data02.dbf
outputfilename=+DATA/prod/datafile/apps_ts_tx_data.257.915017345tag=ORA_ASM_MIGRATIONRECID=3STAMP=915019416
channeldev3:datafilecopycomplete,elapsedtime:00:34:33
channeldev3:startingdatafilecopy
inputdatafilefilenumber=00406name=/app/ora_prod/db/apps_st/data/a_txn_ind05.dbf
outputfilename=+DATA/prod/datafile/apps_ts_tx_data.256.915017345tag=ORA_ASM_MIGRATIONRECID=2STAMP=915019415
channeldev4:datafilecopycomplete,elapsedtime:00:34:34
channeldev4:startingdatafilecopy
inputdatafilefilenumber=00353name=/app/ora_prod/db/apps_st/data/system08.dbf
outputfilename=+DATA/prod/datafile/apps_ts_tx_idx.261.915019419tag=ORA_ASM_MIGRATIONRECID=4STAMP=915020891
channeldev3:datafilecopycomplete,elapsedtime:00:24:35
channeldev3:startingdatafilecopy
inputdatafilefilenumber=00405name=/app/ora_prod/db/apps_st/data/a_txn_ind04.dbf
outputfilename=+DATA/prod/datafile/system.262.915019421tag=ORA_ASM_MIGRATIONRECID=5STAMP=915020917
channeldev4:datafilecopycomplete,elapsedtime:00:24:60
channeldev4:startingdatafilecopy
inputdatafilefilenumber=00379name=/app/ora_prod/db/apps_st/data/undo01.dbf
outputfilename=+DATA/prod/datafile/apps_ts_tx_data.260.915019419tag=ORA_ASM_MIGRATIONRECID=6STAMP=915020948
channeldev2:datafilecopycomplete,elapsedtime:00:25:39
channeldev2:startingdatafilecopy
inputdatafilefilenumber=00394name=/app/ora_prod/db/apps_st/data/a_ref01.dbf
outputfilename=+DATA/prod/datafile/system.259.915017345tag=ORA_ASM_MIGRATIONRECID=7STAMP=915021071
channeldev1:datafilecopycomplete,elapsedtime:01:02:10
channeldev1:startingdatafilecopy
inputdatafilefilenumber=00403name=/app/ora_prod/db/apps_st/data/a_txn_ind02.dbf
outputfilename=+DATA/prod/datafile/apps_ts_seed.265.915020959tag=ORA_ASM_MIGRATIONRECID=8STAMP=915022008
channeldev2:datafilecopycomplete,elapsedtime:00:17:31
channeldev2:startingdatafilecopy
inputdatafilefilenumber=00392name=/app/ora_prod/db/apps_st/data/a_txn_data01.dbf
outputfilename=+DATA/prod/datafile/apps_undots1.264.915020925tag=ORA_ASM_MIGRATIONRECID=9STAMP=915022032
channeldev4:datafilecopycomplete,elapsedtime:00:18:35
channeldev4:startingdatafilecopy
inputdatafilefilenumber=00400name=/app/ora_prod/db/apps_st/data/a_media01.dbf
outputfilename=+DATA/prod/datafile/apps_ts_tx_idx.266.915021079tag=ORA_ASM_MIGRATIONRECID=10STAMP=915022041
channeldev1:datafilecopycomplete,elapsedtime:00:16:04
channeldev1:startingdatafilecopy
inputdatafilefilenumber=00407name=/app/ora_prod/db/apps_st/data/a_ref02.dbf
outputfilename=+DATA/prod/datafile/apps_ts_tx_idx.263.915020895tag=ORA_ASM_MIGRATIONRECID=11STAMP=915022110
channeldev3:datafilecopycomplete,elapsedtime:00:20:25
channeldev3:startingdatafilecopy
inputdatafilefilenumber=00396name=/app/ora_prod/db/apps_st/data/a_summ01.dbf
outputfilename=+DATA/prod/datafile/apps_ts_seed.269.915022045tag=ORA_ASM_MIGRATIONRECID=12STAMP=915022812
channeldev1:datafilecopycomplete,elapsedtime:00:12:57
channeldev1:startingdatafilecopy
inputdatafilefilenumber=00393name=/app/ora_prod/db/apps_st/data/a_txn_ind01.dbf
outputfilename=+DATA/prod/datafile/apps_ts_summary.270.915022123tag=ORA_ASM_MIGRATIONRECID=13STAMP=915022828
channeldev3:datafilecopycomplete,elapsedtime:00:11:50
channeldev3:startingdatafilecopy
inputdatafilefilenumber=00015name=/app/ora_prod/db/apps_st/data/a_txn_ind06.dbf
outputfilename=+DATA/prod/datafile/apps_ts_media.268.915022041tag=ORA_ASM_MIGRATIONRECID=14STAMP=915022965
channeldev4:datafilecopycomplete,elapsedtime:00:15:38
channeldev4:startingdatafilecopy
inputdatafilefilenumber=00404name=/app/ora_prod/db/apps_st/data/a_txn_ind03.dbf
outputfilename=+DATA/prod/datafile/apps_ts_tx_data.267.915022013tag=ORA_ASM_MIGRATIONRECID=15STAMP=915023002
channeldev2:datafilecopycomplete,elapsedtime:00:16:32
channeldev2:startingdatafilecopy
inputdatafilefilenumber=00395name=/app/ora_prod/db/apps_st/data/a_int01.dbf
outputfilename=+DATA/prod/datafile/apps_ts_tx_idx.272.915022833tag=ORA_ASM_MIGRATIONRECID=16STAMP=915023669
channeldev3:datafilecopycomplete,elapsedtime:00:14:04
channeldev3:startingdatafilecopy
inputdatafilefilenumber=00352name=/app/ora_prod/db/apps_st/data/system09.dbf
outputfilename=+DATA/prod/datafile/apps_ts_tx_idx.271.915022823tag=ORA_ASM_MIGRATIONRECID=17STAMP=915023698
channeldev1:datafilecopycomplete,elapsedtime:00:14:38
channeldev1:startingdatafilecopy
inputdatafilefilenumber=00001name=/app/ora_prod/db/apps_st/data/system01.dbf
outputfilename=+DATA/prod/datafile/apps_ts_interface.274.915023007tag=ORA_ASM_MIGRATIONRECID=18STAMP=915023748
channeldev2:datafilecopycomplete,elapsedtime:00:12:35
channeldev2:startingdatafilecopy
inputdatafilefilenumber=00002name=/app/ora_prod/db/apps_st/data/system02.dbf
outputfilename=+DATA/prod/datafile/apps_ts_tx_idx.273.915022981tag=ORA_ASM_MIGRATIONRECID=19STAMP=915023787
channeldev4:datafilecopycomplete,elapsedtime:00:13:38
channeldev4:startingdatafilecopy
inputdatafilefilenumber=00003name=/app/ora_prod/db/apps_st/data/system03.dbf
outputfilename=+DATA/prod/datafile/system.276.915023707tag=ORA_ASM_MIGRATIONRECID=21STAMP=915024715
channeldev1:datafilecopycomplete,elapsedtime:00:16:56
channeldev1:startingdatafilecopy
inputdatafilefilenumber=00004name=/app/ora_prod/db/apps_st/data/system04.dbf
outputfilename=+DATA/prod/datafile/system.275.915023677tag=ORA_ASM_MIGRATIONRECID=20STAMP=915024710
channeldev3:datafilecopycomplete,elapsedtime:00:17:25
channeldev3:startingdatafilecopy
inputdatafilefilenumber=00005name=/app/ora_prod/db/apps_st/data/system05.dbf
outputfilename=+DATA/prod/datafile/system.277.915023763tag=ORA_ASM_MIGRATIONRECID=22STAMP=915024730
channeldev2:datafilecopycomplete,elapsedtime:00:16:17
channeldev2:startingdatafilecopy
inputdatafilefilenumber=00398name=/app/ora_prod/db/apps_st/data/a_archive01.dbf
outputfilename=+DATA/prod/datafile/system.278.915023799tag=ORA_ASM_MIGRATIONRECID=23STAMP=915024767
channeldev4:datafilecopycomplete,elapsedtime:00:16:17
channeldev4:startingdatafilecopy
inputdatafilefilenumber=00295name=/app/ora_prod/db/apps_st/data/system06.dbf
outputfilename=+DATA/prod/datafile/apps_ts_archive.281.915024741tag=ORA_ASM_MIGRATIONRECID=24STAMP=915025460
channeldev2:datafilecopycomplete,elapsedtime:00:12:06
channeldev2:startingdatafilecopy
inputdatafilefilenumber=00351name=/app/ora_prod/db/apps_st/data/system07.dbf
outputfilename=+DATA/prod/datafile/system.282.915024777tag=ORA_ASM_MIGRATIONRECID=25STAMP=915025475
channeldev4:datafilecopycomplete,elapsedtime:00:11:47
channeldev4:startingdatafilecopy
inputdatafilefilenumber=00354name=/app/ora_prod/db/apps_st/data/system11.dbf
outputfilename=+DATA/prod/datafile/system.279.915024723tag=ORA_ASM_MIGRATIONRECID=26STAMP=915025584
channeldev1:datafilecopycomplete,elapsedtime:00:14:29
channeldev1:startingdatafilecopy
inputdatafilefilenumber=00008name=/app/ora_prod/db/apps_st/data/a_queue02.dbf
outputfilename=+DATA/prod/datafile/system.280.915024725tag=ORA_ASM_MIGRATIONRECID=27STAMP=915025598
channeldev3:datafilecopycomplete,elapsedtime:00:14:44
channeldev3:startingdatafilecopy
inputdatafilefilenumber=00012name=/app/ora_prod/db/apps_st/data/apps_ts_tools01.dbf
outputfilename=+DATA/prod/datafile/apps_ts_queues.285.915025591tag=ORA_ASM_MIGRATIONRECID=28STAMP=915025942
channeldev1:datafilecopycomplete,elapsedtime:00:05:54
channeldev1:startingdatafilecopy
inputdatafilefilenumber=00399name=/app/ora_prod/db/apps_st/data/a_queue01.dbf
outputfilename=+DATA/prod/datafile/apps_ts_tools.286.915025609tag=ORA_ASM_MIGRATIONRECID=29STAMP=915025967
channeldev3:datafilecopycomplete,elapsedtime:00:06:04
channeldev3:startingdatafilecopy
inputdatafilefilenumber=00016name=/app/ora_prod/db/apps_st/data/a_ref03.dbf
outputfilename=+DATA/prod/datafile/system.283.915025469tag=ORA_ASM_MIGRATIONRECID=30STAMP=915026003
channeldev2:datafilecopycomplete,elapsedtime:00:09:00
channeldev2:startingdatafilecopy
inputdatafilefilenumber=00011name=/app/ora_prod/db/apps_st/data/sysaux01.dbf
outputfilename=+DATA/prod/datafile/system.284.915025485tag=ORA_ASM_MIGRATIONRECID=31STAMP=915026035
channeldev4:datafilecopycomplete,elapsedtime:00:09:20
channeldev4:startingdatafilecopy
inputdatafilefilenumber=00018name=/app/ora_prod/db/apps_st/data/sysaux02.dbf
outputfilename=+DATA/prod/datafile/sysaux.290.915026047tag=ORA_ASM_MIGRATIONRECID=32STAMP=915026220
channeldev4:datafilecopycomplete,elapsedtime:00:03:00
channeldev4:startingdatafilecopy
inputdatafilefilenumber=00006name=/app/ora_prod/db/apps_st/data/ctxd01.dbf
outputfilename=+DATA/prod/datafile/apps_ts_seed.288.915025973tag=ORA_ASM_MIGRATIONRECID=33STAMP=915026265
channeldev3:datafilecopycomplete,elapsedtime:00:05:01
channeldev3:startingdatafilecopy
inputdatafilefilenumber=00314name=/app/ora_prod/db/apps_st/data/portal01.dbf
outputfilename=+DATA/prod/datafile/apps_ts_queues.287.915025947tag=ORA_ASM_MIGRATIONRECID=34STAMP=915026275
channeldev1:datafilecopycomplete,elapsedtime:00:05:34
channeldev1:startingdatafilecopy
inputdatafilefilenumber=00397name=/app/ora_prod/db/apps_st/data/a_nolog01.dbf
outputfilename=+DATA/prod/datafile/sysaux.289.915026009tag=ORA_ASM_MIGRATIONRECID=35STAMP=915026280
channeldev2:datafilecopycomplete,elapsedtime:00:04:34
channeldev2:startingdatafilecopy
inputdatafilefilenumber=00009name=/app/ora_prod/db/apps_st/data/odm.dbf
outputfilename=+DATA/prod/datafile/ctxd.291.915026227tag=ORA_ASM_MIGRATIONRECID=36STAMP=915026294
channeldev4:datafilecopycomplete,elapsedtime:00:01:11
channeldev4:startingdatafilecopy
copyingcurrentcontrolfile
outputfilename=+DATA/prod/datafile/odm.294.915026285tag=ORA_ASM_MIGRATIONRECID=37STAMP=915026313
channeldev2:datafilecopycomplete,elapsedtime:00:00:32
channeldev2:startingdatafilecopy
inputdatafilefilenumber=00010name=/app/ora_prod/db/apps_st/data/olap.dbf
outputfilename=+DATA/prod/datafile/apps_ts_nologging.293.915026283tag=ORA_ASM_MIGRATIONRECID=38STAMP=915026314
channeldev1:datafilecopycomplete,elapsedtime:00:00:35
channeldev1:startingdatafilecopy
inputdatafilefilenumber=00017name=/app/ora_prod/db/apps_st/data/a_int02.dbf
outputfilename=+DATA/prod/datafile/apps_ts_interface.297.915026319tag=ORA_ASM_MIGRATIONRECID=42STAMP=915026328
channeldev1:datafilecopycomplete,elapsedtime:00:00:15
channeldev1:startingdatafilecopy
inputdatafilefilenumber=00007name=/app/ora_prod/db/apps_st/data/owad01.dbf
outputfilename=+DATA/prod/datafile/olap.296.915026317tag=ORA_ASM_MIGRATIONRECID=40STAMP=915026327
channeldev2:datafilecopycomplete,elapsedtime:00:00:18
channeldev2:startingincrementallevel0datafilebackupset
channeldev2:specifyingdatafile(s)inbackupset
includingcurrentSPFILEinbackupset
channeldev2:startingpiece1at20-JUN-16
outputfilename=+DATA/prod/datafile/portal.292.915026277tag=ORA_ASM_MIGRATIONRECID=39STAMP=915026327
channeldev3:datafilecopycomplete,elapsedtime:00:01:01
outputfilename=+DATA/prod/controlfile/backup.295.915026299tag=ORA_ASM_MIGRATIONRECID=41STAMP=915026328
channeldev4:datafilecopycomplete,elapsedtime:00:00:35
outputfilename=+DATA/prod/datafile/owapub.298.915026333tag=ORA_ASM_MIGRATIONRECID=43STAMP=915026335
channeldev1:datafilecopycomplete,elapsedtime:00:00:04
channeldev2:finishedpiece1at20-JUN-16
piecehandle=+DATA/prod/backupset/2016_06_20/nnsnn0_ora_asm_migration_0.299.915026335tag=ORA_ASM_MIGRATIONcomment=NONE
channeldev2:backupsetcomplete,elapsedtime:00:00:03
Finishedbackupat20-JUN-16
releasedchannel:dev1
releasedchannel:dev2
releasedchannel:dev3
releasedchannel:dev4
RMAN>BACKUPASBACKUPSETSPFILE;
Startingbackupat20-JUN-16
allocatedchannel:ORA_DISK_1
channelORA_DISK_1:SID=109devicetype=DISK
channelORA_DISK_1:startingfulldatafilebackupset
channelORA_DISK_1:specifyingdatafile(s)inbackupset
includingcurrentSPFILEinbackupset
channelORA_DISK_1:startingpiece1at20-JUN-16
channelORA_DISK_1:finishedpiece1at20-JUN-16
piecehandle=/app/ora_prod/db/tech_st/11.2.0/dbs/1hr8kcrg_1_1tag=TAG20160620T140640comment=NONE
channelORA_DISK_1:backupsetcomplete,elapsedtime:00:00:01
Finishedbackupat20-JUN-16
RMAN>shutdownimmediate;
databaseclosed
databasedismounted
Oracleinstanceshutdown
RMAN>startupmount;
connectedtotargetdatabase(notstarted)
Oracleinstancestarted
databasemounted
TotalSystemGlobalArea1068937216bytes
FixedSize2260088bytes
VariableSize482345864bytes
DatabaseBuffers570425344bytes
RedoBuffers13905920bytes
RMAN>RESTORESPFILETO'+DATA/PROD/spfile/spfilePROD.ora';
Startingrestoreat20-JUN-16
allocatedchannel:ORA_DISK_1
channelORA_DISK_1:SID=301devicetype=DISK
channelORA_DISK_1:startingdatafilebackupsetrestore
channelORA_DISK_1:restoringSPFILE
outputfilename=+DATA/PROD/spfile/spfilePROD.ora
channelORA_DISK_1:readingfrombackuppiece/app/ora_prod/db/tech_st/11.2.0/dbs/1hr8kcrg_1_1
channelORA_DISK_1:piecehandle=/app/ora_prod/db/tech_st/11.2.0/dbs/1hr8kcrg_1_1tag=TAG20160620T140640
channelORA_DISK_1:restoredbackuppiece1
channelORA_DISK_1:restorecomplete,elapsedtime:00:00:07
Finishedrestoreat20-JUN-16
RMAN>STARTUPFORCENOMOUNT;
Oracleinstancestarted
TotalSystemGlobalArea1068937216bytes
FixedSize2260088bytes
VariableSize482345864bytes
DatabaseBuffers570425344bytes
RedoBuffers13905920bytes

修改控制文件路径:

[oraprod@ebsprod~]$sqlplus/assysdba
sql*Plus:Release11.2.0.4.0ProductiononMonJun2014:13:262016
Copyright(c)1982,2013,Oracle.Allrightsreserved.
Connectedto:
OracleDatabase11gEnterpriseEditionRelease11.2.0.4.0-64bitProduction
WiththePartitioning,OLAP,DataMiningandRealApplicationTestingoptions
sql>ALTERSYSTEMSETDB_CREATE_FILE_DEST='+DATA'SID='*';
Systemaltered.
sql>ALTERSYSTEMSETDB_RECOVERY_FILE_DEST_SIZE=100GSID='*';
Systemaltered.
sql>ALTERSYSTEMSETDB_RECOVERY_FILE_DEST='+FRA'SID='*';
Systemaltered.
sql>STARTUPFORCENOMOUNT;
ORACLEinstancestarted.
TotalSystemGlobalArea1068937216bytes
FixedSize2260088bytes
VariableSize482345864bytes
DatabaseBuffers570425344bytes
RedoBuffers13905920bytes
sql>ALTERSYSTEMSETCONTROL_FILES='+DATA','+FRA'SCOPE=SPFILESID='*';
Systemaltered.
sql>exit
DisconnectedfromOracleDatabase11gEnterpriseEditionRelease11.2.0.4.0-64bitProduction
WiththePartitioning,DataMiningandRealApplicationTestingoptions

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

[oraprod@ebsprod~]$rmantarget/
RecoveryManager:Release11.2.0.4.0-ProductiononMonJun2014:15:202016
Copyright(c)1982,Oracleand/oritsaffiliates.Allrightsreserved.
connectedtotargetdatabase:PROD(notmounted)
RMAN>STARTUPFORCENOMOUNT;
Oracleinstancestarted
TotalSystemGlobalArea1068937216bytes
FixedSize2260088bytes
VariableSize482345864bytes
DatabaseBuffers570425344bytes
RedoBuffers13905920bytes
RMAN>RESTORECONTROLFILEFROM'/app/ora_prod/db/apps_st/data/cntrl01.dbf';
Startingrestoreat20-JUN-16
usingtargetdatabasecontrolfileinsteadofrecoverycatalog
allocatedchannel:ORA_DISK_1
channelORA_DISK_1:SID=307devicetype=DISK
channelORA_DISK_1:copiedcontrolfilecopy
outputfilename=+DATA/prod/controlfile/current.301.915027381
outputfilename=+FRA/prod/controlfile/current.256.915027385
Finishedrestoreat20-JUN-16
RMAN>ALTERDATABASEMOUNT;
databasemounted
releasedchannel:ORA_DISK_1

切换datafile:

RMAN>SWITCHDATABASETOCOPY;
RUN
{
ALLOCATECHANNELdev1DEVICETYPEDISK;
ALLOCATECHANNELdev2DEVICETYPEDISK;
ALLOCATECHANNELdev3DEVICETYPEDISK;
ALLOCATECHANNELdev4DEVICETYPEDISK;
RECOVERDATABASE;
}
datafile1switchedtodatafilecopy"+DATA/prod/datafile/system.276.915023707"
datafile2switchedtodatafilecopy"+DATA/prod/datafile/system.277.915023763"
datafile3switchedtodatafilecopy"+DATA/prod/datafile/system.278.915023799"
datafile4switchedtodatafilecopy"+DATA/prod/datafile/system.279.915024723"
datafile5switchedtodatafilecopy"+DATA/prod/datafile/system.280.915024725"
datafile6switchedtodatafilecopy"+DATA/prod/datafile/ctxd.291.915026227"
datafile7switchedtodatafilecopy"+DATA/prod/datafile/owapub.298.915026333"
datafile8switchedtodatafilecopy"+DATA/prod/datafile/apps_ts_queues.285.915025591"
datafile9switchedtodatafilecopy"+DATA/prod/datafile/odm.294.915026285"
datafile10switchedtodatafilecopy"+DATA/prod/datafile/olap.296.915026317"
datafile11switchedtodatafilecopy"+DATA/prod/datafile/sysaux.289.915026009"
datafile12switchedtodatafilecopy"+DATA/prod/datafile/apps_ts_tools.286.915025609"
datafile13switchedtodatafilecopy"+DATA/prod/datafile/system.259.915017345"
datafile14switchedtodatafilecopy"+DATA/prod/datafile/apps_ts_tx_data.256.915017345"
datafile15switchedtodatafilecopy"+DATA/prod/datafile/apps_ts_tx_idx.272.915022833"
datafile16switchedtodatafilecopy"+DATA/prod/datafile/apps_ts_seed.288.915025973"
datafile17switchedtodatafilecopy"+DATA/prod/datafile/apps_ts_interface.297.915026319"
datafile18switchedtodatafilecopy"+DATA/prod/datafile/sysaux.290.915026047"
datafile288switchedtodatafilecopy"+DATA/prod/datafile/system.258.915017345"
datafile295switchedtodatafilecopy"+DATA/prod/datafile/system.282.915024777"
datafile314switchedtodatafilecopy"+DATA/prod/datafile/portal.292.915026277"
datafile351switchedtodatafilecopy"+DATA/prod/datafile/system.283.915025469"
datafile352switchedtodatafilecopy"+DATA/prod/datafile/system.275.915023677"
datafile353switchedtodatafilecopy"+DATA/prod/datafile/system.262.915019421"
datafile354switchedtodatafilecopy"+DATA/prod/datafile/system.284.915025485"
datafile379switchedtodatafilecopy"+DATA/prod/datafile/apps_undots1.264.915020925"
datafile392switchedtodatafilecopy"+DATA/prod/datafile/apps_ts_tx_data.267.915022013"
datafile393switchedtodatafilecopy"+DATA/prod/datafile/apps_ts_tx_idx.271.915022823"
datafile394switchedtodatafilecopy"+DATA/prod/datafile/apps_ts_seed.265.915020959"
datafile395switchedtodatafilecopy"+DATA/prod/datafile/apps_ts_interface.274.915023007"
datafile396switchedtodatafilecopy"+DATA/prod/datafile/apps_ts_summary.270.915022123"
datafile397switchedtodatafilecopy"+DATA/prod/datafile/apps_ts_nologging.293.915026283"
datafile398switchedtodatafilecopy"+DATA/prod/datafile/apps_ts_archive.281.915024741"
datafile399switchedtodatafilecopy"+DATA/prod/datafile/apps_ts_queues.287.915025947"
datafile400switchedtodatafilecopy"+DATA/prod/datafile/apps_ts_media.268.915022041"
datafile401switchedtodatafilecopy"+DATA/prod/datafile/apps_ts_tx_data.260.915019419"
datafile402switchedtodatafilecopy"+DATA/prod/datafile/apps_ts_tx_data.257.915017345"
datafile403switchedtodatafilecopy"+DATA/prod/datafile/apps_ts_tx_idx.266.915021079"
datafile404switchedtodatafilecopy"+DATA/prod/datafile/apps_ts_tx_idx.273.915022981"
datafile405switchedtodatafilecopy"+DATA/prod/datafile/apps_ts_tx_idx.263.915020895"
datafile406switchedtodatafilecopy"+DATA/prod/datafile/apps_ts_tx_idx.261.915019419"
datafile407switchedtodatafilecopy"+DATA/prod/datafile/apps_ts_seed.269.915022045"
RMAN>2>3>4>5>6>7>8>
allocatedchannel:dev1
channeldev1:SID=107devicetype=DISK
allocatedchannel:dev2
channeldev2:SID=207devicetype=DISK
allocatedchannel:dev3
channeldev3:SID=308devicetype=DISK
allocatedchannel:dev4
channeldev4:SID=7devicetype=DISK
Startingrecoverat20-JUN-16
startingmediarecovery
557.dbf
557.dbf
archivedlogfilename=/app/ora_prod/db/tech_st/11.2.0/dbs/arch1_73_913677557.dbfthread=1sequence=73
mediarecoverycomplete,elapsedtime:00:00:16
Finishedrecoverat20-JUN-16
releasedchannel:dev1
releasedchannel:dev2
releasedchannel:dev3
releasedchannel:dev4


[oraprod@ebsprod~]$sqlplus/assysdba
sql*Plus:Release11.2.0.4.0ProductiononMonJun2014:19:542016
Copyright(c)1982,AutomaticStorageManagement,DataMining
andRealApplicationTestingoptions
sql>ALTERDATABASEENABLEBLOCKCHANGETRACKINGUSINGFILE'+DATA';
Databasealtered.
sql>ALTERDATABASEFLASHBACKON;
Databasealtered.
sql>ALTERDATABASEOPEN;
Databasealtered.

处理临时表空间:

sql>selectnamefromv$tempfile;
sql>ALTERDATABASETEMPFILE'/app/ora_prod/db/apps_st/data/temp01.dbf'DROP;
Databasealtered.
sql>ALTERDATABASETEMPFILE'/app/ora_prod/db/apps_st/data/temp02.dbf'DROP;
Databasealtered.
sql>ALTERTABLESPACETEMP1ADDTEMPFILE;
sql>ALTERTABLESPACETEMP2ADDTEMPFILE;


处理日志文件

DECLARE
CURSORrlcIS
SELECTGROUP#GRP,THREAD#THR,BYTES,'NO'SRL
FROMV$LOG
UNION
SELECTGROUP#GRP,'YES'SRL
FROMV$STANDBY_LOG
ORDERBY1;
stmtVARCHAR2(2048);
BEGIN
FORrlcRecINrlcLOOP
IF(rlcRec.srl='YES')THEN
stmt:='ALTERDATABASEADDSTANDBYLOGFILETHREAD'||
rlcRec.thr||'SIZE'||rlcRec.bytes;
EXECUTEIMMEDIATEstmt;
stmt:='ALTERDATABASEDROPSTANDBYLOGFILEGROUP'||rlcRec.grp;
EXECUTEIMMEDIATEstmt;
ELSE
stmt:='ALTERDATABASEADDLOGFILETHREAD'||
rlcRec.thr||'SIZE'||rlcRec.bytes;
EXECUTEIMMEDIATEstmt;
BEGIN
stmt:='ALTERDATABASEDROPLOGFILEGROUP'||rlcRec.grp;
DBMS_OUTPUT.PUT_LINE(stmt);
EXECUTEIMMEDIATEstmt;
EXCEPTION
WHENOTHERSTHEN
EXECUTEIMMEDIATE'ALTERSYSTEMSWITCHLOGFILE';
EXECUTEIMMEDIATE'ALTERSYSTEMCHECKPOINTGLOBAL';
EXECUTEIMMEDIATEstmt;
END;
ENDIF;
ENDLOOP;
END;
原文链接:https://www.f2er.com/oracle/213942.html

猜你在找的Oracle相关文章