文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>Oracle Database 10.2.0.5.0 升级笔记

Oracle Database 10.2.0.5.0 升级笔记

时间:2010-09-09  来源:snowtty

     
Oracle Database 10.2.0.5.0 的PatchSet在两周前发布了, 昨天天对一个生产环境的小逻辑备库做了一下升级, 小记一下. 本升级步骤适用于升级Oracle Database 10.2.0.x.0 版本的数据库, 普通数据库和逻辑备库都一样.

1 停止OEM/isqlplus/监听/DB实例

$ emctl stop dbconsole
$ isqlplusctl stop
$ lsnrctl stop
$ sqlplus /  as sysdba
SQL> shutdown immediate;

2 升级Oracle软件


1) 备份ORACLE_HOME和oraInventory

升级前对要升级的ORACLE_HOME进行备份是必要的, 还有oraInventory目录, 一旦升级失败便于回退.


$ cd $ORACLE_HOME/..

$ tar jcvf db_1_`date +%Y%m%d`.tar.bz2 db_1

$ cd $ORACLE_BASE

$ tar jcvf oraInventory_`date +%Y%m%d`.tar.bz2 oraInventory


另外一个备份的方法:


$ cd $ORACLE_HOME/..

$ cp -pr db_1 db_1_new                    (备份到新目录, 且保留mode,ownership,timestamps等信息)

$ diff -q -r db_1 db_1_new                (比较两个目录, 应该只有日志文件发生变化)


2) 升级Oracle 软件


通过response文件开始升级, 升级时间大概2-3分钟.


$ cd /u01/software/10g/

$ unzip p8202632_10205_LINUX.zip

$ cd Disk1

$ export DISTRIB=`pwd`

$ ./runInstaller -silent -responseFile $DISTRIB/response/patchset.rsp ORACLE_HOME="/u01/app/oracle/product/10.2.0/db_1" ORACLE_HOME_NAME="OraDb10g_home1" DECLINE_SECURITY_UPDATES="true"


如果未使用默认的组oinstall, 则runInstaller命令后需再加一个参数: 

UNIX_GROUP_NAME="oinstall"


各参数含义如下:

-silent 表示以静默方式安装,不会有任何提示;

-responseFile 表示使用哪个响应文件,必需使用绝对路径;

ORACLE_HOME="/u01/app/oracle/product/10.2.0/db_1" oracle安装目录;

ORACLE_HOME_NAME="OraDb10g_home1" ORACLE_HOME名;

DECLINE_SECURITY_UPDATES="true" 是否需要安全更新, true表示不需要, 否则会要求输入metalink账号和联网信息;

UNIX_GROUP_NAME="oinstall" oracle用户用于安装软件的组名;


3) 运行root.sh和changePerm.sh


ü 升级结束后, 以root用户执行$ORACLE_HOME下的root.sh(如有提示则一直回车): 

# /u01/app/oracle/product/10.2.0/db_1/root.sh


ü 安装PatchSet后新增的文件或目录是限制访问的, 其它用户或第三方工具要访问这些文件时会提示错误, 所以要修改权限:

# su - oracle

$ cd $ORACLE_HOME/install

$ ./changePerm.sh

...

Do you wish to continue (y/n) [n]: y

...

$ tail -50f /tmp/changePerm_err.log


ü 升级软件后检查:

$ sqlplus /nolog

SQL*Plus: Release 10.2.0.5.0 - Production on Sat May 8 14:34:51 2010

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

SQL> exit;


3 升级数据库


$ sqlplus / as sysdba

SQL> startup upgrade;                     (以升级模式启动数据库)

SQL> SPOOL /tmp/patch102050.log 

SQL> @?/rdbms/admin/catupgrd.sql          (重建数据字典, 若有问题可重复执行)

...

Total Upgrade Time: 00:23:34              (数据库大小110G)

...

SQL> SPOOL off 

SQL> !egrep "ORA-|Error" /tmp/patch102050.log   (查看是否有错误)

SQL> shutdown immediate;

SQL> startup;

SQL> select count(1) from dba_objects where status='INVALID';

  COUNT(1)

----------

       484

SQL> @?/rdbms/admin/utlrp.sql             (编译失效PLSQL包对象, 尽管第一次访问包是会自动编译, 还是推荐操作)

...

OBJECTS WITH ERRORS

-------------------

                  0

...

ERRORS DURING RECOMPILATION

---------------------------

                          0


4 开启OEM/isqlplus/监听

$ lsnrctl start
$ isqlplusctl start
$ emctl start dbconsole

--End--
Oracle Database 10.2.0.5.0 升级笔记 2010-05-21 14:51
Oracle Database 10.2.0.5.0 的PatchSet在两周前发布了, 昨天天对一个生产环境的小逻辑备库做了一下升级, 小记一下. 本升级步骤适用于升级Oracle Database 10.2.0.x.0 版本的数据库, 普通数据库和逻辑备库都一样.

