A-A+

ORACLE 10gRAC升级并打补丁一例

2013年01月12日 DG&RAC&OGG 暂无评论 阅读 2,110 次

(零) RAC数据库升级(10.2.0.1.0->10.2.0.5.0)并打补丁(P12880299)

--原始库信息
SQL> select * from v$version where rownum<5;

BANNER
----------------------------------------------------------------
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Prod
PL/SQL Release 10.2.0.1.0 - Production
CORE 10.2.0.1.0 Production
TNS for Linux: Version 10.2.0.1.0 - Production

[oracle@rac1 ~]$ crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora....SM1.asm application ONLINE ONLINE rac1
ora....C1.lsnr application ONLINE ONLINE rac1
ora.rac1.gsd application ONLINE ONLINE rac1
ora.rac1.ons application ONLINE ONLINE rac1
ora.rac1.vip application ONLINE ONLINE rac1
ora....SM2.asm application ONLINE ONLINE rac2
ora....C2.lsnr application ONLINE ONLINE rac2
ora.rac2.gsd application ONLINE ONLINE rac2
ora.rac2.ons application ONLINE ONLINE rac2
ora.rac2.vip application ONLINE ONLINE rac2
ora.racdb.db application ONLINE ONLINE rac1
ora....b1.inst application ONLINE ONLINE rac1
ora....b2.inst application ONLINE ONLINE rac2

/*(一)升级 CRS*/
--停止所有资源
[oracle@rac1 ~]$ crs_stop -all
Attempting to stop `ora.rac1.gsd` on member `rac1`
Attempting to stop `ora.rac1.ons` on member `rac1`
Attempting to stop `ora.racdb.db` on member `rac1`
Attempting to stop `ora.rac2.ons` on member `rac2`
Attempting to stop `ora.rac2.gsd` on member `rac2`
Stop of `ora.rac2.ons` on member `rac2` succeeded.
Stop of `ora.rac2.gsd` on member `rac2` succeeded.
Stop of `ora.rac1.gsd` on member `rac1` succeeded.
Stop of `ora.rac1.ons` on member `rac1` succeeded.
Stop of `ora.racdb.db` on member `rac1` succeeded.
`ora.racdb.racdb1.inst` is already OFFLINE.
`ora.racdb.racdb2.inst` is already OFFLINE.
Attempting to stop `ora.rac1.ASM1.asm` on member `rac1`
Attempting to stop `ora.rac2.ASM2.asm` on member `rac2`
Stop of `ora.rac1.ASM1.asm` on member `rac1` succeeded.
Stop of `ora.rac2.ASM2.asm` on member `rac2` succeeded.
Attempting to stop `ora.rac1.LISTENER_RAC1.lsnr` on member `rac1`
Attempting to stop `ora.rac2.LISTENER_RAC2.lsnr` on member `rac2`
Stop of `ora.rac2.LISTENER_RAC2.lsnr` on member `rac2` succeeded.
Attempting to stop `ora.rac2.vip` on member `rac2`
Stop of `ora.rac2.vip` on member `rac2` succeeded.
Stop of `ora.rac1.LISTENER_RAC1.lsnr` on member `rac1` succeeded.
Attempting to stop `ora.rac1.vip` on member `rac1`
Stop of `ora.rac1.vip` on member `rac1` succeeded.
CRS-0216: Could not stop resource 'ora.racdb.racdb1.inst'.

CRS-0216: Could not stop resource 'ora.racdb.racdb2.inst'.

[oracle@rac1 ~]$ crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora....SM1.asm application OFFLINE OFFLINE
ora....C1.lsnr application OFFLINE OFFLINE
ora.rac1.gsd application OFFLINE OFFLINE
ora.rac1.ons application OFFLINE OFFLINE
ora.rac1.vip application OFFLINE OFFLINE
ora....SM2.asm application OFFLINE OFFLINE
ora....C2.lsnr application OFFLINE OFFLINE
ora.rac2.gsd application OFFLINE OFFLINE
ora.rac2.ons application OFFLINE OFFLINE
ora.rac2.vip application OFFLINE OFFLINE
ora.racdb.db application OFFLINE OFFLINE
ora....b1.inst application OFFLINE OFFLINE
ora....b2.inst application OFFLINE OFFLINE

