Sunday, December 7, 2008

Auditing ddl on a database + DDL trigger

Conn / as sysdba

15:53:53 SQL > CREATE TABLE perfstat.STATS$DDL_LOG
15:55:30 2 (
15:55:30 3 USER_NAME VARCHAR2(25 BYTE),
15:55:30 4 DDL_DATE DATE,
15:55:30 5 DDL_TYPE VARCHAR2(25 BYTE),
15:55:30 6 OBJECT_TYPE VARCHAR2(25 BYTE),
15:55:30 7 OWNER VARCHAR2(25 BYTE),
15:55:30 8 OBJECT_NAME VARCHAR2(30 BYTE),
15:55:30 9 TERMINAL_NAME VARCHAR2(40 BYTE),
15:55:30 10 IP_ADDRESS VARCHAR2(30 BYTE)
15:55:30 11 );

Table created.

15:55:32 SQL > grant all on perfstat.STATS$DDL_LOG to apps;

Grant succeeded.

15:55:38 SQL > conn apps
Enter password:
Connected.
15:55:45 SQL > create synonym DDL_LOG for perfstat.STATS$DDL_LOG;

Synonym created.

15:55:53 SQL > conn / as sysdba
Connected.
15:55:57 SQL > CREATE OR REPLACE TRIGGER DDLTrigger
15:56:21 2 AFTER DDL ON DATABASE
15:56:21 3 DECLARE
15:56:21 4 v_terminal_name varchar2(40);
15:56:21 5 v_ip_address varchar2(40);
15:56:21 6 BEGIN
15:56:21 7 SELECT SYS_CONTEXT ('USERENV', 'TERMINAL')
15:56:21 8 INTO v_terminal_name
15:56:21 9 FROM DUAL;
15:56:21 10 SELECT SYS_CONTEXT ('USERENV', 'IP_ADDRESS')
15:56:21 11 INTO v_ip_address
15:56:21 12 FROM DUAL;
15:56:21 13 insert into
15:56:21 14 perfstat.stats$ddl_log
15:56:21 15 (
15:56:21 16 user_name,
15:56:21 17 ddl_date,
15:56:21 18 ddl_type,
15:56:21 19 object_type,
15:56:21 20 owner,
15:56:21 21 object_name,
15:56:21 22 terminal_name ,
15:56:21 23 ip_address
15:56:21 24 )
15:56:21 25 VALUES
15:56:21 26 (
15:56:21 27 ora_login_user,
15:56:21 28 sysdate,
15:56:21 29 ora_sysevent,
15:56:21 30 ora_dict_obj_type,
15:56:21 31 ora_dict_obj_owner,
15:56:21 32 ora_dict_obj_name,
15:56:21 33 v_terminal_name,
15:56:21 34 v_ip_address
15:56:21 35 );
15:56:21 36
15:56:21 37 END;
15:56:22 38 /

Trigger created.


16:01:36 SQL > conn apps
Enter password:
Connected.

16:02:36 SQL > select * from DDL_LOG;

USER_NAME DDL_DATE DDL_TYPE OBJECT_TYPE OWNER OBJECT_NAME TERMINAL_NAME IP_ADDRESS
---------- --------- ---------- --------------- -------- -------------------- -------------------- ----------------
APPS 16-JUN-08 CREATE TABLE APPS MOHIT LGDBA 10.102.120.118
APPS 16-JUN-08 DROP TABLE APPS MOHIT LGDBA 10.102.120.118

=======================================================================================================================

Monday, September 15, 2008

ORA-27211: Failed to load Media Management Library


RMAN-00571: ===========================================================

RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============

RMAN-00571: ===========================================================

RMAN-03009: failure of allocate command on t1 channel at 02/03/2008 19:31:04

ORA-19554: error allocating device, device type: SBT_TAPE, device name:

ORA-27211: Failed to load Media Management Library

Additional information: 2

Solution :

Step 1 :

Check the trace file for more information in udump .

-------------------------------------------------------------------------------------------

/ms10/oracle/9.2.0/admin/lgeil/udump/lgeil_ora_4026994.trc

Oracle9i Enterprise Edition Release 9.2.0.8.0 - 64bit Production

With the Partitioning, OLAP and Oracle Data Mining options

JServer Release 9.2.0.8.0 - Production

ORACLE_HOME = /ms10/oracle/9.2.0

System name: AIX

Node name: ilomsdb01

Release: 3

Version: 5

Machine: 00C0657C4C00

Instance name: lgeil

Redo thread mounted by this instance: 1

Oracle process number: 20

Unix process pid: 4026994, image: oracle@ilomsdb01 (TNS V1-V3)

*** SESSION ID:(19.1) 2008-02-03 19:31:04.091

Failed to load SBT library libobk.a(shr.o)

--------------------------------------------------------------------------------------------

libobk.a -> /usr/lib/libobk64.a

-------------------------------------------------------------------------------------------------------------------------

Solution :

Step 1 :

Now go to the locaiton $ORACLE_HOME/lib and check for the file libobk.a . If you won't find this file then contact your OS support team or Backup Team

Step 2 : ( To be peroformed by the unix team )

Now , Go to the location /usr/openv/netbackup/bin and chk for the file libobk.a64 . If this file exist , then run the command given below ( from root as user )

1. ln -s /usr/openv/netbackup/bin/libobk.a64 /usr/lib/libobk64.a

2. ln -s /usr/lib/libobk64.a <$ORACLE_HOME>/lib/libobk.a