1 停止OEM/isqlplus/监听/DB实例

$ emctl stop dbconsole
$ isqlplusctl stop
$ lsnrctl stop
$ sqlplus /  as sysdba
SQL> shutdown immediate;

2 升级Oracle软件


1) 备份ORACLE_HOME和oraInventory

升级前对要升级的ORACLE_HOME进行备份是必要的, 还有oraInventory目录, 一旦升级失败便于回退.


$ cd $ORACLE_HOME/..

$ tar jcvf db_1_`date +%Y%m%d`.tar.bz2 db_1

$ cd $ORACLE_BASE

$ tar jcvf oraInventory_`date +%Y%m%d`.tar.bz2 oraInventory


另外一个备份的方法:


$ cd $ORACLE_HOME/..

$ cp -pr db_1 db_1_new                    (备份到新目录, 且保留mode,ownership,timestamps等信息)

$ diff -q -r db_1 db_1_new                (比较两个目录, 应该只有日志文件发生变化)


2) 升级Oracle 软件


通过response文件开始升级, 升级时间大概2-3分钟.


$ cd /u01/software/10g/

$ unzip p8202632_10205_LINUX.zip

$ cd Disk1

$ export DISTRIB=`pwd`

$ ./runInstaller -silent -responseFile $DISTRIB/response/patchset.rsp ORACLE_HOME="/u01/app/oracle/product/10.2.0/db_1" ORACLE_HOME_NAME="OraDb10g_home1" DECLINE_SECURITY_UPDATES="true"


如果未使用默认的组oinstall, 则runInstaller命令后需再加一个参数: 

UNIX_GROUP_NAME="oinstall"


各参数含义如下:

-silent 表示以静默方式安装,不会有任何提示;

-responseFile 表示使用哪个响应文件,必需使用绝对路径;

ORACLE_HOME="/u01/app/oracle/product/10.2.0/db_1" oracle安装目录;

ORACLE_HOME_NAME="OraDb10g_home1" ORACLE_HOME名;

DECLINE_SECURITY_UPDATES="true" 是否需要安全更新, true表示不需要, 否则会要求输入metalink账号和联网信息;

UNIX_GROUP_NAME="oinstall" oracle用户用于安装软件的组名;


3) 运行root.sh和changePerm.sh


ü 升级结束后, 以root用户执行$ORACLE_HOME下的root.sh(如有提示则一直回车): 

# /u01/app/oracle/product/10.2.0/db_1/root.sh


ü 安装PatchSet后新增的文件或目录是限制访问的, 其它用户或第三方工具要访问这些文件时会提示错误, 所以要修改权限:

# su - oracle

$ cd $ORACLE_HOME/install

$ ./changePerm.sh

...

Do you wish to continue (y/n) [n]: y

...

$ tail -50f /tmp/changePerm_err.log


ü 升级软件后检查:

$ sqlplus /nolog

SQL*Plus: Release 10.2.0.5.0 - Production on Sat May 8 14:34:51 2010

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

SQL> exit;


3 升级数据库


$ sqlplus / as sysdba

SQL> startup upgrade;                     (以升级模式启动数据库)

SQL> SPOOL /tmp/patch102050.log 

SQL> @?/rdbms/admin/catupgrd.sql          (重建数据字典, 若有问题可重复执行)

...

Total Upgrade Time: 00:23:34              (数据库大小110G)

...

SQL> SPOOL off 

SQL> !egrep "ORA-|Error" /tmp/patch102050.log   (查看是否有错误)

SQL> shutdown immediate;

SQL> startup;

SQL> select count(1) from dba_objects where status='INVALID';

  COUNT(1)

----------

       484

SQL> @?/rdbms/admin/utlrp.sql             (编译失效PLSQL包对象, 尽管第一次访问包是会自动编译, 还是推荐操作)

...

OBJECTS WITH ERRORS

-------------------

                  0

...

ERRORS DURING RECOMPILATION

---------------------------

                          0


4 开启OEM/isqlplus/监听

$ lsnrctl start
$ isqlplusctl start
$ emctl start dbconsole

--End--
  --------------------------------------------------------------------------------
COMP_TIMESTAMP RUL        2010-09-09 22:20:45
DBUA_TIMESTAMP RUL        VALID       2010-09-09 22:20:45
     
