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/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- oracle asm asmcmdOracleASM
- 【asmcmd】使用asmcmd工具管理ASMASM
- ASM工具asmcmdASM
- 【ASM】ASMCMD cp 命令ASM
- Oracle IZ0-053 Q36(ASM ASMCMD REMAP)OracleASMREM
- 12C Oracle ASM Filter DriverOracleASMFilter
- 【ASM】ASMCMD chtmpl 更改ASM 模版的屬性ASM
- [zt] ORACLE 10g中ASMCMD使用及ASM檔案Oracle 10gASM
- ASMCMD - ASM command line utility .ASM
- ASM命令列管理工具asmcmdASM命令列
- OCP(11g)------> ASM Command-Line Utility (ASMCMD)和 使用 ASMCMDASM
- Oracle 12C Database File Mapping for Oracle ASM FilesOracleDatabaseAPPASM
- Oracle ASM使用asmcmd中的cp命令來執行遠端複製OracleASM
- 學習ASM技術(六)-- ASMCMD命令列ASM命令列
- rac環境 asmcmd用法;首先設定oracle_home oracle_sid(asm例項)ASMOracle
- Oracle 12c新特性--ASMFD(ASM Filter Driver)特性OracleASMFilter
- ORACLE 10g中ASMCMD使用及ASM檔案XML DB訪問-1Oracle 10gASMXML
- 使用 ASMCMD 工具管理ASM目錄及檔案ASM
- Oracle ASMCMD命令參考OracleASM
- 【oracle 12c asm專題】flex diskgroup相關概念OracleASMFlex
- 【ASM】ASMCMD 之md_backup,md_restore介紹ASMREST
- 用asmcmd 的rebal 代替 ASM_POWER_LIMIT 引數ASMMIT
- 12c ASM中建立ACFSASM
- ASMCMD執行ASM後設資料備份與還原ASM
- 12c下更換ASM磁碟ASM
- Linux 6.9 加盤後的Oracle 12c ASM DiskGroup配置過程LinuxOracleASM
- Oracle 12c ASM|專題配額組的配額真的管用嗎?OracleASM
- Oracle 12c ASM專題|Flex磁碟組到底有多Fexible?OracleASMFlex
- asmcmdASM
- ASM 翻譯系列第二彈:ASM 12C 版本新特性ASM
- 【ASM】ASMCMD 磁碟後設資料的備份與恢復實踐ASM
- oracle asmOracleASM
- solaris10上oracle10g之asm_asmcmd和rman歸檔日誌資料不同學習OracleASM
- ASMCMD命令ASM
- ASMCMD - cpASM
- 使用asmcmdASM
- Oracle 12cOracle
- oracle 11gR2 asmcmd工具增加 cp命令OracleASM