--停止所有节点的CRS
[oracle@rac1 ~]$ su -
Password:
[root@rac1 ~]# /opt/ora10g/product/crs/bin/crsctl stop crs
Stopping resources.
Successfully stopped CRS resources
Stopping CSSD.
Shutting down CSS daemon.
Shutdown request successfully issued.
[root@rac1 ~]# /opt/ora10g/product/crs/bin/crsctl check crs
Failure 1 contacting CSS daemon
Cannot communicate with CRS
Cannot communicate with EVM

[root@rac2 ~]# /opt/ora10g/product/crs/bin/crsctl stop crs
Stopping resources.
Successfully stopped CRS resources
Stopping CSSD.
Shutting down CSS daemon.
Shutdown request successfully issued.
[root@rac2 ~]# /opt/ora10g/product/crs/bin/crsctl check crs
Failure 1 contacting CSS daemon
Cannot communicate with CRS
Cannot communicate with EVM

--确认参数(2个节点需要修改部分参数)
[root@rac2 ~]# vi /etc/sysctl.conf
#oracle set
kernel.shmall = 2097152
#kernel.shmmax = 536870912
kernel.shmmax = 1073741824
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
#fs.file-max = 65536
fs.file-max = 101365
#net.ipv4.ip_local_port_range = 1024 65000
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 1048576
net.core.rmem_max = 1048576
net.core.wmem_default = 262144
net.core.wmem_max = 262144

--执行runInstaller升级CRS
[oracle@rac1 ~]$ cd /tmp/p8202632_10205_LINUX/Disk1/
[oracle@rac1 Disk1]$ pwd
/tmp/p8202632_10205_LINUX/Disk1
[oracle@rac1 Disk1]$ export DISPLAY=192.168.137.1:0.0
[oracle@rac1 Disk1]$ ./runInstaller

Starting Oracle Universal Installer...

Checking installer requirements...

Checking operating system version: must be redhat-3, SuSE-9, SuSE-10, redhat-4, redhat-5, redhat-6, UnitedLinux-1.0, asianux-1, asianux-2, asianux-3, enterprise-4, enterprise-5 or SuSE-11
Passed

All installer requirements met.

Preparing to launch Oracle Universal Installer from /tmp/OraInstall2012-09-11_04-47-48PM. Please wait ...

--按提示执行脚本
[root@rac1 ~]# /opt/ora10g/product/crs/bin/crsctl stop crs
Stopping resources.
Error while stopping resources. Possible cause: CRSD is down.
Stopping CSSD.
Unable to communicate with the CSS daemon.
[root@rac1 ~]# /opt/ora10g/product/crs/install/root102.sh
Creating pre-patch directory for saving pre-patch clusterware files
Completed patching clusterware files to /opt/ora10g/product/crs
Relinking some shared libraries.
Relinking of patched files is complete.
WARNING: directory '/opt/ora10g/product' is not owned by root
WARNING: directory '/opt/ora10g' is not owned by root
Preparing to recopy patched init and RC scripts.
Recopying init and RC scripts.
Startup will be queued to init within 30 seconds.
Starting up the CRS daemons.
Waiting for the patched CRS daemons to start.
This may take a while on some systems.
.
.
10205 patch successfully applied.
clscfg: EXISTING configuration version 3 detected.
clscfg: version 3 is 10G Release 2.
Successfully deleted 1 values from OCR.
Successfully deleted 1 keys from OCR.
Successfully accumulated necessary OCR keys.
Using ports: CSS=49895 CRS=49896 EVMC=49898 and EVMR=49897.
node :
node 1: rac1 rac1-priv rac1
Creating OCR keys for user 'root', privgrp 'root'..
Operation successful.
clscfg -upgrade completed successfully
Creating '/opt/ora10g/product/crs/install/paramfile.crs' with data used for CRS configuration
Setting CRS configuration values in /opt/ora10g/product/crs/install/paramfile.crs

