asm10g&11g升级降级测试(六)

2015-02-03 03:55:32 · 作者: · 浏览: 42
dev/oracleasm/disks/VOL9 > vol9_10g_kefd.bk1
[oracle@oratest kefd]$ diff vol9_10g_kefd.bk vol9_10g_kefd.bk1
7c7
< kfbh.check: 3158608421 ; 0x00c: 0xbc448a25
---
> kfbh.check: 127173163 ; 0x00c: 0x0794822b
29,30c29,30
< kfdhdb.mntstmp.hi: 33009223 ; 0x0b0: HOUR=0x7 DAYS=0x12 MNTH=0xb YEAR=0x7de
< kfdhdb.mntstmp.lo: 567114752 ; 0x0b4: USEC=0x0 MSEC=0x35f SECS=0x1c MINS=0x8
---
> kfdhdb.mntstmp.hi: 33009225 ; 0x0b0: HOUR=0x9 DAYS=0x12 MNTH=0xb YEAR=0x7de
> kfdhdb.mntstmp.lo: 2585621504 ; 0x0b4: USEC=0x0 MSEC=0x35d SECS=0x21 MINS=0x26

[oracle@oratest kefd]$

ASM磁盘头信息保存在每个磁盘的前4K里面,这个信息的备份对于ASM的恢复非常重要,有下面的几种方法
1.直接做dd来备份磁盘的前4K,磁盘头信息丢失时,dd回来
备份:dd if=/dev/raw/raw1 of=/gyj/asmheader.dd bs=4096 count=1
恢复:dd if=/gyj/asmheader.dd of=/dev/raw/raw1


2.利用oracle的kfed工具来备份,将磁盘头信息转换成文本明文形式记录下来,恢复时使用kfed merge进去
备份:kfed read /dev/raw/raw1 aunum=0 blknum=0 text=raw1.txt
恢复:kfed write /dev/raw/raw1 aunum=0 blknum=0 text=raw1.txt


3.11G asmcmd里面增加了md_backup,md_restore备份指令,但这个只是备份DG的meta结构信息,他的恢复必须是DG已经mount,然
后导入结构信息,类似于exp/imp,这种方式对于DG损坏是不起作用的
备份:asmcmd md_backup -b /gyj/asmheader.20130130.txt
恢复:asmcmd md_restore -t full -g dg2 -i -b /gyj/asmheader.20130130.txt

--自动备份的位置
[oracle@oratest kefd]$ kfed read /dev/oracleasm/disks/VOL9 blkn=0 |grep KFBTYP
kfbh.type: 1 ; 0x002: KFBTYP_DISKHEAD
[oracle@oratest kefd]$ kfed read /dev/oracleasm/disks/VOL9 blkn=510 |grep KFBTYP
kfbh.type: 1 ; 0x002: KFBTYP_DISKHEAD
[oracle@oratest kefd]$

[oracle@oratest kefd]$ kfed repair /dev/oracleasm/disks/VOL9
[oracle@oratest kefd]$

结论:
从Oracle 10.2.0.5开始,ASM磁盘已经开始自动将头块进行备份,备份块的位置在第2个AU的倒数第2个块上(对于默认1M的AU来说,是第510个块), 如果头块损坏,可以用kfed repair命令来修复。因此对于选用ASM存储作为生产环境的用户来说,尽快升级到10.2.0.5是明智的选择。


[root@oratest 11g]# /opt/oracle/grid/product/11.2.0/grid/rootupgrade.sh
Performing root user operation for Oracle 11g

The following environment variables are set as:
ORACLE_OWNER= oracle
ORACLE_HOME= /opt/oracle/grid/product/11.2.0/grid

Enter the full pathname of the local bin directory: [/usr/local/bin]:
The file "dbhome" already exists in /usr/local/bin. Overwrite it? (y/n)
[n]:
The file "oraenv" already exists in /usr/local/bin. Overwrite it? (y/n)
[n]:
The file "coraenv" already exists in /usr/local/bin. Overwrite it? (y/n)
[n]:


Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root script.
Now product-specific root actions will be performed.
Using configuration parameter file: /opt/oracle/grid/product/11.2.0/grid/crs/install/crsconfig_params
Creating trace directory
LOCAL ADD MODE
Creating OCR keys for user 'oracle', privgrp 'oinstall'..
Operation successful.
CSS appears healthy
Stopping CSSD.
Shutting down CSS daemon.
Shutdown request successfully issued.
Shutdown has begun. The daemons should exit soon.
LOCAL ONLY MODE
Successfully accumulated necessary OCR keys.
Creating OCR keys for user 'root', privgrp 'root'..
Operation successful.
CRS-4664: Node oratest successfully pinned.
Replacing Clusterware entries in inittab


oratest 2014/11/18 10:35:07 /opt/oracle/grid/product/11.2.0/grid/cdata/oratest/backup_20141118_103507.olr
Successfully configured Oracle Grid Infrastructure for a Standalone Server
[root@oratest 11g]#