Oracle数据库数据恢复、性能优化

找回密码
注册
搜索
热搜: 活动 交友 discuz
发新帖

11

积分

0

好友

3

主题
1#
发表于 2012-7-9 16:25:31 | 查看: 7783| 回复: 13
环境:oracle   10.2.0.4  单实例           操作系统:  aix 5306

          hacmp:5.4.1
         数据库使用的数据文件为raw裸设备

   操作系统升级,从aix 5305升级到5306,升级过程正常,升级完成后启动数据库,报错:
prmapp2[/oracle]$ sqlplus "/as sysdba"

SQL*Plus: Release 10.2.0.4.0 - Production on Mon Jul 9 11:42:30 2012

Copyright (c) 1982, 2007, Oracle.  All Rights Reserved.

Connected to an idle instance.

SQL> startup
ORA-01506: missing or illegal database name
SQL> exit


原因是无法读raw设备:
手工指定pfile 文件启动数据库:
prmapp2[/oracle/ht]$ sqlplus "/as sysdba"

SQL*Plus: Release 10.2.0.4.0 - Production on Mon Jul 9 11:48:31 2012

Copyright (c) 1982, 2007, Oracle.  All Rights Reserved.

Connected to an idle instance.

SQL> startup pfile='/oracle/ht/prmorapfile2012.ora' mount
ORACLE instance started.

Total System Global Area 8589934592 bytes
Fixed Size                  2097800 bytes
Variable Size             570428792 bytes
Database Buffers         8002732032 bytes
Redo Buffers               14675968 bytes
ORA-00205: error in identifying control file, check alert log for more info


使用dbv校验文件的结果:
DBVERIFY - Verification complete

Total Pages Examined         : 131070
Total Pages Processed (Data) : 0
Total Pages Failing   (Data) : 0
Total Pages Processed (Index): 0
Total Pages Failing   (Index): 0
Total Pages Processed (Other): 0
Total Pages Processed (Seg)  : 0
Total Pages Failing   (Seg)  : 0
Total Pages Empty            : 0
Total Pages Marked Corrupt   : 131070
Total Pages Influx           : 801
Highest block SCN            : 0 (0.0)



请帮忙分析一下。谢谢刘大以及各位大侠。
2#
发表于 2012-7-9 16:35:59
alert日志信息:Sun Jul  8 01:17:52 2012
Thread 1 advanced to log sequence 2625 (LGWR switch)
  Current log# 1 seq# 2625 mem# 0: /dev/rvgprm1_1_rd11
  Current log# 1 seq# 2625 mem# 1: /dev/rvgprm1_1_rd12
