將普通filesystem上的database移動到asm上
今天測試了一下將普通filesystem上的database遷移到asm上[@more@]
1,backup database
2,restore spfile to asm diskgroupRMAN> backup as compressed backupset database plus archivelog;
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=19 STAMP=806364292
input archived log thread=1 sequence=6 RECID=20 STAMP=806364367
channel ORA_DISK_1: starting piece 1 at 02-FEB-13
channel ORA_DISK_1: finished piece 1 at 02-FEB-13
piece handle=/u01/app/oracle/product/11.2.0/dbhome_1/dbs/0lo1096f_1_1 tag=TAG20130202T220607 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:03
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=/oradata/asm/system01.dbf
input datafile file number=00002 name=/oradata/asm/sysaux01.dbf
input datafile file number=00003 name=/oradata/asm/undotbs01.dbf
input datafile file number=00004 name=/oradata/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=/u01/app/oracle/product/11.2.0/dbhome_1/dbs/0mo1096j_1_1 tag=TAG20130202T220610 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:02:15
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=7 RECID=21 STAMP=806364507
channel ORA_DISK_1: starting piece 1 at 02-FEB-13
channel ORA_DISK_1: finished piece 1 at 02-FEB-13
piece handle=/u01/app/oracle/product/11.2.0/dbhome_1/dbs/0no109ar_1_1 tag=TAG20130202T220827 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-03 comment=NONE
Finished Control File and SPFILE Autobackup at 02-FEB-13
RMAN> restore spfile to '+data/asm/spfileasm.ora';
Starting restore at 02-FEB-13
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: restoring SPFILE
output file name=+data/asm/spfileasm.ora
channel ORA_DISK_1: reading from backup piece /oradata/rmanbackup/c-3825267224-20130202-03
channel ORA_DISK_1: piece handle=/oradata/rmanbackup/c-3825267224-20130202-03 tag=TAG20130202T220828
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
Finished restore at 02-FEB-13
3,在?/dbs/目錄下將initasm.ora中指定 spfile='+data/asm/spfileasm.ora'
4,更改controlfile檔案的路徑
SQL> alter system set control_files='+data' scope=spfile;
System altered.
SQL> shutdown immediate
ORA-01507: database not mounted
ORACLE instance shut down.
SQL> 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
5,restore controlfile to asm diskgroup
6,restore datafile to asm diskgroupRMAN> restore controlfile from '/oradata/rmanbackup/c-3825267224-20130202-03';
Starting restore at 02-FEB-13
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=24 device type=DISK
channel ORA_DISK_1: restoring control file
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
output file name=+DATA/asm/controlfile/current.271.806365451
Finished restore at 02-FEB-13RMAN> alter database mount;
database mounted
released channel: ORA_DISK_1
RMAN> run
2> {
3> allocate channel c1 type disk;
4> set newname for datafile 1 to '+data/asm/system01.dbf';
5> set newname for datafile 2 to '+data/asm/sysaux01.dbf';
6> set newname for datafile 3 to '+data/asm/undotbs01.dbf';
7> set newname for datafile 4 to '+data/asm/users01.dbf';
8> restore database;
9> switch datafile all;
10> recover database;
11> release channel c1;
12> }
allocated channel: c1
channel c1: SID=24 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 +data/asm/system01.dbf
channel c1: restoring datafile 00002 to +data/asm/sysaux01.dbf
channel c1: restoring datafile 00003 to +data/asm/undotbs01.dbf
channel c1: restoring datafile 00004 to +data/asm/users01.dbf
channel c1: reading from backup piece /u01/app/oracle/product/11.2.0/dbhome_1/dbs/0mo1096j_1_1
channel c1: piece handle=/u01/app/oracle/product/11.2.0/dbhome_1/dbs/0mo1096j_1_1 tag=TAG20130202T220610
channel c1: restored backup piece 1
channel c1: restore complete, elapsed time: 00:02:16
Finished restore at 02-FEB-13
datafile 1 switched to datafile copy
input datafile copy RECID=21 STAMP=806365826 file name=+DATA/asm/system01.dbf
datafile 2 switched to datafile copy
input datafile copy RECID=22 STAMP=806365826 file name=+DATA/asm/sysaux01.dbf
datafile 3 switched to datafile copy
input datafile copy RECID=23 STAMP=806365826 file name=+DATA/asm/undotbs01.dbf
datafile 4 switched to datafile copy
input datafile copy RECID=24 STAMP=806365826 file name=+DATA/asm/users01.dbf
Starting recover at 02-FEB-13
starting media recovery
archived log for thread 1 with sequence 7 is already on disk as file /oradata/asm/redo05.log
archived log for thread 1 with sequence 8 is already on disk as file /oradata/asm/redo04.log
archived log file name=/oradata/asm/redo05.log thread=1 sequence=7
archived log file name=/oradata/asm/redo04.log thread=1 sequence=8
media recovery complete, elapsed time: 00:00:01
Finished recover at 02-FEB-13
released channel: c1
RMAN> alter database open resetlogs;
database opened
7,將redo log全部遷移到asm上
8,設定db_recovery_file_dest的路徑SQL> alter database add logfile group 1 '+data/asm/redo01.log' size 50m;
Database altered.
SQL> alter database add logfile group 2 '+data/asm/redo02.log' size 50m;
Database altered.SQL> alter database drop logfile group 4;
Database altered.
SQL> alter database drop logfile group 5;
Database altered.SQL> select * from v$logfile;
GROUP# STATUS TYPE MEMBER IS_
---------- ------- ------- -------------------------------------------------- ---
1 ONLINE +DATA/asm/redo01.log NO
2 ONLINE +DATA/asm/redo02.log NO
9,設定tempfileSQL> alter system set db_recovery_file_dest_size=5G;
System altered.
SQL> ALTER SYSTEM SET DB_RECOVERY_FILE_DEST='+FLASH';
System altered.
======================================================SQL> alter tablespace temp add tempfile '+data/asm/temp02.dbf' size 10m;
Tablespace altered.
SQL> alter tablespace temp drop tempfile '/oradata/asm/temp01.dbf';
Tablespace altered.
移動redo的script
SET SERVEROUTPUT ON;DECLARECURSOR rlc ISSELECT GROUP# GRP, THREAD# THR, BYTES, 'NO' SRLFROM V$LOGUNIONSELECT GROUP# GRP, THREAD# THR, BYTES, 'YES' SRLFROM V$STANDBY_LOGORDER BY 1;stmt VARCHAR2(2048);BEGINFOR rlcRec IN rlc LOOPIF (rlcRec.srl = 'YES') THENstmt := '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;ELSEstmt := 'ALTER DATABASE ADD LOGFILE THREAD ' ||rlcRec.thr || ' SIZE ' || rlcRec.bytes;EXECUTE IMMEDIATE stmt;BEGINstmt := 'ALTER DATABASE DROP LOGFILE GROUP ' || rlcRec.grp;DBMS_OUTPUT.PUT_LINE(stmt);EXECUTE IMMEDIATE stmt;EXCEPTIONWHEN OTHERS THENEXECUTE IMMEDIATE 'ALTER SYSTEM SWITCH LOGFILE';EXECUTE IMMEDIATE 'ALTER SYSTEM CHECKPOINT GLOBAL';EXECUTE IMMEDIATE stmt;END;END IF;END LOOP;END;
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/24237320/viewspace-1060192/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 將asm上的資料庫移動到普通的filesystem上ASM資料庫
- 將asm上datafile移動到其他的diskgroup或者普通filesystem上ASM
- 利用RMAN將非ASM檔案移動到ASM裡 - [ASM]ASM
- 使用RMAN將RAC+ASM複製到單例項+ASM上ASM單例
- 將FileSystem轉換為ASM儲存ASM
- ASM的資料庫遷移回到DISK上ASM資料庫
- 如何將.Net SOE遷移升級到10.1上
- 如何將自己的本地專案上傳到github上?Github
- linux 上32bit的 database向 64bit的database遷移LinuxDatabase
- 【ASM】ASM資料檔案和OS檔案(FILESYSTEM)轉移方法總結ASM
- 移動ASM的spfile到一個新的disk groupASM
- 【ASM學習】普通資料庫向ASM例項的遷移(二)ASM資料庫
- 【ASM學習】普通資料庫向ASM例項的遷移(一)ASM資料庫
- 在 Mac 上通過 VirtualBox 將 Windows 10 安裝到可移動裝置中MacWindows
- 使用SecureCRT的SFTP將檔案上傳到Liunx系統上SecurecrtFTP
- 《如何將windows上的軟體包或檔案上傳到linux服務上》WindowsLinux
- 將Excel file上轉到Internal table的方法Excel
- 關於filesystem與ASM的效能對比ASM
- Rman 單例項filesystem(Windows)恢復到ASM環境(Linux)單例WindowsASMLinux
- oracle asm Unable to mount ASMlib driver filesystemOracleASM
- 如何將SAP API Hub 上提供的工作流匯入到 SAP BTP 上API
- 將lob型別的index移動到其它tablespace型別Index
- 雲上的移動效能測試平臺
- Azure ASM到ARM遷移 (三) Reserved IP的遷移ASM
- 轉移表空間到ASMASM
- 遷移資料庫到ASM資料庫ASM
- Nielsen:70%的使用者會在交通工具上移動上網
- 單節點Windows上的ASM(1)WindowsASM
- 移動資料檔案從ASM到檔案系統ASM
- Oracle使用RMAN將普通資料檔案轉成ASMOracleASM
- 如何將 Google Auto Draw 移植到小程式上Go
- 如何將專案部署到伺服器上伺服器
- 使用git將本地專案上傳到githubGithub
- 附加題:將四則運算原始碼上傳到Github賬戶上原始碼Github
- 如何挖掘移動遊戲市場上的“新渠道”?遊戲
- oracle 遷移資料庫到asmOracle資料庫ASM
- Duplicate Database from ASM to Non- ASM Database Using RMANDatabaseASM
- 移動端圖片上傳元件分享元件