[root@rac2 ~]# /opt/ora10g/product/crs/bin/crsctl stop crs
Stopping resources.
Error while stopping resources. Possible cause: CRSD is down.
Stopping CSSD.
Unable to communicate with the CSS daemon.
[root@rac2 ~]# /opt/ora10g/product/crs/install/root102.sh
Creating pre-patch directory for saving pre-patch clusterware files
Completed patching clusterware files to /opt/ora10g/product/crs
Relinking some shared libraries.
Relinking of patched files is complete.
WARNING: directory '/opt/ora10g/product' is not owned by root
WARNING: directory '/opt/ora10g' is not owned by root
Preparing to recopy patched init and RC scripts.
Recopying init and RC scripts.
Startup will be queued to init within 30 seconds.
Starting up the CRS daemons.
Waiting for the patched CRS daemons to start.
This may take a while on some systems.
.
.
.
10205 patch successfully applied.
clscfg: EXISTING configuration version 3 detected.
clscfg: version 3 is 10G Release 2.
Successfully deleted 1 values from OCR.
Successfully deleted 1 keys from OCR.
Successfully accumulated necessary OCR keys.
Using ports: CSS=49895 CRS=49896 EVMC=49898 and EVMR=49897.
node :
node 2: rac2 rac2-priv rac2
Creating OCR keys for user 'root', privgrp 'root'..
Operation successful.
clscfg -upgrade completed successfully
Creating '/opt/ora10g/product/crs/install/paramfile.crs' with data used for CRS configuration
Setting CRS configuration values in /opt/ora10g/product/crs/install/paramfile.crs

--CRS升级完毕,查看CRS当前版本
[root@rac2 ~]# /opt/ora10g/product/crs/bin/crsctl query crs softwareversion
CRS software version on node [rac2] is [10.2.0.5.0]

/*(二)升级DB software*/
--需要关闭相关进程(如下所示)
--注:需要关闭所有节点的资源和CRS,并且要保证数据库所有节点用户等效和时间同步
[root@rac1 ~]# ps -ef | grep sqlplus
oracle 12149 7832 0 18:45 pts/0 00:00:00 rlwrap sqlplus /nolog
oracle 12152 12149 0 18:45 pts/2 00:00:00 sqlplus
root 14731 7723 0 18:51 pts/1 00:00:00 grep sqlplus
[root@rac1 ~]# kill -9 12149 12152

--执行runInstaller升级DB software
[oracle@rac1 ~]$ crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora....SM1.asm application OFFLINE OFFLINE
ora....C1.lsnr application OFFLINE OFFLINE
ora.rac1.gsd application OFFLINE OFFLINE
ora.rac1.ons application OFFLINE OFFLINE
ora.rac1.vip application OFFLINE OFFLINE
ora....SM2.asm application OFFLINE OFFLINE
ora....C2.lsnr application OFFLINE OFFLINE
ora.rac2.gsd application OFFLINE OFFLINE
ora.rac2.ons application OFFLINE OFFLINE
ora.rac2.vip application OFFLINE OFFLINE
ora.racdb.db application OFFLINE OFFLINE
ora....b1.inst application OFFLINE OFFLINE
ora....b2.inst application OFFLINE OFFLINE

[root@rac1 ~]# /opt/ora10g/product/crs/bin/crsctl stop crs
Stopping resources. This could take several minutes.
Successfully stopped CRS resources.
Stopping CSSD.
Shutting down CSS daemon.
Shutdown request successfully issued.
[root@rac2 ~]# /opt/ora10g/product/crs/bin/crsctl stop crs
Stopping resources. This could take several minutes.
Successfully stopped CRS resources.
Stopping CSSD.
Shutting down CSS daemon.
Shutdown request successfully issued.

[oracle@rac1 ~]$ cd /tmp/p8202632_10205_LINUX/Disk1/
[oracle@rac1 Disk1]$ pwd
/tmp/p8202632_10205_LINUX/Disk1
[oracle@rac1 Disk1]$ export DISPLAY=192.168.137.1:0.0
[oracle@rac1 Disk1]$ ./runInstaller

Starting Oracle Universal Installer...

Checking installer requirements...

Checking operating system version: must be redhat-3, SuSE-9, SuSE-10, redhat-4, redhat-5, redhat-6, UnitedLinux-1.0, asianux-1, asianux-2, asianux-3, enterprise-4, enterprise-5 or SuSE-11
Passed