Mon Jul  9 09:40:57 2012
Shutting down instance: further logons disabled
Mon Jul  9 09:40:59 2012
Stopping background process CJQ0
Mon Jul  9 09:40:59 2012
Stopping background process QMNC
Mon Jul  9 09:41:01 2012
Stopping background process MMNL
Mon Jul  9 09:41:02 2012
Stopping background process MMON
Mon Jul  9 09:41:03 2012
Shutting down instance (immediate)
License high water mark = 109
Mon Jul  9 09:41:03 2012
Stopping Job queue slave processes, flags = 7
Mon Jul  9 09:41:03 2012
Job queue slave processes stopped
Mon Jul  9 09:41:06 2012
ALTER DATABASE CLOSE NORMAL
Mon Jul  9 09:41:06 2012
SMON: disabling tx recovery
SMON: disabling cache recovery
Mon Jul  9 09:48:13 2012
Shutting down archive processes
Archiving is disabled
Mon Jul  9 09:48:13 2012
ARC1: Archiving disabled
ARCH shutting down
ARC1: Archival stopped
Mon Jul  9 09:48:23 2012
ARCH shutting down
ARC0: Archival stopped
Mon Jul  9 09:48:24 2012
Thread 1 closed at log sequence 2625
Successful close of redo thread 1
Mon Jul  9 09:48:32 2012
Completed: ALTER DATABASE CLOSE NORMAL
Mon Jul  9 09:48:32 2012
ALTER DATABASE DISMOUNT
Completed: ALTER DATABASE DISMOUNT
ARCH: Archival disabled due to shutdown: 1089
Shutting down archive processes
Archiving is disabled
Archive process shutdown avoided: 0 active
ARCH: Archival disabled due to shutdown: 1089
Shutting down archive processes
Archiving is disabled
Archive process shutdown avoided: 0 active
Mon Jul  9 11:42:39 2012
Starting ORACLE instance (normal)
sskgpgetexecname failed to get name
LICENSE_MAX_SESSION = 0
LICENSE_SESSIONS_WARNING = 0
Mon Jul  9 11:44:59 2012
Starting ORACLE instance (normal)
sskgpgetexecname failed to get name
LICENSE_MAX_SESSION = 0
LICENSE_SESSIONS_WARNING = 0
Mon Jul  9 11:48:49 2012
Starting ORACLE instance (normal)
sskgpgetexecname failed to get name
LICENSE_MAX_SESSION = 0
LICENSE_SESSIONS_WARNING = 0
Picked latch-free SCN scheme 3
Autotune of undo retention is turned on.
IMODE=BR
ILAT =242
LICENSE_MAX_USERS = 0
SYS auditing is disabled
ksdpec: called for event 13740 prior to event group initialization
Starting up ORACLE RDBMS Version: 10.2.0.4.0.
System parameters with non-default values:
  processes                = 2000
  sessions                 = 2205
  sga_max_size             = 8589934592
  __shared_pool_size       = 536870912
  __large_pool_size        = 16777216
  __java_pool_size         = 16777216
  __streams_pool_size      = 0
  sga_target               = 8589934592
  control_files            = /dev/rvgprm1_1_ctl1, /dev/rvgprm1_1_ctl2, /dev/rvgprm1_1_ctl3
  db_block_size            = 16384
  __db_cache_size          = 8002732032
  compatible               = 10.2.0.3.0
  log_archive_dest_1       = location=/archivelog
  db_files                 = 2048
  db_file_multiblock_read_count= 16
  undo_management          = AUTO
  undo_tablespace          = UNDOTBS1
  undo_retention           = 1800
  remote_login_passwordfile= EXCLUSIVE
  db_domain                =
  distributed_lock_timeout = 700
  local_listener           = (ADDRESS = (PROTOCOL = TCP)(HOST = 134.0.43.98)(PORT = 1521))
  job_queue_processes      = 10
  background_dump_dest     = /oracle/app/oracle/admin/ngprm/bdump
  user_dump_dest           = /oracle/app/oracle/admin/ngprm/udump
  core_dump_dest           = /oracle/app/oracle/admin/ngprm/cdump
  audit_file_dest          = /oracle/app/oracle/admin/ngprm/adump
  db_name                  = ngprm
  open_cursors             = 300
  pga_aggregate_target     = 4294967296
