oracle_1201_upgrade_第二部

wisdomone1發表於2009-12-02

Using the Pre-Upgrade Information Tool

The Pre-Upgrade Information Tool is a SQL script. that ships with the new Oracle Database 10g release, and must be copied to and run from the environment of the database being upgraded. Complete the following steps to run the Pre-Upgrade Information Tool:

  1. Log in to the system as the owner of the Oracle home directory of the new Oracle Database 10g release.

  2. Copy the following file from the ORACLE_HOME/rdbms/admin directory of the new Oracle Database 10g release to a directory outside of the Oracle home, such as the temporary directory on your system:

    • utlu102i.sql

    Make a note of the new location of this file.

  3. Log in to the system as the owner of the Oracle home directory of the database to be upgraded.

  4. Change to the directory outside of the Oracle home directory that you copied files to in Step .

  5. Start SQL*Plus.

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

  7. Set the system to spool results to a log file for later analysis:

    SQL> SPOOL info.log
  8. Run utlu102i.sql:

    SQL> @utlu102i.sql
  9. Turn off the spooling of script. results to the log file:

    SQL> SPOOL OFF



Update Parameters

This section displays a list of initialization parameters in the parameter file of the current database that must be adjusted before the database is upgraded. The adjustments need to be made to the parameter file after it is copied to the new Oracle Database 10g release.



Deprecated Parameters

This section displays a list of initialization parameters in the parameter file of the current database that are deprecated in the new Oracle Database 10g release.

See Also:

for a list of initialization parameters that are deprecated in the new Oracle Database 10g release

Obsolete Parameters

This section displays a list of initialization parameters in the parameter file of the current database that are obsolete in the new Oracle Database 10g release. Obsolete initialization parameters need to be removed from the parameter file before the database is upgraded.




Note:

It is important to run Oracle Net Configuration Assistant before running the Database Upgrade Assistant (DBUA).

Optimizer Statistics

When upgrading to Oracle Database 10g, optimizer statistics are collected for dictionary tables that lack statistics. This statistics collection can be time consuming for databases with a large number of dictionary tables, but statistics gathering only occurs for those tables that lack statistics or are significantly changed during the upgrade.

To decrease the amount of downtime incurred when collecting statistics, you can collect statistics prior to performing the actual database upgrade. As of Oracle Database 10g Release 10.1, Oracle recommends that you use the DBMS_STATS.GATHER_DICTIONARY_STATS procedure to gather these statistics. For example, you can enter the following:

EXEC DBMS_STATS.GATHER_DICTIONARY_STATS:



Database Upgrade Assistant Command Line Options

The Database Upgrade Assistant supports several command line options. You can specify all valid options from the command line using the following syntax:

dbua [ -silent ] [ -dbName SID ] [ -disableUpgradeScriptLogging ] [ -backupLocation directory ] [ -postUpgradeScripts script [, script ] ... ] [ -initParam parameter=value [, parameter=value ] ... ] [ -emConfiguration { LOCAL | CENTRAL | NOBACKUP | NOEMAIL | NONE } -dbsnmpPassword password -sysmanPassword password [ -hostUserName hostname -hostUserPassword password -backupSchedule hh:mm ] ] [ -smtpServer server_name -emailAddress address ] -centralAgent location ] [ -recoveryAreaDestination directory ] [ -h | -help ]


手工升級:
1,rman備升級庫
2,準備new oracle_home
把升級庫的spfile(pfile),password file,specific cluster configure file 複製到它對應目錄下面
3,調節以上cp過來相關檔案的引數
4,升級
shutdown
配置相關環境變數--oracle_home,path and etc
5,cd 新的oracle_home
6,建立sysaux tablespace

Table 3-3 Guidelines for Sizing the SYSAUX Tablespace

Factor Small Medium Large

Number of CPUs

2

8

32

Number of concurrently active sessions

5

20

100

Number of user objects (tables and indexes)

500

5,000

50,000

Estimated SYSAUX size at steady state with default config

500 MB

2 GB

5 GB