All installer requirements met.

Preparing to launch Oracle Universal Installer from /tmp/OraInstall2012-09-11_06-49-28PM. Please wait ...[oracle@rac1 Disk1]$ Oracle Universal Installer, Version 10.2.0.5.0 Production
Copyright (C) 1999, 2010, Oracle. All rights reserved.

--在各节点执行指定脚本
注:在各个节点执行完脚本后,需要执行数据库数据字典和相关包的升级脚本,此处忘记按照readme中的提示进行2个sql脚本的执行,导致后边数据库正常startup时的报错。具体解决及处理过程见后边。(也是后补脚本的执行)
[root@rac1 ~]# /opt/ora10g/product/database/root.sh
Running Oracle 10g root.sh script...

The following environment variables are set as:
ORACLE_OWNER= oracle
ORACLE_HOME= /opt/ora10g/product/database

Enter the full pathname of the local bin directory: [/usr/local/bin]:
The file "dbhome" already exists in /usr/local/bin. Overwrite it? (y/n)
[n]: y
Copying dbhome to /usr/local/bin ...
The file "oraenv" already exists in /usr/local/bin. Overwrite it? (y/n)
[n]: y
Copying oraenv to /usr/local/bin ...
The file "coraenv" already exists in /usr/local/bin. Overwrite it? (y/n)
[n]: y
Copying coraenv to /usr/local/bin ...

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.sh script.
Now product-specific root actions will be performed.

[root@rac2 ~]# /opt/ora10g/product/database/root.sh
Running Oracle 10g root.sh script...

The following environment variables are set as:
ORACLE_OWNER= oracle
ORACLE_HOME= /opt/ora10g/product/database

Enter the full pathname of the local bin directory: [/usr/local/bin]:
The file "dbhome" already exists in /usr/local/bin. Overwrite it? (y/n)
[n]: y
Copying dbhome to /usr/local/bin ...
The file "oraenv" already exists in /usr/local/bin. Overwrite it? (y/n)
[n]: y
Copying oraenv to /usr/local/bin ...
The file "coraenv" already exists in /usr/local/bin. Overwrite it? (y/n)
[n]: y
Copying coraenv to /usr/local/bin ...

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.sh script.
Now product-specific root actions will be performed.

/*(三)安装补丁p12880299_10205_LINUX.zip*/
--查看当前补丁情况
[oracle@rac1 OPatch]$ ./opatch lsinventory
Invoking OPatch 10.2.0.4.9

Oracle Interim Patch Installer version 10.2.0.4.9
Copyright (c) 2009, Oracle Corporation. All rights reserved.

Oracle Home : /opt/ora10g/product/database
Central Inventory : /opt/ora10g/oraInventory
from : /etc/oraInst.loc
OPatch version : 10.2.0.4.9
OUI version : 10.2.0.5.0
OUI location : /opt/ora10g/product/database/oui
Log file location : /opt/ora10g/product/database/cfgtoollogs/opatch/opatch2012-09-12_01-12-58AM.log

Patch history file: /opt/ora10g/product/database/cfgtoollogs/opatch/opatch_history.txt

Lsinventory Output file location : /opt/ora10g/product/database/cfgtoollogs/opatch/lsinv/lsinventory2012-09-12_01-12-58AM.txt

--------------------------------------------------------------------------------
Installed Top-level Products (2):

Oracle Database 10g 10.2.0.1.0
Oracle Database 10g Release 2 Patch Set 4 10.2.0.5.0a
There are 2 products installed in this Oracle Home.

There are no Interim patches installed in this Oracle Home.

Rac system comprising of multiple nodes
Local node = rac1
Remote node = rac2

--------------------------------------------------------------------------------

OPatch succeeded.

--安装补丁
[oracle@rac1 12880299]$ pwd
/tmp/12880299
[oracle@rac1 12880299]$ /opt/ora10g/product/database/OPatch/opatch apply
Invoking OPatch 10.2.0.4.9

Oracle Interim Patch Installer version 10.2.0.4.9
Copyright (c) 2009, Oracle Corporation. All rights reserved.