PSP0 started with pid=3, OS id=118956
MMAN started with pid=4, OS id=336590
PMON started with pid=2, OS id=180854
DBW0 started with pid=5, OS id=131462
DBW1 started with pid=6, OS id=123538
LGWR started with pid=7, OS id=98748
CKPT started with pid=8, OS id=209662
SMON started with pid=9, OS id=98416
RECO started with pid=10, OS id=135570
CJQ0 started with pid=11, OS id=90192
MMON started with pid=12, OS id=139686
MMNL started with pid=13, OS id=86106
Mon Jul  9 11:48:57 2012
ALTER DATABASE   MOUNT
Mon Jul  9 11:48:57 2012
ORA-00202: control file: '/dev/rvgprm1_1_ctl1'
ORA-27047: unable to read the header block of file
Additional information: 2
Mon Jul  9 11:49:00 2012
ORA-205 signalled during: ALTER DATABASE   MOUNT...
Shutting down instance: further logons disabled
Mon Jul  9 11:51:00 2012
Stopping background process CJQ0
Mon Jul  9 11:51:00 2012
Stopping background process MMNL
Mon Jul  9 11:51:01 2012
Stopping background process MMON
Mon Jul  9 11:51:02 2012
Shutting down instance (immediate)
License high water mark = 1
Mon Jul  9 11:51:02 2012
Stopping Job queue slave processes, flags = 7
Mon Jul  9 11:51:02 2012
Job queue slave processes stopped
Mon Jul  9 11:51:02 2012
ALTER DATABASE CLOSE NORMAL
ORA-1507 signalled during: ALTER DATABASE CLOSE NORMAL...
ARCH: Archival disabled due to shutdown: 1089
Shutting down archive processes
Archiving is disabled
Archive process shutdown avoided: 0 active
ARCH: Archival disabled due to shutdown: 1089
Shutting down archive processes
Archiving is disabled
Archive process shutdown avoided: 0 active
Mon Jul  9 12:07:13 2012
Starting ORACLE instance (normal)
sskgpgetexecname failed to get name
LICENSE_MAX_SESSION = 0
LICENSE_SESSIONS_WARNING = 0
Mon Jul  9 12:24:12 2012
Starting ORACLE instance (normal)
sskgpgetexecname failed to get name
LICENSE_MAX_SESSION = 0
LICENSE_SESSIONS_WARNING = 0
Mon Jul  9 12:56:34 2012
Starting ORACLE instance (normal)
sskgpgetexecname failed to get name
LICENSE_MAX_SESSION = 0
LICENSE_SESSIONS_WARNING = 0
Mon Jul  9 13:14:51 2012
Starting ORACLE instance (normal)
sskgpgetexecname failed to get name
LICENSE_MAX_SESSION = 0
LICENSE_SESSIONS_WARNING = 0
Mon Jul  9 14:29:14 2012
Starting ORACLE instance (normal)
sskgpgetexecname failed to get name
LICENSE_MAX_SESSION = 0
LICENSE_SESSIONS_WARNING = 0
Mon Jul  9 14:36:10 2012
Starting ORACLE instance (normal)
sskgpgetexecname failed to get name
LICENSE_MAX_SESSION = 0
LICENSE_SESSIONS_WARNING = 0
Mon Jul  9 15:47:19 2012
Starting ORACLE instance (normal)
sskgpgetexecname failed to get name
LICENSE_MAX_SESSION = 0
LICENSE_SESSIONS_WARNING = 0
Mon Jul  9 15:47:51 2012
Starting ORACLE instance (normal)
sskgpgetexecname failed to get name
LICENSE_MAX_SESSION = 0
LICENSE_SESSIONS_WARNING = 0
Mon Jul  9 16:03:43 2012
Starting ORACLE instance (normal)
sskgpgetexecname failed to get name
LICENSE_MAX_SESSION = 0
LICENSE_SESSIONS_WARNING = 0
Mon Jul  9 16:13:08 2012
Starting ORACLE instance (normal)
sskgpgetexecname failed to get name
LICENSE_MAX_SESSION = 0
LICENSE_SESSIONS_WARNING = 0
Mon Jul  9 16:23:48 2012
Starting ORACLE instance (normal)
sskgpgetexecname failed to get name
LICENSE_MAX_SESSION = 0
LICENSE_SESSIONS_WARNING = 0

回复 只看该作者 道具 举报

3#
发表于 2012-7-9 16:37:17
SQL> startup

ORA-01506: missing or illegal database name

SQL> exit

升级导致spfile或者pfile 破坏或者缺失






SQL> startup pfile='/oracle/ht/prmorapfile2012.ora' mount

ORACLE instance started.

.....

ORA-00205: error in identifying control file, check alert log for more info



估计数据库是spfile启动,而你用了pfile

可以尝试 create spfile from  pfile='....";  




回复 只看该作者 道具 举报

4#
发表于 2012-7-9 17:21:35
ORA-00202: control file: '/dev/rvgprm1_1_ctl1'
ORA-27047: unable to read the header block of file
Additional information: 2


action plan:  

ls -l /dev/rvgprm1_1_ctl*

回复 只看该作者 道具 举报

5#
发表于 2012-7-9 17:23:12
crw-rw----   1 oracle   dba          55,  2 Jul 09 15:52 /dev/rvgprm1_1_ctl1
crw-rw----   1 oracle   dba          55,  3 Jul 09 15:52 /dev/rvgprm1_1_ctl2
crw-rw----   1 oracle   dba          55,  4 Jul 09 15:52 /dev/rvgprm1_1_ctl3

回复 只看该作者 道具 举报

6#
发表于 2012-7-9 17:29:17
action plan:

dd if=/dev/rvgprm1_1_ctl1  of=/tmp/ctl1  bs=512 count=1
dd if=/dev/rvgprm1_1_ctl2  of=/tmp/ctl2  bs=512 count=1

diff    /tmp/ctl1   /tmp/ctl2

回复 只看该作者 道具 举报