SQL> CREATE TABLESPACE sysaux DATAFILE 'sysaux01.dbf'
SIZE 500M REUSE
EXTENT MANAGEMENT LOCAL
SEGMENT SPACE MANAGEMENT AUTO


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

ONLINE;

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

    SQL> @utlu102s.sql

    The Post-upgrade Status Tool displays the status of the database components in the upgraded database and the time required to complete each component upgrade. The Upgrade Status Tool displays output similar to the following:

    Oracle Database 10.2 Upgrade Status Utility           04-20-2005 05:18:40
    .
    Component Status Version HH:MM:SS
    Oracle Database Server VALID 10.2.0.1.0 00:11:37
    JServer JAVA Virtual Machine VALID 10.2.0.1.0 00:02:47
    Oracle XDK VALID 10.2.0.1.0 00:02:15
    Oracle Database Java Packages VALID 10.2.0.1.0 00:00:48
    Oracle Text VALID 10.2.0.1.0 00:00:28
    Oracle XML Database VALID 10.2.0.1.0 00:01:27
    Oracle Workspace Manager VALID 10.2.0.1.0 00:00:35
    Oracle Data Mining VALID 10.2.0.1.0 00:15:56
    Messaging Gateway VALID 10.2.0.1.0 00:00:11
    OLAP Analytic Workspace VALID 10.2.0.1.0 00:00:28
    OLAP Catalog VALID 10.2.0.1.0 00:00:59
    Oracle OLAP API VALID 10.2.0.1.0 00:00:53
    Oracle interMedia VALID 10.2.0.1.0 00:08:03
    Spatial VALID 10.2.0.1.0 00:05:37
    Oracle Ultra Search VALID 10.2.0.1.0 00:00:46
    Oracle Label Security VALID 10.2.0.1.0 00:00:14
    Oracle Expression Filter VALID 10.2.0.1.0 00:00:16
    Oracle Enterprise Manager VALID 10.2.0.1.0 00:00:58
    .
    Total Upgrade Time: 00:56:09
  2. Turn off the spooling of script. results to the log file:

    SQL> SPOOL OFF

    Then, check the spool file and verify that the packages and procedures compiled successfully. You named the spool file in Step ; the suggested name was upgrade.log. Correct any problems you find in this file (see ) and rerun the catupgrd.sql script, if necessary. You can rerun any of the scripts described in this chapter as many times as necessary. (If you have JAVAVM in your database, but you did not install the companion Oracle Database 10g Products, you will most likely receive error message ORA-29558.)

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

    SQL> SHUTDOWN IMMEDIATE
    SQL> STARTUP

    Cleanly shutting down and restarting the instance flushes all caches, clears buffers, and performs other housekeeping activities. These measures are an important final step to ensure the integrity and consistency of the newly upgraded Oracle Database.

    Also, if you encountered a message listing obsolete initialization parameters when you started the database in Step , then remove the obsolete initialization parameters from the parameter file before restarting. If necessary, convert the spfile to a pfile so you can edit the file to delete parameters.

  4. Run olstrig.sql to re-create DML triggers on tables with Oracle Label Security policies. (See for more information.) This step is only necessary if Oracle Label Security is in your database.

    SQL> @olstrig.sql
  5. 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';
  6. Exit SQL*Plus.

Your database is now upgraded to the new Oracle Database 10g release.




手工重新恢復升級庫

Abandon the Upgrade

If you completed the steps in to back up your database, then the easiest way to abandon the upgrade is to restore that backup. Complete the following steps:

  1. Log in to the system as the owner of the Oracle home directory of the previous release.

  2. Sign on to RMAN:

    rman "target / nocatalog"
  3. Issue the following RMAN commands:

    STARTUP NOMOUNT
    RUN
    {
    REPLICATE CONTROLFILE FROM 'save_controlfile_location';
    ALTER DATABASE MOUNT;
    RESTORE DATABASE FROM TAG before_upgrade
    ALTER DATABASE OPEN RESETLOGS;
    }

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/9240380/viewspace-621202/,如需轉載,請註明出處,否則將追究法律責任。

相關文章