ex :

ln -s /usr/lib/libobk64.a /ms10/oracle/9.2.0/lib/libobk.a

Note : In 99% case this will work . If it work for you , Then thats fine .Even after this if you get the error mentioned below .

----------------------------------------------------------------------------------------------------------------

RMAN-03009: failure of backup command on t1 channel at 09/11/2008 19:51:26

ORA-19506: failed to create sequential file, name="al_ORANMES_02jqbjl6_1_1_665177766", parms=""

ORA-27028: skgfqcre: sbtbackup returned error

ORA-19511: Error received from media manager layer, error text:

VxBSACreateObject: Failed with error:

Server Status: Communication with the server has not been iniatated or the server status has not been retrieved from the server.

channel t1 disabled, job failed on it will be run on another channel

released channel: t1

released channel: t2

RMAN-00571: ===========================================================

RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============

RMAN-00571: ===========================================================

RMAN-03009: failure of backup command on t2 channel at 09/11/2008 19:51:26

ORA-19506: failed to create sequential file, name="al_ORANMES_03jqbjl7_1_1_665177767", parms=""

ORA-27028: skgfqcre: sbtbackup returned error

ORA-19511: Error received from media manager layer, error text:

VxBSACreateObject: Failed with error:

Server Status: Communication with the server has not been iniatated or the server status has not been retrieved from the server.

---------------------------------------------------------------------------------------------------------------

Solution :

Then ask the UNIX ADMIN

--> To take the reboot of VERITAS Services .

--> Also to kill all the process related with VERITAS on the client side

Monday, August 11, 2008




ORA - 28040 : No matching authentication protocol









Cause

The parameter DB_ALLOWED_LOGON_VERSION has not been set in the remote database.
DB_ALLOWED_LOGON_VERSION is a new parameter introduced in 10g that allows the DBA to explicitly determine which authentication protocols are allowed by the client or database.
The value specified is the earliest client version level supported by this database.
When clients earlier than the specified version attempt to connect, authentication will fail.


Solution

In the init.ora of the remote (Downstream capture) database, set the following : db_allowed_logon_version=10
Note: Bug 2981553, which is implemented in 10.1.0.2, removes the parameter db_allowed_logon_version. This is replaced by the sqlnet.ora parameter called sqlnet_allowed_logon_version.


SQLNET_ALLOWED_LOGON_VERSIONS

Purpose
Use the parameter SQLNET_ALLOWED_LOGON_VERSIONS to specify whichauthentication protocols are allowed
by the client or database. If the client and database server do not have at least one matching version, then
authentication fails with an error.

Allowed Values

10 for Oracle Database 10g authentication protocols

Note: Additional protocols might support this parameter on certain operating systems. Refer to operating-system specific
documentation for information about additional protocols that support this parameter.

See Also: Oracle Database Net Services Administrator's Guide for information about configuring this parameter

See Also: Oracle Database Advanced Security Administrator's Guide

Profile Parameters
Profile Parameters (sqlnet.ora) 5-7

9 for Oracle9i authentication protocols
8 for Oracle8 authentication protocols
7.3 for Oracle 7.3 authentication protocols

Any value other than 10 could expose vulnerabilities that may have existed in previous version of the authentication protocols. For complete compatibility, set the list of allowable versions for logon to include all versions of database in the system.

Default

10, 9, 8

Example

If both Oracle 8.1.7 and Oracle9i databases are present, then set the parameter as follows:

SQLNET_ALLOWED_LOGON_VERSIONS=(10,9,8)

ORA-00600: internal error code, arguments: [unable to load XDB library]

Error :

--------------------------------------------------------------------------------
ORA-00600: internal error code, arguments: [unable to load XDB library], [], [], [], [], [], [], []
Wed Aug 6 17:45:55 2008
Errors in file /u06/oradata/admin/ilpnp/bdump/ilpnp_s000_73754.trc:
ORA-00600: internal error code, arguments: [ksudel1], [], [], [], [], [], [], []
ORA-00600: internal error code, arguments: [unable to load XDB library], [], [], [], [], [], [], []



[plantopiadb:orapnp] /u06/oradata/admin/ilpnp/bdump> more ilpnp_s000_62274.trc
/u06/oradata/admin/ilpnp/bdump/ilpnp_s000_62274.trc
Oracle9i Enterprise Edition Release 9.2.0.7.0 - 64bit Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.7.0 - Production
ORACLE_HOME = /u01/app/orapnp
System name: AIX
Node name: plantopiadb
Release: 3
Version: 5
Machine: 00C96E2E4C00
Instance name: ilpnp
Redo thread mounted by this instance: 1
Oracle process number: 11
Unix process pid: 62274, image: oracle@plantopiadb (S000)

*** 2008-08-06 17:45:54.338
*** SESSION ID:(21.29949) 2008-08-06 17:45:54.337
Dynamic link error: 0509-022 Cannot load module /u01/app/orapnp/lib32/libxdb.so.
0509-103 The module has an invalid magic number.
*** 2008-08-06 17:45:54.338
ksedmp: internal or fatal error
ORA-00600: internal error code, arguments: [unable to load XDB library], [], [], [], [], [], [], []

--------------------------------------------------------------------------------

Cause

These errors may be the result if the database was started and the environment variable LD_LIBRARY_PATH was not set, or was set to an incorrect version of $ORACLE_HOME/lib (e.g. to a different $ORACLE_HOME). If during the user level or full database export we are unable to locate the correct version of the libxdb.so / libxdb.sl library, the internal errors may occur.


