[20131113]移植11G的amdu到10g.txt
AMDU是ORACLE针对ASM开发的源数据转储工具,其全称为ASM Metadata Dump Utility(AMDU).AMDU是11g才发布的工具,但是实际对10g的ASM 也有效。metalink下10g应该也有下载。
理论讲11G的asm应该与10的asm保存格式应该一样。自己看看以否可以把amdu移植到10g下使用。自己做一些尝试。
$ ldd `which amdu`
linux-vdso.so.1 => (0x00007fff0adfc000)
libasmclnt11.so => /u01/app/oracle/product/11.2.0/grid/lib/libasmclnt11.so (0x00002b8636470000)
libcell11.so => /u01/app/oracle/product/11.2.0/grid/lib/libcell11.so (0x00002b86365f2000)
libskgxp11.so => /u01/app/oracle/product/11.2.0/grid/lib/libskgxp11.so (0x00002b8636749000)
libhasgen11.so => /u01/app/oracle/product/11.2.0/grid/lib/libhasgen11.so (0x00002b8636902000)
libskgxn2.so => /u01/app/oracle/product/11.2.0/grid/lib/libskgxn2.so (0x00002b8636e40000)
libnnz11.so => /u01/app/oracle/product/11.2.0/grid/lib/libnnz11.so (0x00002b8636f43000)
libocr11.so => /u01/app/oracle/product/11.2.0/grid/lib/libocr11.so (0x00002b863730b000)
libocrb11.so => /u01/app/oracle/product/11.2.0/grid/lib/libocrb11.so (0x00002b86374a5000)
libocrutl11.so => /u01/app/oracle/product/11.2.0/grid/lib/libocrutl11.so (0x00002b8637640000)
libclntsh.so.11.1 => /u01/app/oracle/product/11.2.0/grid/lib/libclntsh.so.11.1 (0x00002b863774b000)
libdl.so.2 => /lib64/libdl.so.2 (0x0000003f5ee00000)
libm.so.6 => /lib64/libm.so.6 (0x0000003f5f200000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x0000003f5f600000)
libnsl.so.1 => /lib64/libnsl.so.1 (0x0000003f68400000)
libc.so.6 => /lib64/libc.so.6 (0x0000003f5ea00000)
libaio.so.1 => /usr/lib64/libaio.so.1 (0x0000003f5e600000)
/lib64/ld-linux-x86-64.so.2 (0x0000003f5e200000)
--说明需要除了amdu外,需要拷贝grid/lib/目录下一些库文件。
$ ldd `which amdu`| grep -i grid
libasmclnt11.so => /u01/app/oracle/product/11.2.0/grid/lib/libasmclnt11.so (0x00002ba49752a000)
libcell11.so => /u01/app/oracle/product/11.2.0/grid/lib/libcell11.so (0x00002ba4976ac000)
libskgxp11.so => /u01/app/oracle/product/11.2.0/grid/lib/libskgxp11.so (0x00002ba497803000)
libhasgen11.so => /u01/app/oracle/product/11.2.0/grid/lib/libhasgen11.so (0x00002ba4979bc000)
libskgxn2.so => /u01/app/oracle/product/11.2.0/grid/lib/libskgxn2.so (0x00002ba497efa000)
libnnz11.so => /u01/app/oracle/product/11.2.0/grid/lib/libnnz11.so (0x00002ba497ffd000)
libocr11.so => /u01/app/oracle/product/11.2.0/grid/lib/libocr11.so (0x00002ba4983c5000)
libocrb11.so => /u01/app/oracle/product/11.2.0/grid/lib/libocrb11.so (0x00002ba49855f000)
libocrutl11.so => /u01/app/oracle/product/11.2.0/grid/lib/libocrutl11.so (0x00002ba4986fa000)
libclntsh.so.11.1 => /u01/app/oracle/product/11.2.0/grid/lib/libclntsh.so.11.1 (0x00002ba498805000)
--使用scp命令拷贝到10g的机器,目录名为amdu。
$ ls -l
total 147328
-rwxr-x--x 1 oracle oinstall 25580740 Nov 13 10:55 amdu
-rw-r--r-- 1 oracle oinstall 703495 Nov 13 11:03 libasmclnt11.so
-rw-r--r-- 1 oracle oinstall 460569 Nov 13 11:07 libcell11.so
-rwxr-xr-x 1 oracle oinstall 48724689 Nov 13 10:55 libclntsh.so.10.1.xxx
-rwxr-xr-x 1 oracle oinstall 48724689 Nov 13 10:54 libclntsh.so.11.1
-rw-r--r-- 1 oracle oinstall 12820762 Nov 13 11:08 libhasgen11.so
-rw-r--r-- 1 oracle oinstall 7899997 Nov 13 10:56 libnnz11.so
-rw-r--r-- 1 oracle oinstall 1493029 Nov 13 11:08 libocr11.so
-rw-r--r-- 1 oracle oinstall 3217927 Nov 13 11:09 libocrb11.so
-rw-r--r-- 1 oracle oinstall 150756 Nov 13 11:09 libocrutl11.so
-rw-r--r-- 1 oracle oinstall 12771 Nov 13 15:15 libskgxn2.so
-rw-r--r-- 1 oracle oinstall 851253 Nov 13 10:55 libskgxp11.so
2.使用asmcmd查看:
> ls -l tools*
Type Redund Striped Time Sys Name
DATAFILE UNPROT COARSE NOV 10 03:00:00 Y TOOLS.4927.772739245
--取出tools数据文件看看。
--修改环境变量LD_LIBRARY_PATH。
export LD_LIBRARY_PATH=/home/oracle/amdu:$LD_LIBRARY_PATH
$ ./amdu -diskstring '/dev/raw/raw1' -extract g0.4927
amdu_2013_11_13_15_21_13/
AMDU-00204: file not found; arguments: [1] [G0]
LEM-00031: Error encountered in lempgmh after calling lmserr.
--奇怪!出现错误,看目录数据文件已经取出。
$ dbv file=G0_4927.f
DBVERIFY: Release 10.2.0.4.0 - Production on Wed Nov 13 11:27:46 2013
Copyright (c) 1982, 2007, Oracle. All rights reserved.
DBVERIFY - Verification starting : FILE = G0_4927.f
DBVERIFY - Verification complete
Total Pages Examined : 8192
Total Pages Processed (Data) : 220
Total Pages Failing (Data) : 0
Total Pages Processed (Index): 69
Total Pages Failing (Index): 0
Total Pages Processed (Other): 7259
Total Pages Processed (Seg) : 0
Total Pages Failing (Seg) : 0
Total Pages Empty : 644
Total Pages Marked Corrupt : 0
Total Pages Influx : 0
Highest block SCN : 3292304874 (0.3292304874)
--看看spfile文件copy备份。
RMAN> backup as copy spfile format '+g0';
Starting backup at 2013-11-13 11:23:35
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=1049 devtype=DISK
channel ORA_DISK_1: starting full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
including current SPFILE in backupset
channel ORA_DISK_1: starting piece 1 at 2013-11-13 11:23:40
channel ORA_DISK_1: finished piece 1 at 2013-11-13 11:23:47
piece handle=+G0/XXXX/backupset/2013_11_13/nnsnf0_tag20131113t112338_0.21314.831381821 tag=TAG20131113T112338 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:08
Finished backup at 2013-11-13 11:23:47
Starting Control File and SPFILE Autobackup at 2013-11-13 11:23:50
piece handle=+G0/XXXX/autobackup/2013_11_13/s_831381832.16735.831381837 comment=NONE
Finished Control File and SPFILE Autobackup at 2013-11-13 11:24:18
./amdu -diskstring '/dev/raw/raw1' -extract g0.21314
amdu_2013_11_13_11_25_42/
AMDU-00204: file not found; arguments: [1] [G0]
LEM-00031: Error encountered in lempgmh after calling lmserr.
--依旧报错!
$ strings G0_21314.f
}|{z
ICARE
TAG20131113T112338
*.__db_cache_size=1258291200
xxxx.__db_cache_size=1946157056
*.__java_pool_size=16777216
xxxx.__java_pool_size=16777216
--结果还是正确的。使用还是要小心。不要生产系统做这种测试!!!!