手工升级数据库10.1到10.2

手工升级数据库步骤:

1.对要升级的数据库做完整的备份

2.复制必要文件到新的oracle_home

3.升级数据库

升级前需要用目标数据库中的utlu102i.sql脚本对原数据库进行必要的检测,以检查参数或数据文件是否设置有问题,根据检测报告进行必要的调整

具体步骤:

1.完整备份

用rman 对原数据库进行完整的备份,以防止升级不成功,可以对原数据库进行还原操作

2.复制必要文件到新的oracle_home

 需要复制原数据库的密码文件(也可以重建)密码文件,init_SID.ora参数文件到目标数据库的database/dbs目录下

3.升级数据库

   在设置目标数据库路径的前提下,立即关闭数据库

 在windows下需要用oradim命令删除原数据库服务,然后重建此数据库服务,linux下则不需要,只要保证环境变量正确就可以了;

SQL> SHUTDOWN IMMEDIATE

 
  1. Stop the OracleServiceSID Oracle service of the database you are upgrading, where SID is the instance name. For example, if your SID is ORCL, then enter the following at a command prompt:

    C:\> NET STOP OracleServiceORCL
     
  2. Delete the Oracle service at a command prompt using ORADIM.

    If your SID is ORCL, then enter the following command:

    C:\> ORADIM -DELETE -SID ORCL
     
  3. Create the new Oracle Database 10g service at a command prompt using the ORADIM command of the new Oracle Database release:

    C:\> ORADIM -NEW -SID SID -INTPWD PASSWORD -MAXUSERS USERS -STARTMODE AUTO -PFILE ORACLE_HOME\DATABASE\INITSID.ORA
     
  4. Start SQL*Plus.

  5. Connect to the database instance as a user with SYSDBA privileges.

  6. Start up the instance by issuing the following command:

    SQL> STARTUP UPGRADE
     
  7. Set the system to spool results to a log file for later verification of success:

    SQL> SPOOL upgrade.log
     
  8. Run catupgrd.sql:

    SQL> @catupgrd.sql
     

     

  9. Run utlu102s.sql to display the results of the upgrade:

    SQL> @utlu102s.sql
     

 

    10.Turn off the spooling of script results to the log file:

         SQL> SPOOL OFF

 

 

 

 11. Shut down and restart the instance to reinitialize the system   parameters for normal operation.

SQL> SHUTDOWN IMMEDIATE
SQL> STARTUP
12.Run olstrig.sql to re-create DML triggers on tables with Oracle Label Security policies. This step is only necessary if Oracle Label Security is in your database.

 

SQL> @olstrig.sql

 

13.Run utlrp.sql to recompile any remaining stored PL/SQL and Java code.

SQL> @utlrp.sql

Verify that all expected packages and classes are valid:

SQL> SELECT count(*) FROM dba_objects WHERE status='INVALID';
SQL> SELECT distinct object_name FROM dba_objects WHERE status='INVALID';
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值