zoukankan      html  css  js  c++  java
  • 使用dd备份和恢复ASM中的数据文件头

    这里用大家随处可见的(除了extent分布的x$kffxp需要百度和google外),其余都是文档中有详细记载的常用ASM视图来实现同样功能:

    下面的用于从ASM中备份数据文件头:

    SQL> set pages 9999
    SQL> col "backup(dd) fileheader from asm" for a200
    SQL> SELECT 'dd if='||d.path||' of=&backup_path/'||e.GROUP_KFFXP||'_'||e.DISK_KFFXP||'_'||a.file_number||'.asm'||' count=1 conv=notrunc bs='||G.ALLOCATION_UNIT_SIZE||' skip='||e.AU_KFFXP "backup(dd) fileheader from asm" FROM x$kffxp e, v$asm_file f, v$asm_alias a, v$asm_disk d, V$ASM_DISKGROUP G WHERE e.number_kffxp=a.file_number and e.GROUP_KFFXP=a.GROUP_NUMBER and f.group_number=a.group_number and f.file_number=a.file_number and e.DISK_KFFXP=d.DISK_NUMBER and e.GROUP_KFFXP=d.GROUP_NUMBER and a.SYSTEM_CREATED='Y' and f.type='DATAFILE' and e.XNUM_KFFXP=0 AND D.GROUP_NUMBER=G.GROUP_NUMBER;
    Enter value for backup_path: /tmp
    old 1: SELECT 'dd if='||d.path||' of=&backup_path/'||e.GROUP_KFFXP||'_'||e.DISK_KFFXP||'_'
    new 1: SELECT 'dd if='||d.path||' of=/tmp/'||e.GROUP_KFFXP||'_'||e.DISK_KFFXP||'_'

    backup(dd) fileheader from asm
    -------------------------------------------------------------------------------------------
    dd if=/dev/asm-disk1 of=/tmp/1_0_260.asm count=1 conv=notrunc bs=1048576 skip=700
    dd if=/dev/asm-disk1 of=/tmp/1_0_261.asm count=1 conv=notrunc bs=1048576 skip=749
    dd if=/dev/asm-disk1 of=/tmp/1_0_263.asm count=1 conv=notrunc bs=1048576 skip=1101
    dd if=/dev/asm-disk2 of=/tmp/1_1_262.asm count=1 conv=notrunc bs=1048576 skip=978
    dd if=/dev/asm-disk2 of=/tmp/1_1_259.asm count=1 conv=notrunc bs=1048576 skip=103

    下面的用于使用bbed修改文件头后放回到ASM中:
    SQL> set linesize 200
    SQL> set pages 9999
    SQL> col"Restore(dd) fileheader to asm" for a200
    SQL> SELECT 'dd of='||d.path||' if=&backup_path/'||e.GROUP_KFFXP||'_'||e.DISK_KFFXP||'_'||a.file_number||'.asm'||' count=1 conv=notrunc bs='||G.ALLOCATION_UNIT_SIZE||' seek='||e.AU_KFFXP "Restore(dd) fileheader to asm" FROM x$kffxp e, v$asm_file f, v$asm_alias a, v$asm_disk d, V$ASM_DISKGROUP G WHERE e.number_kffxp=a.file_number and e.GROUP_KFFXP=a.GROUP_NUMBER and f.group_number=a.group_number and f.file_number=a.file_number and e.DISK_KFFXP=d.DISK_NUMBER and e.GROUP_KFFXP=d.GROUP_NUMBER and a.SYSTEM_CREATED='Y' and f.type='DATAFILE' and e.XNUM_KFFXP=0 AND D.GROUP_NUMBER=G.GROUP_NUMBER;
    Enter value for backup_path: /tmp
    old 1: SELECT 'dd of='||d.path||' if=&backup_path/'||e.GROUP_KFFXP||'_'||e.DISK_KFFXP||'_'
    new 1: SELECT 'dd of='||d.path||' if=/tmp/'||e.GROUP_KFFXP||'_'||e.DISK_KFFXP||'_'
    Restore(dd) fileheader to asm
    ---------------------------------------------------------------------------------------
    dd of=/dev/asm-disk1 if=/tmp/1_0_258.asm count=1 conv=notrunc bs=1048576 seek=45
    dd of=/dev/asm-disk1 if=/tmp/1_0_260.asm count=1 conv=notrunc bs=1048576 seek=700
    dd of=/dev/asm-disk1 if=/tmp/1_0_261.asm count=1 conv=notrunc bs=1048576 seek=749
    dd of=/dev/asm-disk1 if=/tmp/1_0_263.asm count=1 conv=notrunc bs=1048576 seek=1101
    dd of=/dev/asm-disk2 if=/tmp/1_1_262.asm count=1 conv=notrunc bs=1048576 seek=978
    dd of=/dev/asm-disk2 if=/tmp/1_1_259.asm count=1 conv=notrunc bs=1048576 seek=103

  • 相关阅读:
    System.Web.Http.Cors配置跨域访问的两种方式
    asp.net反向代理
    web.config SetAttributes
    remove name="ProxyModule“会导致重复执行
    去空格
    api签名
    C# HttpWebRequest获取COOKIES
    Request.Form接收不到post数据.
    webapi文档工具
    https://gogs.io/
  • 原文地址:https://www.cnblogs.com/zfox2017/p/7569088.html
Copyright © 2011-2022 走看看