oracle restart 体验
本站文章除注明转载外,均为本站原创: 转载自love wife love life —Roger的Oracle/MySQL/PostgreSQL数据恢复博客
本文链接地址: oracle restart 体验
1 2 3 |
关于oracle 11gR2的restart特性,早就听说了,但一直没有亲身体验过, 今天简单的进行了相关的测试,在部署环境过程中遇到个小问题,安装过 程中执行root.sh报错,如下: |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
[root@11gR2test ~]# /home/ora11g/product/11.2/grid/root.sh Running Oracle 11g root script... The following environment variables are set as: ORACLE_OWNER= ora11g ORACLE_HOME= /home/ora11g/product/11.2/grid Enter the full pathname of the local bin directory: [/usr/local/bin]: The contents of "dbhome" have not changed. No need to overwrite. The contents of "oraenv" have not changed. No need to overwrite. The contents of "coraenv" have not changed. No need to overwrite. Entries will be added to the /etc/oratab file as needed by Database Configuration Assistant when a database is created Finished running generic part of root script. Now product-specific root actions will be performed. Using configuration parameter file: /home/ora11g/product/11.2/grid/crs/install/crsconfig_params Creating trace directory LOCAL ADD MODE Creating OCR keys for user 'ora11g', privgrp 'oinstall'.. Operation successful. LOCAL ONLY MODE Successfully accumulated necessary OCR keys. Creating OCR keys for user 'root', privgrp 'root'.. Operation successful. CRS-4664: Node 11gr2test successfully pinned. Adding daemon to inittab ohasd failed to start Failed to start the Clusterware. Last 20 lines of the alert log follow: 2011-10-08 22:24:52.838 [client(7511)]CRS-2101:The OLR was formatted using version 3. 2011-10-08 22:24:54.073 [client(7532)]CRS-1001:The OCR was formatted using version 3. [client(7574)]CRS-10001:CRS-6021: No msg for has:crs-6021 [l][unlimited] [client(7575)]CRS-10001:CRS-6021: No msg for has:crs-6021 [n][65536] ohasd failed to start at /home/ora11g/product/11.2/grid/crs/install/roothas.pl line 325. /home/ora11g/product/11.2/grid/perl/bin/perl -I/home/ora11g/product/11.2/grid/perl/lib -I/home/ora11g/product/11.2/grid/crs/install /home/ora11g/product/11.2/grid/crs/install/roothas.pl execution failed |
1 2 3 4 5 6 7 8 9 |
关于该问题类类似文件,大家可以参考如下两个MOS文档: OHASD Failed to Start: Inappropriate ioctl for device [ID 1069182.1] Troubleshooting 11.2 Grid Infastructure Installation Root.sh Issues [ID 1053970.1] How to Proceed from Failed 11gR2 Grid Infrastructure (CRS) Installation [ID 942166.1] 特别是第3个文档,十分有用,主要是一个root.sh执行失败以后如何重跑的东西。 环境搞好以后,如下: |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 |
[ora11g@localhost database]$ cd /home/ora11g/11.2/grid/bin [ora11g@localhost bin]$ ./crs_stat -t Name Type Target State Host ------------------------------------------------------------ ora....ER.lsnr ora....er.type ONLINE ONLINE localhost ora.cssd ora.cssd.type ONLINE ONLINE localhost ora.diskmon ora....on.type ONLINE ONLINE localhost ora.evmd ora.evm.type ONLINE ONLINE localhost ora.ons ora.ons.type OFFLINE OFFLINE ora.roger.db ora....se.type ONLINE ONLINE localhost [ora11g@localhost database]$ srvctl config database -d roger Database unique name: roger Database name: roger Oracle home: /home/ora11g/product/11.2/db Oracle user: ora11g Spfile: Domain: Start options: open Stop options: immediate Database role: PRIMARY Management policy: AUTOMATIC Disk Groups: Services: [ora11g@localhost database]$ srvctl status database -d roger Database is running. ====== 下面测试一下restart功能是否好使 ====== [ora11g@localhost bin]$ ps -ef|grep tns ora11g 10174 1 0 00:31 ? 00:00:00 /home/ora11g/11.2/grid/bin/tnslsnr LISTENER -inherit ora11g 27750 4783 0 02:30 pts/1 00:00:00 grep tns [ora11g@localhost bin]$ kill -9 10174 [ora11g@localhost bin]$ ps -ef|grep tns ora11g 27753 4783 0 02:31 pts/1 00:00:00 grep tns [ora11g@localhost bin]$ ps -ef|grep tns ora11g 27766 4783 0 02:31 pts/1 00:00:00 grep tns [ora11g@localhost bin]$ ps -ef|grep tns ora11g 27768 4783 0 02:31 pts/1 00:00:00 grep tns [ora11g@localhost bin]$ ps -ef|grep tns ora11g 27770 4783 0 02:31 pts/1 00:00:00 grep tns [ora11g@localhost bin]$ ps -ef|grep tns ora11g 27772 4783 0 02:31 pts/1 00:00:00 grep tns [ora11g@localhost bin]$ ps -ef|grep tns ora11g 27774 4783 0 02:31 pts/1 00:00:00 grep tns [ora11g@localhost bin]$ ./crs_stat -t Name Type Target State Host ------------------------------------------------------------ ora....ER.lsnr ora....er.type ONLINE ONLINE localhost ora.cssd ora.cssd.type ONLINE ONLINE localhost ora.diskmon ora....on.type ONLINE ONLINE localhost ora.evmd ora.evm.type ONLINE ONLINE localhost ora.ons ora.ons.type OFFLINE OFFLINE ora.roger.db ora....se.type ONLINE ONLINE localhost [ora11g@localhost bin]$ ps -ef|grep tns ora11g 27887 4783 0 02:31 pts/1 00:00:00 grep tns [ora11g@localhost bin]$ ps -ef|grep tns ora11g 27890 4783 0 02:31 pts/1 00:00:00 grep tns [ora11g@localhost bin]$ ps -ef|grep tns ora11g 27900 1 0 02:31 ? 00:00:00 /home/ora11g/11.2/grid/bin/tnslsnr LISTENER -inherit |
1 2 3 4 5 |
我们发现listener自动重起了,关于这里测试的过程中,listener restart的具体时间间隔? 比如说,oracle它如何知道listener已经停掉了?当检测到listener停掉以后,在多少时间内 去restart listener? 关于这个小问题,我们可以同listener的profile信息得到答案: |
1 2 3 4 5 6 7 8 9 10 11 12 13 |
[ora11g@localhost bin]$ ./crs_stat -p ora.LISTENER.lsnr NAME=ora.LISTENER.lsnr TYPE=ora.listener.type ACTION_SCRIPT= AUTO_START=restore CHECK_INTERVAL=60 DESCRIPTION=CRS resource type for the Listener RESTART_ATTEMPTS=5 SCRIPT_TIMEOUT=60 START_TIMEOUT=180 STOP_TIMEOUT=0 UPTIME_THRESHOLD=1d |
1 |
我们可以看到是60s检测一下,检测到之后立即重启,如果启动失败,会在180s内再次进行restart。 |
One Response to “oracle restart 体验”
当主机名改变以后,必须reconfig restart,如下是一个简单的步骤:
[root@11gr2test install]# ./roothas.pl -deconfig -force
Using configuration parameter file: ./crsconfig_params
CRS-4639: Could not contact Oracle High Availability Services
CRS-4000: Command Stop failed, or completed with errors.
CRS-4639: Could not contact Oracle High Availability Services
CRS-4000: Command Delete failed, or completed with errors.
CLSU-00100: Operating System function: opendir failed with error data: 2
CLSU-00101: Operating System error message: No such file or directory
CLSU-00103: error location: scrsearch1
CLSU-00104: additional error information: cant open scr home dir scls_scr_getval
CRS-4544: Unable to connect to OHAS
CRS-4000: Command Stop failed, or completed with errors.
ACFS-9200: Supported
Successfully deconfigured Oracle Restart stack
[root@11gr2test install]# owd
-bash: owd: command not found
[root@11gr2test install]# pwd
/home/ora11g/11.2/grid/crs/install
[root@11gr2test install]# ./roothas.pl
Using configuration parameter file: ./crsconfig_params
LOCAL ADD MODE
Creating OCR keys for user ‘ora11g’, privgrp ‘oinstall’..
Operation successful.
LOCAL ONLY MODE
Successfully accumulated necessary OCR keys.
Creating OCR keys for user ‘root’, privgrp ‘root’..
Operation successful.
CRS-4664: Node 11gr2test successfully pinned.
Adding daemon to inittab
ACFS-9300: ADVM/ACFS distribution files found.
ACFS-9307: Installing requested ADVM/ACFS software.
ACFS-9308: Loading installed ADVM/ACFS drivers.
ACFS-9321: Creating udev for ADVM/ACFS.
ACFS-9323: Creating module dependencies – this may take some time.
ACFS-9327: Verifying ADVM/ACFS devices.
ACFS-9309: ADVM/ACFS installation correctness verified.
11gr2test 2011/10/09 06:27:20 /home/ora11g/11.2/grid/cdata/11gr2test/backup_20111009_062720.olr
Successfully configured Oracle Grid Infrastructure for a Standalone Server
[root@11gr2test install]# su – ora11g
[ora11g@11gr2test ~]$ srvctl add asm
[ora11g@11gr2test ~]$ srvctl start asm
[ora11g@11gr2test ~]$ srvctl add database -d roger -o /home/ora11g/product/11.2/db
[ora11g@11gr2test ~]$ srvctl add listener
[ora11g@11gr2test ~]$
[ora11g@11gr2test ~]$ cd /home/ora11g/11.2/grid/bin
[ora11g@11gr2test bin]$ ./crs_stat -t
Name Type Target State Host
————————————————————
ora….ER.lsnr ora….er.type OFFLINE OFFLINE
ora.asm ora.asm.type ONLINE ONLINE 11gr2test
ora.cssd ora.cssd.type ONLINE ONLINE 11gr2test
ora.diskmon ora….on.type ONLINE ONLINE 11gr2test
ora.evmd ora.evm.type ONLINE ONLINE 11gr2test
ora.ons ora.ons.type OFFLINE OFFLINE
ora.roger.db ora….se.type OFFLINE OFFLINE
[ora11g@11gr2test bin]$ ./crs_stat -p|grep lnsr
[ora11g@11gr2test bin]$ ./crs_stat -t
Name Type Target State Host
————————————————————
ora.DATA1.dg ora….up.type ONLINE ONLINE 11gr2test
ora….ER.lsnr ora….er.type ONLINE ONLINE 11gr2test
ora.asm ora.asm.type ONLINE ONLINE 11gr2test
ora.cssd ora.cssd.type ONLINE ONLINE 11gr2test
ora.diskmon ora….on.type ONLINE ONLINE 11gr2test
ora.evmd ora.evm.type ONLINE ONLINE 11gr2test
ora.ons ora.ons.type OFFLINE OFFLINE
ora.roger.db ora….se.type ONLINE ONLINE 11gr2test
[ora11g@11gr2test bin]$
[ora11g@11gr2test bin]$ ./crsctl stop has
CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on ’11gr2test’
CRS-2673: Attempting to stop ‘ora.LISTENER.lsnr’ on ’11gr2test’
CRS-2673: Attempting to stop ‘ora.evmd’ on ’11gr2test’
CRS-2673: Attempting to stop ‘ora.asm’ on ’11gr2test’
CRS-2677: Stop of ‘ora.asm’ on ’11gr2test’ succeeded
CRS-2673: Attempting to stop ‘ora.cssd’ on ’11gr2test’
CRS-2677: Stop of ‘ora.cssd’ on ’11gr2test’ succeeded
CRS-2673: Attempting to stop ‘ora.diskmon’ on ’11gr2test’
CRS-2677: Stop of ‘ora.LISTENER.lsnr’ on ’11gr2test’ succeeded
CRS-2677: Stop of ‘ora.diskmon’ on ’11gr2test’ succeeded
CRS-2677: Stop of ‘ora.evmd’ on ’11gr2test’ succeeded
CRS-2793: Shutdown of Oracle High Availability Services-managed resources on ’11gr2test’ has completed
CRS-4133: Oracle High Availability Services has been stopped.
[ora11g@11gr2test bin]$
具体大家可以参考如下Mos文档:
HOW TO RECONFIGURE ORACLE RESTART AFTER SERVER RENAME [ID 986740.1]
Leave a Reply
You must be logged in to post a comment.