TIMESTAMP
--------------------------------------------------------------------------------
COMP_TIMESTAMP UPGRD_END  2010-09-09 22:21:33
.
Oracle Database 10.2 Upgrade Status Utility           09-09-2010 22:21:33
.
Component                                Status         Version  HH:MM:SS
Oracle Database Server                    VALID      10.2.0.5.0  00:05:35
JServer JAVA Virtual Machine              VALID      10.2.0.5.0  00:01:17
Oracle XDK                                VALID      10.2.0.5.0  00:00:16
Oracle Database Java Packages             VALID      10.2.0.5.0  00:00:09
Oracle Text                               VALID      10.2.0.5.0  00:00:14
Oracle XML Database                       VALID      10.2.0.5.0  00:01:15
Oracle Workspace Manager                  VALID      10.2.0.5.0  00:00:28
Oracle Data Mining                        VALID      10.2.0.5.0  00:00:11
OLAP Analytic Workspace                   VALID      10.2.0.5.0  00:00:13
OLAP Catalog                              VALID      10.2.0.5.0  00:00:37
Oracle OLAP API                           VALID      10.2.0.5.0  00:00:25
Oracle interMedia                         VALID      10.2.0.5.0  00:01:40
Spatial                                   VALID      10.2.0.5.0  00:01:32
Oracle Expression Filter                  VALID      10.2.0.5.0  00:00:06
Oracle Enterprise Manager                 VALID      10.2.0.5.0  00:01:02
Oracle Rule Manager                       VALID      10.2.0.5.0  00:00:05
.
Total Upgrade Time: 00:15:59
DOC>#######################################################################
DOC>#######################################################################
DOC>
DOC>   The above PL/SQL lists the SERVER components in the upgraded
DOC>   database, along with their current version and status.
DOC>
DOC>   Please review the status and version columns and look for
DOC>   any errors in the spool log file.  If there are errors in the spool
DOC>   file, or any components are not VALID or not the current version,
DOC>   consult the Oracle Database Upgrade Guide for troubleshooting
DOC>   recommendations.
DOC>
DOC>   Next shutdown immediate, restart for normal operation, and then
DOC>   run utlrp.sql to recompile any invalid application objects.
DOC>
DOC>#######################################################################
DOC>#######################################################################
DOC>#
SQL> SQL>
  SQL> SQL> @/u01/oracle/product/rdbms/admin/utlrp.sql TIMESTAMP
--------------------------------------------------------------------------------
COMP_TIMESTAMP UTLRP_BGN  2010-09-09 22:26:18
DOC>   The following PL/SQL block invokes UTL_RECOMP to recompile invalid
DOC>   objects in the database. Recompilation time is proportional to the
DOC>   number of invalid objects in the database, so this command may take
DOC>   a long time to execute on a database with a large number of invalid
DOC>   objects.
DOC>
DOC>   Use the following queries to track recompilation progress:
DOC>
DOC>   1. Query returning the number of invalid objects remaining. This
DOC>      number should decrease with time.
DOC>         SELECT COUNT(*) FROM obj$ WHERE status IN (4, 5, 6);
DOC>
DOC>   2. Query returning the number of objects compiled so far. This number
DOC>      should increase with time.
DOC>         SELECT COUNT(*) FROM UTL_RECOMP_COMPILED;
DOC>
DOC>   This script automatically chooses serial or parallel recompilation
DOC>   based on the number of CPUs available (parameter cpu_count) multiplied
DOC>   by the number of threads per CPU (parameter parallel_threads_per_cpu).
DOC>   On RAC, this number is added across all RAC nodes.
DOC>
DOC>   UTL_RECOMP uses DBMS_SCHEDULER to create jobs for parallel
DOC>   recompilation. Jobs are created without instance affinity so that they
DOC>   can migrate across RAC nodes. Use the following queries to verify
DOC>   whether UTL_RECOMP jobs are being created and run correctly:
DOC>
DOC>   1. Query showing jobs created by UTL_RECOMP
DOC>         SELECT job_name FROM dba_scheduler_jobs
DOC>            WHERE job_name like 'UTL_RECOMP_SLAVE_%';
DOC>
DOC>   2. Query showing UTL_RECOMP jobs that are running
DOC>         SELECT job_name FROM dba_scheduler_running_jobs
DOC>            WHERE job_name like 'UTL_RECOMP_SLAVE_%';
DOC>#
  TIMESTAMP
--------------------------------------------------------------------------------
COMP_TIMESTAMP UTLRP_END  2010-09-09 22:26:53
DOC> The following query reports the number of objects that have compiled
DOC> with errors (objects that compile with errors have status set to 3 in
DOC> obj$). If the number is higher than expected, please examine the error
DOC> messages reported with each object (using SHOW ERRORS) to see if they
DOC> point to system misconfiguration or resource constraints that must be
DOC> fixed before attempting to recompile these objects.
DOC>#
OBJECTS WITH ERRORS
-------------------
                  0
DOC> The following query reports the number of errors caught during
DOC> recompilation. If this number is non-zero, please query the error
DOC> messages in the table UTL_RECOMP_ERRORS to see if any of these errors
DOC> are due to misconfiguration or resource constraints that must be
DOC> fixed before objects can compile successfully.
DOC>#
ERRORS DURING RECOMPILATION
---------------------------
                          0
相关阅读 更多 +
排行榜 更多 +
辰域智控app

辰域智控app

系统工具 下载
网医联盟app

网医联盟app

运动健身 下载
汇丰汇选App

汇丰汇选App

金融理财 下载