10g-Upgrade Database Dbua1

  • View
    11

  • Download
    1

Embed Size (px)

Text of 10g-Upgrade Database Dbua1

ORACLE 9i to 10g database Upgrade using DBUA.Purpose of this document is to show a complete 9i to 10g upgrade of an Oracle database on AIX 5L using DBUA ( Database Uprgrade Assistant)

3.2 TECHNICAL SOLUTION10g upgrade from 9.2.06 to 10.2.0.3 for any database -: Check the init.ora parameter file in the 9I ORACLE_HOME/dbs Make sure there is no If event=30084 trace name context forever, level1 defined in pfile of spfile. LOGIN TO NEW PSERIES MACHINE AS oraprod user. Important : Issue unix command unset TNS_ADMINexport ORACLE_HOME=/u01/finprod/finproddb/10.2/db_1 export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/perl/bin:/usr/sbin:/usr/bin/export PERL5LIB=$ORACLE_HOME/perl/lib/5.8.3:$ORACLE_HOME/perl/lib/site_pearl/5.8.3 export LIBPATH=$ORACLE_HOME/lib:/usr/dt/lib:/usr/openwin/lib: $ORACLE_HOME/lib32:$ORACLE_HOME/ctx/lib export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/dt/lib:/usr/openwin/lib:$ORACLE_HOME/ctx/lib

export ORA_NLS10=/u01/finprod/finproddb/10.2/db_1/nls/data/9idata unset TNS_ADMIN To make sure run the following to ascertain correct paths below. echo $ORACLE_HOME echo $PATH echo $PERL5LIB echo $LIBPATH echo $LD_LIBRARY_PATH echo $NLS_010

Firstly create the /NLS/DATA/9i data directory.

#

DESCRIPTION The script copies every nlb files under $ORACLE_HOME/nls/data and $ORACLE_HOME/nls/data/old to directory $ORACLE_HOME/nls/data/9idata for customer needs to revert back to 9i locale behavior.

Make sure perl utility being used points to the 10g oracle environment. Make sure there is no reference to the old 9i environment in the $PATH or this command will fail as the old version of perl is picked up. export PATH=$ORACLE_HOME/bin: $ORACLE_HOME/perl/bin:/usr/sbin:/usr/bin/ $ which perl /u01/finprod/finproddb/10.2/db_1/perl/bin/perl $oraprod(DATABASE)@nbrbwdev5:perl $ORACLE_HOME/nls/data/old/cr9idata.pl

Creating directory /u01/finprod/finproddb/10.2/db_1/nls/data/9idata ... Copying files to /u01/finprod/finproddb/10.2/db_1/nls/data/9idata... Copy finished. Please reset environment variable ORA_NLS10 to /u01/finprod/finproddb/10.2/db_1/nls/data/9idata export ORA_NLS10=/u01/finprod/finproddb/10.2/db_1/nls/data/9idata oraprod(DATABASE)@nbrbwdev5:echo $ORA_NLS10 /u01/finprod/finproddb/10.2/db_1/nls/data/9idata Now configure listener for 10g home First unset TNS_ADMIN so that the old 9i environment is unset. unset TNS_ADMINoraprod(DATABASE)@nbrbwdev5:cd $ORACLE_HOME/bin (10g ORACLE_HOME)

oraprod(DATABASE)@nbrbwdev5:export DISPLAY=10.254.101.25:0.0 oraprod(DATABASE)@nbrbwdev5:ls netca netca oraprod(DATABASE)@nbrbwdev5:./netca Oracle Net Services Configuration:

Use same listener name as in old machine.FINPROD was used here and not LISTENER as above.

Use same port number as currently used by the current database -1526

