Professional Documents
Culture Documents
3 )
By: Rahul Gupta
Path InfoTech Limited
Client : L.G.Electronics
/* Hi All , Kindly find the doc containing all the information about 10g Upgradation.
This docs is based on the setup of “L.G. Electronics”. For further references, refer
To the doc 316889.1 . More suggestion / modification on this are highly appreciated */
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
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
NOTE :: BEFORE UPGRADATION
Before Starting ACTIVITY
the activity take the TAKE
COLD Backup THE COLD
of Database BACKUP OF
and ORACLE_HOME
DATABASE AND ORACLE_HOME
================ Upgradation Activity =====================================
WARNING: --> DRSYS tablespace is not large enough for the upgrade
alter tablespace
====>
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"
===>
...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
====>
===>
--> 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
##########################################################################################
Step 3 : Check for the deprecated CONNECT Role
User that contains CONNECT -->
##########################################################################################
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'
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.
no rows selected
---------------------------------------------------------------------------------------
OR :
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);
##########################################################################################
NOTE: If you are upgrading from Oracle9i to 10g, Then no NLS Characterset conversion is
required
+------------+---------+-----------------+
| Charset | RDBMS | Unicode version |
+------------+---------+-----------------+
| AL24UTFFSS | 7.2-8.1 | 1.1 |
| | | |
| UTF8 | 8.0-11g | 2.1 (8.0-8.1.6) |
| | | 3.0 (8.1.7-11g) |
| | | |
| UTFE | 8.0-11g | 2.1 (8.0-8.1.6) |
| | | 3.0 (8.1.7-11g) |
| | | |
| AL32UTF8 | 9.0-11g | 3.0 (9.0) |
| | | 3.1 (9.2) |
| | | 3.2 (10.1) |
| | | 4.01(10.2) |
| | | 5.0 (11.1) |
| | | |
| AL16UTF16 | 9.0-10g | 3.0 (9.0) |
| | | 3.1 (9.2) |
| | | 3.2 (10.1) |
| | | 4.01(10.2) |
| | | 5.0 (11.1) |
+------------+---------+-----------------+
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.
PARAMETER VALUE
------------------------- ------------
NLS_NCHAR_CHARACTERSET AL16UTF16
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.
If you are using N-type columns AND your National Characterset is UTF8 or is in the following list:
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 ====== ====== ====== = = = = = === ===========
#########################################################################################
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.
Note : It’s better if you take the backup of all the schemas of your database . Instead of the existing of that
mentioned in the below … To take the backup of all the existing schema , use the steps given below .
After this skip the step (A) and follow the step (B)
SQL>spool off
( B )
---> Now , Gather the new statistics . This will also reduce the downtime
SQL>spool gdict_stats.txt
SQL>spool off
#########################################################################################
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 ..
OR
#########################################################################################==
Check for corruption in the dictionary, use the following commands in sqlplus connected as
sys:
spool off
#########################################################################################==
Step 9 : Ensure that all Snapshot refreshes are successfully completed, and that
replication is stopped.
(TRUNC(LA
---------
13-MAY-02
-------------------------------------------------------------------------
#########################################################################################==
Step 10 : Stop the listener and confirm that , there should be no file in recovery/backup
mode
$ lsnrctl
LSNRCTL> stop
#########################################################################################==
#########################################################################################
Step 12: sys , system and table "aud$" should be there in system tablespace : Otherwise
change the default tablespace to system ..
Ensure that the aud$ is in the system tablespace when auditing is enabled.
#########################################################################################
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
RUN
{
ALLOCATE CHANNEL chan_name TYPE DISK;
BACKUP DATABASE FORMAT 'some_backup_directory%U' TAG before_upgrade;
BACKUP CURRENT CONTROLFILE TO 'save_controlfile_location';
}
-------------------------------------------------------------------------
#########################################################################################
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
#########################################################################################
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<SID>.ora $NEW_ORACLE_HOME/dbs/
$ cp $OLD_ORACLE_HOME/dbs/orapw<SID> $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
#########################################################################################
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
datafile
-> tempfile
-> logfile
-> controlfile
cp /u06/ilequs/oradata/ilequs/control01.ctl /equs10g2/oradata/
cp /u06/ilequs/oradata/ilequs/control02.ctl /equs10g3/oradata/
cp /u06/ilequs/oradata/ilequs/control03.ctl /equs10g4/oradata/
#########################################################################################
$ cd $ORACLE_HOME/rdbms/admin
$ sqlplus / as sysdba
Use Startup with the UPGRADE option:
SQL> startup upgrade
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
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:
#########################################################################################
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
#########################################################################################
Step 22: If you changed the value for NLS_LENGTH_SEMANTICS from "CHAR" to "BYTE" prior to
the upgrade set it back to "CHAR"
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 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.
==========================================================================================
==========================================================================================
==========================================================================================
==========================================================================================
==========================================================================================
==========================================================================================
===================== 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