欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  数据库

RAC环境新建lv务必注意两个节点权限同步

程序员文章站 2024-04-05 16:29:30
...

AIX5.3 ORACLE10G RAC环境,新建LV时由于CHMOD、CHOWN未在两个节点同步,导致未设置权限的节点报ORA-01186\ORA-01157\ORA-01110错

AIX5.3 Oracle10G RAC环境,新建LV时由于CHMOD、CHOWN未在两个节点同步,导致未设置权限的节点报ORA-01186\ORA-01157\ORA-01110错误,后对数据文件紧急下线过程中又出现数据文件问题,最后通过Media recovery恢复。该案例告诉我们务必注意两个节点权限的同步,即使不同步也不要轻易OFFLINE,可尝试重启之前未同步的节点。

--实际步骤--

新建data36_disk数据文件
通过smit lv
PP SIZE: 256 megabyte(s)
PPs: 10

--权限设置
chown oracle:dba /dev/data36_disk
chown oracle:dba /dev/rdata11_disk
chmod 777 /dev/data36_disk
chmod 777 /dev/rdata11_disk
致命的问题就出在这一步,因为只在RAC的其中一个节点进行了操作,,另外一个节点的权限仍然有问题,
虽然下面的add datafile没有报错,但是另外一个节点的日志出现了错误提示:

--向数据库表空间添加数据文件
# su - oracle
[YOU HAVE NEW MAIL]
$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.4.0 - Production on Sat Feb 12 21:26:42 2011
Copyright (c) 1982, 2007, Oracle. All Rights Reserved.

Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
With the Partitioning, Real Application Clusters, OLAP, Data Mining
and Real Application Testing options

SQL> alter tablespace produc_DATA add datafile '/dev/rdata11_disk' size 2500M;
Tablespace altered.

--这个时候RAC2节点出现ERROR
Sat Feb 12 21:33:00 2011
Errors in file /home/oracle/admin/produc/bdump/produc2_dbw0_803734.trc:
ORA-01186: file 45 failed verification tests
ORA-01157: cannot identify/lock data file 45 - see DBWR trace file
ORA-01110: data file 45: '/dev/rdata11_disk'
File 45 not verified due to error ORA-01157

--修改节点2的相关文件权限
chown oracle:dba /dev/data36_disk
chown oracle:dba /dev/rdata11_disk
chmod 777 /dev/data36_disk
chmod 777 /dev/rdata11_disk

--问题依旧,于是紧急下线
SQL> alter database datafile '/dev/rdata11_disk' offline;
Database altered.

--修改完成,再次上线时出现ORA-01113错误
SQL> alter database datafile '/dev/rdata11_disk' online;
alter database datafile '/dev/rdata11_disk' online
*
ERROR at line 1:
ORA-01113: file 48 needs media recovery
ORA-01110: data file 48: '/dev/rdata11_disk'

--根据上述提示进行recover操作
SQL> recover datafile recover datafile '/dev/data36_disk';
ORA-00279: change 2986334634 generated at 02/12/2011 21:40:35 needed for thread1
ORA-00289: suggestion : /home/oracle/archlog/produc1/1_25181_614088933.arc
ORA-00280: change 2986334634 for thread 1 is in sequence #25181

Specify log: {=suggested | filename | AUTO | CANCEL}

ORA-00279: change 2986334634 generated at 02/12/2011 19:35:48 needed for thread2
ORA-00289: suggestion : /home/oracle/archlog/produc1/2_17592_614088933.arc
ORA-00280: change 2986334634 for thread 2 is in sequence #17592

Specify log: {=suggested | filename | AUTO | CANCEL}

ORA-00308: cannot open archived log '/home/oracle/archlog/produc1/2_17592_614088933.arc'
ORA-27037: unable to obtain file status
IBM AIX RISC System/6000 Error: 2: No such file or directory
Additional information: 3

--上面提示cannot open archived log '/home/oracle/archlog/produc1/2_17592_614088933.arc'
--怀疑文件丢失,进入相关目录确认
SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
With the Partitioning, Real Application Clusters, OLAP, Data Mining
and Real Application Testing options
$ cd /home/oracle/archlog/produc1/
$ ls -lt|grep 2_17592_614088933
--确认没有文件

RAC环境新建lv务必注意两个节点权限同步