將asm上的資料庫移動到普通的filesystem上

tolilong發表於2013-02-06
RMAN> backup as compressed backupset database format '/oradata/rmanbackup/%U' plus archivelog format '/oradata/rmanbackup/arch_%U';
[@more@]

Starting backup at 02-FEB-13
current log archived
using channel ORA_DISK_1
channel ORA_DISK_1: starting compressed archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=5 RECID=1 STAMP=806313718
input archived log thread=1 sequence=6 RECID=2 STAMP=806316137
input archived log thread=1 sequence=7 RECID=3 STAMP=806316236
input archived log thread=1 sequence=8 RECID=4 STAMP=806316422
input archived log thread=1 sequence=9 RECID=5 STAMP=806316490
input archived log thread=1 sequence=10 RECID=6 STAMP=806316657
input archived log thread=1 sequence=11 RECID=7 STAMP=806316803
channel ORA_DISK_1: starting piece 1 at 02-FEB-13
channel ORA_DISK_1: finished piece 1 at 02-FEB-13
piece handle=/oradata/rmanbackup/arch_0eo0uqo3_1_1 tag=TAG20130202T085323 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:15
Finished backup at 02-FEB-13

Starting backup at 02-FEB-13
using channel ORA_DISK_1
channel ORA_DISK_1: starting compressed full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00001 name=+DATA/asm/system01.dbf
input datafile file number=00002 name=+DATA/asm/sysaux01.dbf
input datafile file number=00003 name=+DATA/asm/undotbs01.dbf
input datafile file number=00004 name=+DATA/asm/users.dbf
channel ORA_DISK_1: starting piece 1 at 02-FEB-13
channel ORA_DISK_1: finished piece 1 at 02-FEB-13
piece handle=/oradata/rmanbackup/0fo0uqoj_1_1 tag=TAG20130202T085338 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:02:35
Finished backup at 02-FEB-13

Starting backup at 02-FEB-13
current log archived
using channel ORA_DISK_1
channel ORA_DISK_1: starting compressed archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=12 RECID=8 STAMP=806316974
channel ORA_DISK_1: starting piece 1 at 02-FEB-13
channel ORA_DISK_1: finished piece 1 at 02-FEB-13
piece handle=/oradata/rmanbackup/arch_0go0uqtf_1_1 tag=TAG20130202T085615 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 02-FEB-13

Starting Control File and SPFILE Autobackup at 02-FEB-13
piece handle=/oradata/rmanbackup/c-3825267224-20130202-00 comment=NONE
Finished Control File and SPFILE Autobackup at 02-FEB-13

RMAN> startup nomount;

Oracle instance started

Total System Global Area 839282688 bytes

Fixed Size 2217992 bytes
Variable Size 574621688 bytes
Database Buffers 260046848 bytes
Redo Buffers 2396160 bytes

RMAN> restore spfile to '/u01/app/oracle/product/11.2.0/dbhome_1/dbs/spfileasm.ora' from '/oradata/rmanbackup/c-3825267224-20130202-00';

Starting restore at 02-FEB-13
using channel ORA_DISK_1

channel ORA_DISK_1: restoring spfile from AUTOBACKUP /oradata/rmanbackup/c-3825267224-20130202-00
channel ORA_DISK_1: SPFILE restore from AUTOBACKUP complete
Finished restore at 02-FEB-13

spfile轉換為pfile,然後將pfile中引數修改為普通fileystem上的

RMAN> shutdown immediate

Oracle instance shut down

RMAN> startup nomount;

connected to target database (not started)
Oracle instance started

Total System Global Area 839282688 bytes

Fixed Size 2217992 bytes
Variable Size 574621688 bytes
Database Buffers 260046848 bytes
Redo Buffers 2396160 bytes


RMAN> restore controlfile from '/oradata/rmanbackup/c-3825267224-20130202-00';

Starting restore at 02-FEB-13
using channel ORA_DISK_1

channel ORA_DISK_1: restoring control file
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
output file name=/oradata/asm/control01.ctl
output file name=/oradata/asm/control02.ctl
Finished restore at 02-FEB-13

RMAN> alter database mount;

database mounted
released channel: ORA_DISK_1


RMAN> alter database mount;

database mounted
released channel: ORA_DISK_1

RMAN> run
2> {allocate channel c1 type disk;
3> allocate channel c2 type disk;
4> set newname for datafile 1 to '/oradata/asm/system01.dbf';
5> set newname for datafile 2 to '/oradata/asm/sysaux01.dbf';
6> set newname for datafile 3 to '/oradata/asm/undotbs01.dbf';
7> set newname for datafile 4 to '/oradata/asm/users.dbf';
8> restore database;
9> switch datafile all;
10> recover database;
11> release channel c1;
12> release channel c2;
13> }

allocated channel: c1
channel c1: SID=20 device type=DISK
/
allocated channel: c2
channel c2: SID=21 device type=DISK

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

Starting restore at 02-FEB-13

channel c1: starting datafile backup set restore
channel c1: specifying datafile(s) to restore from backup set
channel c1: restoring datafile 00001 to /oradata/asm/system01.dbf
channel c1: restoring datafile 00002 to /oradata/asm/sysaux01.dbf
channel c1: restoring datafile 00003 to /oradata/asm/undotbs01.dbf
channel c1: restoring datafile 00004 to /oradata/asm/users.dbf
channel c1: reading from backup piece /oradata/rmanbackup/0fo0uqoj_1_1
channel c1: piece handle=/oradata/rmanbackup/0fo0uqoj_1_1 tag=TAG20130202T085338
channel c1: restored backup piece 1
channel c1: restore complete, elapsed time: 00:03:09
Finished restore at 02-FEB-13

datafile 1 switched to datafile copy
input datafile copy RECID=9 STAMP=806318426 file name=/oradata/asm/system01.dbf
datafile 2 switched to datafile copy
input datafile copy RECID=10 STAMP=806318426 file name=/oradata/asm/sysaux01.dbf
datafile 3 switched to datafile copy
input datafile copy RECID=11 STAMP=806318426 file name=/oradata/asm/undotbs01.dbf
datafile 4 switched to datafile copy
input datafile copy RECID=12 STAMP=806318426 file name=/oradata/asm/users.dbf

Starting recover at 02-FEB-13

starting media recovery

archived log for thread 1 with sequence 12 is already on disk as file +FLASH/asm/archivelog/2013_02_02/thread_1_seq_12.257.806316975
archived log for thread 1 with sequence 13 is already on disk as file +DATA/asm/redo01.log
archived log file name=+FLASH/asm/archivelog/2013_02_02/thread_1_seq_12.257.806316975 thread=1 sequence=12
archived log file name=+DATA/asm/redo01.log thread=1 sequence=13
media recovery complete, elapsed time: 00:00:01
Finished recover at 02-FEB-13

released channel: c1

released channel: c2

RMAN> alter database open resetlogs;

database opened
然後刪除在asm上的logfile,建立logfile於普通的filesystem上。

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/24237320/viewspace-1060191/,如需轉載,請註明出處,否則將追究法律責任。

相關文章