7#
发表于 2012-7-9 17:36:54
prmapp2[/tmp]$ diff ctl1 ctl2
diff: 0653-827 Missing newline at the end of file ctl1.
diff: 0653-827 Missing newline at the end of file ctl2.
1,2c1,2
< AIX LVCBjfs00ceba5a00004c000000012dvgprm1_1_ctl1Mon Jul  9 15:58:16 2012
< nmmy a8bdf8e7.2
---
> AIX LVCBjfs00ceba5a00004c000000012dvgprm1_1_ctl2Mon Jul  9 15:58:16 2012
> nmmy a8bdf8e7.3
prmapp2[/tmp]$

回复 只看该作者 道具 举报

8#
发表于 2012-7-9 17:42:17
把 control_files    改成单个/dev/rvgprm1_1_ctl2 试试

不行的话 到udump目录下 找下是否有 create controlfile的脚本存在
cd udump
grep -i  controlfile  *

回复 只看该作者 道具 举报

9#
发表于 2012-7-9 18:00:11
*.control_files='/dev/rvgprm1_1_ctl2'SQL> startup pfile='/oracle/ht/prmorapfile2012.ora'
ORACLE instance started.

Total System Global Area 8589934592 bytes
Fixed Size                  2097800 bytes
Variable Size             570428792 bytes
Database Buffers         8002732032 bytes
Redo Buffers               14675968 bytes
ORA-00205: error in identifying control file, check alert log for more info


SQL> shutdown immediate
ORA-01507: database not mounted

问题还是一样,udump下没有还没有create controlfile文件内容。


现在可能是操作系统升级是修改了raw的header信息。因为升级前vg没有做export导出,只停止了ha。

回复 只看该作者 道具 举报

10#
发表于 2012-7-9 18:16:50
是否有rman catalog可用?

否则考虑手动重建控制文件

回复 只看该作者 道具 举报

11#
发表于 2012-7-9 19:09:35
随便找了一个使用的dbfile通过dbfsize查看
prmapp2[/oracle]$ dbfsize /dev/rlv_prm1_4g_032
/dev/rlv_prm1_4g_032: Header block magic number is bad; trying raw file format...
/dev/rlv_prm1_4g_032: Header block magic number is bad

回复 只看该作者 道具 举报

12#
发表于 2012-7-9 19:10:30
可以确定dbfile的头文件损了吗?

回复 只看该作者 道具 举报

13#
发表于 2012-7-9 19:51:58

回复 11# 的帖子

AIX 上 普通vg划分的LV前512bytes作为 LVCB,如果是normal vg 那么出现Header block magic number is bad 属于正常现象

回复 只看该作者 道具 举报

14#
发表于 2012-7-11 01:56:42
对lv进行了头更新操作
echo "AIX LVCB\0" | dd of=/dev/lv1 bs=1 count=9

导致了没有恢复的可能性,做rman恢复的时候报错

RMAN> recover database;

Starting recover at 20120710223114
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=2191 devtype=DISK

starting media recovery

archive log thread 1 sequence 2544 is already on disk as file /archivelog/1_2544_743823464.dbf
archive log filename=/archivelog/1_2544_743823464.dbf thread=1 sequence=2544
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 07/10/2012 22:32:36
ORA-00283: recovery session canceled due to errors
RMAN-11003: failure during parse/execution of SQL statement: alter database recover logfile '/archivelog/1_2544_743823464.dbf'
ORA-00283: recovery session canceled due to errors
ORA-12801: error signaled in parallel query server P009
ORA-01115: IO error reading block from file 56 (block # 72179)
ORA-01110: data file 56: '/orarestore/oracle/datafile/rlv_prm1_4g_010'
ORA-27063: n

RMAN> exit

经查找是用于做恢复新加的磁盘中有一块是坏盘。严重不顺利。参考文章Database Crash With ORA-27063 and OS Error: 5: I/O Error [ID 877549.1]
重新更换硬盘restore。先睡觉去了。更新一下。
感谢刘大的支持。

回复 只看该作者 道具 举报

您需要登录后才可以回帖 登录 | 注册

QQ|手机版|Archiver|Oracle数据库数据恢复、性能优化

GMT+8, 2024-12-25 14:11 , Processed in 0.052936 second(s), 21 queries .

Powered by Discuz! X2.5

© 2001-2012 Comsenz Inc.

回顶部
TEL/電話+86 13764045638
Email service@parnassusdata.com
QQ 47079569