阿里云-云小站(无限量代金券发放中)
【腾讯云】云服务器、云数据库、COS、CDN、短信等热卖云产品特惠抢购

Oracle 10g使用amdu抽取数据文件

107次阅读
没有评论

共计 2171 个字符,预计需要花费 6 分钟才能阅读完成。

环境:OEL 5.7 + Oracle 10.2.0.5 RAC
需求: 实验在 Oracle 10g 环境使用 amdu 抽取数据库文件

本文主要目的是介绍 3 个知识点:

  • 1. 使 amdu 可以在 oracle 10g 环境中使用
  • 2. 使 kfed 可以在 oracle 10g 环境中使用
  • 3.amdu 如何抽取损坏的 ASM 磁盘组数据

1. 使 amdu 可以在 oracle 10g 环境中使用

在 Oracle 10g 环境,并没有自带 amdu 工具,需要自行去下载:
具体可以参考 MOS 文档:

  • Placeholder for AMDU binaries and using with ASM 10g, 11g, 12c (文档 ID 553639.1)
> $cd <your directory>
> $export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:`pwd`   
> or $setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:`pwd`
> $export PATH=$PATH:`pwd`  or setenv PATH ${PATH}:`pwd`
>
> or 
>
> $cd <your directory>
> $export LIBPATH=$LIBPATH:`pwd` 
> or $setenv LIBPATH ${LIBPATH}:`pwd`
> $export PATH=$PATH:`pwd` or setenv PATH ${PATH}:`pwd`

注意:如果是 AIX 平台,则对应的是设置 LIBPATH 环境变量。我这里是 Linux,所以设置 LD_LIBRARY_PATH 环境变量:

unzip /tmp/amdu_X86-64.zip 
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:`pwd` 
export PATH=$PATH:`pwd`

2. 使 kfed 可以在 oracle 10g 环境中使用

在 Oracle 10g 环境 kfed 需要编译:

  • ASM tools used by Support : KFOD, KFED, AMDU (文档 ID 1485597.1)

KFED executable comes with installation from 11.1 onwards; for the older version you must build it.

编译方法如下:

$cd $ORACLE_HOME/rdbms/lib
$make -f ins_rdbms.mk ikfed

3.amdu 如何抽取损坏的 ASM 磁盘组数据

在 ASM 磁盘组损坏时,如何使用 amdu 工具来抽取数据库文件:

  • How to Restore the Database Using AMDU after Diskgroup Corruption (文档 ID 1597581.1)
1. Create pfile of lost database , from database alert.log startup messages.

2. Startup database in nomount

3. Get the controlfile number from db alert log , it will show while starting the database here in this eg. its 256
eg., control_files='+DATA/orcl/controlfile/current.256.709676643'

If you have controlfile backup already in non-asm location edit the pfile to point to location of non-asm and then mount the database
If you dont have controlfile backup then go to step 4 after determining the file# from step 3

4. $ amdu -diskstring <asm_diskstring> -extract DATA.256 

5. shutdown the database and change the control_file location to point to the extracted file location

6. startup mount the database

7. once mounted, get the datafile file numbers using "select name from v$datafile"
  And get online redo logfile from "select * from v$logfile".

8. Extract all datafiles and redolog files in similar manner

9. alter database rename <datafile 1> to < newly extracte location>

10. open the database

实际可以做实验去验证下 MOS 这个步骤的可行性:
1. 创建参数文件
2. 启动数据库到 nomount 状态
3. 获取到控制文件的 number
4. 抽出控制文件
5. 关闭数据库,修改 control_file 值
6. 启动数据库到 mount 状态
7. 获取到数据文件、日志文件的 number
8. 抽取数据文件和 redo 日志文件
9. 重命名数据库文件到新位置
10. 打开数据库

更多 Oracle 相关信息见 Oracle 专题页面 https://www.linuxidc.com/topicnews.aspx?tid=12

正文完
星哥说事-微信公众号
post-qrcode
 0
星锅
版权声明:本站原创文章,由 星锅 于2022-01-22发表,共计2171字。
转载说明:除特殊说明外本站文章皆由CC-4.0协议发布,转载请注明出处。
【腾讯云】推广者专属福利,新客户无门槛领取总价值高达2860元代金券,每种代金券限量500张,先到先得。
阿里云-最新活动爆款每日限量供应
评论(没有评论)
验证码
【腾讯云】云服务器、云数据库、COS、CDN、短信等云产品特惠热卖中