Oracle 12C ASM asmcmd amdu_extract
amdu_extract命令用來從磁碟組中抽取檔案,其語法如下:
ASMCMD [+DATA/cs/DATAFILE] > help amdu_extract amdu_extract Calls AMDU to extract from Synopsis amdu_extract Description The options for amdu_extract command are described below: disk group - Name of the disk group containing the file to be extracted. file - Name of the file to be extracted. Can be specified as either an absolute or a relative path. diskstring - Specifies the value for the discovery diskstring. Examples The following example uses amdu_extract to extract the parameter file from the '+datafile' disk group. ASMCMD [+] > amdu_extract datafile +datafile/parameterfile/spfile.ora /devices/disk*
其中diskgroup為被抽取檔案所在的磁碟組名字,file_name,被抽取檔案的Oracle ASM別名,disk_string為Oracle ASM發現磁碟字串。而且amdu_extract實際是呼叫的AMDU工具來抽取檔案
查詢資料庫cs的所有資料檔案,這裡我們要抽取的檔名是JY.331.976296525
ASMCMD [+DATA/cs/DATAFILE] > ls -lrt WARNING:option 'r' is deprecated for 'ls' please use 'reverse' Type Redund Striped Time Sys Name DATAFILE UNPROT COARSE MAR 12 18:00:00 Y SYSAUX.259.970598293 DATAFILE UNPROT COARSE MAR 12 18:00:00 Y SYSTEM.258.970598233 DATAFILE UNPROT COARSE MAR 12 18:00:00 Y UNDOTBS1.260.970598319 DATAFILE UNPROT COARSE MAR 12 18:00:00 Y USERS.261.970598319 DATAFILE UNPROT COARSE AUG 16 11:00:00 Y JY.331.976296525 DATAFILE UNPROT COARSE AUG 16 11:00:00 Y SYSAUX.273.970601881 DATAFILE UNPROT COARSE AUG 16 11:00:00 Y SYSTEM.272.970601831 DATAFILE UNPROT COARSE AUG 16 11:00:00 Y TEST.326.976211663 DATAFILE UNPROT COARSE AUG 16 11:00:00 Y UNDOTBS1.274.970601905 DATAFILE UNPROT COARSE AUG 16 11:00:00 Y UNDOTBS2.284.970602381 DATAFILE UNPROT COARSE AUG 16 11:00:00 Y USERS.275.970601909 SQL> select name,file_number from v$asm_alias where file_number<>4294967295 and (name like '%jy%' or name like '%JY%'); NAME FILE_NUMBER -------------------------------------------------------------------------------------------------------------------------------------------- ----------- JY.331.976296525 331 ASMCMD [+DATA/cs/DATAFILE] > amdu_extract DATA +DATA/cs/DATAFILE/JY.331.976296525 /dev/asm* ASMCMD-8024: file number could not be determined for alias name '+DATA/cs/DATAFILE/JY.331.976296525' < ?pre> 可以看到提示資訊說通過檔案別名不能判斷檔案號,實際上+DATA/cs/DATAFILE/JY.331.976296525是Oracle在ASM中建立的資料檔名,並不是別名。如是我們來手動為+DATA/cs/DATAFILE/JY.331.976296525增加別名jy01.dbf
SQL> alter diskgroup data add alias '+DATA/cs/DATAFILE/jy01.dbf' for '+DATA/cs/DATAFILE/JY.331.976296525'; Diskgroup altered. SQL> select name,file_number from v$asm_alias where file_number<>4294967295 and (name like '%jy%' or name like '%JY%'); NAME FILE_NUMBER -------------------------------------------------------------------------------------------------------------------------------------------- ----------- JY.331.976296525 331 jy01.dbf 331 ASMCMD [+DATA/cs/DATAFILE] > amdu_extract DATA +DATA/cs/DATAFILE/jy01.dbf /dev/asm* amdu_2018_08_16_19_17_42/
[grid@cs1 ~]$ ls -lrt drwxr-xr-x 2 grid oinstall 40 Aug 16 19:17 amdu_2018_08_16_19_17_42 [grid@cs1 ~]$ cd amdu_2018_08_16_19_17_42 [grid@cs1 amdu_2018_08_16_19_17_42]$ ls -lrt total 102416 -rw-r--r-- 1 grid oinstall 8103 Aug 16 19:17 report.txt -rw-r--r-- 1 grid oinstall 104865792 Aug 16 19:17 DATA_331.f
使用amdu工具來抽取資料檔案是指定Oracle ASM發現磁碟字串和磁碟組.資料檔案序號
[grid@cs2 ~]$ amdu -diskstring '/dev/asm*' -extract 'DATA.331' amdu_2018_08_16_19_20_59/ AMDU-00204: Disk N0004 is in currently mounted diskgroup DATA. AMDU-00201: Disk N0004: '/dev/asmdisk04' [grid@cs2 ~]$ cd amdu_2018_08_16_19_20_59/ [grid@cs2 amdu_2018_08_16_19_20_59]$ ls -lrt total 102420 -rw-r--r-- 1 grid oinstall 8291 Aug 16 19:21 report.txt -rw-r--r-- 1 grid oinstall 104865792 Aug 16 19:21 DATA_331.f
可以看到使用amdu與asmcmd的amdu_extract所抽取的同一個檔案大小都是104865792。
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/26015009/viewspace-2200230/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 12C Oracle ASM Filter DriverOracleASMFilter
- Oracle 12C Database File Mapping for Oracle ASM FilesOracleDatabaseAPPASM
- Oracle ASM使用asmcmd中的cp命令來執行遠端複製OracleASM
- Oracle ASMCMD命令參考OracleASM
- Oracle 12c新特性--ASMFD(ASM Filter Driver)特性OracleASMFilter
- Linux 6.9 加盤後的Oracle 12c ASM DiskGroup配置過程LinuxOracleASM
- Oracle ASM神書《撥雲見日 解密Oracle ASM核心》出版了OracleASM解密
- Oracle ASM擴容(NFS)OracleASMNFS
- 【ASM】Oracle asm刪除磁碟組注意事項ASMOracle
- Oracle 12c的DG自動同步密碼檔案--ASM 新特性:共享密碼檔案Oracle密碼ASM
- Oracle ASM AMDU工具的使用OracleASM
- Oracle ASM Cluster File Systems (ACOracleASM
- Oracle:ASM & 密碼檔案OracleASM密碼
- Oracle 12c Automatic ReoptimizationOracle
- Oracle 12C安裝Oracle
- Oracle ASM Rebalance執行過程OracleASM
- Overview of Oracle Flex ASM In Oracle 19c RAC-20220111ViewOracleFlexASM
- 【ASM】Oracle asm磁碟被格式化,如何掛載該磁碟組ASMOracle
- Oracle 12c升級指南Oracle
- Oracle 12C Statistics on Column GroupsOracle
- sysbench壓測Oracle 12COracle
- benchmark 壓測Oracle 12cOracle
- 【Oracle】ASM例項安裝入門OracleASM
- ORACLE ASM磁碟組空間溢位OracleASM
- 2.10.3 使用 Oracle Automatic Storage Management (Oracle ASM) 克隆資料庫OracleASM資料庫
- Manage SQL Plan Baselines in Oracle 12cSQLOracle
- Oracle 12c CDB&PDBs管理Oracle
- oracle 12c rman備份pdbOracle
- Oracle 12c系列(五)|PDB RefreshOracle
- Oracle 12c系列(六)|Relocate a PDBOracle
- oracle 12c release 2 安裝Oracle
- Oracle 12C 官方文件地圖Oracle地圖
- Oracle 12C新特性-History命令Oracle
- Oracle 12C新特性In-MemoryOracle
- Oracle 12c 兩個新特性Oracle
- Oracle 12c RMAN全攻略Oracle
- Oracle 12c系列(十) | 12c中的Recovering Tables and Table PartitionsOracle
- Oracle RAC日常運維-ASM磁碟擴容Oracle運維ASM