Message on screen : Oracle Net Services Configuration: Configuring Listener:FINPROD Default local naming configuration complete. Listener configuration complete. Oracle Net Listener Startup:Running Listener Control: /u01/finprod/finproddb/10.2/db_1/bin/lsnrctl start FINPROD Listener Control complete. Listener started successfully. Oracle Net Services configuration successful. The exit code is 0 SHUTDOWN LISTENER lsnrctl stop FINPROD ( Database name ) Now start the PRE-UPGRADE STEPS: Important : START THE DATABASE in the 9i environment and not from the new 10g environment. If you havent changed your .profile and are still using the 9i .profile , just log into a new session so that the old 9i environment is picked up. oraprod(DATABASE)@nbrbwdev5:sqlplus "sys as sysdba" SQL*Plus: Release 9.2.0.6.0 - Production on Thu Feb 21 11:57:55 2008 Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved. Enter password: Connected to an idle instance.

SQL> startup; ORACLE instance started. Total System Global Area 2149552280 bytes Fixed Size 745624 bytes Variable Size 1879048192 bytes Database Buffers 268435456 bytes Redo Buffers 1323008 bytes Database mounted. Database opened. SQL>

STEPS FOR UPGRADING THE DATABASE TO 10G RELEASE 2 ================================================= Preparing to Upgrade -------------------In this section all the steps need to be performed to the previous version of Oracle. Please note that the database must be running in normal mode in the old release- i.e 9i environment. 1. PRE UPGRADE DATABASE HEALTH CHECK: 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: cp $ORACLE_HOME/rdbms/admin/utlu102i.sql /tmp---have to be in the 10g environment to do this. Make a note of the new location of these files. Change to the temporary directory that you copied files to in Step 1. cd /tmp 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' ---In 9i environment. 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).

Database: 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. Logfiles: This section displays a list of redo log files in the current database whose size is less than 4 MB. For each log file, the file name, group number, and recommended size is displayed. New files of at least 4 MB (preferably 10 MB) need to be created in the current database. Any redo log files less than 4 MB must be dropped before the database is upgraded. Tablespaces: This section displays a list of tablespaces in the current database. For each tablespace,the tablespace name and minimum required size is displayed. In addition, a message is displayed if the tablespace is adequate for the upgrade. If the tablespace does not have enough free space, then space must be added to the tablespace in the current database. Tablespace adjustments need to be made before the database is upgraded. Update Parameters: This section displays a list of initialization parameters in parameter file of the current database that must be adjusted the database is upgraded. The adjustments need to be made to parameter file after it is copied to the new Oracle Database release. Deprecated Parameters: This section displays a list of initialization parameters in the parameter file of the current database that are deprecated in the new Oracle Database 10g release. Obsolete Parameters: This section displays a list of initialization parameters in the parameter file of the current database that are obsolete in the new Oracle Database 10g release. Obsolete initialization parameters need to be removed from the parameter file before the database is upgraded. the before the 10g

Components:

This section displays a list of database components in the new Oracle Database 10g release that will be upgraded or installed when the current database is upgraded. 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. However since we are using DBUA to upgrade, the assistant will prompt you for the creation of the SYSAUX tablespace so there is no need to create it manually. 2. CHECK FOR CONNECT ROLE PRIVILEGE CHANGES The CONNECT role in 10g Release 2 has only create session privilege. Therefore create a new role with the usual privileges which CONNECT role had in 9i and grant it to the users who are not generic database users. CREATE ROLE CONNECT1; Grant all privs usually associated with the CONNECT role in previous versions. grant create view to connect1; grant create table to connect1; grant create cluster to connect1; grant create session to connect1; grant create synonym to connect1; grant create sequence to connect1; grant create database link to connect1; grant alter session to connect1; spool grant_connect1.sql Select grant connect1 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'); spool off Run @grant_connect1.sql and make sure any bb staff Id are in quotes. Ex grant connect1 to bb16872.1;

Scripts for the above already in place : Just run create_connect1.sql and grant_connect1.sql from /u02/oradata/software

3. GATHER SCRIPT TO RECREATE DATABASE LINKS IN CASE OF DOWNGRADE: 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. Spool db_links.txt Set head off SELECT 'create '||DECODE(U.NAME,'PUBLIC','public ')||'database link '|| CHR(10)||DECODE(U.NAM