靜默方式安裝、升級oracle(三): 升級資料庫軟體及資料庫

space6212發表於2019-06-22

本文簡單闡述在Linux AS 4中如何不用啟動介面的情況下安裝oracle 10g軟體、建立資料庫以及升級資料庫,這就是oracle的靜默安裝。


三、升級資料庫
1、升級資料庫軟體
1)把下載的補丁集解壓,修改/oradata/soft/Disk1/response/patchset.rsp
把如下值修改為你實際的值:
UNIX_GROUP_NAME="oinstall"
FROM_LOCATION="/oradata/soft/Disk1/stage/products.xml"
ORACLE_HOME="/opt/oracle/product/10.2"
RESTART_SYSTEM=false
OUI_HOSTNAME="tdata"
RESTART_SYSTEM=false
CLUSTER_NODES={}
REMOVE_HOMES={}

2)關閉資料庫和監聽
[oracle@tdata Disk1]$ sqlplus "/as sysdba"

SQL*Plus: Release 10.2.0.1.0 - Production on 星期一 10月 22 16:08:29 2007

Copyright (c) 1982, 2005, Oracle. All rights reserved.


Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning and Data Mining options

SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning and Data Mining options
[oracle@tdata Disk1]$ lsnrctl stop

LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 22-10月-2007 16:08:48

Copyright (c) 1991, 2005, Oracle. All rights reserved.

Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
TNS-12541: TNS:no listener
TNS-12560: TNS:protocol adapter error
TNS-00511: No listener
Linux Error: 111: Connection refused

3)升級軟體
[oracle@tdata Disk1]$ ./runInstaller -silent -responseFile /oradata/soft/Disk1/response/patchset.rsp
Starting Oracle Universal Installer...

Checking installer requirements...

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


All installer requirements met.

Preparing to launch Oracle Universal Installer from /tmp/OraInstall2007-10-22_04-08-52PM. Please wait ...[oracle@tdata Disk1]$ Oracle Universal Installer, Version 10.2.0.3.0 Production
Copyright (C) 1999, 2006, Oracle. All rights reserved.

You can find a log of this install session at:
/oradata/oraInventory/logs/installActions2007-10-22_04-08-52PM.log
.................................................................................................... 100% Done.


Loading Product Information
..................................................................................................................... 100% Done.


Analyzing dependencies
.................................................................................................... 100% Done.


