手工升级数据库步骤:
1.对要升级的数据库做完整的备份
2.复制必要文件到新的oracle_home
3.升级数据库
升级前需要用目标数据库中的utlu102i.sql脚本对原数据库进行必要的检测,以检查参数或数据文件是否设置有问题,根据检测报告进行必要的调整
具体步骤:
1.完整备份
用rman 对原数据库进行完整的备份,以防止升级不成功,可以对原数据库进行还原操作
2.复制必要文件到新的oracle_home
需要复制原数据库的密码文件(也可以重建)密码文件,init_SID.ora参数文件到目标数据库的database/dbs目录下
3.升级数据库
在设置目标数据库路径的前提下,立即关闭数据库
在windows下需要用oradim命令删除原数据库服务,然后重建此数据库服务,linux下则不需要,只要保证环境变量正确就可以了;
SQL> SHUTDOWN IMMEDIATE
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: Delete the Oracle service at a command prompt using ORADIM. If your SID is ORCL, then enter the following command: Create the new Oracle Database 10g service at a command prompt using the ORADIM command of the new Oracle Database release: Start SQL*Plus. Connect to the database instance as a user with SYSDBA privileges. Start up the instance by issuing the following command: Set the system to spool results to a log file for later verification of success:
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
13.Run utlrp.sql to recompile any remaining stored PL/SQL and Java code. Verify that all expected packages and classes are valid:SQL> @olstrig.sql
SQL> @utlrp.sql
SQL> SELECT count(*) FROM dba_objects WHERE status='INVALID';
SQL> SELECT distinct object_name FROM dba_objects WHERE status='INVALID';
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/9399028/viewspace-682165/ ,如需转载,请注明出处,否则将追究法律责任。