Oracle Home : /opt/ora10g/product/database
Central Inventory : /opt/ora10g/oraInventory
from : /etc/oraInst.loc
OPatch version : 10.2.0.4.9
OUI version : 10.2.0.5.0
OUI location : /opt/ora10g/product/database/oui
Log file location : /opt/ora10g/product/database/cfgtoollogs/opatch/opatch2012-09-12_01-15-11AM.log

Patch history file: /opt/ora10g/product/database/cfgtoollogs/opatch/opatch_history.txt

ApplySession applying interim patch '12880299' to OH '/opt/ora10g/product/database'

Running prerequisite checks...

OPatch detected the node list and the local node from the inventory. OPatch will patch the local system then propagate the patch to the remote nodes.

Backing up files and inventory (not for auto-rollback) for the Oracle Home
Backing up files affected by the patch '12880299' for restore. This might take a while...
Backing up files affected by the patch '12880299' for rollback. This might take a while...

Patching component oracle.network.listener, 10.2.0.5.0...

Patching component oracle.network.rsf, 10.2.0.5.0...
Updating archive file "/opt/ora10g/product/database/network/lib/libnlsnr10.a" with "network/lib/libnlsnr10.a/nsglsn.o"
Running make for target itnslsnr
Running make for target tnslsnr
Running make for target client_sharedlib
ApplySession adding interim patch '12880299' to inventory

Verifying the update...
Inventory check OK: Patch ID 12880299 is registered in Oracle Home inventory with proper meta-data.
Files check OK: Files from Patch ID 12880299 are present in Oracle Home.

Patching in rolling mode.

Updating nodes 'rac2'
Apply-related files are:
FP = "/opt/ora10g/product/database/.patch_storage/12880299_May_3_2012_20_16_10/rac/copy_files.txt"
DP = "/opt/ora10g/product/database/.patch_storage/12880299_May_3_2012_20_16_10/rac/copy_dirs.txt"
MP = "/opt/ora10g/product/database/.patch_storage/12880299_May_3_2012_20_16_10/rac/make_cmds.txt"
RC = "/opt/ora10g/product/database/.patch_storage/12880299_May_3_2012_20_16_10/rac/remote_cmds.txt"

Instantiating the file "/opt/ora10g/product/database/.patch_storage/12880299_May_3_2012_20_16_10/rac/copy_files.txt.instantiated" by replacing $ORACLE_HOME in "/opt/ora10g/product/database/.patch_storage/12880299_May_3_2012_20_16_10/rac/copy_files.txt" with actual path.
Propagating files to remote nodes...
Instantiating the file "/opt/ora10g/product/database/.patch_storage/12880299_May_3_2012_20_16_10/rac/copy_dirs.txt.instantiated" by replacing $ORACLE_HOME in "/opt/ora10g/product/database/.patch_storage/12880299_May_3_2012_20_16_10/rac/copy_dirs.txt" with actual path.
Propagating directories to remote nodes...
Instantiating the file "/opt/ora10g/product/database/.patch_storage/12880299_May_3_2012_20_16_10/rac/make_cmds.txt.instantiated" by replacing $ORACLE_HOME in "/opt/ora10g/product/database/.patch_storage/12880299_May_3_2012_20_16_10/rac/make_cmds.txt" with actual path.
Running command on remote node 'rac2':
cd /opt/ora10g/product/database/network/lib; /usr/bin/make -f ins_net_server.mk itnslsnr ORACLE_HOME=/opt/ora10g/product/database || echo REMOTE_MAKE_FAILED::>&2

Running command on remote node 'rac2':
cd /opt/ora10g/product/database/network/lib; /usr/bin/make -f ins_net_server.mk tnslsnr ORACLE_HOME=/opt/ora10g/product/database || echo REMOTE_MAKE_FAILED::>&2

Running command on remote node 'rac2':
cd /opt/ora10g/product/database/network/lib; /usr/bin/make -f ins_net_client.mk client_sharedlib ORACLE_HOME=/opt/ora10g/product/database || echo REMOTE_MAKE_FAILED::>&2

