./runInstaller -clone -waitForCompletion "ORACLE_BASE=/u01/app/oracle" "ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1" "ORACLE_HOME_NAME=OraDb11g_home1" -silent -noConfig -nowait
Starting Oracle Universal Installer...
Checking swap space: must be greater than 500 MB. Actual 7967 MB Passed
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2016-10-18_07-39-36PM. Please wait ...Oracle Universal Installer, Version 11.2.0.4.0 Production
Copyright (C) 1999, 2013, Oracle. All rights reserved.
You can find the log of this install session at:
/u01/app/oraInventory/logs/cloneActions2016-10-18_07-39-36PM.log
.................................................................................................... 100% Done.
(篇幅原因,有省略……)
The cloning of OraDb11g_home1 was successful.
Please check '/u01/app/oraInventory/logs/cloneActions2016-10-18_07-39-36PM.log' for more details.
(执行脚本略……)
启动原有数据库,此时已经是更新过的目录了。
[oracle@testlife 11.2.0]$ export ORACLE_HOME=$O_ORACLE_HOME
[oracle@testlife 11.2.0]$ env | grep ORACLE_SID
ORACLE_SID=testdb
[oracle@testlife 11.2.0]$ $ORACLE_HOME/bin/lsnrctl start LISTENER
LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 18-OCT-2016 19:44:23
The listener supports no services
The command completed successfully
[oracle@testlife 11.2.0]$ $ORACLE_HOME/bin/sqlplus / as sysdba
SQL*Plus: Release 11.2.0.4.0 Production on Tue Oct 18 19:44:45 2016
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Connected to an idle instance.
SQL> startup
ORACLE instance started.
Total System Global Area 3540881408 bytes
Fixed Size 2258320 bytes
Variable Size 855640688 bytes
Database Buffers 2667577344 bytes
Redo Buffers 15405056 bytes
Database mounted.
Database opened.
注意:此时可以完成各个升级补丁需要进行的postinstall操作,更新数据库或者重新编译数据库对象。
[oracle@testlife 11.2.0]$ cd $ORACLE_HOME/rdbms/admin
[oracle@testlife admin]$ sqlplus /nolog
SQL*Plus: Release 11.2.0.4.0 Production on Tue Oct 18 19:46:45 2016
Copyright (c) 1982, 2013, Oracle. All rights reserved.
SQL> conn / as sysdba
Connected.
SQL> @catbundle.sql psu apply
后续将新创建设置的环境变量重置,重新启动服务器。
[oracle@testlife admin]$ exit
logout
[root@testlife ~]# su - oracle
[oracle@testlife ~]$ env | grep ORA
ORACLE_SID=testdb
ORACLE_BASE=/u01/app/oracle
ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1
[oracle@testlife ~]$ sqlplus /nolog
SQL*Plus: Release 11.2.0.4.0 Production on Tue Oct 18 20:01:08 2016
Copyright (c) 1982, 2013, Oracle. All rights reserved.
SQL> conn / as sysdba
Connected.
SQL> startup force
ORACLE instance started.
Total System Global Area 3540881408 bytes
Fixed Size 2258320 bytes
Variable Size 855640688 bytes
Database Buffers 2667577344 bytes
Redo Buffers 15405056 bytes
Database mounted.
Database opened.
--升级完成
SQL> select version, comments from dba_registry_history;
VERSION COMMENTS
------------------------------ -----------------------------
11.2.0.4 Patchset 11.2.0.2.0
11.2.0.4 Patchset 11.2.0.2.0
11.2.0.4.160719OJVMPSU RAN jvmpsu.sql
11.2.0.4 PSU 11.2.0.4.160719
11.2.0.4.160719OJVMPSU OJVM PSU post-install
Patch 23177551 applied
6 rows selected
最后,运行一段时间之后,确认升级版本没有问题,就可以将原有的目录删除掉。
[oracle@testlife trace]$ cd ~
[oracle@testlife ~]$ rm -rf `echo $ORACLE_HOME`_to_be_removed
[oracle@testlife ~]$ cd $ORACLE_HOME
[oracle@testlife dbhome_1]$ cd ..
[oracle@testlife 11.2.0]$ ls -l
total 4
drwxr-xr-x 79 oracle dba 4096 Oct 18 19:39 dbhome_1
3、结论