Solution :

1. Stop the database and stop the listener.

2. Set LD_LIBRARY_PATH so the first directory referenced is $ORACLE_HOME/lib
Example (replace $ORACLE_HOME with the full path of the Oracle home directory):

> export LD_LIBRARY_PATH=$ORACLE_HOME/lib
> export LIBPATH=$ORACLE_HOME/lib

For Oracle9i and Oracle10g on AIX: set environment variable LIBPATH and afterwards, run /usr/sbin/slibclean as root
For Oracle9i and Oracle10g on HP-UX, Linux, Solaris, and Tru64: set environment variable LD_LIBRARY_PATH

3. Re-start the database and the listener.


Tuesday, July 29, 2008

Host Name / I.P Change for the AP node ( Apache / Form Node ) in 11i

Pre-Information

1. ILTEST Architecture (EBS: 11.5.10 ; O.S : AIX 5.3 )




Activity is to change the change the hostname from iltestap (192.168.20.137) to LGEILMESD02N (10.101.0.62).Before the activity stop all the services on Form and Concurrent Node, by running adstpall.sh
on 192.168.20.137 and 192.168.20.133. Also stop the database and listener.

UNIX Team Activity: Change the I.P / hostname of iltestap (192.168.20.137)

When the I.P./Hostname changed. Then up the database and listener only .

Login the Form Node (10.101.0.62) and follow the steps mentioned below.

Step 1 : Add the new host entry in the /etc/hosts file

$ cd /etc
$ vi hosts

Add the entry mentioned below

10.102.0.62 LGEILMESD02N.lgeil.com LGEILMESD02N

Step 2: Now change the host name in the .xml file .

$ cd $APPL_TOP/admin
$ cp ILTEST_iltestap.xml ILTEST_LGEILMESD02N.xml
$ vi ILTEST_LGEILMESD02N.xml

And here change the “iltestap” to “LGEILMESD02N” globally

Step 3: Run the autoconfig.

$ cd $AD_TOP/bin
$ adconfig.sh contextfile=$APPL_TOP/admin/ ILTEST_LGEILMESD02N.xml
Enter the password of apps : apps ( OR apps password of your apps )

Step 4: After the autoconfig completed successfully. Then, make custom.env file

Note: Autoconfig never makes the custom.env file. This file Need to be created manually.

$ cd $APPL_TOP
$ ls –ltr customILTEST_iltestap.env

-rw-r--r-- 1 oracle dba 126369792 Jul 4 17:36 customILTEST_iltestap.env
$ cp customILTEST_iltestap.env customILTEST_LGEILMESD02N.env

Step 5: Edit $APPL_TOP/ILTEST_LGEILMESD02N.env

$ cd $APPL_TOP
$ ls –ltr ILTEST_LGEILMESD02N.env

Vi this file (ILTEST_LGEILMESD02N.env) and edit

Find "FORMS60_PATH" and add lines

FORMS60_PATH=$FORMS60_PATH:$CUSTOM_TOP/resource:$CUSTOM_TOP/forms/US:$EAU_TOP/forms/US
export FORMS60_PATH

Below the following line

FORMS60_PATH="/u02/app/ilprodappl/au/11.5.0/resource:/u01/app/ilprodappl/au/11.5.0/resource/stub"export FORMS60_PATH

Step 6
: Now, up the services on Form Node and Concurrent Node

Run adstrtal.sh on both Form and Concurrent Node and up the services. After try to open the EBS through the new url i.e.; http:.: .

New Setting :

Host File Entry
10.101.0.62 lgeilmesd02n lgeilmesd02n.lgeil.com

Proxy Settings
*lgeilmesd02n*;*lgeilmesd02n.lgeil.com*

Url
http://lgeilmesd02n.lgeil.com:8001
http://lgeilmesd02n.lgeil.com:8001/dev60cgi/f60cgi

Note: If this didn’t wok for you and you EBS shoes some error while opening the form launcher. Then stop the all on AP and DB node by running adstpall.sh (Don’t down the database & listener ) . After this change the iltestap to LGEILMESD02N in the .xml of Concurrent Node and then run the autoconfig firstly on Concurrent Node and after that on Form Node.


Wednesday, July 23, 2008

11g : Password can be make case sensitive

Scenario,

A database link ILMIS_FND was created on ILPROD database (oracle 9i) to access tables in ERPDBA database (11g R1) using the
connect string FNDDATA,

Link was created successfully but when
select count(*) from tab@ILMIS_FND ;
errored out with message -- Invalid username or Password.

