《oracle 9i 升級 10g 過程 二》

執行catuprd.sql 約需2個半小時, 參考 oracle document b14238.pdf...

2009/6/19

執行catuprd.sql 約需2個半小時

參考 oracle document b14238.pdf

1.在同一台oracle 9i 機器上,安裝oracle 10g software only

2. 連到原本oracle 9i的instance

SQL> spool info.log
SQL> @$ORACLE_HOME\rdbms\admin\utlu102i.sql
SQL> spool off

根據 info.log 建議內容,修改原本oracle 9i的 pfile 參數(部份參數是增加,部份在10g已不再使用),

修改建議的redo log及datafile size。

將pfile檔複製到$ORACLE_HOME\database\。

SQL> shutdown immediate

3. 刪除 oracle 9i database service,重建oracle 10 database service

> net stop oracleserviceorcl

> oradim -delete -sid orcl
> oradim -new -sid orcl -INTPWD change_on_install
  -MAXUSERS 5 -STARTMODE AUTO -PFILE $ORACLE_HOME\database\initORCL.ora


4.

> sqlplus /nolog
SQL> conn sys/change_on_install as sysdba
SQL> startup upgrade
SQL> CREATE TABLESPACE SYSAUX DATAFILE 'SYSAUX01.DBF'
     SIZE 500M REUSE
     EXTENT MANAGEMENT LOCAL
     SEGMENT SPACE MANAGEMENT AUTO
     ONLINE;
SQL> spool upgrade.log
SQL> @$ORACLE_HOME\rdbms\admin\catupgrd.sql
SQL> @$ORACLE_HOME\rdbms\admin\utlu102s.sql
SQL> spool off

Then, check the spool file and verify that the packages and procedures compiled

successflly. Correct any problems you find in this file (see "Troubleshoot the Upgrade" on page 3-22)

and rerun the catupgrd.sql script, if necessary. You can rerun any of the scripts described in this

chapter as many times as necessary.

SQL> shutdown immediate
SQL> startup
SQL> @$ORACLE_HOME\rdbms\admin\olstrig.sql
SQL> @$ORACLE_HOME\rdbms\admin\utlrp.sql

附註: 如何知道 sqlplus 是用oracle 10g還是oracle 9i的執行檔?

執行 conn sys/change_on_install as sysdba 連到那一個instance呢?

答案就是看 ORACLE_HOME。

set oracle_home= c:\oracle\ora92\ 就是oracle 9i