Linux下Oracle 10.2.0.1升级到10.2.0.4总结
2014-03-12 17:26
671 查看
最近部署测试环境时,将测试环境ORACLE数据库从10.2.0.1升级到了10.2.0.4,顺便整理记录一下升级过程。
实验环境: 操作系统:Oracle Linux Server release 5.7 数据库:Oracle 10.2.0.1
下载解压补丁包
[/code]
解压后生成Disk1目录,里面patch_note.htm 有详细的升级补丁的介绍,建议升级补丁前,应该好好看看patch_note.htm,里面介绍了Oracle Database、Oracle Real Application Clusters、Oracle Database Client、Oracle Database Vault等各类情况升级。
安装前任务
1:操作系统要求
如下所示,官方文档有system requirements,即必须满足操作系统要求才能打补丁,一般情况下很少有不满足条件。
System Requirements
The following are the system requirements for this patch set:
Operating System
Asianux 2.0
Asianux 3.0
Oracle Enterprise Linux 4.0/Oracle VM
Oracle Enterprise Linux 5.0/Oracle VM
Red Hat Enterprise Linux AS/ES 3.0
Red Hat Enterprise Linux AS/ES 4.0/Oracle VM
Red Hat Enterprise Linux AS/ES 5.0/Oracle VM
SUSE Linux Enterprise Server (SLES) 9
SUSE Linux Enterprise Server (SLES) 10
Oracle Database 10g (10.2.0.1) or later
2:检查设置环境变量
[/code]
3:查看安装补丁情况
[/code]
4:检查Oracle Time Zone Definitions
5:停止所有进程(Stop All Processes)
$ emctl stop dbconsole
$ isqlplusctl stop
$ lsnrctl stop
SQL> SHUTDOWN IMMEDIATE
[/code]
备份数据库
因为是测试数据库,可以做备份或不做备份关系不大,生产环境则必须先做一个冷备或热备。
安装补丁包
Oracle提供了两种方式安装补丁包,即图形化安装或静默安装。即Installing the Oracle Database 10g Patch Set Interactively 和
Installing the Oracle Database 10g Patch Set Noninteractively 安装。
下面我们先用Installing the Oracle Database 10g Patch Set Interactively
Installing the Oracle Database 10g Patch Set Interactively
1.Log in as the oracle user.
2.If you are not installing the software on the local computer, then run the following command on remote machine:
Bourne, Bash, or Korn shell:
$ export DISPLAY=localhost:0.0
C shell:
% setenv DISPLAY local_host:0.0
In this example, local_host is the host name or IP address of the computer that you want to use to display Oracle Universal Installer.
Now to enable X applications, run the following command on the machine that you want to use to display Oracle Universal Installer:
$ xhost + [fully_qualified_remote_host_name]
注意上面事项,否则有可能出现下面错误信息。
[/code]
[oracle@DB-Server Disk1]$./runInstaller
在root账号下执行/u01/app/oracle/product/dbhome_1/root.sh
安装后任务
升级数据库
可以使用手工升级数据库或使用DBUA界面安装数据库。下面我们选择使用手工升级数据库
1:Start the database in the UPGRADE mode
[/code]
2.Set the system to spool results to a log file for later analysis:
SQL> SPOOL upgrade_info.log
3.Run the Pre-Upgrade Information Tool:
[/code]
查看已经安装的补丁情况:
[/code]
关闭数据库,然后执行脚本:
SQL> STARTUP UPGRADE
SQL> SPOOL patch.log
SQL> @?/rdbms/admin/catupgrd.sql
SQL> SPOOL OFF
@?/rdbms/admin/catupgrd.sql
[/code]
验证
[/code]
如果你需要升级emca,那么可以通过emca –upgrade db命令实现。如下所示
[/code]
实验环境: 操作系统:Oracle Linux Server release 5.7 数据库:Oracle 10.2.0.1
下载解压补丁包
[code] [oracle@DB-Server tmp]$ unzip p6810189_10204_Linux-x86-64.zip
[oracle@DB-Server Disk1]$ ls
10204_buglist.htm install patch_note.htm response runInstaller stage
[/code]
解压后生成Disk1目录,里面patch_note.htm 有详细的升级补丁的介绍,建议升级补丁前,应该好好看看patch_note.htm,里面介绍了Oracle Database、Oracle Real Application Clusters、Oracle Database Client、Oracle Database Vault等各类情况升级。
安装前任务
1:操作系统要求
如下所示,官方文档有system requirements,即必须满足操作系统要求才能打补丁,一般情况下很少有不满足条件。
System Requirements
The following are the system requirements for this patch set:
Operating System
Asianux 2.0
Asianux 3.0
Oracle Enterprise Linux 4.0/Oracle VM
Oracle Enterprise Linux 5.0/Oracle VM
Red Hat Enterprise Linux AS/ES 3.0
Red Hat Enterprise Linux AS/ES 4.0/Oracle VM
Red Hat Enterprise Linux AS/ES 5.0/Oracle VM
SUSE Linux Enterprise Server (SLES) 9
SUSE Linux Enterprise Server (SLES) 10
Oracle Database 10g (10.2.0.1) or later
2:检查设置环境变量
[code][oracle@DB-Server ~]$echo $ORACLE_HOME
/u01/app/oracle/product/dbhome_1
[oracle@DB-Server ~]$ echo $ORACLE_SID
epps
[oracle@DB-Server ~]$
[/code]
3:查看安装补丁情况
[code] [oracle@DB-Server OPatch]$./opatch
Invoking OPatch 10.2.0.1.0
Oracle interim Patch Installer version 10.2.0.1.0
Copyright (c) 2005, Oracle Corporation. All rights reserved..
Oracle Home :/u01/app/oracle/product/dbhome_1
Central Inventory : /u01/app/oracle/oraInventory
from :/u01/app/oracle/product/dbhome_1/oraInst.loc
OPatch version : 10.2.0.1.0
OUI version : 10.2.0.1.0
OUI location :/u01/app/oracle/product/dbhome_1/oui
Log file location :/u01/app/oracle/product/dbhome_1/cfgtoollogs/opatch/opatch-2014_Mar_11_15-22-45-CST_Tue.log
Usage: opatch [ -help ] [ -r[eport] ] [ command ]
command := apply
lsinventory
query
rollback
version
<global_arguments> := -help Displays the help message for the command.
-report Print the actions without executing (deprecated).
example:
'opatch -help'
'opatch apply -help'
'opatch lsinventory -help'
'opatch rollback -help'
OPatch succeeded.
[oracle@DB-Server OPatch]$./opatch lsinventory -all
Invoking OPatch 10.2.0.1.0
Oracle interim Patch Installer version 10.2.0.1.0
Copyright (c) 2005, Oracle Corporation. All rights reserved..
Oracle Home :/u01/app/oracle/product/dbhome_1
Central Inventory : /u01/app/oracle/oraInventory
from :/u01/app/oracle/product/dbhome_1/oraInst.loc
OPatch version : 10.2.0.1.0
OUI version : 10.2.0.1.0
OUI location :/u01/app/oracle/product/dbhome_1/oui
Log file location :/u01/app/oracle/product/dbhome_1/cfgtoollogs/opatch/opatch-2014_Mar_11_15-23-02-CST_Tue.log
Lsinventory Output file location :/u01/app/oracle/product/dbhome_1/cfgtoollogs/opatch/lsinv/lsinventory-2014_Mar_11_15-23-02-CST_Tue.txt
--------------------------------------------------------------------------------
List of Oracle Homes:
Name Location
OraDb10g_home1 /u01/app/oracle/product/dbhome_1
Installed Top-level Products (1):
Oracle Database 10g 10.2.0.1.0
There are 1 products installed in this Oracle Home.
There are no Interim patches installed in this Oracle Home.
--------------------------------------------------------------------------------
OPatch succeeded.
[/code]
4:检查Oracle Time Zone Definitions
5:停止所有进程(Stop All Processes)
$ emctl stop dbconsole
$ isqlplusctl stop
$ lsnrctl stop
SQL> SHUTDOWN IMMEDIATE
[code][oracle@DB-Server ~]$emctl stop dbconsole
TZ set to Asia/Chungking
OC4J Configuration issue./u01/app/oracle/product/dbhome_1/oc4j/j2ee/OC4J_DBConsole_DB-Server.localdomain_epps not found.
[oracle@DB-Server ~]$isqlplusctl stop
iSQL*Plus 10.2.0.1.0
Copyright (c) 2003, 2005, Oracle. All rights reserved.
getnameinfo failed
getnameinfo failed
iSQL*Plus instance on port 5560 is not running...
[oracle@DB-Server ~]$lsnrctl stop
LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 11-MAR-2014 15:33:20
Copyright (c) 1991, 2005, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.10.11)(PORT=1521)))
The command completed successfully
[oracle@DB-Server ~]$sqlplus / as sysdba
SQL*Plus: Release 10.2.0.1.0 - Production on Tue Mar 11 15:34:02 2014
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
[/code]
备份数据库
因为是测试数据库,可以做备份或不做备份关系不大,生产环境则必须先做一个冷备或热备。
安装补丁包
Oracle提供了两种方式安装补丁包,即图形化安装或静默安装。即Installing the Oracle Database 10g Patch Set Interactively 和
Installing the Oracle Database 10g Patch Set Noninteractively 安装。
下面我们先用Installing the Oracle Database 10g Patch Set Interactively
Installing the Oracle Database 10g Patch Set Interactively
1.Log in as the oracle user.
2.If you are not installing the software on the local computer, then run the following command on remote machine:
Bourne, Bash, or Korn shell:
$ export DISPLAY=localhost:0.0
C shell:
% setenv DISPLAY local_host:0.0
In this example, local_host is the host name or IP address of the computer that you want to use to display Oracle Universal Installer.
Now to enable X applications, run the following command on the machine that you want to use to display Oracle Universal Installer:
$ xhost + [fully_qualified_remote_host_name]
注意上面事项,否则有可能出现下面错误信息。
[code] [oracle@DB-Server 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, UnitedLinux-1.0, asian
ux-1, asianux-2 or asianux-3
Passed
All installer requirements met.
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2014-03-11_03-39-25PM. Please wait...[oracle
@DB-Server Disk1]$ Oracle Universal Installer, Version 10.2.0.4.0 Production
Copyright (C) 1999, 2008, Oracle. All rights reserved.
Xlib: connection to ":0.0" refused by server
Xlib: No protocol specified
Can't connect to X11 window server using ':0.0' as the value of the DISPLAY variable.
:0.0
:0.0
OUI-10025:Unable to start an interactive install session because of the following error:Can't connect to X11 win
dow server using ':0.0' as the value of the DISPLAY variable. The DISPLAY environment variable should be set to
<hostname or IP address>:<screen>, where the <screen> is usually '0.0'.
OUI-10026:Depending on the Unix Shell, you can use one of the following commands as examples to set the DISPLAY
environment variable:
- For csh: % setenv DISPLAY 192.168.1.128:0.0
- For sh, ksh and bash: $ DISPLAY=192.168.1.128:0.0; export DISPLAY
Use the following command to see what shell is being used:
echo $SHELL
Use the following command to view the current DISPLAY environment variable setting:
echo $DISPLAY
- Make sure that client users are authorized to connect to the X Server.
OUI-10027:To enable client users to access the X Server, open an xterm, dtterm or xconsole as the user that star
ted the session and type the following command:
% xhost +
To test that the DISPLAY environment variable is set correctly, run a X11 based program that comes with the nati
ve operating system such as 'xclock':
% <full path to xclock... see below>
If you are not able to run xclock successfully, please refer to your PC-X Server or OS vendor for further assistance.
Typical path for 'xclock': '/usr/X11R6/bin/xclock'
[oracle@DB-Server ~]$
[/code]
[oracle@DB-Server Disk1]$./runInstaller
在root账号下执行/u01/app/oracle/product/dbhome_1/root.sh
安装后任务
升级数据库
可以使用手工升级数据库或使用DBUA界面安装数据库。下面我们选择使用手工升级数据库
1:Start the database in the UPGRADE mode
[code][oracle@DB-Server ~]$sqlplus / as sysdba
SQL*Plus: Release 10.2.0.4.0 - Production on Tue Mar 11 16:27:30 2014
Copyright (c) 1982, 2007, Oracle. All Rights Reserved.
Connected to an idle instance.
SQL> startup upgrade
ORACLE instance started.
Total System Global Area 2483027968 bytes
Fixed Size 2085968 bytes
Variable Size 603982768 bytes
Database Buffers 1862270976 bytes
Redo Buffers 14688256 bytes
Database mounted.
Database opened.
[/code]
2.Set the system to spool results to a log file for later analysis:
SQL> SPOOL upgrade_info.log
3.Run the Pre-Upgrade Information Tool:
[code] SQL> @?/rdbms/admin/utlu102i.sql
Oracle Database 10.2 Upgrade Information Utility 03-11-2014 16:30:19
.
**********************************************************************
Database:
**********************************************************************
--> name: EPPS
--> version: 10.2.0.1.0
--> compatible: 10.2.0.1.0
--> blocksize: 8192
.
**********************************************************************
Tablespaces: [make adjustments in the current environment]
**********************************************************************
--> SYSTEM tablespace is adequate for the upgrade.
.... minimum required size: 544 MB
.... AUTOEXTEND additional space required: 4 MB
--> UNDOTBS1 tablespace is adequate for the upgrade.
.... minimum required size: 400 MB
.... AUTOEXTEND additional space required: 270 MB
--> SYSAUX tablespace is adequate for the upgrade.
.... minimum required size: 410 MB
--> TEMP tablespace is adequate for the upgrade.
.... minimum required size: 58 MB
--> EXAMPLE tablespace is adequate for the upgrade.
.... minimum required size: 69 MB
.
**********************************************************************
Update Parameters: [Update Oracle Database 10.2 init.ora or spfile]
**********************************************************************
-- No update parameter changes are required.
.
**********************************************************************
Renamed Parameters: [Update Oracle Database 10.2 init.ora or spfile]
**********************************************************************
-- No renamed parameters found. No changes are required.
.
**********************************************************************
Obsolete/Deprecated Parameters: [Update Oracle Database 10.2 init.ora or spfile]
**********************************************************************
-- No obsolete parameters found. No changes are required
.
**********************************************************************
Components: [The following database components will be upgraded or installed]
**********************************************************************
--> Oracle Catalog Views [upgrade] VALID
--> Oracle Packages and Types [upgrade] VALID
--> JServer JAVA Virtual Machine [upgrade] VALID
--> Oracle XDK for Java [upgrade] VALID
--> Oracle Java Packages [upgrade] VALID
--> Oracle Text [upgrade] VALID
--> Oracle XML Database [upgrade] VALID
--> Oracle Workspace Manager [upgrade] VALID
--> Oracle Data Mining [upgrade] VALID
--> OLAP Analytic Workspace [upgrade] VALID
--> OLAP Catalog [upgrade] VALID
--> Oracle OLAP API [upgrade] VALID
--> Oracle interMedia [upgrade] VALID
--> Spatial [upgrade] VALID
--> Expression Filter [upgrade] VALID
--> EM Repository [upgrade] VALID
--> Rule Manager [upgrade] VALID
.
**********************************************************************
Miscellaneous Warnings
**********************************************************************
PL/SQL procedure successfully completed.
[/code]
查看已经安装的补丁情况:
[code] [oracle@DB-Server OPatch]$./opatchlsinventory -all
Invoking OPatch 10.2.0.4.2
Oracle Interim Patch Installer version 10.2.0.4.2
Copyright (c) 2007, Oracle Corporation. All rights reserved.
Oracle Home :/u01/app/oracle/product/dbhome_1
Central Inventory : /u01/app/oracle/oraInventory
from : /etc/oraInst.loc
OPatch version : 10.2.0.4.2
OUI version : 10.2.0.4.0
OUI location :/u01/app/oracle/product/dbhome_1/oui
Log file location :/u01/app/oracle/product/dbhome_1/cfgtoollogs/opatch/opatch2014-03-11_16-55-25PM.log
Lsinventory Output file location :/u01/app/oracle/product/dbhome_1/cfgtoollogs/opatch/lsinv/lsinventory2014-03-11_16-55-25PM.txt
--------------------------------------------------------------------------------
List of Oracle Homes:
Name Location
OraDb10g_home1 /u01/app/oracle/product/dbhome_1
Installed Top-level Products (2):
Oracle Database 10g 10.2.0.1.0
Oracle Database 10g Release 2 Patch Set 3 10.2.0.4.0
There are 2 products installed in this Oracle Home.
There are no Interim patches installed in this Oracle Home.
--------------------------------------------------------------------------------
OPatch succeeded.
[/code]
关闭数据库,然后执行脚本:
SQL> STARTUP UPGRADE
SQL> SPOOL patch.log
SQL> @?/rdbms/admin/catupgrd.sql
SQL> SPOOL OFF
@?/rdbms/admin/catupgrd.sql
[code]SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.
Total System Global Area 2483027968 bytes
Fixed Size 2085968 bytes
Variable Size 637537200 bytes
Database Buffers 1828716544 bytes
Redo Buffers 14688256 bytes
Database mounted.
Database opened.
SQL> @?/rdbms/admin/utlrp.sql
[/code]
验证
[code] SQL> COL COMP_NAME FOR A50
SQL> COL VERSION FOR A12
SQL> COL STATUS FOR A12
SQL> SELECT COMP_NAME, VERSION, STATUS FROM SYS.DBA_REGISTRY;
COMP_NAME VERSION STATUS
-------------------------------------------------- ------------ ------------
Oracle Database Catalog Views 10.2.0.4.0 VALID
Oracle Database Packages and Types 10.2.0.4.0 VALID
Oracle Workspace Manager 10.2.0.4.3 VALID
JServer JAVA Virtual Machine 10.2.0.4.0 VALID
Oracle XDK 10.2.0.4.0 VALID
Oracle Database Java Packages 10.2.0.4.0 VALID
Oracle Expression Filter 10.2.0.4.0 VALID
Oracle Data Mining 10.2.0.4.0 VALID
Oracle Text 10.2.0.4.0 VALID
Oracle XML Database 10.2.0.4.0 VALID
Oracle Rule Manager 10.2.0.4.0 VALID
COMP_NAME VERSION STATUS
-------------------------------------------------- ------------ ------------
Oracle interMedia 10.2.0.4.0 VALID
OLAP Analytic Workspace 10.2.0.4.0 VALID
Oracle OLAP API 10.2.0.4.0 VALID
OLAP Catalog 10.2.0.4.0 VALID
Spatial 10.2.0.4.0 VALID
Oracle Enterprise Manager 10.2.0.4.0 VALID
17 rows selected.
[/code]
如果你需要升级emca,那么可以通过emca –upgrade db命令实现。如下所示
[code][oracle@DB-Server ~]$emca -upgrade db
STARTED EMCA at Mar 12, 2014 2:59:18 PM
EM Configuration Assistant, Version 10.2.0.1.0 Production
Copyright (c) 2003, 2005, Oracle. All rights reserved.
Enter the following information:
ORACLE_HOME for the database to be upgraded:/u01/app/oracle/product/dbhome_1
Database SID:epps
Listener port number: 15
...........
[/code]
相关文章推荐
- Linux6.3_64安装Oracle10.2.0.1数据库并升级至10.2.0.4版本
- linux平台下oracle从10.2.0.1升级到10.2.0.4
- linux平台下oracle从10.2.0.1升级到10.2.0.4
- Oracle 10.2.0.1静默升级至10.2.0.4(Linux)
- linux平台下oracle从10.2.0.1升级到10.2.0.4
- LINUX平台上,oracle 10.2.0.1升级到10.2.0.4出现oracle universal installer has detected that there are processe
- linux环境下oracle版本升级(10.2.0.1-10.2.0.4)
- linux平台下oracle从10.2.0.1升级到10.2.0.4
- Linux5.3_x86_64上oracle10.2.0.1升级到10.2.0.4
- linux平台下oracle从10.2.0.1升级到10.2.0.4
- linux平台下oracle从10.2.0.1升级到10.2.0.4
- linux平台下oracle从10.2.0.1升级到10.2.0.4
- linux环境Oracle10.2.0.1到10.2.0.4的升级
- linux平台下oracle从10.2.0.1升级到10.2.0.4
- Oracle 10.2.0.1 升级到 10.2.0.4
- oracle 之 安装10.2.0.1 且 升级到 10.2.0.4
- oracle 之 安装10.2.0.1 且 升级到 10.2.0.4
- Windows Server 2003上安装Oracle10g-10.2.0.1并升级至补丁Oracle Patch-10.2.0.4图解
- Oracle 10.2.0.1 升级到 10.2.0.4
- oracle10.2.0.1升级到oracle10.2.0.4