Documente Academic
Documente Profesional
Documente Cultură
Lets step through the manual database upgrade process in this section so you understand
whathappens during a database upgrade. Recall that the DBUA does a lot of the following
steps for you.
The steps for a manual upgrade to the Oracle Database 10g database version are briefly listed
here, and they are discussed in more detail in the following sections:
1) Create a spool file.
2) Log in as a user with the SYSDBA privilege, and run the Pre-Upgrade Information
Tool.
3) Make any changes it recommends.
4) Back up the database youre going to upgrade.
5) Copy the current init.ora file to the new Oracle Database 10g init.ora file location.
6) Shut down the database and restart it under the new Oracle 10g home in the
STARTUP
7) UPGRADE mode.
8) Create the required Sysaux tablespace.
9) Run the catupgrd.sql upgrade script.
10) Check to see if any objects became invalidated during the database upgrade.
11) Run the utlrp.sql script to recompile any objects that became invalid during the
database
12) upgrade.
13) Run the Post-Upgrade Status Tool.
14) End the spool file.
Creating a Spool File
Create a spool file to record the upgrade process so that you can easily review it later.
SQL> SPOOL upgrade.log
Starting the Pre-Upgrade Information Tool
To start the Pre-Upgrade Information Tool, run the following:
SQL> @$ORACLE_HOME\rdbms\admin\utlu102i.sql
To see the results of the pre-upgrade check, turn spooling off with the following command:
SQL> spool off
Check the upgrade.log spool file to see if you meet all upgrade requirements. Listing 8-1
shows part of the output from a sample run. Note that I was upgrading an Oracle 8.17
database to Oracle
Database 10g.
Listing 8-1. Partial Output of the Pre-Upgrade Information Tool
*************************************************************************
Database:
--> name: FINANCE
--> version: 8.1.7.0.0
--> compatibility: 8.1.0
Listing 8-2. Starting the Database with the STARTUP UPGRADE Command
[oracle@localhost admin]$ sqlplus /nolog
SQL*Plus: Release 10.2.0.0.0 - Beta on Mon Feb21 16:43:14 2005
Copyright (c) 1982, 2004, Oracle. All rights reserved.
SQL> CONNECT sys/sammyy1 AS SYSDBA
Connected to an idle instance.
SQL> STARTUP UPGRADE
ORACLE instance started.
Total System Global Area 314572800 bytes
Fixed Size 1236756 bytes
Variable Size 99164396 bytes
Database Buffers 213909504 bytes
Redo Buffers 262144 bytes
Database mounted.
Database opened.
SQL>
Creating the Sysaux Tablespace
Once you have brought up the database instance, you can create the Sysaux tablespace:
SQL> CREATE TABLESPACE sysaux DATAFILE '/u10/oradata/prod/sysaux01.dbf'
SIZE 500M REUSE EXTENT MANAGEMENT LOCAL
SEGMENT SPACE MANAGEMENT AUTO;
The database is now technically converted into an Oracle Database 10g version, as shown by
the following query:
SQL> SELECT * FROM V$VERSION
BANNER
---------------------------------------------------------------Oracle Database 10g Enterprise Edition Release 10.2.0.0.0 - Beta
PL/SQL Release 10.2.0.0.0 - Beta
CORE 10.2.0.0.0 Beta
TNS for Linux: Version 10.2.0.0.0 - Beta
NLSRTL Version 10.2.0.0.0 - Beta
SQL>
In the next step, you actually upgrade the current database to the 10.2 version.
Note As of this writing, the Oracle Database 10g Release 2 (10.2) production version hasnt
been officially released. The output from the previous SQL query notes that I used the 10.2
Beta version. While there could be changes in the final production version of the software,
such changes will be focused on fixing bugs encountered during the Beta testing phase and
wont introduce substantive functional modifications.
Note You can revert to the older database as long as you have a backup of the database
made before starting the upgrade process. Its vital to have a backup, since the upgrade
process may fail before its completed, leaving you with a database that wont be functional
under the pre- or post-upgrade version of Oracle.
Running the Post-Upgrade Status Tool
After the upgrade process completes, you must run the Post-Upgrade Status Tool, using the
following script:.
SQL> @utlu102s.sql
The Post-Upgrade Status Tool summarizes the upgrade process, which should look similar to
Listing 8-3, if everything went okay during the database upgrade.
Listing 8-3. Partial Output from the Post-Upgrade Status Tool
Oracle Database 10.2 Upgrade Status Utility 5-02-2005 11:26:50
...
Component Status Version HH:MM:SS
Oracle Database Server
VALID 10.2.0.0.0 00:35:54
JServer JAVA Virtual Machine
VALID 10.2.0.0.0 00:12:01
Oracle XDK
VALID 10.2.0.0.0 00:03:56
Oracle Database Java Packages
VALID 10.2.0.0.0 00:01:27
Oracle XML Database
VALID 10.2.0.0.0 00:04:05
Oracle Workspace Manager
VALID 10.2.0.0.0 00:03:18
Oracle Data Mining
VALID 10.2.0.0.0 00:00:24
Messaging Gateway
VALID 10.2.0.0.0 00:00:20
OLAP Analytic Workspace
VALID 10.2.0.0.0 00:00:43
OLAP Catalog
VALID 10.2.0.0.0 00:02:54
Oracle OLAP API
VALID 10.2.0.0.0 00:00:50
Oracle interMedia
VALID 10.2.0.0.0 00:05:10
Spatial
VALID 10.2.0.0.0 00:07:02
Oracle Text
VALID 10.2.0.0.0 00:01:51
Oracle Ultra Search
VALID 10.2.0.0.0 00:02:04
Oracle Label Security
VALID 10.2.0.0.0 00:00:37
...
Total Upgrade Time: 01:27:32
The Post-Upgrade Status Tool determines the upgrade status of each database component by
querying the DBA_SERVER_REGISTRY view. You can also query the
DBA_SERVER_REGISTRY view, as shown in Listing 8-4.
Listing 8-4. Querying the DBA_SERVER_REGISTRY View for Post-Upgrade Information
SQL> SELECT comp_id, comp_name, version, status FROM DBA_SERVER_REGISTRY;
COMP_ID COMP_NAME- VERSION STATUS
------------------------------ -------------------------------------------CATALOG Oracle Database Catalog Views 10.2.0.0.0 VALID
CATPROC Oracle Database Packages and Types 10.2.0.0.0 VALID
JAVAVM JServer JAVA Virtual Machine 10.2.0.0.0 VALID
Several of Oracle Database 10gs new features expect you to use locally managed
tablespaces. You may, at this point, choose to migrate all your dictionary-managed
tablespaces to locally managed tablespaces by using the DBMS_SPACE_ADMIN package.
Chapter 5 shows you how to convert dictionary-managed tablespaces to locally managed
tablespaces. You can also start migrating database jobs to the new Oracle Scheduler and
check out the Automatic Jobs feature, the Automatic Database Diagnostic Monitor, and many
other goodies you have available in your new Oracle Database 10g Release 2 database.