文章目錄
ASM, 檔案系統
在itpub上,看到一個問題,有關asm上的備份組裡的檔案的傳輸的。看到有關asm的提問越來越多了,也可以感覺到asm越來越使用的普及了。 該問題在http://www.itpub.net/thread-1299334-1-1.html 其中網友提出的最後的疑問應該是很多使用asm的朋友關心的。 我備份出來的是這個樣子: +DDGG4/full_racdb1_01ld1sbj_1 沒有辦法像作業系統那樣在+DDGG4下面再建立子目錄啊? 另外,這個本地的 +DDGG4/full_racdb1_01ld1sbj_1 ,我要copy一份到異地,怎麼copy ? 第一個問題,我在以前的檔案裡提到過很多次了, 方法可以用asmcmd,或者是直接在asm執行個體裡用alter diskgroup add directory來實現。 這裡後面的一個問題也許更是普遍的。由於asm是介於raw devices和os之間的一種方式,我們無法用類似os裡的檔案管理命令來實現,不過這個在11g r2裡已經解決了。這裡我們下面主要是針對11g r2之前的版本的。 方法有兩個。 方法一:使用rman,rman是一個非常好的工具,不僅僅是備份的作用,如果你只用rman作備份的話,有些浪費了。 通過rman裡的backup backupset可以達到使用者的要求。 下面是示範過程。 先準備一個backupset。 這裡我備份了單個的archivelog來做示範。 RMAN> backup archivelog sequence 83294; Starting backup at 06-MAY-10 using channel ORA_DISK_1 channel ORA_DISK_1: starting archive log backupset channel ORA_DISK_1: specifying archive log(s) in backup set input archive log thread=1 sequence=83294 recid=83294 stamp=718324431 channel ORA_DISK_1: starting piece 1 at 06-MAY-10 channel ORA_DISK_1: finished piece 1 at 06-MAY-10 piece handle=+DG1/soldb/backup/0dld1gpq_1_1_718324538_20100506 tag=TAG20100506T223536 comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:00:02 Finished backup at 06-MAY-10 查看該backupset RMAN> list backup of archivelog sequence 83294; List of Backup Sets =================== BS Key Size Device Type Elapsed Time Completion Time ——- ———- ———– ———— ————— 8 97.50K DISK 00:00:01 06-MAY-10 BP Key: 3 Status: AVAILABLE Compressed: NO Tag: TAG20100506T223536 Piece Name: +DG1/soldb/backup/0dld1gpq_1_1_718324538_20100506 List of Archived Logs in backup set 8 Thrd Seq Low SCN Low Time Next SCN Next Time —- ——- ———- ——— ———- ——— 1 83294 3111066080 06-MAY-10 3111066263 06-MAY-10 下面我們使用rman把這個在asm裡的備份組做到檔案系統上使用 backup backupset就可以了 如下 RMAN> backup backupset 8 format ‘/export/home/oracle/1.dbf’; Starting backup at 06-MAY-10 using channel ORA_DISK_1 input backupset count=13 stamp=718324538 creation_time=06-MAY-10 channel ORA_DISK_1: starting piece 1 at 06-MAY-10 channel ORA_DISK_1: backup piece +DG1/soldb/backup/0dld1gpq_1_1_718324538_20100506 piece handle=/export/home/oracle/1.dbf comment=NONE channel ORA_DISK_1: finished piece 1 at 06-MAY-10 channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01 Finished backup at 06-MAY-10 下面到檔案系統下查看 [oracle@solaris ~]pwd /export/home/oracle [oracle@solaris ~]ls -al 1.dbf -rw-r—– 1 oracle oinstall 100352 May 6 22:40 1.dbf 可以看到backupset已經在檔案系統了,這裡只有100K,這是我手工archive的一個日誌,拿來做實驗用的,沒必要寫滿。 除了使用rman,我們還可以使用dbms_file_transfer這個包的copy_file來實現同樣的過程,下面看看這個過程 先建立directory SQL> create directory sourcedir as ‘+DG1/soldb/backup/’; Directory created SQL> create directory destdir as ‘/export/home/oracle/’;/0dld1gpq_1_1_718324538_20100506 Directory created SQL> exec dbms_file_transfer.copy_file(’sourcedir’, ‘0dld1gpq_1_1_718324538_20100506′, ‘destdir’, ‘2.dbf’); PL/SQL procedure successfully completed 這樣我們已經完成了我們的目標了。 在目錄下查看查看 [oracle@solaris ~]pwd /export/home/oracle [oracle@solaris ~]ls -al 2.dbf -rw-r—– 1 oracle oinstall 100352 May 6 22:45 2.dbf 這兩種方法都可以達到目的,但是還是有差異的,畢竟前一種方法是用rman的,所以rman裡留下了記錄 List of Backup Sets =================== BS Key Size ——- ———- 8 97.50K List of Archived Logs in backup set 8 Thrd Seq Low SCN Low Time Next SCN Next Time —- ——- ———- ——— ———- ——— 1 83294 3111066080 06-MAY-10 3111066263 06-MAY-10 Backup Set Copy #2 of backup set 8 Device Type Elapsed Time Completion Time Compressed Tag ———– ———— ————— ———- — DISK 00:00:01 06-MAY-10 NO TAG20100506T223536 List of Backup Pieces for backup set 8 Copy #2 BP Key Pc# Status Piece Name ——- — ———– ———- 4 1 AVAILABLE /export/home/oracle/1.dbf Backup Set Copy #1 of backup set 8 Device Type Elapsed Time Completion Time Compressed Tag ———– ———— ————— ———- — DISK 00:00:01 06-MAY-10 NO TAG20100506T223536 List of Backup Pieces for backup set 8 Copy #1 BP Key Pc# Status Piece Name ——- — ———– ———- 3 1 AVAILABLE +DG1/soldb/backup/0dld1gpq_1_1_718324538_20100506 這裡是沒有第二個方法的記錄的 |
***相關主題****************************************
ASM上的備份組如何轉移到檔案系統中
ASM的一張體繫結構簡圖
RAC環境在ASM上建立資料表空間出錯ORA-569
A peek Inside Oracle ASM Metadata
asm中template特性測試!
Diskgroup 的rebalance power
v$asm_operation
RAC 註冊ASM instance 失敗
使用kfed工具查看ASM disk header資訊
ASM不能發現磁碟的一種情況的處理[KFED-00303]