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/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/8183550/viewspace-669394/