silent安裝oracle10g 10.2.0.5 patch

edwardking888發表於2010-07-25
根據patch包中的README.html檔案找到靜默安裝部分:
Installing the Oracle Database 10g Patch Set Noninteractively

關鍵是執行如下命令
$ ./runInstaller -silent -responseFile response_file
但安裝檔案中沒有response_file檔案的模板,經查詢,patch包中的Disk1/response/patchset.rsp為此模板

模板中修改如下選項,其它保持不變:
UNIX_GROUP_NAME=oinstall
--安裝使用者組
FROM_LOCATION=/orapatch/Disk1/stage/products.xml
--patch包的products.xml路徑
ORACLE_HOME=/u01/oracle/product/10.2.0/db_1
ORACLE_HOME_NAME=OraDb10g_home1

確認ORACLE_HOME_NAME選項稍微麻煩點,通過檢視/etc/oraInst.loc中inventory_loc值的指向的/ContentsXML/inventory.xml
我的是/u01/app/oracle/oraInventory/ContentsXML/inventory.xml
# less /u01/app/oracle/oraInventory/ContentsXML/inventory.xml
找到
此處的OraDb10g_home1就是上面ORACLE_HOME_NAME選項的值。

下面就開始靜默安裝(經修改的patchset.rsp檔案放在/orapatch/Disk1下):
注意:此安裝需要oracle使用者

--設定My Oracle Support username

MYORACLESUPPORT_USERNAME="ssss@hotmail.com"

MYORACLESUPPORT_PASSWORD="xxxx"

$ cd /orapatch/Disk1
$ ./runInstaller -silent -responseFile patchset.rsp
此處patchset.rsp不寫絕對路徑會出如下錯誤
OUI-10203:The specified response file 'patchset.rsp' is not found. Make sure that the response file specified exists and you have read privileges to this file.

patchset.rsp寫了絕對路徑後,安裝正常進行,速度很快,比圖形介面快多了。

$ ./runInstaller -silent -responseFile /orapatch/Disk1/patchset.rsp
Starting Oracle Universal Installer...

Checking installer requirements...

 

 # /u01/oracle/product/10.2/root.sh

Running Oracle 10g root.sh script...


The following environment variables are set as:

    ORACLE_OWNER= oracle

    ORACLE_HOME=  /u01/oracle/product/10.2


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]: 

The file "oraenv" already exists in /usr/local/bin.  Overwrite it? (y/n) 

[n]: 

The file "coraenv" already exists in /usr/local/bin.  Overwrite it? (y/n) 

[n]: 


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.

--啟動監聽
[oracle@tdata Disk1]$ lsnrctl start

--升級資料庫
-dbname: 要升級的資料庫的db_name
-oracleHome: 要升級的資料庫的ORACLE_HOME
-sysDBAUserName: 要升級資料庫的擁有sysdba許可權的使用者名稱,一般寫sys
-sysDBAPassword: sysDBAUserName對應的密碼
-recompile_invalid_objects: 升級完成後是否編譯無效物件,true為編譯、false為不編譯
[oracle@tdata Disk1]$ dbua -silent -dbname XXX -oracleHome /opt/oracle/product/10.2 -sysDBAUserName sys -sysDBAPassword XXX -recompile_invalid_objects true

Log files for the upgrade operation are located at: /u01/oracle/product/10.2/cfgtoollogs/dbua/fostTW/upgrade0
Performing Pre Upgrade
1% complete
7% complete
Upgrading Oracle Server
7% complete
8% complete
9% complete
10% complete
10% complete
11% complete
12% complete
12% complete
13% complete
14% complete
15% complete
15% complete
16% complete
17% complete
17% complete
18% complete
19% complete
20% complete
20% complete
21% complete
Upgrading JServer JAVA Virtual Machine
22% complete
23% complete
24% complete
Upgrading Oracle XDK for Java
25% complete
Upgrading Oracle Java Packages
27% complete
Upgrading Oracle Text
28% complete
29% complete
30% complete
Upgrading Oracle XML Database
31% complete
Upgrading Oracle Workspace Manager
32% complete
33% complete
34% complete
35% complete
35% complete
Upgrading Oracle Data Mining
37% complete
Upgrading OLAP Analytic Workspace
38% complete
Upgrading OLAP Catalog
40% complete
Upgrading Oracle OLAP API
41% complete
Upgrading Oracle interMedia
42% complete
43% complete
44% complete
45% complete
45% complete
46% complete
47% complete
47% complete
48% complete
Upgrading Spatial
50% complete
50% complete
Upgrading Expression Filter
52% complete
Upgrading EM Repository
53% complete
54% complete
55% complete
55% complete
56% complete
57% complete
57% complete
58% complete
59% complete
60% complete
60% complete
61% complete
62% complete
62% complete
63% complete
64% complete
65% complete
Upgrading Rule Manager
66% complete
Performing Post Upgrade
67% complete
78% complete
79% complete
80% complete
80% complete
85% complete
Configuring Database with Enterprise Manager
92% complete
Generating Summary
100% complete
Check the log file "/u01/oracle/product/10.2/cfgtoollogs/dbua/logs/silent.log" for upgrade details.

 [oracle@oracle ~]$ sqlplus / as sysdba

SQL> STARTUP UPGRADE

 執行兩個指令碼就OK了:

SQL> @?/rdbms/admin/utlu102i.sql
SQL> @?/rdbms/admin/catupgrd.sql


[oracle@oracle ~]$ sqlplus / as sysdba

SQL*Plus: Release 10.2.0.5.0 - Production on Sun Jul 25 22:18:58 2010

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


Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> select status from v$instance;

STATUS
------------
OPEN


 

 

 

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/8183550/viewspace-669394/,如需轉載,請註明出處,否則將追究法律責任。

相關文章