學習ASM技術(七)--ASM檔案轉化
一、非ASM資料檔案轉發成ASM步驟:
1、建立測試表空間
SQL>create tablespace test datafile '/home/oracle/test.dbf' size 20M;
2、使用RMAN,將資料檔案offline
SQL>rman target system/password
RMAN>sql 'alter tablespace test offline';
3、使用backup as copy命令遷移
RMAN>backup as copy tablespace 'TEST' format 'ASM_DISKGROUP';
4、切換表空間
RMAN>switch tablespace 'TEST' to copy;
5、將表空間online
RMAN>sql 'alter tablespace test online';
6、檢視錶空間資訊
select file_name from dba_data_files where tablespace_name='TEST';
二、將資料檔案從一個diskgroup遷移到另一個diskgroup
1、檢視需要遷移的資料檔案#
SQL> select file_id from dba_data_files where TABLESPACE_NAME='TEST';
FILE_ID
----------
5
2、備份資料檔案
RMAN> sql 'alter tablespace test offline';
RMAN>backup device type disk as copy datafile 5 format '+DG1';
3、切換
RMAN>switch datafile 5 to copy;
RMAN>recover datafile 5;
4、啟動
RMAN>sql 'alter tablespace test online';
三、將ASM檔案轉發成OS檔案(除RMAN外的另一種方法)
1、檢視資料檔案
SQL> select file_name from dba_data_files
where tablespace_name='TEST';
FILE_NAME
--------------------------------------------------------------------------------
+DG1/ora10g/datafile/test.261.713925727
2、將表空間offline
SQL>alter tablespace test offline;
3、建立ASM目錄
SQL> create directory asmsrc as '+DG1/ora10g/datafile';
SQL> create directory osdesc as '/home/oracle';
4、執行轉化
SQL> begin
dbms_file_transfer.copy_file('ASMSRC',
'TEST.261.713925727',
'OSDESC',
'TEST.DBF');
END;
/
5、將資料檔案rename
SQL> alter database rename file
'+DG1/ora10g/datafile/test.261.713925727'
to '/home/oracle/TEST.DBF';
6、恢復資料檔案
SQL> recover datafile 5;
7、將表空間online,並檢視資料檔案
SQL> alter tablespace test online;
SQL> select file_name from dba_data_files
where tablespace_name='TEST';
8、進入ASMCMD,將test.261.713925727刪除
ASMCMD>rm test.261.713925727
1、建立測試表空間
SQL>create tablespace test datafile '/home/oracle/test.dbf' size 20M;
2、使用RMAN,將資料檔案offline
SQL>rman target system/password
RMAN>sql 'alter tablespace test offline';
3、使用backup as copy命令遷移
RMAN>backup as copy tablespace 'TEST' format 'ASM_DISKGROUP';
4、切換表空間
RMAN>switch tablespace 'TEST' to copy;
5、將表空間online
RMAN>sql 'alter tablespace test online';
6、檢視錶空間資訊
select file_name from dba_data_files where tablespace_name='TEST';
二、將資料檔案從一個diskgroup遷移到另一個diskgroup
1、檢視需要遷移的資料檔案#
SQL> select file_id from dba_data_files where TABLESPACE_NAME='TEST';
FILE_ID
----------
5
2、備份資料檔案
RMAN> sql 'alter tablespace test offline';
RMAN>backup device type disk as copy datafile 5 format '+DG1';
3、切換
RMAN>switch datafile 5 to copy;
RMAN>recover datafile 5;
4、啟動
RMAN>sql 'alter tablespace test online';
三、將ASM檔案轉發成OS檔案(除RMAN外的另一種方法)
1、檢視資料檔案
SQL> select file_name from dba_data_files
where tablespace_name='TEST';
FILE_NAME
--------------------------------------------------------------------------------
+DG1/ora10g/datafile/test.261.713925727
2、將表空間offline
SQL>alter tablespace test offline;
3、建立ASM目錄
SQL> create directory asmsrc as '+DG1/ora10g/datafile';
SQL> create directory osdesc as '/home/oracle';
4、執行轉化
SQL> begin
dbms_file_transfer.copy_file('ASMSRC',
'TEST.261.713925727',
'OSDESC',
'TEST.DBF');
END;
/
5、將資料檔案rename
SQL> alter database rename file
'+DG1/ora10g/datafile/test.261.713925727'
to '/home/oracle/TEST.DBF';
6、恢復資料檔案
SQL> recover datafile 5;
7、將表空間online,並檢視資料檔案
SQL> alter tablespace test online;
SQL> select file_name from dba_data_files
where tablespace_name='TEST';
8、進入ASMCMD,將test.261.713925727刪除
ASMCMD>rm test.261.713925727
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/354732/viewspace-629618/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 【ASM】ASM資料檔案和OS檔案(FILESYSTEM)轉移方法總結ASM
- ASM叢集檔案系統ACFS(ASM Cluster File System)ASM
- Oracle:ASM & 密碼檔案OracleASM密碼
- Java ASM學習(2)JavaASM
- Oracle使用RMAN將普通資料檔案轉成ASMOracleASM
- Automatic Storage Management (ASM)(轉)ASM
- ASM單例項安裝後,需要手動設定ASM的引數檔案ASM單例
- 將spfile從ASM裡遷移到檔案系統ASM
- 【ASM】Oracle asm磁碟被格式化,如何掛載該磁碟組ASMOracle
- IDA批量處理VirusShare樣本獲得asm檔案與bytes檔案ASM
- [20191128]11GR2 asm例項audit檔案.txtASM
- xbbed一鍵讀取ASM block到檔案系統ASMBloC
- 【ASM】Oracle asm刪除磁碟組注意事項ASMOracle
- 【ASM】ASM磁碟頭被重寫,如何修復ASM
- ASM有自己的引數、密碼、alert、監聽檔案ASM密碼
- goldengate + asm + racGoASM
- gnu inline asminlineASM
- 12c複製 RAC ASM中的密碼檔案到檔案系統ASM密碼
- 【ASM】ASM啟動無法找到spfile問題原因ASM
- 從定位資料塊所在ASM磁碟到ASM strippingASM
- Oracle Linux 7使用syslog來管理Oracle ASM的審計檔案OracleLinuxASM
- ORACLE RAC ASM資料檔案遷移OMF檔案報錯ORA-01276解決OracleASM
- 淺談位元組碼增強技術系列2-Asm與CglibASMCGLib
- 零零信安:攻擊面管理(ASM)技術詳解和實現ASM
- ASM Metadata Dump UtilityASM
- ASM磁碟組限制ASM
- 4.5.1.1 srvctl add asmASM
- Android Transform + ASM 初探AndroidORMASM
- RAC+ASM+DATAGUARDASM
- ASM Fast Mirror ResyncASMAST
- ASM(Automatic Storage Management)ASM
- linux下如何使用檔案來模擬硬碟進行ASM測試Linux硬碟ASM
- 【ASM】asm常用命令及主要功能介紹ASM
- Oracle 12c的DG自動同步密碼檔案--ASM 新特性:共享密碼檔案Oracle密碼ASM
- Oracle ASM神書《撥雲見日 解密Oracle ASM核心》出版了OracleASM解密
- 重建共享(db或asm)密碼檔案 in Oracle 19c RAC-20220209ASM密碼Oracle
- Web程式效能優化——asm.js和WebAssemblyWeb優化ASMJS
- ASM下遷移spfileASM
- 遷移ASM磁碟組ASM