There were relinks on remote nodes. Remember to check the binary size and timestamp on the nodes 'rac2' .
The following make commands were invoked on remote nodes:
'cd /opt/ora10g/product/database/network/lib; /usr/bin/make -f ins_net_server.mk itnslsnr ORACLE_HOME=/opt/ora10g/product/database
cd /opt/ora10g/product/database/network/lib; /usr/bin/make -f ins_net_server.mk tnslsnr ORACLE_HOME=/opt/ora10g/product/database
cd /opt/ora10g/product/database/network/lib; /usr/bin/make -f ins_net_client.mk client_sharedlib ORACLE_HOME=/opt/ora10g/product/database
'

OPatch succeeded.

--查看安装后补丁情况
[oracle@rac1 12880299]$ /opt/ora10g/product/database/OPatch/opatch lsinventory
Invoking OPatch 10.2.0.4.9

Oracle Interim Patch Installer version 10.2.0.4.9
Copyright (c) 2009, Oracle Corporation. All rights reserved.

Oracle Home : /opt/ora10g/product/database
Central Inventory : /opt/ora10g/oraInventory
from : /etc/oraInst.loc
OPatch version : 10.2.0.4.9
OUI version : 10.2.0.5.0
OUI location : /opt/ora10g/product/database/oui
Log file location : /opt/ora10g/product/database/cfgtoollogs/opatch/opatch2012-09-12_01-16-58AM.log

Patch history file: /opt/ora10g/product/database/cfgtoollogs/opatch/opatch_history.txt

Lsinventory Output file location : /opt/ora10g/product/database/cfgtoollogs/opatch/lsinv/lsinventory2012-09-12_01-16-58AM.txt

--------------------------------------------------------------------------------
Installed Top-level Products (2):

Oracle Database 10g 10.2.0.1.0
Oracle Database 10g Release 2 Patch Set 4 10.2.0.5.0a
There are 2 products installed in this Oracle Home.

Interim patches (1) :

Patch 12880299 : applied on Wed Sep 12 01:15:39 CST 2012
Unique Patch ID: 14803344
Created on 3 May 2012, 20:16:10 hrs PST8PDT
Bugs fixed:
12880299

Rac system comprising of multiple nodes
Local node = rac1
Remote node = rac2

--------------------------------------------------------------------------------

OPatch succeeded.

/*(附)检查数据库状态*/
--启动RAC相关资源,验证结果
[root@rac1 ~]# /opt/ora10g/product/crs/bin/crsctl start crs
Attempting to start CRS stack
The CRS stack will be started shortly
[root@rac2 ~]# /opt/ora10g/product/crs/bin/crsctl start crs
Attempting to start CRS stack
The CRS stack will be started shortly

SQL> conn /as sysdba
Connected to an idle instance.
SQL> startup
ORACLE instance started.

Total System Global Area 536870912 bytes
Fixed Size 1274716 bytes
Variable Size 272632996 bytes
Database Buffers 260046848 bytes
Redo Buffers 2916352 bytes
Database mounted.
ORA-01092: ORACLE instance terminated. Disconnection forced

--告警日志如下(部分)
Wed Sep 12 10:20:11 CST 2012
Errors in file /opt/ora10g/admin/racdb/udump/racdb1_ora_12504.trc:
ORA-00704: bootstrap process failure
ORA-39700: database must be opened with UPGRADE option
Wed Sep 12 10:20:11 CST 2012
Error 704 happened during db open, shutting down database
USER: terminating instance due to error 704
Instance terminated by USER, pid = 12504
ORA-1092 signalled during: ALTER DATABASE OPEN...

--trace如下(部分)
Validate domain 0
Validated domain 0, flags = 0x0
ORA-00704: bootstrap process failure
ORA-39700: database must be opened with UPGRADE option

--执行脚本
[oracle@rac1 ~]$ sqlplus /nolog

SQL*Plus: Release 10.2.0.5.0 - Production on Wed Sep 12 10:27:35 2012

Copyright (c) 1982, 2010, Oracle. All Rights Reserved.

SQL> connect /as sysdba
Connected to an idle instance.
SQL> startup nomount
ORACLE instance started.

