Monday 10 September 2012

Migration of 10.2.0.3(32-Bit) database to 11.2.0.3(64-Bit)

Test Setup

Initial Platform : Redhat Linux 5 update 6 (32 – bit)

Since Oracle DB 10.2.0.3 is not a complete patch set, we need to install the base version that is 10.2.0.1 and create a test database ( here RMS), later upgrade it into 10.2.0.3 for test setup.

Before installing 10g, do the prerequisites, and also install all the required rpms which you can find inside RHEL media Server directory.

After the Successful installation of Oracle 10g & creation of test database,

Download the patchset for 10.2.0.3 and unzip the same.

Before installing the patchset.

1.Stutdown the database.
2.Stop the listener >> lsnrctl stop
3.stop dbconsole >> emctl stop dbconsole
4.stop isqlplusctl >> isqlplusctl stop
[oracle@localhost ~]$ . .bash_profile

[oracle@localhost ~]$ emctl status dbconsole

TZ set to Asia/Calcutta
Oracle Enterprise Manager 10g Database Control Release 10.2.0.1.0 
Copyright (c) 1996, 2005 Oracle Corporation. All rights reserved.
Oracle Enterprise Manager 10g is running.


Logs are generated in directory /home/oracle/oracle/product/10.2.0/db_1/localhost.localdomain_rms/sysman/log

[oracle@localhost ~]$ emctl stop dbconsole
TZ set to Asia/Calcutta
Oracle Enterprise Manager 10g Database Control Release 10.2.0.1.0 
Copyright (c) 1996, 2005 Oracle Corporation. All rights reserved.
Stopping Oracle Enterprise Manager 10g Database Control ...
... Stopped.

[oracle@localhost ~]$ emctl status dbconsole
TZ set to Asia/Calcutta
Oracle Enterprise Manager 10g Database Control Release 10.2.0.1.0 
Copyright (c) 1996, 2005 Oracle Corporation. All rights reserved.
http://localhost.localdomain:1158/em/console/aboutApplication

Oracle Enterprise Manager 10g is not running.

Unzip the Patch set for 10.2.0.3 u can get Disk1 directory.

Install the patch set in the existing path, where 10.2.0.1 binaries installed. It will automatically update the binaries. Or else you can use Opatch utility.

[oracle@localhost ~]$ cd Disk1/

[oracle@localhost Disk1]$ ./runInstaller

Starting Oracle Universal Installer...
Checking installer requirements...
Checking operating system version: must be redhat-3, SuSE-9, SuSE-10, redhat-4, UnitedLinux-1.0, asianux-1 or asianux-2
Passed
All installer requirements met
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2012-08-20_05-33-38AM. Please wait ...[oracle@localhost Disk1]$ Oracle Universal Installer, Version 10.2.0.3.0 Production
Copyright (C) 1999, 2006, Oracle. All rights reserved.
Asia/Calcutta
[oracle@localhost Disk1]$
For Ex.. Updation of binaries process..

Updating jar file "/home/oracle/oracle/product/10.2.0/db_1/sysman/jlib/emjsp.jar" with "/sysman/jlib/emjsp.jar/_jobs/_jobsList.class"

Updating jar file "/home/oracle/oracle/product/10.2.0/db_1/sysman/jlib/emjsp.jar" with "/sysman/jlib/emjsp.jar/_jobs/_jobsList$__jsp_StaticText.class"

After the successful upgradation of binaries, You can start the database with upgrade mode.

Or you can upgrade using dbua utility.

sql> startup upgrade;

Run Catupgrd.sql

@?/rdbms/admin/catupgrd.sql

Oracle Database Server VALID 10.2.0.3.0 00:08:09
JServer JAVA Virtual Machine VALID 10.2.0.3.0 00:03:05
Oracle XDK VALID 10.2.0.3.0 00:00:41
Oracle Database Java Packages VALID 10.2.0.3.0 00:00:48
Oracle Text VALID 10.2.0.3.0 00:00:26
Oracle XML Database VALID 10.2.0.3.0 00:01:38
Oracle Data Mining VALID 10.2.0.3.0 00:00:22
Oracle Rule Manager VALID 10.2.0.3.0 00:00:12

.

Total Upgrade Time: 00:25:08

DOC>#######################################################################
DOC>#######################################################################

Bounceback the database with normal mode then run utlrp.sql script to validate invalid objects.

SQL> shu immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.

Startup;

SQL> select count(*) from dba_objects where status = 'INVALID';

COUNT(*)

506

SQL> @?/rdbms/admin/utlrp.sql

TIMESTAMP
DOC> WHERE job_name like 'UTL_RECOMP_SLAVE_%';
DOC>
 
SQL> select count(*) from dba_objects where status = 'INVALID';

COUNT(*)

0

Check the status and version of all components

SQL> select comp_name , status ,version from dba_registry;

COMP_NAME STATUS VERSION

Oracle Database Catalog Views VALID 10.2.0.3.0
Oracle Database Packages and Types VALID 10.2.0.3.0
Oracle Workspace Manager VALID 10.2.0.1.0
Server JAVA Virtual Machine VALID 10.2.0.3.0
Oracle XDK VALID 10.2.0.3.0
Oracle Database Java Packages VALID 10.2.0.3.0
Oracle Expression Filter VALID 10.2.0.3.0
Oracle Data Mining VALID 10.2.0.3.0
Oracle Text VALID 10.2.0.3.0
Oracle XML Database VALID 10.2.0.3.0
Oracle Rule Manager VALID 10.2.0.3.0
Oracle interMedia VALID 10.2.0.3.0
OLAP Analytic Workspace VALID 10.2.0.3.0
Oracle OLAP API VALID 10.2.0.3.0
OLAP Catalog VALID 10.2.0.3.0
Spatial VALID 10.2.0.3.0
Oracle Enterprise Manager VALID 10.2.0.3.0

Everything is fine now..

Download Oracle DB 11.2.0.3 and install it in a different path
After Installing 11.2.0.3.. Check the prerequisites to upgrade to 11g for the existing 10g database.

Inside 11g ORACLE_HOME/rdbms/admin path you can find utlu112i.sql script copy it into temporary location and run it on 10g database to check the prerequisites.
[oracle@localhost ~]$ sqlplus
SQL*Plus: Release 10.2.0.3.0 - Production on Tue Aug 21 05:43:27 2012

Copyright (c) 1982, 2006, Oracle. All Rights Reserved.
Enter user-name: sys as sysdba
Enter password:
Connected to:

Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - Production

With the Partitioning, OLAP and Data Mining options

SQL> @/tmp/utlu112i.sql

Oracle Database 11.2 Pre-Upgrade Information Tool 08-21-2012 05:44:01
Script Version: 11.2.0.3.0 Build: 001
**********************************************************************
Obsolete/Deprecated Parameters: [Update Oracle Database 11.2 init.ora or spfile]
Components: [The following database components will be upgraded or installed]
**********************************************************************

--> Oracle Catalog Views [upgrade] VALID
--> Oracle Packages and Types [upgrade] INVALID
 
Changes will need to be made in the init.ora or spfile. Check the timezone

SQL> select count(*) from dba_objects where status='INVALID';

632

SQL> select * from v$timezone_file;

timezlrg.dat 3

Before Upgrade Purge the recycle bin and also gather the statistics for all schemas.

SQL> purge dba_recyclebin;

Upgradation using DBUA

Export the Oracle 11g Home path in the bash Profile.
In 11g home invoke dbua...

1.select the database which needed to upgrade..


I:\Screenshot-4.png

I:\Screenshot-4.png



(For our test DB RMS has been selected)

2.Select the timezone too.
4.Select the degree of parallelism


I:\Screenshot-3.png

I:\Screenshot-3.png


It will take long time to complete.


I:\Screenshot-6.png

I:\Screenshot-6.png


Everything will be upgraded automaticallically, when you use dbua including timezone.


I:\Screenshot-7.png

I:\Screenshot-7.png



Export 11g Home and check the status of all components.

SQL> col comp_name for a40;

SQL> /

COMP_NAME STATUS VERSION
 
