Post on 07-Apr-2018
transcript
8/3/2019 Database Upgrade 10g to 11g
1/28
Database upgrade from 10g (10.2.0.1) to 11g (11.2.0.1)
Introduction: To upgrade the database from 10g (10.2.0.1) to 11g (11.2.0.1), first we need to upgrade
the database from 10.2.0.1 to 10.2.0.5. 11.2.0.1 can be achieved from 10.2.0.5 only. Below are the
steps:
1) Install the 10g(10.2.0.1)
8/3/2019 Database Upgrade 10g to 11g
2/28
8/3/2019 Database Upgrade 10g to 11g
3/28
8/3/2019 Database Upgrade 10g to 11g
4/28
8/3/2019 Database Upgrade 10g to 11g
5/28
8/3/2019 Database Upgrade 10g to 11g
6/28
After the installation of 10.2.0.1 upgrade the database to 10.2.0.5
For upgrading to 10.2.0.5, we have to download patch#8202632 according to platform.
Before starting the up gradation shutdown the database, listener, and db-console
Select the same oracle home path and name as you have selected for 10.2.0.1 and run thepatch#8202632 according to the instructions.
8/3/2019 Database Upgrade 10g to 11g
7/28
8/3/2019 Database Upgrade 10g to 11g
8/28
8/3/2019 Database Upgrade 10g to 11g
9/28
8/3/2019 Database Upgrade 10g to 11g
10/28
Post Installation Steps:
After the installation do the following task:
1) cd $ORACLE_HOME/install
2) sh changePerm.sh
3) cd $ORACLE_HOME/bin
4) SQL> STARTUP UPGRADE
5) SQL> SPOOL upgrade_info.log
6) SQL> @/rdbms/admin/utlu102i.sql
7) SQL> SPOOL OFF
8) SQL> SHUTDOWN immediate;
9) SQL> STARTUP NOMOUNT
10)SQL> ALTER SYSTEM SET CLUSTER_DATABASE=FALSE SCOPE=spfile;
11)SQL> SHUTDOWN
12)SQL> STARTUP UPGRADE
13)SQL> SPOOL patch.log14)SQL> @/rdbms/admin/catupgrd.sql
15)SQL> SPOOL OFF
16)SQL> SHUTDOWN IMMEDIATE
17)SQL> STARTUP
18)SQL> @/rdbms/admin/utlrp.sql
19)SQL> SELECT COMP_NAME, VERSION, STATUS FROM SYS.DBA_REGISTRY;
20)Create pfile from spfile :create pfile='F:\OraHome_2\dbs\pfiletnpldev.ora' from
spfile='F:\OraHome_2\dbs\SPFILETNPLDEV.ORA'
21)SQL> SHUTDOWN IMMEDIATE
Now after the Up gradation to 10.2.0.5 is successful we can upgrade our Database to 11.2.0
To upgrade the database from 10.2.0.5, we need to download the Oracle 11g Binaries
win32_11gR2_database_1of2_2.zip
win32_11gR2_database_2of2.zip
Unzip both the files.
Before we start the up-gradation do the below steps:
Startup the database and compile all the invalid objects. (Ensure that you do not have the duplicate
objects in the SYS and SYSTEM schema)
Download the script utlu112i.sql from metalink (884522.1) and keep the file under
ORACLE_HOME/rdbms/admin
8/3/2019 Database Upgrade 10g to 11g
11/28
$ sqlplus / as sysdba
SQL> @utlu112i.sql
Oracle Database 11.2 Pre-Upgrade Information Tool 08-16-2010 11:02:02Script Version: 11.2.0.1.0 Build: 003
.**********************************************************************Database:**********************************************************************--> name: EVER--> version: 10.2.0.1.0--> compatible: 10.2.0.1.0--> blocksize: 8192--> platform: Linux 64-bit for AMD--> timezone file: V4.**********************************************************************Tablespaces: [make adjustments in the current environment]**********************************************************************--> SYSTEM tablespace is adequate for the upgrade.
.... minimum required size: 257 MB--> SYSAUX tablespace is adequate for the upgrade..... minimum required size: 72 MBWARNING: --> TEMP tablespace is not large enough for the upgrade..... currently allocated size: -1 MB.... minimum required size: 61 MB.... increase current size by: 62 MB.... tablespace is NOT AUTOEXTEND ENABLED..**********************************************************************Flashback: OFF********************************************************************************************************************************************Update Parameters: [Update Oracle Database 11.2 init.ora or spfile]Note: Pre-upgrade tool was run on a lower version 64-bit database.
**********************************************************************--> If Target Oracle is 32-Bit, refer here for Update Parameters:-- No update parameter changes are required..
--> If Target Oracle is 64-Bit, refer here for Update Parameters:WARNING: --> "shared_pool_size" needs to be increased to at least 472 MB.**********************************************************************Renamed Parameters: [Update Oracle Database 11.2 init.ora or spfile]**********************************************************************-- No renamed parameters found. No changes are required..**********************************************************************Obsolete/Deprecated Parameters: [Update Oracle Database 11.2 init.ora or spfile]**********************************************************************--> background_dump_dest 11.1 DEPRECATED replaced by "diagnostic_dest"--> user_dump_dest 11.1 DEPRECATED replaced by "diagnostic_dest".
**********************************************************************Components: [The following database components will be upgraded or installed]**********************************************************************--> Oracle Catalog Views [upgrade] VALID--> Oracle Packages and Types [upgrade] VALID
8/3/2019 Database Upgrade 10g to 11g
12/28
.**********************************************************************Miscellaneous Warnings**********************************************************************WARNING: --> Database is using a timezone file older than version 11..... After the release migration, it is recommended that DBMS_DST package.... be used to upgrade the 10.2.0.1.0 database timezone version
.... to the latest version which comes with the new release.WARNING: --> Your recycle bin is turned on and currently contains no objects.
.... Because it is REQUIRED that the recycle bin be empty prior to upgrading
.... and your recycle bin is turned on, you may need to execute the command:PURGE DBA_RECYCLEBIN
.... prior to executing your upgrade to confirm the recycle bin is empty.
.**********************************************************************Recommendations**********************************************************************Oracle recommends gathering dictionary statistics prior toupgrading the database.To gather dictionary statistics execute the following commandwhile connected as SYSDBA:
EXECUTE dbms_stats.gather_dictionary_stats;
**********************************************************************Oracle recommends removing all hidden parameters prior to upgrading.
To view existing hidden parameters execute the following commandwhile connected AS SYSDBA:
SELECT name,description from SYS.V$PARAMETER WHERE nameLIKE '\_%' ESCAPE '\'
Changes will need to be made in the init.ora or spfile.
**********************************************************************Oracle recommends reviewing any defined events prior to upgrading.
To view existing non-default events execute the following commandswhile connected AS SYSDBA:Events:
SELECT (translate(value,chr(13)||chr(10),' ')) FROM sys.v$parameter2WHERE UPPER(name) ='EVENT' AND isdefault='FALSE'
Trace Events:SELECT (translate(value,chr(13)||chr(10),' ')) from sys.v$parameter2WHERE UPPER(name) = '_TRACE_EVENTS' AND isdefault='FALSE'
Changes will need to be made in the init.ora or spfile.
**********************************************************************
Change the tablespaces accordingly.
Lets take below ORACLE_HOME as 10g home:
F:\ORACLE_HOME\10.2.0.1
Create a new 11g Oracle home as F:\ORACLE_HOME\11.2.0.1
8/3/2019 Database Upgrade 10g to 11g
13/28
Copy the below files from 10g home to 11g home:
1. init/spfile/pfile
2. password file
3. tnsnames.oraModify the below parameter of the spfile of 10g after copping that to 11g oracle home:
background_dump_dest, user_dump_dest , compatible
Below is an example :
10g spfile:
*.background_dump_dest='F:\ORACLE_HOME/admin/tnpldemo/bdump'
*.user_dump_dest='F:\ORACLE_HOME/admin/tnpldemo/udump'
*.compatible='10.2.0.1.0'
11g spfile:
*.diagnostc_dest='F:\ORACLE_HOME'
*.compatible='11.2.0'
Now set the ORACLE_HOME and ORACLE_SID to 11g home.
Export ORACLE_HOME= F:\ORACLE_HOME\11.2.0.1
Export the ORACLE_SID=tnpldemo
Now shutdown the database and start the database once again. After that perform the below steps :
1) sqlplus / as sysdba
2) SQL> EXECUTE dbms_stats.gather_dictionary_stats;3) SQL> PURGE DBA_RECYCLEBIN;
4) select TZ_VERSION from registry$database;5) SQL> select value from NLS_DATABASE_PARAMETERS where parameter =
'NLS_NCHAR_CHARACTERSET';
(If this is UTF8 or AL16UTF16 then no action is needed.)
6) SQL> @$ORACLE_HOME/rdbms/admin/utlvalid.sql
7) SQL> @analyze.sql8) SQL> SELECT username, default_tablespace
FROM dba_users
WHERE username in ('SYS','SYSTEM');
If DEFAULT_TABLESPACE is anything other than SYSTEM tablespace, modify the default
tablespace to SYSTEM by using the below command.
SQL> ALTER user SYS default tablespace SYSTEM;
SQL> ALTER user SYSTEM default tablespace SYSTEM;
8/3/2019 Database Upgrade 10g to 11g
14/28
9) Ensure that if the aud$ table exists that it is in the sys schema and in the system tablespace.
SQL> SELECT owner,tablespace_name
FROM dba_tables
WHERE table_name='AUD$';
If the AUD$ table is not in SYSTEM tablespace and not owned by the SYS user then before doing the
upgrade put is back of the SYSTEM tablespace and it should be owned by SYS .
Note :If the AUD$ table exists, and is in use, upgrade performance can be effected depending on the
number of records in the table.
Check whether database has any externally authenticated SSL users.
SQL> SELECT name FROM sys.user$
WHERE ext_username IS NOT NULLAND password = 'GLOBAL';
Note down the location of datafiles, redo logs, control files. Also take a backup of all configuration files
like listener.ora,tnsnames.ora,etc., from $ORACLE_HOME
SQL> SELECT name FROM v$controlfile;
SQL> SELECT file_name FROM dba_data_files;
SQL> SELECT group#, member FROM v$logfile;
Take a backup of the database before upgrading it.
Start the database in upgrade mode and run DBUA ( DataBase Up gradation Assistance) and follow the
instructions as directed below.
8/3/2019 Database Upgrade 10g to 11g
15/28
8/3/2019 Database Upgrade 10g to 11g
16/28
8/3/2019 Database Upgrade 10g to 11g
17/28
8/3/2019 Database Upgrade 10g to 11g
18/28
8/3/2019 Database Upgrade 10g to 11g
19/28
8/3/2019 Database Upgrade 10g to 11g
20/28
8/3/2019 Database Upgrade 10g to 11g
21/28
8/3/2019 Database Upgrade 10g to 11g
22/28
After completion of DBUA, shutdown the database. And then start it in normal mode.
Run utlu112s.sql script , which gives a summary of the upgradation.
8/3/2019 Database Upgrade 10g to 11g
23/28
Run : SQL> @catuppst.sql
8/3/2019 Database Upgrade 10g to 11g
24/28
Run : SQL> @utlrp.sql (recompile any remaining stored PL/SQL and Java code in another session)
8/3/2019 Database Upgrade 10g to 11g
25/28
8/3/2019 Database Upgrade 10g to 11g
26/28
Recreate the EM:
8/3/2019 Database Upgrade 10g to 11g
27/28
8/3/2019 Database Upgrade 10g to 11g
28/28