注意:文章内容太多,公众号有限制,小麦苗作了精简,全过程能够参考http://blog.itpub.net/26736162/viewspace-2121863/ 或 http://www.cnblogs.com/lhrbest/articles/5661762.html 或者去云盘下载pdf版本阅读,谢谢你们的理解。html
各位技术爱好者,看完本文后,你能够掌握以下的技能,也能够学到一些其它你所不知道的知识,~O(∩_∩)O~:node
① dbca静默建立rac库sql
② Inventory目录做用及其2种重建方法(重点)数据库
③ rac环境dbca工具不能建立rac库的解决办法微信
④ dbca静默建库常见问题处理oracle
⑤ 重建CRS集群环境执行root.sh脚本app
项目ide |
source db工具 |
db 类型学习 |
RAC |
db version |
11.2.0.4 |
db 存储 |
ASM |
OS版本及kernel版本 |
AIX 64位 6.1.0.0 |
小麦苗采用dbca -silent+nodeinifo建立rac库,原来用的好好的命令,结果在这个rac环境上建立出来的库成了单实例的,非常郁闷,,,,且看故障发生的现象:
[ZFZHLHRDB1:oracle]:/oracle>dbca -silent -createDatabase -templateName General_Purpose.dbc -responseFile NO_VALUE \
> -gdbname raclhr -sid raclhr \
> -sysPassword oracle -systemPassword lhr \
> -datafileDestination 'DATA/' -recoveryAreaDestination 'DATA/' \
> -redoLogFileSize 50 \
> -storageType ASM -asmsnmpPassword lhr -diskGroupName 'DATA' \
> -characterset ZHS16GBK -nationalCharacterSet AL16UTF16 \
> -sampleSchema true \
> -automaticMemoryManagement true -totalMemory 2048 \
> -databaseType OLTP \
> -emConfiguration NONE \
> -nodeinfo ZFZHLHRDB1,ZFZHLHRDB2
Copying database files
1% complete
3% complete
10% complete
17% complete
24% complete
35% complete
Creating and starting Oracle instance
37% complete
42% complete
47% complete
52% complete
53% complete
56% complete
58% complete
Registering database with Oracle Restart
64% complete
Completing Database Creation
68% complete
71% complete
75% complete
85% complete
96% complete
100% complete
Look at the log file "/oracle/app/oracle/cfgtoollogs/dbca/raclhr/raclhr.log" for further details.
[ZFZHLHRDB1:oracle]:/oracle>more /oracle/app/oracle/cfgtoollogs/dbca/raclhr/raclhr.log
Copying database files
DBCA_PROGRESS : 1%
DBCA_PROGRESS : 3%
DBCA_PROGRESS : 10%
DBCA_PROGRESS : 17%
DBCA_PROGRESS : 24%
DBCA_PROGRESS : 31%
DBCA_PROGRESS : 35%
Creating and starting Oracle instance
DBCA_PROGRESS : 37%
DBCA_PROGRESS : 42%
DBCA_PROGRESS : 47%
DBCA_PROGRESS : 52%
DBCA_PROGRESS : 53%
DBCA_PROGRESS : 56%
DBCA_PROGRESS : 58%
Registering database with Oracle Restart
DBCA_PROGRESS : 64%
Completing Database Creation
DBCA_PROGRESS : 68%
DBCA_PROGRESS : 71%
DBCA_PROGRESS : 75%
DBCA_PROGRESS : 85%
DBCA_PROGRESS : 96%
DBCA_PROGRESS : 100%
Database creation complete. For details check the logfiles at:
/oracle/app/oracle/cfgtoollogs/dbca/raclhr.
Database Information:
Global Database Name:raclhr
System Identifier(SID):raclhr
[ZFZHLHRDB1:oracle]:/oracle>
[ZFZHLHRDB1:oracle]:/oracle>ORACLE_SID=raclhr
[ZFZHLHRDB1:oracle]:/oracle>sqlplus / as sysdba
SQL*Plus: Release 11.2.0.4.0 Production on Tue Jul 5 17:17:42 2016
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options
SYS@raclhr> show parameter cluster
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
cluster_database boolean FALSE
cluster_database_instances integer 1
cluster_interconnects string
你们看到这里的安装百分比是1%->3%->10%-17%.....,而rac库建立的时候进度百分比应该是1%->3%->9%-15%.....,以下图所示:
Copying database files
1% complete
3% complete
9% complete
15% complete
21% complete
30% complete
Creating and starting Oracle instance
32% complete
36% complete
40% complete
44% complete
45% complete
48% complete
50% complete
Creating cluster database views
52% complete
70% complete
Completing Database Creation
73% complete
76% complete
85% complete
94% complete
100% complete
Look at the log file "/oracle/app/oracle/cfgtoollogs/dbca/raclhr/raclhr.log" for further details.
接下来小麦苗尝试了以下的几种方式:①dbca采用响应文件的形式,②dbca图形界面的方式,都是一样的状况。
个人环境dbca图形界面的第一张图:
而正常rac环境下dbca图形界面的第一步图应该是:
以上都是目前出现的问题,初步预估是哪一个配置文件出错了,dbca不能判断集群环境。
起初小麦苗觉得是集群出现了问题,在万般无奈的状况下执行root.sh重建了集群,按照之前的经验,这个终极大招执行后集群确定能够恢复到正常的状况下,结果呢?结果仍是令小麦苗很伤心,状况依旧没有解决。
这个终极大招已经使用过了,问题没有解决只能说明不是权限的问题,也不是集群的问题,而是DB环境的问题。
因而硬着头皮分析分析dbca的日志,dbca建立库的时候日志在:11g:$ORACLE_BASE/cfgtoollogs/dbca , 10g:$ORACLE_HOME/cfgtoollogs/dbca,发现多是监听的问题,因而又重建了监听,仍是不行,
有种深深的挫败感,因而解决同事碰到的那个DG问题,参考:http://blog.itpub.net/26736162/viewspace-2121688/。时间就这样过了2天,到了7月8号,手头又没什么事情了,想起来dbca这个问题,想来想去仍是得从日志入手,老子一行一行的看,总能看出点东西来,但此次我比对的看,就是找一个dbca能够建立rac的环境,生成日志来分析差别,结果令我震惊了。
当小麦苗看到第5行的日志的时候,发现一个null的问题,Current Version From Inventory: null,截图以下:
错误环境截图:
而正常环境的rac是这个样子的:
能够看到正常环境下,能够获取到Homeinfo和Current Version From Inventory的值,当看到Inventory这个词的时候我就想我已经找到问题的答案了。应该是Inventory这个目录出现了问题,标准点的说法应该是/oracle/app/oraInventory/ContentsXML/inventory.xml这个文件的内容有问题了。Inventory目录存放的是Oracle软件安装的目录信息,Oracle升级也须要这个目录,执行opatch lspatches也须要这个目录。oraInventory目录的位置在/etc/oraInst.loc中记录,11g中咱们能够经过$ORACLE_HOME/oui/bin/attachHome.sh来重建这个目录。
在其中的1个节点上分别用oracle和grid来执行:
[ZFLHRDB1:root]:/oracle/app/oraInventory>$ORACLE_HOME/oui/bin/attachHome.sh
The user is root. Oracle Universal Installer cannot continue installation if the user is root.
: A file or directory in the path name does not exist.
[ZFLHRDB1:root]:/oracle/app/oraInventory>su - grid
[ZFLHRDB1:grid]:/home/grid>$ORACLE_HOME/oui/bin/attachHome.sh
Starting Oracle Universal Installer...
Checking swap space: must be greater than 500 MB. Actual 8192 MB Passed
The inventory pointer is located at /etc/oraInst.loc
The inventory is located at /oracle/app/oraInventory
'AttachHome' was successful.
[ZFLHRDB1:grid]:/home/grid>cd /oracle/app/oraInventory/ContentsXML
[ZFLHRDB1:grid]:/oracle/app/oraInventory/ContentsXML>more inv*
<?xml version="1.0" standalone="yes" ?>
<!-- Copyright (c) 1999, 2013, Oracle and/or its affiliates.
All rights reserved. -->
<!-- Do not modify the contents of this file by hand. -->
<INVENTORY>
<VERSION_INFO>
<SAVED_WITH>11.2.0.4.0</SAVED_WITH>
<MINIMUM_VER>2.1.0.6.0</MINIMUM_VER>
</VERSION_INFO>
<HOME_LIST>
<HOME NAME="Ora11g_gridinfrahome1" LOC="/oracle/app/11.2.0/grid" TYPE="O" IDX="1" CRS="true">
<NODE_LIST>
<NODE NAME="ZFLHRDB1"/>
<NODE NAME="ZFLHRDB2"/>
</NODE_LIST>
</HOME>
</HOME_LIST>
<COMPOSITEHOME_LIST>
</COMPOSITEHOME_LIST>
</INVENTORY>
[ZFLHRDB1:grid]:/oracle/app/oraInventory/ContentsXML>exit
[ZFLHRDB1:root]:/oracle/app/oraInventory>su - oracle
[ZFLHRDB1:oracle]:/oracle>$ORACLE_HOME/oui/bin/attachHome.sh
Starting Oracle Universal Installer...
Checking swap space: must be greater than 500 MB. Actual 8192 MB Passed
The inventory pointer is located at /etc/oraInst.loc
The inventory is located at /oracle/app/oraInventory
'AttachHome' was successful.
[ZFLHRDB1:oracle]:/oracle>cd /oracle/app/oraInventory/ContentsXML
[ZFLHRDB1:oracle]:/oracle/app/oraInventory/ContentsXML>more inv*
<?xml version="1.0" standalone="yes" ?>
<!-- Copyright (c) 1999, 2013, Oracle and/or its affiliates.
All rights reserved. -->
<!-- Do not modify the contents of this file by hand. -->
<INVENTORY>
<VERSION_INFO>
<SAVED_WITH>11.2.0.4.0</SAVED_WITH>
<MINIMUM_VER>2.1.0.6.0</MINIMUM_VER>
</VERSION_INFO>
<HOME_LIST>
<HOME NAME="Ora11g_gridinfrahome1" LOC="/oracle/app/11.2.0/grid" TYPE="O" IDX="1" CRS="true">
<NODE_LIST>
<NODE NAME="ZFLHRDB1"/>
<NODE NAME="ZFLHRDB2"/>
</NODE_LIST>
</HOME>
<HOME NAME="DbHome1" LOC="/oracle/app/oracle/product/11.2.0/db" TYPE="O" IDX="2">
<NODE_LIST>
<NODE NAME="ZFLHRDB1"/>
<NODE NAME="ZFLHRDB2"/>
</NODE_LIST>
</HOME>
</HOME_LIST>
<COMPOSITEHOME_LIST>
</COMPOSITEHOME_LIST>
</INVENTORY>
重建Inventory这个目录后从新执行建库脚本就正常了,唉,o(︶︿︶)o 唉,折腾了这么久原来是这个文件的问题,至于新环境为啥这个目录的配置文件不全,这个估计得追溯到rac的安装过程了,这个就不去纠结了。
About Me
..........................................................................................................................................................................................................
本文做者:小麦苗,只专一于数据库的技术,更注重技术的运用
本文在ITpub(http://blog.itpub.net/26736162)和博客园(http://www.cnblogs.com/lhrbest)有同步更新
本文地址:http://blog.itpub.net/26736162/viewspace-2121863/
本文pdf版:http://yunpan.cn/cdEQedhCs2kFz (提取码:ed9b)
小麦苗分享的其它资料:http://blog.itpub.net/26736162/viewspace-1624453/
联系我请加QQ好友(642808185),注明添加原因
于 2016-07-05 16:00~ 2016-07-08 19:00 在中行完成
【版权全部,文章容许转载,但须以连接方式注明源地址,不然追究法律责任】
..........................................................................................................................................................................................................
拿起手机扫描下边的图片来关注小麦苗的微信公众号:xiaomaimiaolhr,学习最实用的数据库技术。
本文分享自微信公众号 - DB宝(lhrdba)。
若有侵权,请联系 support@oschina.cn 删除。
本文参与“OSC源创计划”,欢迎正在阅读的你也加入,一块儿分享。