Oracle Enterprise Manager VALID 11.2.0.3.0
OLAP Catalog VALID 11.2.0.3.0
Spatial VALID 11.2.0.3.0
Oracle Multimedia VALID 11.2.0.3.0
Oracle XML Database VALID 11.2.0.3.0
Oracle Text VALID 11.2.0.3.0
Oracle Data Mining VALID 11.2.0.3.0
Oracle Expression Filter VALID 11.2.0.3.0
Oracle Rule Manager VALID 11.2.0.3.0
Oracle Workspace Manager VALID 11.2.0.3.0
Oracle Database Catalog Views VALID 11.2.0.3.0
Oracle Database Packages and Types VALID 11.2.0.3.0
JServer JAVA Virtual Machine VALID 11.2.0.3.0
Oracle XDK VALID 11.2.0.3.0
Oracle Database Java Packages VALID 11.2.0.3.0
OLAP Analytic Workspace VALID 11.2.0.3.0
Oracle OLAP API VALID 11.2.0.3.0
17 rows selected.

SQL> select * from v$timezone_file;

FILENAME VERSION
-------------------- ----------
timezlrg_14.dat 14

We have upgraded the database from 10.2.0.3(32-Bit) to 11.2.0.3(32-Bit).

Now, We have to migrate this database to 64-bit

 
1. Install 64-bit RHEL 5.6 and get the server ready.

2. Do the prerequisites before install 11g like kernel settings

3. Install all the required rpms.( u can find inside server directory of RHEL Media)

4. Create oracle user under dba group

5. Give the appropriate privileges to Oracle user, in which software has to be installed.

6. Install Oracle 11.2.0.3 64-Bit Software.

 
Clone the database from 32-bit server to 64 – Bit Server by creating appropriate directory.

(Using SCP copy all the data, control , redo and spfiles to 64- bit Server)

(Comment audit_trail_file parameter in pfile and create spfile by the same)

In the New Server After the Cloning,(Export Bash profile)
Startup Upgrade;
Run
@?/rdbms/admin/utlirp.sql -------

PL/SQL procedure successfully completed.

DOC>#######################################################################

SQL> select count(*) from dba_objects where status='INVALID';
COUNT(*)
8841

Normal Shutdown

Shutdown;

startup;

SQL> @?/rdbms/admin/utlrp.sql
2 threads pls_integer := &&1;
3 BEGIN
4 utl_recomp.recomp_parallel(threads);
5 END;

[oracle@localhost ~]$ sqlplus

SQL*Plus: Release 11.2.0.3.0 Production on Thu Aug 23 01:58:50 2012

Copyright (c) 1982, 2011, Oracle. All rights reserved.

Enter user-name: sys as sysdba
Enter password:

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> select count(*) from dba_objects where status ='INVALID';

COUNT(*)
 
0

SQL> select platform_name from v$database;

PLATFORM_NAME
--------------------------------------------------------------------------------
Linux x86 64-bit

SQL> select comp_name ,version,status from dba_registry;

COMP_NAME VERSION STATUS

------------------------------ -----------
Oracle Enterprise Manager 11.2.0.3.0 VALID
OLAP Catalog 11.2.0.3.0 VALID
Spatial 11.2.0.3.0 VALID
Oracle Multimedia 11.2.0.3.0 VALID
Oracle XML Database 11.2.0.3.0 VALID
Oracle Text 11.2.0.3.0 VALID
Oracle Data Mining 11.2.0.3.0 VALID
Oracle Expression Filter 11.2.0.3.0 VALID
Oracle Rule Manager 11.2.0.3.0 VALID
Oracle Workspace Manager11.2.0.3.0 VALID
Oracle Database Catalog Views11.2.0.3.0 VALID
Oracle Database Packages and Types11.2.0.3.0 VALID
JServer JAVA Virtual Machine11.2.0.3.0 VALID
Oracle XDK 11.2.0.3.0 VALID
Oracle Database Java Packages11.2.0.3.0 VALID
OLAP Analytic Workspace 11.2.0.3.0 VALID
Oracle OLAP API 11.2.0.3.0 VALID
17 rows selected.
SQL> select ( case length(address) when 16 then '64 - bit oracle'
2 when 8 then '32-bit'
3 when 32 then '128-bit' end) wordsize
4 from v$sql
5 where rownum < 2;

WORDSIZE

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

64 - bit oracle

No comments:

Post a Comment