DBCA建库问题处理之-无法创建RAC实例

在安装完RAC11.2.0.4,并打上PSU后,在通过DBCA创建数据库实例是出现诡异现象:

弹出来的框为单实例创建,二并非RAC实例。反复试了几次都是同样的问题,检查安装无问题。
在metalink上查看了下,问题原因很多,同事通过sqlplus连接空实例测试出现如下报错:
[oracle@zderp2vprd01 cfgtoollogs]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.4.0 Production on Thu Nov 17 09:59:10 2016

Copyright (c) 1982, 2013, Oracle.  All rights reserved.

ERROR:
ORA-12547: TNS:lost contact

Enter user-name: ^C

上述报错通常出现在打完PSU后,看到这个错误,怀疑是一个经常遇到的老问题了。目录权限问题,检查如下:
[oracle@zderp2vprd01 11.2.0]$ ls -lrt
total 8
drwxr-xr-x 73 root oinstall 4096 Nov 16 21:29 grid_1
drwxrwxr-x 78 grid oinstall 4096 Nov 17 09:40 db_1
[oracle@zderp2vprd01 11.2.0]$ chown oracle:oinstall db_1 
[root@zderp2vprd01 11.2.0]# ls -lrt
total 8
drwxr-xr-x 73 root oinstall 4096 Nov 16 21:29 grid_1
drwxrwxr-x 78 grid oinstall 4096 Nov 17 09:40 db_1
[root@zderp2vprd01 11.2.0]# chown oracle:oinstall db_1

修改后终于可以正常创建RAC实例了。

此处将metalink上的信息也贴出来,供大家参考学习。
Oracle Database - Enterprise Edition - Version 10.2.0.1 to 11.2.0.4 [Release 10.2 to 11.2]
Information in this document applies to any platform.

SYMPTOMS

After CRS or Grid Infrastructure installation and RDBMS installation, using dbca to create a RAC database,  it gives a welcome screen without the 'Oracle Real Applications Clusters' and 'Oracle single instance' database options. (same for netca).

While it supposes to be:

This can happen for the following cases.

Case I

With 11.2 Grid Infrastructure, using dbca to create a RAC database from a 10.x or 11.1.x ORACLE_HOME.

$ORACLE_HOME/cfgtoologs/dbca/trace.log shows:

[main] [10:36:4:10] [OCR.<init>:259] Primary Group of Current user: oracle
[main] [10:36:4:11] [HASContext.getInstance:200] Module init : 24
[main] [10:36:4:11] [HASContext.getInstance:223] Local Module init : 24
[main] [10:36:4:13] [ClusterLock.<init>:56] ClusterLock Instance Allocation Failed: oracle.ops.mgmt.has.HASContextException: OCR Error(Native: prsr_initCLSS:[21])
[main] [10:36:4:20] [Cluster.isCluster:206] oracle.ops.mgmt.cluster.Cluster.isCluster(Cluster.java:260)
oracle.ops.mgmt.cluster.Cluster.isCluster(Cluster.java:197)
oracle.sysman.assistants.util.ClusterUtils.<init>(ClusterUtils.java:185)
oracle.sysman.assistants.util.ClusterUtils.getInstance(ClusterUtils.java:236)
oracle.sysman.assistants.dbca.backend.Host.checkOPS(Host.java:2070)
oracle.sysman.assistants.dbca.backend.Host.startOperation(Host.java:2303)
oracle.sysman.assistants.dbca.Dbca.execute(Dbca.java:115)
oracle.sysman.assistants.dbca.Dbca.main(Dbca.java:180)
[main] [10:36:4:20] [Host.checkOPS:2073] cluster existence:false
[main] [10:36:4:20] [Host.checkOPS:2111] Cluster installed=false
[Finalizer] [10:36:4:25] [ClusterLock.finalize:88] ClusterLock: finalized called for oracle.ops.mgmt.has.ClusterLock@5c7734

Case II

RDBMS is at the same release as CRS or Grid Infrastructure, RDBMS is installed with Real Application Cluster option

Case III

RDBMS is at the same release as CRS or Grid Infrastructure, RDBMS is installed on each individual node without selecting Real Application Cluster option.

Case IV,  V,  VI & VII

Grid Infrastructure and RDBMS are on the same release, they are installed as different user: grid and oracle. Grid Infrastructure is running on all nodes, RDBMS is installed with RAC option.

CAUSE

Case I

  This is caused by the cluster nodes not being pinned in 11.2 Grid Infrastructure.

See Oracle Grid Infrastructure Installation Guide 11g Release 2 (11.2) for Linux Chapter 5.3.3 Pinning Cluster Nodes for Oracle Database Release 10.x or 11.x for more details.

Case II

This is caused by the problem inventory, eg: oraInventory/ContentsXML/inventory.xml does not list RAC nodes for the corresponding RDBMS ORACLE_HOME. For example:

/HOME>
<HOME NAME="OraDb11g_home" LOC="/opt/oracle/product/11.2.0/racdb" TYPE="O" IDX="3">
</HOME>

While it should be similar to:

/HOME>
<HOME NAME="OraDb11g_home" LOC="/opt/oracle/product/11.2.0/racdb" TYPE="O" IDX="3">
   <NODE_LIST>
     <NODE NAME="racnode1"/>
     <NODE NAME="racnode2"/>
   </NODE_LIST>
</HOME>

 

Case III

If the RDBMS software is not installed with RAC option, then dbca will not show RAC option either. To confirm if RDBMS software is installed with RAC option, please refer Note 284785.1 How to Check Whether Oracle Binary/Instance is RAC Enabled and Relink Oracle Binary in RAC.

Case IV

The problem is caused by RDBMS ORACLE_HOME wrongly owned by grid user. It should be owned by oracle user.
dbca trace shows:

[main] [ 2012-08-09 03:46:46.745 GST ] [OracleHome.isDatabaseOptionOn:1133]  Checking Database Option: Real Application Clusters
[main] [ 2012-08-09 03:46:46.745 GST ] [OracleHome.isDatabaseOptionOn:1190]  Database Option Real Application Clusters is false

Despite RDBMS ORACLE_HOME has RAC option installed correctly.

Further strace against dbca reveals there are ORA-600 reported before dbca display the option page:

21999 02:45:37.053231 open("/u01/app/oracle/product/11.2.0/dbhome_1/rdbms/log/dbua4535717_ora_21999.trc", O_WRONLY|O_CREAT|O_TRUNC, 0660) = 3
...
21999 02:45:37.058573 write(3, "ORA-00600: internal error code, "..., 139) = 139
21999 02:45:37.214275 --- SIGSEGV (Segmentation fault) @ 0 (0) ---

checking /u01/app/oracle/product/11.2.0/dbhome_1/rdbms/log/dbua4535717_ora_21999.trc, shows:
ORA-00600: internal error code, arguments: [spstp: ORACLE_HOME uid does not match euid], [1100], [1101], [], [], [], [], [], [], [], [], []

While:
# id grid
uid=1100(grid) gid=1000(oinstall) groups=1000(oinstall),1200(asmadmin),1201(asmdba),1202(asmoper),1300(dba)
# id oracle
uid=1101(oracle) gid=1000(oinstall) groups=1000(oinstall),1201(asmdba),1300(dba),1301(oper)

$ ls -l /u01/app/oracle/product/11.2.0
drwxrwxr-x 75 grid oinstall 4096 Aug  8 14:21 dbhome_1  << this is wrongly owned by grid user

Case V

The problem is caused by an prior abnormal termination of dbca which left a test instance DBUA0 running on 1 of the cluster nodes, this prevents a new test instance to be created before the RAC option is displayed. dbca trace shows:

[main] [ 2011-03-11 21:21:08.473 GMT ] [OracleHome.initOptions:1226] Initializing Database Options with  for dummy sid=DBUA0 using initfile=/data/oracle/product/11.2.0.2/dbs/initDBUA0.ora using pwdfile=/data/oracle/product/11.2.0.2/dbs/orapwDBUA0
[main] [ 2011-03-11 21:21:08.899 GMT ] [OracleHome.initOptions:1240]  executing: startup nomount pfile='/data/oracle/product/11.2.0.2/dbs/initDBUA0.ora'
[main] [ 2011-03-11 21:21:32.871 GMT ] [SQLEngine.done:2167]  Done called
[main] [ 2011-03-11 21:21:32.872 GMT ] [OracleHome.initOptions:1247]  ORA-304: requested INSTANCE_NUMBER is busy <<<<
oracle.sysman.assistants.util.sqlEngine.SQLFatalErrorException: ORA-304: requested INSTANCE_NUMBER is busy 
        at 
oracle.sysman.assistants.util.sqlEngine.SQLEngine.executeImpl(SQLEngine.java:1
...
[main] [ 2011-03-11 21:21:33.499 GMT ] [OracleHome.isDatabaseOptionOn:1129] Checking Database Option: Real Application Clusters
[main] [ 2011-03-11 21:21:33.500 GMT ] [OracleHome.isDatabaseOptionOn:1186] Database Option Real Application Clusters is false <<<<

Case VI

The problem is caused by $ORACLE_HOME/rdbms/audit directory missing or not writable.

$ORACLE_BASE/cfgtoollogs/dbca/trace.log_<ORACLE_HOMENAME>_<date> shows:

[main] [ 2014-06-27 00:15:15.835 EST ] [OracleHome.initOptions:1236]  Initializing Database Options with  for dummy sid=DBUA1500252 using initfile=/u01/app/oradb1/product/11.2.0/dbhome_1/dbs/initDBUA1500252.ora using pwdfile=/u01/app/oradb1/product/11.2.0/dbhome_1/dbs/orapwDBUA1500252
...
[main] [ 2014-06-27 00:15:38.793 EST ] [OracleHome.initOptions:1285]  ORA-09925: Unable to create audit trail file

 

Case VII

The problem is caused by insufficient semaphores configed which leads to test instance startup failure.
dbca trace.log shows:

[main] [ 2015-08-06 09:28:58.544 EDT ] [OracleHome.initOptions:1253]  executing: startup nomount pfile='/oracle/product/11.2.0.4.5/db11g/dbs/initDBUA2857847.ora'
[main] [ 2015-08-06 09:29:00.158 EDT ] [SQLEngine.done:2189]  Done called
[main] [ 2015-08-06 09:29:00.159 EDT ] [OracleHome.initOptions:1262]  ORA-27154: post/wait create failed
ORA-27300: OS system dependent operation:semget failed with status: 28
ORA-27301: OS failure message: No space left on device
ORA-27302: failure occurred at: sskgpbitsper

 

 

Other Possible causes
1. RDBMS software corrupted, oracle binary shows different size for different nodes

2. Grid_home is not relinked properly

 

SOLUTION

Case I

1.  To fix the issue, pin all nodes within the cluster using:

as root user:
crsctl pin css -n<node1> <node2>

2. To list all pinned nodes:

olsnodes -t -n

After this, dbca shows Oracle Real Application Clusters database option correctly.

For 10.x and 11.1.x dbca to work with 11.2 listener, patch 8288940 needs to be applied. Please refer to Note 948456.1 for other potential issues in such mixed environments.

Case II

   Fix the inventory.xml via detaching the problem ORACLE_HOME, then re-attaching with correct information.

1. To detach ORACLE_HOME, on each cluster node, issue:

$ORACLE_HOME/oui/bin/runInstaller -detachHome -silent -local ORACLE_HOME=<$ORACLE_HOME path>

eg:
$ORACLE_HOME/oui/bin/runInstaller -detachHome -silent -local ORACLE_HOME=/opt/oracle/product/11.2.0/racdb

2. To attach ORACLE_HOME, on each cluster node, issue:

$ORACLE_HOME/oui/bin/runInstaller -silent -local -ignoreSysPrereqs -attachHome ORACLE_HOME=<$ORACLE_HOME path> ORACLE_HOME_NAME=<$ORACLE_HOME_NAME> CLUSTER_NODES=<local-node>,<remote-node> LOCAL_NODE=<local-node>

For example, on node 1, issue:

$ORACLE_HOME/oui/bin/runInstaller -silent -attachHome -local ORACLE_HOME="/opt/oracle/product/11.2.0/racdb" ORACLE_HOME_NAME="OraDb11g_home" "CLUSTER_NODES={racnode1,racnode2}" LOCAL_NODE='racnode1'

 on node 2, issue:

$ORACLE_HOME/oui/bin/runInstaller -silent -attachHome -local ORACLE_HOME="/opt/oracle/product/11.2.0/racdb" ORACLE_HOME_NAME="OraDb11g_home" "CLUSTER_NODES={racnode1,racnode2}" LOCAL_NODE='racnode2'

Case III

1. Relink Oracle binary to include RAC option.

cd $ORACLE_HOME/rdbms/lib
make -f ins_rdbms.mk rac_on ioracle

2. Fix the inventory using the same procedure as case II.

Case IV

Change RDBMS ORACLE_HOME to be owned by oracle user:

As root user:
cd /u01/app/oracle/product/11.2.0
chown oracle dbhome_1


Case V

Manually shutdown the instance DBUA0.
Please ensure there is no instance with name DBUA0 running on any node of the cluster before start dbca. This is not required if there is no earlier abnormal termination of dbca happened.


Case VI

Create the default audit directory under $ORACLE_HOME/rdbms/audit if it is missing, otherwise correct the permission and ownership:

$ mkdir $ORACLE_HOME/rdbms/audit
It should have permission 755 (drwxr-xr-x) and ownership <oracle>:oinstall

 

Case VII

Either increase the semaphores setting or clear up left over semaphores. Please refer to Note 825001.1 for solution.

Others

1. Reinstall RDBMS oracle software

2. Relinking Grid Infrastructure binaries, refer to
Oracle? Grid Infrastructure Installation Guide
11g Release 2 (11.2) for Linux
6.3 Relinking Oracle Grid Infrastructure for a Cluster Binaries 

时间: 2024-11-08 22:49:13

DBCA建库问题处理之-无法创建RAC实例的相关文章

【故障处理】DBCA建库诡异问题处理--rac环境不能创建rac库

[故障处理]DBCA建库诡异问题处理--rac环境不能创建rac库 BLOG文档结构图 前言部分 导读和注意事项 各位技术爱好者,看完本文后,你可以掌握如下的技能,也可以学到一些其它你所不知道的知识,~O(∩_∩)O~: ① dbca静默创建rac库 ② Inventory目录作用及其2种重建方法(重点) ③ rac环境dbca工具不能创建rac库的解决办法 ④ dbca静默建库常见问题处理 ⑤ 重建CRS集群环境执行root.sh脚本 Tips: ① 本文在ITpub(http://blog.

【故障处理】 DBCA建库报错CRS-2566

[故障处理] DBCA建库报错CRS-2566 PRCR-1071 PRCR-1006 一.1  BLOG文档结构图       一.2  前言部分   一.2.1  导读和注意事项 各位技术爱好者,看完本文后,你可以掌握如下的技能,也可以学到一些其它你所不知道的知识,~O(∩_∩)O~: ① dbca静默建库 ② 将监听加入CRS中     Tips:        ① 若文章代码格式有错乱,推荐使用搜狗.QQ或360浏览器,也可以下载pdf格式的文档来查看,pdf文档下载地址:http://

Oracle 12c手工建库(非CDB及CDB创建)

对于Oracle数据库的创建,Oracle除了支持dbca(GUI界面),同时也支持手工方式创建数据库,即使用CREATE DATABASE语句创建数据库.使用此语句对使用DBCA的一个优点是可以从脚本内创建数据库.在Oracle 12c版本中支持12c之前的非CDB数据库以及CDB容器数据库.因此创建方式略有不同.本文同时描述2种不同数据库的手工创建方法. 一.12c手工创建非CDB数据库 步骤1:指定实例标识符(SID) ORACLE_SID的环境变量用于该实例从稍后可能创建并同时在同一主机

DBCA静默建库中的两个小问题

创建数据库,主要有手工建库,DBCA建库,OMF建库.手工建库会重新初始化数据字典,过程相对比较耗时,但是完全定制化:OMF建库的场景比较特别,一般都是糅合在ASM中使用;DBCA图形化建库使用场景受限较大,其实DBCA还有另外一种快捷的方式就是DBCA静默建库,整个过程分分钟即可搞定. 如果说想简单使用,可以参考下面的例子,比如我们创建数据库为testdb,字符集为ZHS16GBK,命令如下:  dbca -silent -createDatabase -templateName $ORACL

Oracle手动建库常见问题

Oracle手动建库常见问题 BLOG文档结构图 前言部分 导读和注意事项 各位技术爱好者,看完本文后,你可以掌握如下的技能,也可以学到一些其它你所不知道的知识,~O(∩_∩)O~: ① 10G和11g手动建库(重点) ② 各种组件安装 ③ 创建Sample Schemas数据 ④ 手动建库中常用脚本的解释 ⑤ sqlplus中的帮助命令 Tips: ① 本文在ITpub(http://blog.itpub.net/26736162)和博客园(http://www.cnblogs.com/lhr

手工建库

手工建库步骤: 1.创建数据库所需的目录,包括数据文件存放目录,日志存放目录,归档存放目录等2.创建密码文件3.创建参数文件4.通过刚创建的pfile参数将数据库启动的nomount状态5.开始执行create database 命令创建数据库6.创建数据库相关视图和数据字典7.检查数据库状态,是否创建完成8.将创建数据库用的pfile参数创建成spfile,以后启动的时候不需要指定.9.重启数据库,验证第八步骤10.数据库创建完成. ------------------------------

Oracle 11g R2 手动建库(create database manually)

      手动创建数据库是DBA们经常遇到的情形,因为有些情况下无法提供GUI环境.实际上手动建库,只要设置好了相关的参数或值,也是非常方便的.本文基于Oracle 11g首先描述了手动建库的大致步骤并给出示例演示.最后提供了一个shell脚本直接执行来实现手动建库.在执行前该脚本可根据你的路径进行适当的修改.   一.手动建库大致步骤    设置环境变量.bash_profile    创建参数文件(位置:$ORACLE_HOME/dbs)    创建目录结构    执行建库脚本   二.手

oracle建库与日期格式用法

oracle建库与日期格式用法 安装oracle 实例名orcl,system密码system /*建库步骤: 1.安装oracle数据库教程,填写实例名orcl,最后创建实例数据库后结束. 2.系统运行中输入cmd回车打开命令窗口,输入命令 sqlplus ,输入用户名 system/system@orcl 回车登录,输入命令 start D:ksxt.sql (D:ksxt.sql是本文件的路径)  回车执行.自动结束  命令窗口如下:   C:UsersAdministrator>sqlp

DBCA静默方式建库

DBCA静默方式建库 本篇blog结构图:   使用DBCA的图形方式建库实在有诸多不便,但是使用静默方式建库就比较方便了,一个命令即可搞定.   使用dbca安装oracle数据库实例也有差不多两种方法: 一种就是根据模板文件进行安装,在上文中提到了在oracle安装程序的安装文件夹下的response目录中有一个dbca.rsp文件就是dbca的模板文件.当然我们也可以通过复制这个模板文件来修改其中的内容来建立定制的数据库,在这个模板文件中对于各个参数的说明非常详细,对这个文件的内容在此不做