Total System Global Area 536870912 bytes
Fixed Size 1274716 bytes
Variable Size 272632996 bytes
Database Buffers 260046848 bytes
Redo Buffers 2916352 bytes
SQL> alter system set cluster_database=false scope=spfile;

System altered.

SQL> shutdown immediate
ORA-01507: database not mounted

ORACLE instance shut down.
SQL> startup upgrade
ORACLE instance started.

Total System Global Area 536870912 bytes
Fixed Size 1274716 bytes
Variable Size 272632996 bytes
Database Buffers 260046848 bytes
Redo Buffers 2916352 bytes
Database mounted.
Database opened.
SQL> spool /tmp/patch.log append
SQL> @?/rdbms/admin/catupgrd.sql
... ...
SQL> spool off
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.

Total System Global Area 536870912 bytes
Fixed Size 1274716 bytes
Variable Size 293604516 bytes
Database Buffers 239075328 bytes
Redo Buffers 2916352 bytes
Database mounted.
Database opened.
SQL> spool /tmp/plsql_paks.log append
SQL> @?/rdbms/admin/utlrp.sql
... ...
SQL> spool off
SQL> alter system set cluster_database=true scope=spfile;

System altered.

SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.

Total System Global Area 536870912 bytes
Fixed Size 1274716 bytes
Variable Size 293604516 bytes
Database Buffers 239075328 bytes
Redo Buffers 2916352 bytes
Database mounted.
Database opened.
SQL> !
[oracle@rac1 ~]$ crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora....SM1.asm application ONLINE ONLINE rac1
ora....C1.lsnr application ONLINE ONLINE rac1
ora.rac1.gsd application ONLINE ONLINE rac1
ora.rac1.ons application ONLINE ONLINE rac1
ora.rac1.vip application ONLINE ONLINE rac1
ora....SM2.asm application ONLINE ONLINE rac2
ora....C2.lsnr application ONLINE ONLINE rac2
ora.rac2.gsd application ONLINE ONLINE rac2
ora.rac2.ons application ONLINE ONLINE rac2
ora.rac2.vip application ONLINE ONLINE rac2
ora.racdb.db application ONLINE ONLINE rac2
ora....b1.inst application ONLINE ONLINE rac1
ora....b2.inst application OFFLINE OFFLINE
[oracle@rac1 ~]$ srvctl start instance -d racdb -i racdb2
[oracle@rac1 ~]$ crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora....SM1.asm application ONLINE ONLINE rac1
ora....C1.lsnr application ONLINE ONLINE rac1
ora.rac1.gsd application ONLINE ONLINE rac1
ora.rac1.ons application ONLINE ONLINE rac1
ora.rac1.vip application ONLINE ONLINE rac1
ora....SM2.asm application ONLINE ONLINE rac2
ora....C2.lsnr application ONLINE ONLINE rac2
ora.rac2.gsd application ONLINE ONLINE rac2
ora.rac2.ons application ONLINE ONLINE rac2
ora.rac2.vip application ONLINE ONLINE rac2
ora.racdb.db application ONLINE ONLINE rac2
ora....b1.inst application ONLINE ONLINE rac1
ora....b2.inst application ONLINE ONLINE rac2
[oracle@rac1 ~]$ sqlplus /nolog

SQL*Plus: Release 10.2.0.5.0 - Production on Wed Sep 12 14:10:23 2012

Copyright (c) 1982, 2010, Oracle. All Rights Reserved.

SQL> conn /as sysdba
Connected.
SQL> select * from gv$version where rownum

INST_ID BANNER
---------- ----------------------------------------------------------------
1 Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - Prod
1 PL/SQL Release 10.2.0.5.0 - Production
1 CORE 10.2.0.5.0 Production
1 TNS for Linux: Version 10.2.0.5.0 - Production
1 NLSRTL Version 10.2.0.5.0 - Production
2 Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - Prod
2 PL/SQL Release 10.2.0.5.0 - Production
2 CORE 10.2.0.5.0 Production
2 TNS for Linux: Version 10.2.0.5.0 - Production

SQL> select * from test;

ID NAME
---------- ----------
1 YALLONKING

标签:

给我留言

Copyright © YallonKing 保留所有权利.   Theme  Ality

用户登录

分享到: