Upgradation is posible on these Compatibility Matrix
Minimum Version of the database that can be directly upgraded to Oracle 10g Release
2
8.1.7.4 -> 10.2.X.X.X
9.0.1.4 or 9.0.1.5 -> 10.2.X.X.X
9.2.0.4 or higher -> 10.2.X.X.X
10.1.0.2 or higher -> 10.2.X.X.X
The following database version will require an indirect upgrade path.
7.3.3 (or lower) -> 7.3.4 -> 8.1.7 -> 8.1.7.4 -> 10.2.X.X.X
7.3.4 -> 8.1.7 -> 8.1.7.4 -> 10.2.X.X.X
8.0.n -> 8.1.7 -> 8.1.7.4 -> 10.2.X.X.X
8.1.n -> 8.1.7 -> 8.1.7.4 -> 10.2.X.X.X
Introduction
This technical document has been created for the purpose of upgrading Oracle
databases running in version 9i to 10gR2. This project�s scope includes revision
and upgrade of the host operating system with appropriate versions and patch level.
Document scope
Below is the high-level scope for this upgrade:
� To analyze the existing application and database architecture for
certification of the upgrade.
� Identify prerequisites for the upgrade.
� Identify and list steps needed to complete the upgrade.
� Identify post upgrade steps.
Upgrade Methodology
The upgrade methodology we use is �in-place� upgrade. The original database remains
in the same server prior to the upgrade. Hostname and port #�s also remain the same
as prior to upgrade. However, two oracle homes are required to be in place for
comparison and rollback if necessary.
Following major steps are followed during the upgrade:
� Cold Backup the ORACLE_HOME and ORACLE_BASE of the pre-upgrade database.
� Cold Backup the database to disk prior to upgrade.
� Create new ORACLE_HOME and ORACLE_BASE directories.
� Create new file systems for the data & oracle home if needed.
� Run thru the pre-upgrade steps in section 3.
� Install 10gR2 binaries on the target host.
� Run thru the upgrade scripts in section 3.
� Run thru the post-upgrade in section 3
� Backup the new database , ORACLE_HOME and ORACLE_BASE.
Steps for upgrading the database to 10g Release 2
1. Install 10gR2 Binaries.
2. Checking the Hardware Requirements.
The system must meet the following minimum hardware requirements:
� At least 1024 MB of physical RAM
� The following table describes the relationship between installed RAM and the
configured swap space requirement.
RAM Swap Space
Between 1024 MB and 2048 MB 1.5 times the size of RAM
Between 2049 MB and 8192 MB Equal to the size of RAM
More than 8192 MB 0.75 times the size of RAM
� 400 MB of disk space in the /tmp directory
� Between 1.5 GB and 3.5 GB of disk space for the Oracle software, depending on
the installation type.
� 1.2 GB of disk space for a preconfigured database that uses file system
storage (optional).
� To ensure that the system meets these requirements:
To determine the physical RAM size, enter the following command:
# /usr/sbin/prtconf | grep "Memory size"
If the size of the physical RAM is less than the required size, then you must
install more memory before continuing.
To determine the size of the configured swap space, enter the following command:
# /usr/sbin/swap -s
To determine the amount of disk space available in the /tmp directory, enter the
following command:
# df -k /tmp
# df -h /tmp (on Solaris 10)
If there is less than 400 MB of free disk space available in the /tmp directory,
then complete one of the following steps:
o Delete unnecessary files from the /tmp directory to meet the disk space
requirement.
o Set the TMP and TMPDIR environment variables when setting the oracle user's
environment (described later).
o Extend the file system that contains the /tmp directory. If necessary,
contact your system administrator for information about extending file systems.
To determine the amount of free disk space on the system, enter the following
command:
# df -k
# df -h (on Solaris 10)
The following table shows the approximate disk space requirements for software
files for each installation type:
Installation Type Requirement for Software Files (GB)
Enterprise Edition 2.0
Standard Edition 1.5
Custom (maximum) 2.5
To determine whether the system architecture can run the software, enter the
following command:
# /bin/isainfo �kv
Note: In addition please refer to 169706_1.doc for further O/S patch requirements
before upgrade.
Note: In addition please refer to 169706_1.doc for further O/S patch requirements
before upgrade.
Preparing to Install the binaries.
1. Take a backup of the new $ORACLE_HOME
2. Verify kernel parameters are set according to the 10gR2 installation Guide.
Verify that all O/S packages and patches are installed as per the installation
guide.
Checking the Software Requirements
Depending on the products that you intend to install, verify that the following
software is installed on the system. The procedure following the table describes
how to verify whether these requirements are addressed.
Note:
Oracle Universal Installer performs checks on your system to verify that it meets
the listed requirements. To ensure that these checks pass, verify the requirements
before you start Oracle Universal Installer.
Item Requirement
Operating system One of the following 64-bit operating system versions:
Solaris 8 Update 7 or later
Solaris 9 Update 6 or later
Solaris 10
Packages
SUNWarc
SUNWbtool
SUNWhea
SUNWlibm
SUNWlibms
SUNWsprot
SUNWtoo
SUNWi1of
SUNWi1cs
SUNWi15cs
SUNWxwfnt
SUNWsprox
To determine whether the required packages are installed, enter a command similar
to the following:
# pkginfo -i SUNWarc SUNWbtool SUNWhea SUNWlibm SUNWlibms SUNWsprot \
SUNWsprox SUNWtoo SUNWi1of SUNWi1cs SUNWi15cs SUNWxwfnt
All installations Patches for Solaris 9:
* 112233-11, SunOS 5.9: Kernel Patch
* 111722-04, SunOS 5.9: Math Library (libm) patch
The following additional patches are required for Numa Systems:
* 115675-01, SunOS 5.9: liblgrp API
* 113471-08, SunOS 5.9: Miscellaneous SunOS Commands Patch
* 115675-01, SunOS 5.9: /usr/lib/liblgrp.so Patch
PL/SQL native compilation, Pro*C/C++, Pro*FORTRAN, Oracle Call Interface, Oracle C+
+ Call Interface, Oracle XML Developer's Kit (XDK) Patches for Solaris 8 and
Solaris 9 :
112760-05, C 5.5: Patch for S1S8CC C compiler
To determine whether an operating system patch is installed, enter a command
similar to the following:
# /usr/sbin/patchadd -p | grep patch_number(without version number)
Open the /etc/system file in any text editor and, if necessary, add lines similar
to the following (edit the lines if the file already contains them):
set noexec_user_stack=1
set semsys:seminfo_semmni=100
set semsys:seminfo_semmns=1024
set semsys:seminfo_semmsl=256
set semsys:seminfo_semvmx=32767
set shmsys:shminfo_shmmax=4294967295
set shmsys:shminfo_shmmin=1
set shmsys:shminfo_shmmni=100
set shmsys:shminfo_shmseg=10
To view the current values of the resource control, enter the following commands:
# id -p // to verify the project id
uid=0(root) gid=0(root) projid=1 (user.root)
# prctl -n project.max-shm-memory -i project user.root
# prctl -n project.max-sem-ids -i project user.root
If you must change any of the current values, then:
To modify the value of max-shm-memory to 6 GB:
# prctl -n project.max-shm-memory -v 6gb -r -i project user.root
To modify the value of max-sem-ids to 256:
# prctl -n project.max-sem-ids -v 256 -r -i project user.root
Verify that the new database user id�s needed in the 10g database .
Create a new ORACLE_HOME and ORACLE_BASE directories with at least 10GB of free
space.
Mount the installation media and/or change dir to the root directory of the
binaries.
Start a Xserver on your desktop.
Start runInstaller from the installation mount point on the host server.
Complete the installation which should take about an hour at the max.
Apply 10.2.0.3 patchset
Apply DST patch
Apply the most recent CPU.
Preparing to Upgrade.
Following are the bullet points for steps involved in preparing to upgrade to 10g :
1 Disable the veritas� cluster failover. Notify the VCS admin of all database
nodes
involved in this upgrade.
2 Disable the monitoring from the central monitoring server for the database.
� As DBAMON, edit tucdbap1:$ADMIN/monitor/prod/sid.tab for file system names
that have changed.
� As DBAMON, edit tucdbap1:$ADMIN/monitor/prod/host.tab for any file system
names that have changed.
� As DBAMON, edit tucdbap1:$ADMIN/monitor/prod/sharepelx.tab for any file
system names that have changed.
� As DBAMON, run tucdbap1:$ADMIN/monitor/prod/sync_tab.sh.
� As orarmanip on tucdbap1, edit the tnsnames.ora file in $TNS_ADMIN for
anything that may have changed about your listener.
� As oradbamn on tucdbap2, edit the tnsnames.ora file in $TNS_ADMIN for
anything that may have changed about your listener.
� Update System admin with new ORACLE_HOME information so that VCS cluster
failover can be tested for the upgraded database.
3 Backup the database and ORACLE_BASE.
4 Please check the following table for 32 bit to 64 bit database upgrade :
Upgrade from version Upgrade to version Patch to be applied before upgrade
9i � 32 bit 10g 64 bit Patch 5755471, Patch 5871314 and Patch
5892355
9i � 32 bit 10g 32 bit None
9i - 64 bit 10g 32 bit Patch 5755471, Patch 5871314 and Patch
5892355
9i � 64 bit 10g 64 bit None
5 Execute the Pre-upgrade steps as below - on the existing database for upgrade
:
UPGRADATION PROCEDURE USING TAB BAL
Step1
Log in to the system as the owner of the new 10gR2 ORACLE_HOME and copy the
following files from the 10gR2 ORACLE_HOME/rdbms/admin directory to a directory
outside of the Oracle home, such as the /tmp directory on your system:
ORACLE_HOME/rdbms/admin/utlu102i.sql ---------------> This section displays global
database information about the current database such as the database name, release
number, and compatibility level. A warning is displayed if the COMPATIBLE
initialization parameter needs to be adjusted before the database is upgraded to
10gR2
Miscellaneous Warnings:This section
provides warnings about specific situations that may require attention before
and/or after the upgrade.
SYSAUX Tablespace:This section displays
the minimum required size for the SYSAUX tablespace, which is required in Oracle
Database 10g. The SYSAUX tablespace must be created after the new Oracle Database
10g release is started and BEFORE the upgrade scripts are invoked.
ORACLE_HOME/rdbms/admin/utltzuv2.sql ---------------> It's drop this table
sys.sys_tzuv2_temptab and recreate it
Step2
Change to the temporary directory that you copied files to in step1
Start SQL*Plus and connect to the database instance as a user with SYSDBA
privileges. Then run and spool the utlu102i.sql file.
sqlplus '/as sysdba'
SQL> spool Database_Info.log
SQL> @utlu102i.sql
SQL> spool off
Then, check the spool file and examine the output of the upgrade information tool.
The sections which follow, describe the output of the Upgrade Information Tool
(utlu102i.sql).
NOTE: If you are upgrading from 8.1.7.4, the utlu102i.sql script will fail with an
ORA-1403 error. Please follow the workaround in Note 5640527.8 (or Note 407031.1)
to enable utlu102i.sql to run.
Example:
SQL> desc sys.sys_tzuv2_temptab
Name Null? Type
----------------------------------------- -------- ----------------------------
TABLE_OWNER VARCHAR2(30)
TABLE_NAME VARCHAR2(30)
COLUMN_NAME VARCHAR2(30)
ROWCOUNT NUMBER
SQL> select count(1) from sys.sys_tzuv2_temptab;
COUNT(1)
----------
0
SQL> @utltzuv2.sql
Table dropped.
Table created.
Query sys.sys_tzuv2_temptab Table to see if any TIMEZONE data is affected by
version 2 transition rules
PL/SQL procedure successfully completed.
Commit complete.
SQL> desc sys.sys_tzuv2_temptab
Name Null? Type
----------------------------------------- -------- ----------------------------
TABLE_OWNER VARCHAR2(30)
TABLE_NAME VARCHAR2(30)
COLUMN_NAME VARCHAR2(30)
ROWCOUNT NUMBER
NESTED_TAB VARCHAR2(3)
SQL> select count(1) from sys.sys_tzuv2_temptab;
COUNT(1)
----------
0
Step3
Check for the deprecated CONNECT Role
After upgrading to 10gR2, the CONNECT role will only have the CREATE SESSION
privilege; the other privileges granted to the CONNECT role in earlier releases
will be revoked during the upgrade. To identify which users and roles in your
database are granted the CONNECT role, use the following query:
SELECT grantee FROM dba_role_privs WHERE granted_role = 'CONNECT' and
grantee NOT IN ('SYS', 'OUTLN', 'SYSTEM', 'CTXSYS',
'DBSNMP','LOGSTDBY_ADMINISTRATOR', 'ORDSYS','ORDPLUGINS', 'OEM_MONITOR', 'WKSYS',
'WKPROXY',
'WK_TEST', 'WKUSER', 'MDSYS', 'LBACSYS', 'DMSYS','WMSYS', 'OLAPDBA', 'OLAPSVR',
'OLAP_USER','OLAPSYS', 'EXFSYS', 'SYSMAN', 'MDDATA','SI_INFORMTN_SCHEMA', 'XDB',
'ODM');
If users or roles require privileges other than CREATE SESSION, then grant the
specific required privileges prior to upgrading. The upgrade scripts adjust the
privileges for the Oracle-supplied users.
SELECT GRANTEE,PRIVILEGE FROM DBA_SYS_PRIVS WHERE GRANTEE='CONNECT';
GRANTEE PRIVILEGE
------------------------------ ---------------------------
CONNECT CREATE VIEW
CONNECT CREATE TABLE
CONNECT ALTER SESSION
CONNECT CREATE CLUSTER
CONNECT CREATE SESSION
CONNECT CREATE SYNONYM
CONNECT CREATE SEQUENCE
CONNECT CREATE DATABASE LINK
In Oracle 10.2 the CONNECT role only includes CREATE SESSION privilege.
Step 4:
Taking the backup of the dblinks but we are not creating the dblinks after
upgradation to 10gR2
Create the script for dblink incase of downgrade of the database.
During the upgrade to 10gR2, any passwords in database links will be encrypted. To
downgrade back to the original release, all of the database links with encrypted
passwords must be dropped prior to the downgrade. Consequently, the database links
will not exist in the downgraded database. If you anticipate a requirement to be
able to downgrade back to your original release, then save the information about
affected database links from the SYS.LINK$ table, so that you can recreate the
database links after the downgrade.
Following script can be used to construct the dblink.
SELECT
'create '||DECODE(U.NAME,'PUBLIC','public ')||'database link '||CHR(10)
||DECODE(U.NAME,'PUBLIC',Null, U.NAME||'.')|| L.NAME||chr(10)
||'connect to ' || L.USERID || ' identified by '''
||L.PASSWORD||''' using ''' || L.host || ''''
||chr(10)||';' TEXT
FROM sys.link$ L,
sys.user$ U
WHERE L.OWNER# = U.USER# ;
You can skip Step5
Step 6: You can skip this Step6
Starting in Oracle 9i the National Characterset (NLS_NCHAR_CHARACTERSET) will be
limited to UTF8 and AL16UTF16.
Any other NLS_NCHAR_CHARACTERSET will no longer be supported.
NOTE: If you are upgrading from Oracle9i to 10g, skip to step 7.
Step 7:
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.
$ sqlplus '/as sysdba'
SQL> EXEC DBMS_STATS.GATHER_SCHEMA_STATS
Backup the existing statistics as follows:
Using this query what shcemas are available in your database you can execute that
schema statistics
SQL> select username from dba_users where username like '%SYS%';
SQL> select username from dba_users where username in
('XDB','ODM','ORDPLUGINS','SI_INFORMTN_SCHEMA','OUTLN','DBSNMP');
SQL>spool sdict
SQL>grant analyze any to sys;
SQL>exec dbms_stats.create_stat_table('SYS','dictstattab');
SQL>exec dbms_stats.export_schema_stats('WMSYS','dictstattab',statown => 'SYS');
SQL>exec dbms_stats.export_schema_stats('MDSYS','dictstattab',statown => 'SYS');
SQL>exec dbms_stats.export_schema_stats('CTXSYS','dictstattab',statown => 'SYS');
SQL>exec dbms_stats.export_schema_stats('XDB','dictstattab',statown => 'SYS');
SQL>exec dbms_stats.export_schema_stats('WKSYS','dictstattab',statown => 'SYS');
SQL>exec dbms_stats.export_schema_stats('LBACSYS','dictstattab',statown => 'SYS');
SQL>exec dbms_stats.export_schema_stats('OLAPSYS','dictstattab',statown => 'SYS');
SQL>exec dbms_stats.export_schema_stats('DMSYS','dictstattab',statown => 'SYS');
SQL>exec dbms_stats.export_schema_stats('ODM','dictstattab',statown => 'SYS');
SQL>exec dbms_stats.export_schema_stats('ORDSYS','dictstattab',statown => 'SYS');
SQL>exec dbms_stats.export_schema_stats('ORDPLUGINS','dictstattab',statown =>
'SYS');
SQL>exec dbms_stats.export_schema_stats('SI_INFORMTN_SCHEMA','dictstattab',statown
=> 'SYS');
SQL>exec dbms_stats.export_schema_stats('OUTLN','dictstattab',statown => 'SYS');
SQL>exec dbms_stats.export_schema_stats('DBSNMP','dictstattab',statown => 'SYS');
SQL>exec dbms_stats.export_schema_stats('SYSTEM','dictstattab',statown => 'SYS');
SQL>exec dbms_stats.export_schema_stats('SYS','dictstattab',statown => 'SYS');
SQL>spool off
To gather statistics run this script, connect to the database AS SYSDBA using
SQL*Plus.
SQL>spool gdict
SQL>grant analyze any to sys;
SQL>exec dbms_stats.gather_schema_stats('WMSYS',options=>'GATHER',estimate_percent
=> DBMS_STATS.AUTO_SAMPLE_SIZE, method_opt => 'FOR ALL COLUMNS SIZE AUTO', cascade
=> TRUE);
SQL>exec dbms_stats.gather_schema_stats('MDSYS',options=>'GATHER',estimate_percent
=> DBMS_STATS.AUTO_SAMPLE_SIZE, method_opt => 'FOR ALL COLUMNS SIZE AUTO', cascade
=> TRUE);
SQL>exec dbms_stats.gather_schema_stats('CTXSYS',options=>'GATHER',estimate_percent
=> DBMS_STATS.AUTO_SAMPLE_SIZE, method_opt => 'FOR ALL COLUMNS SIZE AUTO', cascade
=> TRUE);
SQL>exec dbms_stats.gather_schema_stats('XDB',options=>'GATHER',estimate_percent =>
DBMS_STATS.AUTO_SAMPLE_SIZE, method_opt => 'FOR ALL COLUMNS SIZE AUTO', cascade =>
TRUE);
SQL>exec dbms_stats.gather_schema_stats('WKSYS',options=>'GATHER',estimate_percent
=> DBMS_STATS.AUTO_SAMPLE_SIZE, method_opt => 'FOR ALL COLUMNS SIZE AUTO', cascade
=> TRUE);
SQL>exec
dbms_stats.gather_schema_stats('LBACSYS',options=>'GATHER',estimate_percent =>
DBMS_STATS.AUTO_SAMPLE_SIZE, method_opt => 'FOR ALL COLUMNS SIZE AUTO', cascade =>
TRUE);
SQL>exec
dbms_stats.gather_schema_stats('OLAPSYS',options=>'GATHER',estimate_percent =>
DBMS_STATS.AUTO_SAMPLE_SIZE, method_opt => 'FOR ALL COLUMNS SIZE AUTO', cascade =>
TRUE);
SQL>exec dbms_stats.gather_schema_stats('DMSYS',options=>'GATHER',estimate_percent
=> DBMS_STATS.AUTO_SAMPLE_SIZE, method_opt => 'FOR ALL COLUMNS SIZE AUTO', cascade
=> TRUE);
SQL>exec dbms_stats.gather_schema_stats('ODM',options=>'GATHER',estimate_percent =>
DBMS_STATS.AUTO_SAMPLE_SIZE, method_opt => 'FOR ALL COLUMNS SIZE AUTO', cascade =>
TRUE);
SQL>exec dbms_stats.gather_schema_stats('ORDSYS',options=>'GATHER',estimate_percent
=> DBMS_STATS.AUTO_SAMPLE_SIZE, method_opt => 'FOR ALL COLUMNS SIZE AUTO', cascade
=> TRUE);
SQL>exec
dbms_stats.gather_schema_stats('ORDPLUGINS',options=>'GATHER',estimate_percent =>
DBMS_STATS.AUTO_SAMPLE_SIZE, method_opt => 'FOR ALL COLUMNS SIZE AUTO', cascade =>
TRUE);
SQL>exec
dbms_stats.gather_schema_stats('SI_INFORMTN_SCHEMA',options=>'GATHER',estimate_perc
ent => DBMS_STATS.AUTO_SAMPLE_SIZE, method_opt => 'FOR ALL COLUMNS SIZE AUTO',
cascade => TRUE);
SQL>exec dbms_stats.gather_schema_stats('OUTLN',options=>'GATHER',estimate_percent
=> DBMS_STATS.AUTO_SAMPLE_SIZE, method_opt => 'FOR ALL COLUMNS SIZE AUTO', cascade
=> TRUE);
SQL>exec dbms_stats.gather_schema_stats('DBSNMP',options=>'GATHER',estimate_percent
=> DBMS_STATS.AUTO_SAMPLE_SIZE, method_opt => 'FOR ALL COLUMNS SIZE AUTO', cascade
=> TRUE);
SQL>exec dbms_stats.gather_schema_stats('SYSTEM',options=>'GATHER',estimate_percent
=> DBMS_STATS.AUTO_SAMPLE_SIZE, method_opt => 'FOR ALL COLUMNS SIZE AUTO', cascade
=> TRUE);
SQL>exec dbms_stats.gather_schema_stats('SYS',options=>'GATHER',estimate_percent =>
DBMS_STATS.AUTO_SAMPLE_SIZE, method_opt => 'FOR ALL COLUMNS SIZE AUTO', cascade =>
TRUE);
SQL>spool off
Step 8:
Check for invalid objects in the database:
SQL> select count(1) from dba_objects where status='INVALID';
SQL> spool invalid_pre.log
SQL> select owner, object_name, subobject_name, object_type from dba_objects where
status='INVALID';
Run the following script as a user with SYSDBA privs using SQL*Plus and then
requery invalid objects:
% sqlplus '/as sysdba'
SQL> @?/rdbms/admin/utlrp.sql
SQL> select owner, object_name, subobject_name, object_type from dba_objects where
status='INVALID';
SQL> select COMP_ID,COMP_NAME,VERSION,STATUS,MODIFIED from dba_registry;
select COMP_ID,COMP_NAME,VERSION,STATUS from dba_registry;
COMP_ID COMP_NAME
VERSION STATUS MODIFIED
------------------------------ --------------------------------------------------
---------- ---------- ----------------------
CATALOG Oracle9i Catalog Views
9.2.0.4.0 VALID 31-MAR-2007 11:09:35
CATPROC Oracle9i Packages and Types
9.2.0.4.0 VALID 31-MAR-2007 11:09:35
RAC Oracle9i Real Application Clusters
9.2.0.4.0 INVALID 31-MAR-2007 11:09:35
ORDIM Oracle interMedia
9.2.0.4.0 VALID 19-MAR-2004 20:08:41
SDO Spatial
9.2.0.4.0 LOADED 19-MAR-2004 20:09:46
If this dba_registry view is empty, run the following scripts from the 9.2 home &
If you receive the output you skip these scripts execution
% sqlplus '/as sysdba'
SQL> @?/rdbms/admin/catalog.sql
SQL> @?/rdbms/admin/catproc.sql
SQL> @?/rdbms/admin/utlrp.sql
Verify that the dba_registry view now contains data.
Step 9:
Check for corruption in the dictionary, use the following commands in sqlplus
connected as sys:
Set verify off
Set space 0
Set line 120
Set heading off
Set feedback off
Set pages 1000
Spool analyze.sql
Select 'Analyze cluster "'||cluster_name||'" validate structure cascade;'
from dba_clusters where owner='SYS'
union
Select 'Analyze table "'||table_name||'" validate structure cascade;'
from dba_tables
where owner='SYS' and partitioned='NO' and (iot_type='IOT' or iot_type is NULL)
union
Select 'Analyze table "'||table_name||'" validate structure cascade into
invalid_rows;'
from dba_tables where owner='SYS' and partitioned='YES';
spool off
This creates a script called analyze.sql.
Now execute the following steps.
$ sqlplus '/as sysdba'
SQL> @$ORACLE_HOME/rdbms/admin/utlvalid.sql
SQL> @analyze.sql
This script (analyze.sql) should not return any errors.
Step 10:
If your database is having the snapshot refreshes you can do this step
Ensure that all Snapshot refreshes are successfully completed, and that replication
is stopped.
$ sqlplus '/ as sysdba'
SQL> select distinct(trunc(last_refresh)) from dba_snapshot_refresh_times;
Step 11:
Verifyt the listener location in your database
echo $TNS_ADMIN
Stop the listener of your database:
$ lsnrctl stop <listener_name>
Ensure no files need media recovery:
$ sqlplus '/ as sysdba'
SQL> select * from v$recover_file;
This should return no rows.
Step 12:
Ensure no files are in backup mode:
SQL> select distinct status from v$backup;
This should return NOT ACTIVE
Step 13:
Resolve any outstanding unresolved distributed transaction:
SQL> select * from dba_2pc_pending;
If this returns rows you should do the following:
SQL> select local_tran_id from dba_2pc_pending;
SQL> execute dbms_transaction.purge_lost_db_entry('');
SQL> commit;
Step 14:
Disable all batch and cron jobs.
Step 15:
Ensure the users sys and system have 'system' as their default tablespace.
SQL> select username, default_tablespace from dba_users where username in
('SYS','SYSTEM');
This should return SYSTEM default tablespace.
If you are not receiving the default tablespace SYSTEM then you perform these steps
SQL> alter user sys default tablespace SYSTEM;
SQL> alter user system default tablespace SYSTEM;
Step 16:
Ensure that the aud$ is in the system tablespace when auditing is enabled.
SQL> select tablespace_name from dba_tables where table_name='AUD$';
This should return SYSTEM
If you are not receiving the SYSTEM then you can execute this command
SQL> alter table AUD$ move tablespace system;
SQL> select tablespace_name from dba_tables where table_name='AUD$';
TABLESPACE_NAME
------------------------------
SYSTEM
Step 17:
Note down where all control files are located.
SQL> select * from v$controlfile;
Step 18:
If table XDB.MIGR9202STATUS exists in the database, drop it before upgrading the
database (to avoid the issue described in Note 356082.1);
Make sure you could receive this output
SQL> desc XDB.MIGR9202STATUS
ERROR:
ORA-04043: object XDB.MIGR9202STATUS does not
exist
Taking the database information
spool db_details.lst
select name from v$database;
select * from global_name;
select * from dba_db_links;
select name from v$controlfile;
select member from v$logfile;
select file_name from dba_data_files;
select file_name from dba_temp_files;
spool off
spool alter_user.sql
select ' alter user '||username||' identified by values xxxxx'||password|| 'xxxxx;'
from dba_users;
spool off
Set verify off
Set space 0
set feedback off;
set echo off;
set pages 1000;
set lines 150;
spool create_synonym.sql
Select 'CREATE SYNONYM '||owner||'.'||synonym_name||' FOR '||table_owner||'.'||
table_name||'@'||db_link||';' from dba_synonyms where db_link
is not null and table_owner is not null;
Select 'CREATE SYNONYM '||owner||'.'||synonym_name||' FOR '||table_name||'@'||
db_link||';' from dba_synonyms where db_link is not null and
table_owner is null;
spool off;
Verifying the system tablespace free space require 1000mb
VCAPQ> select sum(bytes/1024/1024) from dba_free_space where
tablespace_name='SYSTEM';
SQL> sho parameter cluster
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
cluster_database boolean FALSE
cluster_database_instances integer 1
cluster_interconnects string
SQL>
Step 19:
Verify the ODM is available in this oracle home using this link in your database
cd $ORACLE_HOME/lib
ls -ltr libodm10.so ------------> If it displays the link that means odm is
available or you can find it odm is available verifying this alert log file
Open a new session copy the tar appsoh_db10203_Solaris_64bit_sa.tar.gz where you
oracle base
1. Modify /var/opt/oracle/oraInst.loc with following:
inst_group=dba
inventory_loc=/<ORACLE_BASE>/db10203/oraInventory
Update the oratab entry, to add the new ORACLE_HOME and disable automatic
startup of old & new:
SID:ORACLE_HOME:N
2. untar this to $ORACLE_BASE (will create db10203 directory)
tar zxvfp appsoh_db10203_Solaris_64bit.tar.gz
If you run into any issue with tar zxvfp command, you can first do gunzip, than
tar xvf
3. setup .profile per standard doc for oracle user, then source your profile, check
if the new $ORACLE_HOME/bin in the PATH and LD_LIBRARY_PATH is set
4. Enable ODM is very easy task if the current database is already ODM enabled.
After you untar your 10g binary, please do the following
Go to 10g Oracle_home/lib
rm libodm10.so (which was a link to libodmd10.so )
recreate that same link libodm10.so , pointing to the file
/opt/VRTSodm/lib/sparcv9/libodm.so (this is same as where your binary locates for
ODM)
Then you can run the clone.pl and rest of steps.
5. If you Oracle base file system is /apps/oh, please skip this step, go to step 5
directly,
if your oracle home file system is different than /apps/oh, please do the
following
cd $ORACLE_HOME/clone/bin
perl clone.pl ORACLE_HOME =/<ORACLE_BASE>/db10203
ORACLE_HOME_NAME="OraDb_home1"
6. edit root.sh to make sure ORACLE_HOME and ORACLE_OWNER for your database.
then ask sa to run root.sh.
Come the old session what you are doing the presteps that session before export
oracle_home
Disable the cronjobs
Shutdown the database
$ sqlplus '/as sysdba'
SQL> select count(1) from dba_objects where status='INVALID';
SQL> @?/rdbms/admin/utlrp.sql
SQL> select * from v$recover_file;
SQL> select distinct status from v$backup;
SQL> shutdown immediate;
Now open new session and do these steps
Step 20 :
Check for adequate freespace on archive log destination file systems.
Step 21 :
Ensure the NLS_LANG variable is set correctly:
$ env | grep $NLS_LANG
Step 22:
Copy the SQL*Net files like (listener.ora,tnsnames.ora etc) to the new location
(when no TNS_ADMIN env. Parameter is used)
Example
$cp $OLD_ORACLE_HOME/network/admin/*.ora /network/admin ----------- modify your
new_oracle_home location in these files
$cp $OLD_ORACLE_HOME/dbs/init.ora $NEW_ORACLE_HOME/dbs/
cd $NEW_ORACLE_HOME/dbs/
Modifying the parameters in init.ora file
JAVA_POOL_SIZE=150m
SHARED_POOL_SIZE=150m
LARGE_POOL_SIZE=150m
AQ_TM_PROCESSES=0
JOB_QUEUE_PROCESSES=0
UNDO_MANAGEMENT=AUTO
If you are using a cluster database, set the parameter CLUSTER_DATABASE=FALSE
during the upgrade.
Step 23:
Startup upgrade the database:
$ cd $ORACLE_HOME/rdbms/admin
$ sqlplus / as sysdba
Use Startup with the UPGRADE option:
SQL> startup upgrade
Step 24:
Create a SYSAUX tablespace. In Oracle Database 10g, the SYSAUX tablespace is used
to consolidate data from a number of tablespaces that were separate in previous
releases.
SQL> CREATE TABLESPACE sysaux DATAFILE 'sysaux01.dbf'
SIZE 500M REUSE
EXTENT MANAGEMENT LOCAL
SEGMENT SPACE MANAGEMENT AUTO
ONLINE;
Step 25:
SQL> spool upgrade.log
SQL> @catupgrd.sql
SQL> SPOOL OFF
Step 26:
Run utlu102s.sql, specifying the TEXT option:
SQL> @utlu102s.sql TEXT
This is the Post-upgrade Status Tool displays the status of the database
components in the upgraded database. 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
Step 27:
Run utlrp.sql to recompile any remaining stored PL/SQL and Java code.
SQL> shut immediate
When you start your db using 10g , please check the alert.log and see there is any
entry like
Oracle instance running with ODM: VERITAS x.x ODM Library, Version x.x
SQL> startup
SQL> select count(1) from dba_objects where status='INVALID';
SQL> @?/rdbms/admin/utlrp.sql
SQL> select count(1) from dba_objects where status='INVALID';
SQL>exit
verify existence of:
$cd $ORACLE_HOME/lib
ls -ltr libobk.so -> /usr/openv/netbackup/bin/libobk.so64
If you are upgrading database, please run any db upgrade scripts against your db
and complete the Apr 2008 CPU patch db part of scripts.
If you are created a new database, you can use starter db , please check
create_startdb.readme
Now verify all patches are applied or not using opatch lsinventory if cpu patch is
applied execute this .sql script
cd $ORACLE_HOME/cpu/CPUapril2008
SQL> @catcpu.sql
STARTING THE LISTENER
lsnrctl start <listenername>
Enable cron and batch jobs
Change oratab entry to use automatic startup
SID:ORACLE_HOME:Y
You can refer this metalink noteid's are 316889.1 & 359483.1 (if you are upgrading
from 8i to 10g any cluster)
Enable the cronjobs & Inform to any other related applications this database
Business Objects, Eai interfaces & Unfreeze the cluster