veritas环境Oracle ORA-01157异常处理-orastar


1、 异常现象


结点2:
数据库查询异常,报错信息如下,
SQL> select file_name,status,online_status from dba_data_files where file_id=238;
select file_name,status,online_status from dba_data_files where file_id=238
                                           *
ERROR at line 1:
ORA-01157: cannot identify/lock data file 238 - see DBWR trace file
ORA-01110: data file 238: '/dev/vx/rdsk/ht/ht_data8_34'


结点1:
数据库查询正常,
SQL> select file_name,status,online_status from dba_data_files where file_id=238;


FILE_NAME                    STATUS        ONLINE
------------------------------------ -      --------------     ----------------
/dev/vx/rdsk/ht/ht_data8_34      AVAILABLE     ONLINE


2 、环境介绍



操作系统: aix 6.1
共享存储管理: veritas storage foundation(以下简称veritas)
数据库版本: Oracle 10.2.0.5  2结点rac
?


3 、异常处理



查看ora-01157错误代码

点击(此处)折叠或打开

  1. [oracle@htapp1 ~]$ oerr ora 1157
  2. 01157, 00000, "cannot identify/lock data file %s - see DBWR trace file"
  3. // *Cause: The background process was either unable to find one of the data
  4. // files or failed to lock it because the file was already in use.
  5. // The database will prohibit access to this file but other files will
  6. // be unaffected. However the first instance to open the database will
  7. // need to access all online data files. Accompanying error from the
  8. // operating system describes why the file could not be identified.
  9. // *Action: Have operating system make file available to database. Then either
  10. // open the database or do ALTER SYSTEM CHECK DATAFILES.
查询结点2磁盘状态:


crw-------    1 root     system       48,51277 Apr 15 19:19 ht_data8_34(异常磁盘权限)


查询结点1磁盘状态:
crw-rw----    1 oracle   oinstall     48,51281 Apr 15 19:19 ht_data8_34(正常磁盘权限)


发现结点2磁盘权限异常,造成数据库无法正常访问该数据文件。
使用veritas集群命令修改磁盘权限
vxedit -g vght set user=oracle group=oinstall mode=660 ht_data8_34
说明: vght裸设备所在卷组,ht_data8_34裸设备名称


重新识别并验证数据文件
SQL> alter system check datafiles;


System altered.
再次检查该数据文件可用性:
SQL> select file_name,status,online_status from dba_data_files where file_id=238;


FILE_NAME                    STATUS        ONLINE
------------------------------------ -      --------------     ----------------
/dev/vx/rdsk/ht/ht_data8_34      AVAILABLE     ONLINE
数据文件恢复正常。

4 、问题分析



数据库2号结点服务器重启后,veritas管理的裸设备权限重置造成数据文件异常。根据以往的经验,异常数据文件是通过操作系统命令分别在2个结点修改权限,裸设备的权限信息未记录到veritas集群中,在服务器重启后,裸设备权限重置,造成数据文件异常。标准化操作应该使用veritas命令修改设备权限,命令如下:
vxedit -g vght set user=oracle group=oinstall mode=660 ht_data8_34


5 、优化建议



1、 检查所有在运veritas是否存在以上问题。
2、 规范veritas操作,统一使用veritas命令修改设备权限,杜绝该问题再次出现。



请使用浏览器的分享功能分享到微信等