您好,登錄后才能下訂單哦!
本篇內(nèi)容主要講解“Oracle中amdu_extract命令有什么作用”,感興趣的朋友不妨來看看。本文介紹的方法操作簡單快捷,實用性強。下面就讓小編來帶大家學習“Oracle中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發(fā)現(xiàn)磁盤字符串。而且amdu_extract實際是調(diào)用的AMDU工具來抽取文件
查詢數(shù)據(jù)庫cs的所有數(shù)據(jù)文件,這里我們要抽取的文件名是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中創(chuàng)建的數(shù)據(jù)文件名,并不是別名。如是我們來手動為+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工具來抽取數(shù)據(jù)文件是指定Oracle ASM發(fā)現(xiàn)磁盤字符串和磁盤組.數(shù)據(jù)文件序號
[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。
到此,相信大家對“Oracle中amdu_extract命令有什么作用”有了更深的了解,不妨來實際操作一番吧!這里是億速云網(wǎng)站,更多相關內(nèi)容可以進入相關頻道進行查詢,關注我們,繼續(xù)學習!
免責聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進行舉報,并提供相關證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權(quán)內(nèi)容。