1.tnsping FNDDATA (connect string ) found to be OK.
2.sqlplus fnd_data/****@FNDDATA too found to be ok.


Workaround
--------------------
In 11g version of Oracle Database password can be made case sensitive.
The following init parameter is to be set accordingly.

sec_case_sensitive_logon == (TRUE | FALSE)

On ERPDBA database (which is on 11g R1) the above parameter found tobe set TRUE

05:44:52 erpdb > show parameter sec_case_sensitive_logon

NAME TYPE VALUE
------------------------------------ ----------- ------------
sec_case_sensitive_logon boolean TRUE


The above parametre set to be FALSE then....

05:45:45 erpdb > alter system set sec_case_sensitive_logon=FALSE scope=BOTH;

System altered.

05:46:01 erpdb > show parameter sec_case_sensitive_logon

NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
sec_case_sensitive_logon boolean FALSE


Now login was successfull using the db link ILMIS_FND.


one more Feature.......

while creating the password file using orapwd utility do the following
to make password case insensitive ..

orapwd file=orclpwd password=manager ignorecase=y

ORA-14071: invalid option for an index used to enforce a constraint

Hi ,

While enforcing the constraints for an index . "ORA-14071" error comes out as mentioned below ..

alter table esvc.ESVC_LGEIL_ITEM_AGEING
add constraint PK_ESVC_LGEIL_ITEM_AGEING primary key (INVENTORY_ITEM_ID, YYYYMM)
using index
tablespace ESVCD
pctfree 10
pctused 40
initrans 75
maxtrans 255
storage
(
initial 1M
next 1M
minextents 1
maxextents unlimited
pctincrease 0
);
ERROR at line 6:
ORA-14071: invalid option for an index used to enforce a constraint


This eror is because the user has used "PCTUSED" in the above command and only
options COMPRESS, NOCOMPRESS, PCTFREE, INITRANS,MAXTRANS, STORAGE, TABLESPACE, PARALLEL, NOPARALLEL, RECOVERABLE,
UNRECOVERABLE, LOGGING, NOLOGGING, LOCAL, or GLOBAL are allowed with index used to enforce a constraint .

Since the user was using the "pctused 40" . Thus this error comes out . To get out of this error remove the "pctused 40" .
It will work for you ....

Monday, July 21, 2008

Checking mainentance mode in 11i

Maintenance Mode is a new mode of operation introduced with Release 11.5.10, in which the

Oracle Applications system is made accessible only for patching activities not allowing the users

to login to any responsibility. This provides optimal performance for AutoPatch sessions, and

minimizes downtime needed.

1. Scheduling System Downtime

Administrators can schedule 'System Downtime' using Oracle Applications Manager (OAM):

Site Map --> Maintenance --> Manage Downtime Schedules

When the System has been scheduled for 'Downtime', Apache should be re-started on Restricted Mode

by using the Script (adaprstctl.sh). By doing this, users attempting to log on to Oracle Applications will

be automatically redirected to a System Downtime URL showing a message similar to the following one:

Scheduled Downtime Details
Start Time : 17:30:00 12/11/2004
Expected Up Time : 09:00:00 12/12/2004
For Updates : ecengineer84@gmail.com
The system is currently undergoing a scheduled maintenance.

This message can be customized with any text message. If No Downtime has been specified, and the users

try to access the Applications, the following message might also appear:

! Warning
The system has not been taken off maintenance mode completely.
Please contact your System Administrator.

2. Advantages

There are several practical points relating to the use of Maintenance Mode:

  • You can toggle Maintenance Mode between Enabled and Disabled using the new Change Maintenance

Mode menu in AD Administration, or the equivalent function in Oracle Applications Manager.

  • Although you can run AutoPatch with Maintenance Mode disabled, there will be a significant

degradation in performance.

  • There is a separate logon page for Restricted Mode access while the system is in Maintenance Mode.

For more Information on Restricted Mode Access

3. Enabling and Disabling Maintenance Mode

Maintenance mode is Enabled or Disabled from adadmin.

When you Enable or Disable 'Maintenance Mode', adadmin will execute the script:

$AD_TOP/patch/115/sql/adsetmmd.sql sending the parameter 'ENABLE' or 'DISABLE' :

sqlplus /@adsetmmd.sql ENABLE | DISABLE

ENABLE - Enable Maintenance Mode .
DISABLE - Disable Maintenance Mode.

When adsetmmd.sql runs, it sets the Profile Option 'Applications Maintenance Mode'

(APPS_MAINTENANCE_MODE) to 'MAINT' to Enable 'Maintenance Mode' and to 'NORMAL' to Disable it.

4. Determining if Maintenance Mode is Running

A quick way to verify if the Environment is on Maintenance Mode or not, is by checking the value of this

Profile Option as follows:

sqlplus apps/apps

SQL> select fnd_profile.value('APPS_MAINTENANCE_MODE') from dual;

If the query returns 'MAINT', then Maintenance Mode has been Enabled and the Users will not be able to

Login. If the query returns 'NORMAL' then Maintenance Mode has been De-Activated and the Users will be

able to use the application.

Note: Maintenance Mode is only needed for AutoPatch Sessions. Other AD utilities do not require

Maintenance Mode to be enabled. Maintenance Mode must be 'Enabled' before running AutoPatch

and 'Disabled' after the patch application was completed.

When Maintenance Mode is disabled, you can still run Autopatch by using options=hotpatch on the

command line, if necessary. However, doing so can cause a significant degradation of performance.

5. Error Messages

Always remember to Disable Maintenance Mode after any Patch application. If Maintenance Mode is not

Disabled, the Application will not allow the users to use the system. Take note that Apache must be

re-started in normal mode after disabling 'Maintenance Mode' by using the Script adapcctl.sh (or adstrtal.sh)

As explained before, when 'Maintenance Mode' is enabled, a Downtime should be Scheduled from OAM and

Apache should be started on Restricted Mode by using the Script (adaprstctl.sh).

If a 'DownTime' is not Scheduled from OAM and Apache has not been re-started on Restricted Mode,

the Application will allow the users to Login, but it might experience unusual behaviors afterwards

depending on the Patch Level.

Here are some examples of the possible error messages:

  • When clicking on a Responsibility from the PHP

There are no applications available for this responsibility. Please click on a different responsibility

link to display the list of available applications.

or

You are not authorized to access the function Applications Home Page. Please contact your System

Administrator.

  • When trying to access to the Application via CGI directly (not supported):

There are no valid navigations for this responsibility
Cause: The menu compilation has failed.
Cause: There is not valid menu defined for this responsibility.
Cause: There are no navigable forms associated with this responsibility.
Action: Contact your system administrator. Ensure that a valid menu,
containing navigable forms, is defined for the responsibility.
Ensure that the menu is correctly compiled.

Note: In some cases, the behavior is slightly different. Instead of showing the above messages, the

Application might not show any Responsibilities listed for the user at all.

6. Step by Step Process

1. Schedule the 'System Downtime' from OAM

OAM: Site Map --> Maintenance --> Manage Downtime Schedules

At the moment of the downtime, do the following:

2. Shutdown Apache (on Normal Mode):

adapcctl.sh stop
or
adstpall.sh /

3. Enable 'Maintenance Mode' from adadmin

adadmin: Options 5, 1

4. Start Apache (on Restricted Mode)

adaprstctl.sh start

5. Apply the Patch with adpatch
6. Stop Apache (on Restricted Mode)

adaprstctl.sh stop

7. Disable 'Maintenance Mode' from adadmin

adadmin: Options 5, 2

8. Start Apache (on Normal Mode):

adapcctl.sh start
or
adstrtal.sh /

Enabling f60cgi direct login in 11i

Accessing f60cgi is disabled in 11.5.10
----------------------------------------

With increased security in Oracle EBusiness Suite 11.5.10, the ability to
connect directly to forms via f60cgi has been disabled. By default, a user will
see the following error after entering their username and password:

APP-FND-01542: This Applications Server is not authorized to access this database.

This is expected functionality.


Enabling f60cgi direct login
------------------------------

It is possible to login however this method should only be used when
debugging problems.

1. Backup and open $APPL_TOP/admin/_.xml context file

2. Update the context variable:
s_appserverid_authentication

By default in 11.5.10, this is set to SECURE.
In previous 11i versions, this was set to OFF.
For debug purposes, you can use ON or OFF.

Modes:
- ON : Partial
- SECURE : activates full server security (SECURE mode)
- OFF : deactivates server security

3. Run Autoconfig to instantiate the change.

You should now be able to access forms directly again using the f60cgi call.

4. After you have finished your Forms debugging, please reset
s_appserverid_authentication to SECURE and re-run Autoconfig.


Alternative option
---------------------

Running Autoconfig is the preferred method of updating
s_appserverid_authentication.

If you are unable to run Autoconfig during troubleshooting, you can run the
the following commands instead from $FND_TOP/secure directory:

Disable:

java oracle.apps.fnd.security.AdminAppServer apps/apps \
AUTHENTICATION OFF DBC=host_visdemo1.dbc

Enable:

To activate basic server security, from the command line, enter:

jre oracle.apps.fnd.security.AdminAppServer apps/apps \
AUTHENTICATION ON DBC=

To activate full server security (SECURE mode), from the command
line, enter:

jre oracle.apps.fnd.security.AdminAppServer apps/apps \
AUTHENTICATION SECURE DBC=

Check the status:

java oracle.apps.fnd.security.AdminAppServer apps/apps \
STATUS DBC=host_visdemo1.dbc






Upgradation from 9.2.0.8 to 10.2.0.3





=>Prerequisites and recommendations :
Ø Install Oracle 10g Release-2 / Release-3 in a new Oracle Home. Kindly refer to the 10g installation guide for the same
Ø Install the 10g Companion CD for the base ORACLE 10g version.
Ø Compatibility Matrix
a) Minimum Version of the database that can be directly upgraded 10gR2/10gr3
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

b) 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

NOTE : BEFORE UPGRADATION ACTIVITY TAKE THE COLD BACKUP OF DATABASE AND ORACLE_HOME

============ Upgradation Activity ==============================

Step 1 : Run the “utlu102i.sql”
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
sqlplus '/as sysdba'

SQL> spool Database_Info.log
SQL> @utlu102i.sql
SQL> spool off
--- ----- ------ ------ ------ --------
WARNING: --> DRSYS tablespace is not large enough for the upgrade
alter tablespace
size of DRSYS tablespace need to be increased
---> atleast to 50 MB
====>
WARNING: --> "streams_pool_size" is not currently defined and needs a value of
at least 50331648
WARNING: --> "session_max_open_files" needs to be increased to at least 20
streams_pool_size=50331648
session_max_open_files=20
=======>
--> "hash_join_enabled"
--> "log_archive_start"
Remove this parameter from the pfile of 9i
===>
...The 'JServer JAVA Virtual Machine' JAccelerator (NCOMP) is required to be installed from the 10g Companion CD.
...The 'Oracle interMedia Image Accelerator' is required to be installed from the 10g Companion CD
====>
WARNING: --> Passwords exist in some database links.
.... Passwords will be encrypted during the upgrade.
.... Downgrade of database links with passwords is not supported.
WARNING: --> Deprecated CONNECT role granted to some user/roles.
.... CONNECT role after upgrade has only CREATE SESSION privilege.
WARNING: --> Database contains stale optimizer statistics.
.... Refer to the 10g Upgrade Guide for instructions to update
.... statistics prior to upgrading the database.
.... Component Schemas with stale statistics:
.... SYS
.... XDB
.... OLAPSYS
.... MDSYS
WARNING: --> Database contains INVALID objects prior to upgrade.
.... USER ORAEQUS has 8 INVALID objects.
===>
--> New "SYSAUX" tablespace
....minimum required size for database upgrade: 500 MB
----- ------ -------- ---------- ---
#########################################################################################
Step 2 : Take the backup sys.link$ and create a script of all the bd links .
===> DB_links password will be encrypted in ORACLE10g , So ,in case of downgrade password will no be available . So, Please take the backup of database link
Create table db_link_backup as select * from sys.link$;
select 'create database link '||name||'connect to'||userid||'identified by '||password||';' from sys.link$;

##########################################################################################
Step 3 : Check for the deprecated CONNECT Role
User that contains CONNECT -->
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');
===> grant them all priviliges , other than "CONNECT"
select 'CREATE VIEW, CREATE TABLE, ALTER SESSION,CREATE CLUSTER,CREATE SESSION,CREATE SYNONYM,CREATE SEQUENCE,CREATE DATABASE LINK
to '||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');

##########################################################################################
( There is no table on our site , that required this step )
Step 4 : Data of table with "TIMESTAMP WITH TIMEZONE" can be affected . Thus to avoid this ..
Copy the files , to the temp location .. Then the scripts need to be run
$ sqlplus '/as sysdba'
SQL> spool TimeZone_Info.log
SQL> @utltzuv2.sql
SQL> spool off
Scripts mentioned below will show you the column with "TIMESTAMP WITH TIMEZONE" .then back up the data in character format before you upgrade the database. After the upgrade, you must update the tables to ensure that the data is stored based on the new rules
---------------------------------------------------------------------------------
SQL> @utltzuv2.sql
DROP TABLE sys.sys_tzuv2_temptab
*
ERROR at line 1:
ORA-00942: table or view does not exist
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> spool off
[ilomsdb01:ora9equs] /tmp> sysdba
SQL*Plus: Release 9.2.0.8.0 - Production on Wed Jun 25 10:34:04 2008
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
Connected to:
Oracle9i Enterprise Edition Release 9.2.0.8.0 - 64bit Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.8.0 - Production
SQL> select * from sys.sys_tzuv2_temptab;
no rows selected
---------------------------------------------------------------------------------------
OR :
Suppose if there is any table
SQL> desc test_table
x number primary key
y timestamp with time zone
Now ,take the backup of this table
SQL> create table test_table_backup as select * from test_table where 1=2;
SQL> insert into test_table_backup select x,to_char(y, 'YYYY-MM-DD HH24.MI.SSXFF TZR') from test_table;
After the upgrade , run the update command to update the data according to new transition rule
update test_table t set t.y = (select to_timestamp_tz(t1.y,'YYYY-MM-DD HH24.MI.SSXFF TZR') from test_table_backup t1 where t.x=t1.x);
##########################################################################################
Step 5 : 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. Basicaly N-datatype used this NLS-Characterset conversion
NOTE: If you are upgrading from Oracle9i to 10g, Then no NLS Characterset conversion is required
---------------- Internal Use ------------------------

SQL> select distinct OWNER, TABLE_NAME from DBA_TAB_COLUMNS where DATA_TYPE in ('NCHAR','NVARCHAR2', 'NCLOB') and OWNER not in ('SYS','SYSTEM','XDB');
OWNER TABLE_NAME
------------------------------ ------------------------------
OE BOMBAY_INVENTORY
OE PRODUCTS
OE PRODUCT_DESCRIPTIONS
OE SYDNEY_INVENTORY
OE TORONTO_INVENTORY
PM PRINT_MEDIA
6 rows selected.
SQL> select * from nls_database_parameters where parameter ='NLS_NCHAR_CHARACTERSET';
PARAMETER VALUE
------------------------- ------------
NLS_NCHAR_CHARACTERSET AL16UTF16
= = = == == === == == == === For 8i to 10g upgradaion = = = = = = == == == == === == == = = =
select distinct OWNER, TABLE_NAME from DBA_TAB_COLUMNS where DATA_TYPE in ('NCHAR','NVARCHAR2', 'NCLOB') and OWNER not in ('SYS','SYSTEM','XDB');
If no rows are returned it should mean that the database is not using N-type columns for user data, so simply go to the next step.
SQL> select * from nls_database_parameters where parameter ='NLS_NCHAR_CHARACTERSET';
If you are using N-type columns AND your National Characterset is UTF8 or is in the following list:
JA16SJISFIXED , JA16EUCFIXED , JA16DBCSFIXED , ZHT32TRISFIXED
KO16KSC5601FIXED , KO16DBCSFIXED , US16TSTFIXED , ZHS16CGB231280FIXED
ZHS16GBKFIXED , ZHS16DBCSFIXED , ZHT16DBCSFIXED , ZHT16BIG5FIXED
ZHT32EUCFIXED
then also simply go to point next step.
Otherwise --:
* change the tables to use CHAR, VARCHAR2 or CLOB instead the N-type
or
* use export/import the table(s) containing N-type column and truncate those tables before migrating to 10g
The recommended NLS_LANG during export is simply the NLS_CHARACTERSET, not the NLS_NCHAR_CHARACTERSET
========= ========= ============== NLS Conversion for 8i ====== ====== ====== = = = = = === ===========
#########################################################################################
Step 6 : Stats Gathering
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.
( A) --> First take the backup of existing stats ....
$ sqlplus '/as sysdba'
SQL>spool sdict
SQL>grant analyze any to sys;
SQL>exec dbms_stats.create_stat_table('SYS','dictstattab'); --- It'll create a new stat table
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
OR .., Run the sql "stats_exp_backup.sql"
$ sqlplus " /as sysdba"
SQL>@stats_exp_backup.sql
( B )
---> Now , Gather the new statistics . This will also reduce the downtime
$ sqlplus '/as sysdba'
SQL>spool gdict_stats.txt
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_percent => 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
OR , Use the sql "gather_stats_9i.sql"
$ sqlplus " /as sysdba"
SQL>@gather_stats_9i.sql
#########################################################################################
Step 7 : Invalid Count and compile the invalid
Take a list of all the invalids object before upgrading
spool invalid_pre.lst
select substr(owner,1,12) owner,substr(object_name,1,30) object,substr(object_type,1,30) type, status from dba_objects where status='INVALID';
spool off

After taking the list of invalids object , Now compile the invalids ..

% sqlplus '/as sysdba'
SQL> @?/rdbms/admin/utlrp.sql
OR
$ sqlplus " /as sysdba"
SQL> exec utl_recomp,parallel(4); -- Something like this . Refer to shift log regarding this
#########################################################################################==
Step 8 : Dictionary Conrruption check
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 9 : 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;
----------- ----------------- -------------------------------------------
SQL> select distinct(trunc(last_refresh)) from dba_snapshot_refresh_times;
(TRUNC(LA
---------
13-MAY-02
-------------------------------------------------------------------------
#########################################################################################==
Step 10 : Stop the listener and confirm that , there should be no file in recovery/backup mode
Stop the listener for the database:
$ lsnrctl
LSNRCTL> stop
Ensure no files need media recovery:
$ sqlplus '/ as sysdba'
SQL> select * from v$recover_file; ---- Ensure no files are in revovery mode:
This should return no rows.
SQL> select * from v$backup where status!='NOT ACTIVE'; --Ensure no files are in backup mode:
This should return no row
#########################################################################################==
Step 11 :Check for Distributed transaction : 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;
====>> Now disable , all the batch and cron jobs.
Crontab –l > cronbackup
Now , Hash all the program in the crontab
#########################################################################################
Step 12: sys , system and table "aud$" should be there in system tablespace : Otherwise change the default tablespace to system ..
SQL> select username, default_tablespace from dba_users where username in ('SYS','SYSTEM');
Ensure that the aud$ is in the system tablespace when auditing is enabled.
SQL> select tablespace_name from dba_tables where table_name='AUD$';
#########################################################################################
Step 13:
===> Drop table XDB.MIGR9202STATUS if it exist in the databse
#########################################################################################
Step 14: Note down where all control files are located.
SQL> select * from v$controlfile;
#########################################################################################
Step 15: NOW SHUTDOWN the database and take a full cold backup including ORACLE_HOME ( for security purpose ) OR take the RMAN online full backup
[ No need to take the backup , As already taken earlier .. ]
------------------------------------------------------------------------
Issue the following RMAN commands:
RUN
{
ALLOCATE CHANNEL chan_name TYPE DISK;
BACKUP DATABASE FORMAT 'some_backup_directory%U' TAG before_upgrade;
BACKUP CURRENT CONTROLFILE TO 'save_controlfile_location';
}
-------------------------------------------------------------------------
$ sqlplus '/as sysdba'
SQL> shutdown immediate;
======================================================================================
==================== PHASE 2 ================================
=============== Upgrading to the New Oracle Database 10g Release 2 =================
======================================================================================
#########################################################################################
Step 16: Copy the init file to the new ORACLE_HOME
=====> Changes in INIT.ORA file
* Comment out obsoleted parameters like hash_join_enabled , ( Please chk it againg also )
* Change all deprecated parameters like “log_archive_start”
* Change the value of "COMPATIBLE" parameter :
If upgradaing from 8i , Then set the value to 9.2.0
If upgrading from 9.2.0 or 10.1.0 then leave the COMPATIBLE parameter set to it's current
value until the upgrade has been completed successfully .This will avoid any unnecessary
ORA-942 errors from being reported in SMON trace files during the upgrade (because the upgrade is looking for 10.2 objects that have not yet been created)
Note : In out case there is no need to change the value of COMPATIBLE parameter
* If you have the parameter NLS_LENGTH_SEMANTICS currently set to CHAR, change the value
to BYTE during the upgrade .
Note : In our case there is no need to change the value as this bug has been resolved in 10.2.0.3
* Verify that the parameter DB_DOMAIN is set properly.
* PGA_AGGREGATE_TARGET >= 24MB
* SHARED_POOL_SIZE and the LARGE_POOL_SIZE should be greater than 150MB
* JAVA_POOL_SIZE should be greater than 150MB
* Ensure there is a value for DB_BLOCK_SIZE
* Change the value of BDUMP ,CDUMP ,UDUMP
* Comment AQ_TM_PROCESSES and JOB_QUEUE_PROCESSES parameter
Now add ..,
AQ_TM_PROCESSES=0
JOB_QUEUE_PROCESSES=0 ( This is required for upgrade purpose , That's why hashed above )
* Set the parameter UNDO_MANAGEMENT=AUTO
#########################################################################################
Step 17: Ensure the NLS_LANG variable is set correctly:
$ env | grep $NLS_LANG
#########################################################################################
Step 18: Copy the Network Configuration/init.ora/password file from old ORACLE_HOME to new ORACLE_HOME
$ cp $OLD_ORACLE_HOME/network/admin/*.ora $NEW_ORACLE_HOME/network/admin
$ cp $OLD_ORACLE_HOME/dbs/init.ora $NEW_ORACLE_HOME/dbs/
$ cp $OLD_ORACLE_HOME/dbs/orapw $NEW_ORACLE_HOME/dbs/
#########################################################################################
Step 18: Update the enviorement setting according to new 10g enviorment
---> Update the oratab entry, to set the new ORACLE_HOME and disable automatic startup:
SID:ORACLE_HOME:N
---> Update the environment variables like ORACLE_HOME and PATH
$. oraenv
---> Make sure the following environment variables point to the new release (10g) directories:
- ORACLE_HOME
- PATH
- ORA_NLS10
- ORACLE_BASE
- LD_LIBRARY_PATH
- LIBPATH (AIX only)
- ORACLE_PATH
$ env | grep ORACLE_HOME
$ env | grep PATH
$ env | grep ORA_NLS10
$ env | grep ORACLE_BASE
$ env | grep LD_LIBRARY_PATH
$ env | grep ORACLE_PATH
$ env | grep LIBPATH
---> Unset ORA_NLS33 and set ORA_NLS10 to point to $ORACLE_HOME/nls/data
#########################################################################################
Step 19: Datafile movement need to be done
As in our case, we have created the different mount points for the database also. Thus file movement
is also required .
You can skip this step if you’re not changing the location of your database
Step 1 : Copy all the file to the desire location .

Step 2 : Then use the " alter database rename file '.....' to '...''; ( taking database in mount mode )

#########################################################################################
Step 20: Now , start the upgradation of database
$ cd $ORACLE_HOME/rdbms/admin
$ sqlplus / as sysdba
Use Startup with the UPGRADE option:
SQL> startup upgrade
After this create the SYSAUX tablespace
SQL > CREATE TABLESPACE sysaux DATAFILE '/sp04/equs10g/oradata/sysaux01.dbf'
SIZE 1000M REUSE
EXTENT MANAGEMENT LOCAL
SEGMENT SPACE MANAGEMENT AUTO
ONLINE;
Now , run the "catupgrd.sql" script and also spooled the output ..
SQL> spool upgrade.log
SQL> @catupgrd.sql
SQL> SPOOL OFF
Note : This script determines which upgrade scripts need to be run and then runs each necessary script. The upgrade script creates and alters certain data dictionary tables . Check the spool file and verify .If there is any error , then you can run the errored out scripts again
Now , Run the "@utlu102s.sql" to check the upgrade status tool
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:
#########################################################################################
Step 21: Restart the database and do the following
SQL> shutdown immediate (DO NOT use "shutdown abort" !!!)
SQL> startup restrict
Run olstrig.sql to re-create DML triggers
SQL> @olstrig.sql
Above script will give error. IF [Oracle Label Security VALID 10.2.0.1.0 00:00:14 ] is
not installed . Thus you can skip this script
Run utlrp.sql and compiled all the invalids object
SQL> @utlrp.sql
Take the list of invalid now and compare it with old list
spool invalid_post_new.lst
Select substr(owner,1,12) owner,substr(object_name,1,30) object,substr(object_type,1,30) type, status from dba_objects where status <>'VALID';
spool off
NOTE: If you have upgraded from version 9.2 to version 10.2 and find that the following views are invalid , the views can be safely ignored (or dropped):
SYS.V_$KQRPD,SYS.V_$KQRSD,SYS.GV_$KQRPD,SYS.GV_$KQRSD
Again restat the database :-
% sqlplus '/as sysdba'
SQL> shutdown
SQL> startup
#########################################################################################
Step 22: If you changed the value for NLS_LENGTH_SEMANTICS from "CHAR" to "BYTE" prior to the upgrade set it back to "CHAR"
Now revert the init parameters
AQ_TM_PROCESSES , JOB_QUEUE_PROCESSES to their old value
Now , start the database and create spfile ..
SQL> startup
SQL> create spfile from pfile;
This will create a spfile as a copy of the init.ora file located in the $ORACLE_HOME/dbs directory.
Now ,modify the listener.ora according to the new ORACLE_HOME stttings and then ..
$ lsnrctl
LSNRCTL> start
#########################################################################################
Step 23: Enable cron and batch jobs
crontab < cronbackup
#########################################################################################
Step 24: For more better plan new stats can be gathered , using dbms_stats() ;
#########################################################################################
Step 25 : If your database contains the rman catalog , Then upgrade that also.
% rman CATALOG rcat/rcat@oemdb
 
connected to recovery catalog database 
PL/SQL package rcat.DBMS_RCVCAT version 08.00.04 in RCVCAT database is too old
 
RMAN> UPGRADE CATALOG
 
recovery catalog owner is rcat 
enter UPGRADE CATALOG command again to confirm catalog upgrade 
 
RMAN> UPGRADE CATALOG
 
recovery catalog upgraded to version 10.01.00
DBMS_RCVMAN package upgraded to version 10.01.00
DBMS_RCVCAT package upgraded to version 10.01.00
==========================================================================================
=============== Suggestion on 10g upgrade==========================
If you are applying any CPUs ( Critical Patch Upgrades ) .. then you will have to re-run the catcpu.sql for that particular CPU after upgrading to 10g
Also make sure there are no invalid objects after the 10g upgrade and also after applying the CPU