-----------------------------------------------------------------------------
Summary
Global Settings
Source: /oradata/soft/Disk1/stage/products.xml
Oracle Home: /opt/oracle/product/10.2 (OraDb10g_home1)
Product Languages
English
Space Requirements
/oradata/ Required 122KB : Available 444.85GB
/opt/ Required 800MB : Available 17.07GB
/ Required 33MB (only as temporary space) : Available 10.58GB
New Installations (62 products)
Oracle Notification Service Patch 10.2.0.3.0
Database Configuration and Upgrade Assistants Patch 10.2.0.3.0
Character Set Migration Utility Patch 10.2.0.3.0
Oracle Database 10g Patch 10.2.0.3.0
Oracle JDBC/OCI Instant Client Patch 10.2.0.3.0
Oracle Database 10g Patch 10.2.0.3.0
SQL*Plus 10.2.0.3.0
HAS Common Files Patch 10.2.0.3.0
HAS Files for DB Patch 10.2.0.3.0
Oracle Java Client Patch 10.2.0.3.0
Oracle JVM Patch 10.2.0.3.0
Oracle Internet Directory Client Patch 10.2.0.3.0
Oracle Net Patch 10.2.0.3.0
Oracle Net Listener Patch 10.2.0.3.0
Oracle Wallet Manager Patch 10.2.0.3.0
Precompiler Common Files Patch 10.2.0.3.0
Secure Socket Layer Patch 10.2.0.3.0
OLAP SQL Scripts Patch 10.2.0.3.0
Oracle interMedia Client Option Patch 10.2.0.3.0
Oracle Database 10g interMedia Files Patch 10.2.0.3.0
Oracle interMedia Patch 10.2.0.3.0
PL/SQL Embedded Gateway Patch 10.2.0.3.0
Oracle XML Development Kit Patch 10.2.0.3.0
Oracle Text Patch 10.2.0.3.0
Oracle Clusterware RDBMS Files Patch 10.2.0.3.0
Database SQL Scripts Patch 10.2.0.3.0
Oracle Data Mining RDBMS Files Patch 10.2.0.3.0
Generic Connectivity Common Files Patch 10.2.0.3.0
Installation Common Files Patch 10.2.0.3.0
Oracle Starter Database Patch 10.2.0.3.0
Sample Schema Data Patch 10.2.0.3.0
Oracle interMedia Locator RDBMS Files Patch 10.2.0.3.0
Oracle Call Interface (OCI) Patch 10.2.0.3.0
Oracle Partitioning Patch 10.2.0.3.0
PL/SQL 10.2.0.3.0
Oracle Recovery Manager Patch 10.2.0.3.0
Oracle Database Utilities Patch 10.2.0.3.0
Oracle interMedia Locator Patch 10.2.0.3.0
XML Parser for Java Patch 10.2.0.3.0
Assistant Common Files Patch 10.2.0.3.0
Oracle JDBC Thin Driver for JDK 1.2 Patch 10.2.0.3.0
Oracle JDBC Thin Driver for JDK 1.4 Patch 10.2.0.3.0
Oracle interMedia Java Advanced Imaging Patch 10.2.0.3.0
SQLJ Runtime Patch 10.2.0.3.0
XML Parser for Oracle JVM Patch 10.2.0.3.0
Enterprise Manager Baseline 10.2.0.3.0
XDK Required Support Files Patch 10.2.0.3.0
Agent Required Support Files Patch 10.2.0.3.0
DBJAVA Required Support Files Patch 10.2.0.3.0
LDAP Required Support Files Patch 10.2.0.3.0
Precompiler Required Support Files Patch 10.2.0.3.0
Oracle RAC Required Support Files-HAS Patch 10.2.0.3.0
RDBMS Required Support Files for Instant Client Patch 10.2.0.3.0
RDBMS Required Support Files Patch 10.2.0.3.0
SQL*Plus Required Support Files Patch 10.2.0.3.0
SSL Required Support Files for InstantClient Patch 10.2.0.3.0
Oracle Net Required Support Files Patch 10.2.0.3.0
Oracle Globalization Support Patch 10.2.0.3.0
Oracle Core Required Support Files Patch 10.2.0.3.0
Platform Required Support Files 10.2.0.3.0
Oracle Message Gateway Common Files Patch 10.2.0.3.0
Oracle Containers for Java 10.2.0.3.0
Upgrades (3 products)
Oracle Universal Installer 10.2.0.3.0
Oracle One-Off Patch Installer 10.2.0.3.0
Installer SDK Component 10.2.0.3.0
Already Installed (64 products)
Oracle Notification Service 10.1.0.3.0
Database Configuration and Upgrade Assistants 10.2.0.1.0
Character Set Migration Utility 10.2.0.1.0
Oracle Database 10g 10.2.0.1.0
Oracle JDBC/OCI Instant Client 10.2.0.1.0
Oracle Database 10g 10.2.0.1.0
SQL*Plus 10.2.0.1.0
HAS Common Files 10.2.0.1.0
HAS Files for DB 10.2.0.1.0
Oracle Java Client 10.2.0.1.0
Oracle JVM 10.2.0.1.0
Oracle Internet Directory Client 10.2.0.1.0
Oracle Net 10.2.0.1.0
Oracle Net Listener 10.2.0.1.0
Oracle Wallet Manager 10.2.0.1.0
Precompiler Common Files 10.2.0.1.0
Secure Socket Layer 10.2.0.1.0
OLAP SQL Scripts 10.2.0.1.0
Oracle interMedia Client Option 10.2.0.1.0
Oracle Database 10g interMedia Files 10.2.0.1.0
Oracle interMedia 10.2.0.1.0
PL/SQL Embedded Gateway 10.2.0.1.0
Oracle XML Development Kit 10.2.0.1.0
Oracle Text 10.2.0.1.0
Oracle Clusterware RDBMS Files 10.2.0.1.0
Database SQL Scripts 10.2.0.1.0
Oracle Data Mining RDBMS Files 10.2.0.1.0
Generic Connectivity Common Files 10.2.0.1.0
Installation Common Files 10.2.0.1.0
Oracle Starter Database 10.2.0.1.0
Sample Schema Data 10.2.0.1.0
Oracle interMedia Locator RDBMS Files 10.2.0.1.0
Oracle Call Interface (OCI) 10.2.0.1.0
Oracle Partitioning 10.2.0.1.0
PL/SQL 10.2.0.1.0
Oracle Recovery Manager 10.2.0.1.0
Oracle Database Utilities 10.2.0.1.0
Oracle interMedia Locator 10.2.0.1.0
XML Parser for Java 10.2.0.1.0
Assistant Common Files 10.2.0.1.0
Oracle JDBC Thin Driver for JDK 1.2 10.2.0.1.0
Oracle JDBC Thin Driver for JDK 1.4 10.2.0.1.0
Oracle interMedia Java Advanced Imaging 10.2.0.1.0
SQLJ Runtime 10.2.0.1.0
XML Parser for Oracle JVM 10.2.0.1.0
Enterprise Manager Baseline 10.2.0.1.0
XDK Required Support Files 10.2.0.1.0
Agent Required Support Files 10.2.0.1.0
DBJAVA Required Support Files 10.2.0.1.0
LDAP Required Support Files 10.2.0.1.0
Precompiler Required Support Files 10.2.0.1.0
Oracle RAC Required Support Files-HAS 10.2.0.1.0
RDBMS Required Support Files for Instant Client 10.2.0.1.0
RDBMS Required Support Files 10.2.0.1.0
SQL*Plus Required Support Files 10.2.0.1.0
SSL Required Support Files for InstantClient 10.2.0.1.0
Oracle Net Required Support Files 10.2.0.1.0
Oracle Globalization Support 10.2.0.1.0
Oracle Core Required Support Files 10.2.0.1.0
Platform Required Support Files 10.2.0.1.0
Oracle Message Gateway Common Files 10.2.0.1.0
Oracle Containers for Java 10.2.0.1.0
Java Runtime Environment 1.4.2.8.0
Sun JDK 1.4.2.0.8
-----------------------------------------------------------------------------


