oracle的环境配置-oracle的小版本升级


oracle的小版本升级:从10.2.0.1升级到10.2.0.4

需要准备的升级包:p6810189_10204_Linux-x86

1、当前版本

SQL> conn /as sysdba
Connected.
SQL> select * from v$version;

BANNER
----------------------------------------------------------------
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Prod
PL/SQL Release 10.2.0.1.0 - Production
CORE    10.2.0.1.0    Production
TNS for Linux: Version 10.2.0.1.0 - Production
NLSRTL Version 10.2.0.1.0 - Production

2、将升级包上传到oracle server的OS上

3、将server上的所有的和oracle有关的服务全部停止:OEM、isqlplus、数据库、监听

[oracle@oracle3 ~]$ emctl stop dbconsole               --停止OEM
TZ set to PRC
Oracle Enterprise Manager 10g Database Control Release 10.2.0.1.0  
Copyright (c) 1996, 2005 Oracle Corporation.  All rights reserved.
http://oracle3:1158/em/console/aboutApplication
Stopping Oracle Enterprise Manager 10g Database Control ...
 ...  Stopped.
[oracle@oracle3 ~]$ isqlplusctl stop         ---停止isqlplus
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@oracle3 ~]$ sqlplus /nolog

SQL*Plus: Release 10.2.0.1.0 - Production on Fri Jun 6 09:13:10 2014

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

SQL> conn /as sysdba
Connected.
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, OLAP and Data Mining options
[oracle@oracle3 ~]$ lsnrctl stop   --停止监听服务

LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 06-JUN-2014 09:13:28

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

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1)))
The command completed successfully


4、升级oracle软件

A 将升级包解压缩

[root@oracle3 u01]# unzip p6810189_10204_Linux-x86.zip

B 升级DBMS
[root@oracle3 ~]# xhost +
access control disabled, clients can connect from any host
[root@oracle3 ~]# su - oracle
[oracle@oracle3 ~]$ export DISPLAY="10.1.1.250:0.0"
[oracle@oracle3 ~]$ export LANG=en_US
[oracle@oracle3 ~]$ cd /u01/Disk1/
[oracle@oracle3 Disk1]$ ./runInstaller

不用做任何设置,都是点击“Next”,最后一步要在root下执行root.sh脚本

[root@oracle3 ~]# cd /u01/oracle/product/10.2.0/db_1/
[root@oracle3 db_1]# ./root.sh
Running Oracle10 root.sh script...

The following environment variables are set as:
    ORACLE_OWNER= oracle
    ORACLE_HOME=  /u01/oracle/product/10.2.0/db_1

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.

点击“OK”,“Exit”

5、升级数据库实例(升级RDBMS)

注意,由于实例创建的时候是10.2.0.1下创建的,所以这个实例ORCL需要升级,如果是升级到10.2.0.4之后创建的数据库实例RDBMS,版本就是10.2.0.4.


A 将数据库启动到升级状态

[oracle@oracle3 ~]$ sqlplus /nolog

SQL*Plus: Release 10.2.0.4.0 - Production on Fri Jun 6 09:37:57 2014

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

SQL> conn /as sysdba                  
Connected to an idle instance.
SQL> startup upgrade
ORACLE instance started.

Total System Global Area  608174080 bytes
Fixed Size            1268920 bytes
Variable Size          188744520 bytes
Database Buffers      415236096 bytes
Redo Buffers            2924544 bytes
Database mounted.
Database opened.

B 升级Oracle实例的组件

需要执行一个SQL脚本,这个脚本在第四步升级DBMS的时候copy到了磁盘上。

SQL> @$ORACLE_HOME/rdbms/admin/catupgrd.sql

C 创建组件的目录

SQL> @$ORACLE_HOME/rdbms/admin/catalog.sql

D 关闭数据库再正常启动

SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.

Total System Global Area  608174080 bytes
Fixed Size                  1268920 bytes
Variable Size             226493256 bytes
Database Buffers          377487360 bytes
Redo Buffers                2924544 bytes
Database mounted.
Database opened.

E 创建包和存储过程

SQL> @$ORACLE_HOME/rdbms/admin/catproc.sql

F 编译无效的对象

SQL> @$ORACLE_HOME/rdbms/admin/utlrp.sql

SQL> SET VERIFY OFF;
SQL>
SQL> SELECT dbms_registry_sys.time_stamp('utlrp_bgn') as timestamp from dual;

TIMESTAMP
--------------------------------------------------------------------------------
COMP_TIMESTAMP UTLRP_BGN  2014-06-06 11:16:29

1 row selected.

SQL> DECLARE
  2     threads pls_integer := &&1;
  3  BEGIN
  4     utl_recomp.recomp_parallel(threads);
  5  END;
  6  /

6、验证

SQL> col comp_name format a30
SQL> select comp_name,version,status from dba_registry;

COMP_NAME               VERSION                  STATUS
------------------------------ ------------------------------ ----------------------
Oracle Enterprise Manager      10.2.0.4.0              VALID
Spatial                10.2.0.4.0              VALID
Oracle interMedia           10.2.0.4.0              VALID
OLAP Catalog               10.2.0.4.0              VALID
Oracle XML Database           10.2.0.4.0              VALID
Oracle Text               10.2.0.4.0              VALID
Oracle Expression Filter       10.2.0.4.0              VALID
Oracle Rule Manager           10.2.0.4.0              VALID
Oracle Workspace Manager       10.2.0.4.3              VALID
Oracle Data Mining           10.2.0.4.0              VALID
Oracle Database Catalog Views  10.2.0.4.0              VALID
Oracle Database Packages and T 10.2.0.4.0              VALID
ypes

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
OLAP Analytic Workspace        10.2.0.4.0              VALID
Oracle OLAP API            10.2.0.4.0              VALID

17 rows selected.  --升级成功


检查OEM是否升级成功:

[oracle@oracle3 ~]$ emctl start dbconsole
TZ set to PRC
Oracle Enterprise Manager 10g Database Control Release 10.2.0.4.0  
Copyright (c) 1996, 2007 Oracle Corporation.  All rights reserved.
http://oracle3:1158/em/console/aboutApplication
Starting Oracle Enterprise Manager 10g Database Control .............................. started.
------------------------------------------------------------------
Logs are generated in directory /u01/oracle/product/10.2.0/db_1/oracle3_ORCL/sysman/log

你可能感兴趣的:(oracle,数据库,server,version,版本升级)