Deinstall in progress (Mon Oct 22 16:09:04 CST 2007)
............................................................... 0% Done.
............................................................... 28% Done.
............................................................... 57% Done.
................................ 100% Done.

Deinstall successful

Installation in progress (Mon Oct 22 16:09:04 CST 2007)
............................................................... 28% Done.
............................................................... 57% Done.
.............................................. 77% Done.
Install successful

Linking in progress (Mon Oct 22 16:09:56 CST 2007)
. 78% Done.
Link successful

Setup in progress (Mon Oct 22 16:10:33 CST 2007)
.... 100% Done.
Setup successful

End of install phases.(Mon Oct 22 16:10:34 CST 2007)
WARNING:
The following configuration scripts need to be executed as the "root" user.
#!/bin/sh
#Root script to run
/opt/oracle/product/10.2/root.sh
To execute the configuration scripts:
1. Open a terminal window
2. Log in as "root"
3. Run the scripts

The installation of Oracle Database 10g Release 2 Patch Set 2 was successful.
Please check '/oradata/oraInventory/logs/silentInstall2007-10-22_04-08-52PM.log' for more details.

以root執行/opt/oracle/product/10.2/root.sh

4)升級資料庫
升級資料庫必須先把資料庫以upgrade模式開啟:
[oracle@tdata Disk1]$ sqlplus "/as sysdba"

SQL*Plus: Release 10.2.0.3.0 - Production on 星期一 10月 22 16:15:21 2007

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

Connected to an idle instance.

SQL> startup upgrade
ORACLE instance started.

Total System Global Area 1258291200 bytes
Fixed Size 1261540 bytes
Variable Size 318767132 bytes
Database Buffers 922746880 bytes
Redo Buffers 15515648 bytes
Database mounted.
Database opened.
SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - Production
With the Partitioning and Data Mining options

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

LSNRCTL for Linux: Version 10.2.0.3.0 - Production on 22-10月-2007 16:16:03

Copyright (c) 1991, 2006, Oracle. All rights reserved.

Starting /opt/oracle/product/10.2/bin/tnslsnr: please wait...

TNSLSNR for Linux: Version 10.2.0.3.0 - Production
Log messages written to /opt/oracle/product/10.2/network/log/listener.log
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=tdata)(PORT=1521)))

Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 10.2.0.3.0 - Production
Start Date 22-10月-2007 16:16:03
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Log File /opt/oracle/product/10.2/network/log/listener.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=tdata)(PORT=1521)))
The listener supports no services
The command completed successfully

--升級資料庫
-dbname: 要升級的資料庫的db_name
-oracleHome: 要升級的資料庫的ORACLE_HOME
-sysDBAUserName: 要升級資料庫的擁有sysdba許可權的使用者名稱,一般寫sys
-sysDBAPassword: sysDBAUserName對應的密碼
-recompile_invalid_objects: 升級完成後是否編譯無效物件,true為編譯、false為不編譯
[oracle@tdata Disk1]$ dbua -silent -dbname testzj -oracleHome /opt/oracle/product/10.2 -sysDBAUserName sys -sysDBAPassword testzjsys -recompile_invalid_objects true
Log files for the upgrade operation are located at: /opt/oracle/product/10.2/cfgtoollogs/dbua/testzj/upgrade
Performing Pre Upgrade
1% complete
7% complete
Upgrading Oracle Server
9% complete
10% complete
12% complete
13% complete
15% complete
16% complete
18% complete
20% complete
21% complete
23% complete
24% complete
26% complete
27% complete
29% complete
30% complete
32% complete
33% complete
35% complete
Upgrading Oracle Workspace Manager
36% complete
84% complete
85% complete
86% complete
86% complete
92% complete
Performing Post Upgrade
Database upgrade has been completed successfully, and the database is ready to use.
Generating Summary
100% complete
Check the log file "/opt/oracle/product/10.2/cfgtoollogs/dbua/logs/silent0.log" for upgrade details.

資料庫升級完畢。
至此,靜默方式下安裝oracle 10g軟體、建立資料庫以及升級資料庫的所有步驟就完成了。

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

相關文章