Showing posts with label Migration. Show all posts
Showing posts with label Migration. Show all posts

22 July 2015

Database platform migration from Windows-64bit to Linux-64bit


Step by step oracle database platform migration from Windows-64bit to Linux-64bit :

To convert the database from one platform to another, the endian format of both databases should be the same.  So as a first step, check the v$transportable_platform view for both platforms.

SQL> select a.VERSION,a.INSTANCE_NAME,b.PLATFORM_NAME from v$instance a, v$database b;

VERSION           INSTANCE_NAME    PLATFORM_NAME
----------------- ---------------- --------------------------------

11.2.0.1.0        prod             Microsoft Windows x86 64-bit

SQL> select platform_name from v$db_transportable_platform;

PLATFORM_NAME
-------------------------------------
Microsoft Windows IA (32-bit)
Linux IA (32-bit)
HP Tru64 UNIX
Linux IA (64-bit)
HP Open VMS
Microsoft Windows IA (64-bit)
Linux x86 64-bit
Microsoft Windows x86 64-bit
Solaris Operating System (x86)
HP IA Open VMS
Solaris Operating System (x86-64)

11 rows selected.

It is seen from the output that both the Windows and Linux operating systems are in the little endian format.  So in this case, RMANcan be easily used to convert the whole database.

start database with mount stage and open database with the read only option
----------------------------------------------------------------------------

SQL> shut immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount
ORACLE instance started.

Total System Global Area  855982080 bytes
Fixed Size                  2180544 bytes
Variable Size             515902016 bytes
Database Buffers          331350016 bytes
Redo Buffers                6549504 bytes
Database mounted.
SQL> alter database open read only;

Database altered.

Use dbms_tdb.check_db function to check whether the database can be transported to a target platform and the dbms_tdb.check_external function to check for existence of external objects, directories and BFILEs.  Pass the name of the destination platform as a parameter to the first function.  The return type of the function is boolean, so declare a variable with boolean type and call the function as follows:

SQL> set serveroutput on
SQL> declare
  2  v_return boolean;
  3  begin
  4  v_return:=dbms_tdb.check_db('Linux x86 64-bit');
  5  end;
  6  /

PL/SQL procedure successfully completed.

If nothing was returned, then it means that the database is ready to be transported to the destination platform.
----------------------------------------------------------------------------------------------------------------
Now call the second function dbms_tdb.check_external:

SQL> declare
  2  v_return boolean;
  3  begin
  4  v_return:=dbms_tdb.check_external;
  5  end;
  6  /
The following external tables exist in the database:
SH.SALES_TRANSACTIONS_EXT
The following directories exist in the database:
SYS.ORACLE_OCM_CONFIG_DIR, SYS.DATA_PUMP_DIR, SYS.XMLDIR, SYS.DATA_FILE_DIR,
SYS.LOG_FILE_DIR, SYS.MEDIA_DIR, SYS.SS_OE_XMLDIR, SYS.SUBDIR
The following BFILEs exist in the database:
PM.PRINT_MEDIA

PL/SQL procedure successfully completed.

SQL>

Run the convert database command to convert the whole database to the Linux platform.
------------------------------------------------------------------------------------

C:\Users\muthu>rman target /

Recovery Manager: Release 11.2.0.1.0 - Production on Tue Jul 21 18:40:46 2015

Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.

connected to target database: PROD (DBID=297504150)

RMAN> convert database new database 'PRODNEW'
2> transport script 'c:\app\transport.sql'
3> db_file_name_convert 'C:\app\oradata\prod'
4> 'c:\app'
5> to platform 'Linux x86 64-bit';

Starting conversion at source at 21-JUL-15
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=14 device type=DISK

External table SH.SALES_TRANSACTIONS_EXT found in the database

Directory SYS.ORACLE_OCM_CONFIG_DIR found in the database
Directory SYS.DATA_PUMP_DIR found in the database
Directory SYS.XMLDIR found in the database
Directory SYS.DATA_FILE_DIR found in the database
Directory SYS.LOG_FILE_DIR found in the database
Directory SYS.MEDIA_DIR found in the database
Directory SYS.SS_OE_XMLDIR found in the database
Directory SYS.SUBDIR found in the database

BFILE PM.PRINT_MEDIA found in the database

User SYS with SYSDBA and SYSOPER privilege found in password file
channel ORA_DISK_1: starting datafile conversion
input datafile file number=00001 name=C:\APP\ORADATA\PROD\SYSTEM01.DBF
converted datafile=C:\APP\SYSTEM01.DBF
channel ORA_DISK_1: datafile conversion complete, elapsed time: 00:00:35
channel ORA_DISK_1: starting datafile conversion
input datafile file number=00002 name=C:\APP\ORADATA\PROD\SYSAUX01.DBF
converted datafile=C:\APP\SYSAUX01.DBF
channel ORA_DISK_1: datafile conversion complete, elapsed time: 00:00:25
channel ORA_DISK_1: starting datafile conversion
input datafile file number=00003 name=C:\APP\ORADATA\PROD\UNDOTBS01.DBF
converted datafile=C:\APP\UNDOTBS01.DBF
channel ORA_DISK_1: datafile conversion complete, elapsed time: 00:00:07
channel ORA_DISK_1: starting datafile conversion
input datafile file number=00005 name=C:\APP\ORADATA\PROD\EXAMPLE01.DBF
converted datafile=C:\APP\EXAMPLE01.DBF
channel ORA_DISK_1: datafile conversion complete, elapsed time: 00:00:07
channel ORA_DISK_1: starting datafile conversion
input datafile file number=00004 name=C:\APP\ORADATA\PROD\USERS01.DBF
converted datafile=C:\APP\USERS01.DBF
channel ORA_DISK_1: datafile conversion complete, elapsed time: 00:00:01
Edit init.ora file C:\APP\PRODUCT\11.2.0\DBHOME_1\DATABASE\INIT_00QCKDEH_1_0.ORA. This PFILE will be used to create the database on the
target platform
Run SQL script C:\APP\TRANSPORT.SQL on the target platform to create database
To recompile all PL/SQL modules, run utlirp.sql and utlrp.sql on the target platform
To change the internal database identifier, use DBNEWID Utility
Finished conversion at source at 21-JUL-15

RMAN> exit

While performing the convert database command, RMAN does not convert and transfer redo log files, controlfiles, password files and temporary tablespaces to the destination platform.

RMAN converted all datafiles to the destination platform type.  Now copy the parameter file transport.sql script, which is located at the $ORACLE_HOME/dbs directory, that is used to create the database and all datafiles to the destination host.

Perform the following prerequisite actions on the destination host before running the transport.sql.
----------------------------------------------------------------------------------------------------

[root@prodnew /]# mkdir oracle
[root@prodnew /]# chown -R oracle:oinstall oracle/
[root@prodnew /]# chmod -R 755 oracle/
[root@prodnew /]# su - oracle
[oracle@prodnew ~]$ mkdir -p /oracle/product/11.2.0/admin
[oracle@prodnew ~]$ mkdir -p /oracle/product/11.2.0/admin/adump
[oracle@prodnew ~]$ cd /oracle/product/11.2.0/dbs/
[oracle@prodnew ~]$ cp -r /oracle/*.DBF /oracle/product/oradata/

Move all datafiles to the necessary folder. Edit parameter file and convert paths from Windows syntax to the Linux syntax:
---------------------------------------------------------------------------------------------------------------------------
diagnostic_dest=/oracle/product/11.2.0/admin
control_files=("/oracle/product/oradata/control01.ctl", "/oracle/product/oradata/control02.ctl")
db_recovery_file_dest=/oracle/product/11.2.0
audit_file_dest=/oracle/product/11.2.0/admin/adump
local_listener=LISTENER_PROD

[oracle@prodnew dbs]$ vi initPRODNEW.ora  ----- Copy init file from Windows to linux then change the parameter
[oracle@prodnew dbs]$ cd ../network/admin/
[oracle@prodnew admin]$ vi listener.ora   ----  Copy listner file Windows to linux then change the parameter
[oracle@prodnew admin]$ vi tnsnames.ora   ----  Copy tnsname file Windows to linux then change the parameter
[oracle@prodnew admin]$ lsnrctl start

LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 22-JUL-2015 00:20:35

Copyright (c) 1991, 2009, Oracle.  All rights reserved.

Starting /oracle/product/11.2.0/bin/tnslsnr: please wait...

TNSLSNR for Linux: Version 11.2.0.1.0 - Production
System parameter file is /oracle/product/11.2.0/network/admin/listener.ora
Log messages written to /oracle/product/11.2.0/admin/diag/tnslsnr/prodnew/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=prodnew.muthu.com)(PORT=1521)))

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 11.2.0.1.0 - Production
Start Date                22-JUL-2015 00:20:36
Uptime                    0 days 0 hr. 0 min. 0 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /oracle/product/11.2.0/network/admin/listener.ora
Listener Log File         /oracle/product/11.2.0/admin/diag/tnslsnr/prodnew/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=prodnew.muthu.com)(PORT=1521)))
Services Summary...
Service "CLRExtProc" has 1 instance(s).
  Instance "CLRExtProc", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
[oracle@prodnew admin]$ tnsping PRODNEW

TNS Ping Utility for Linux: Version 11.2.0.1.0 - Production on 22-JUL-2015 00:20:39

Copyright (c) 1997, 2009, Oracle.  All rights reserved.

Used parameter files:


Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = PRODNEW.muthu.com)))
OK (50 msec)

Edit transport.sql script and correct paths of datafiles, controlfiles and trace directories.
---------------------------------------------------------------------------------------------

CREATE CONTROLFILE SET DATABASE "PRODNEW" RESETLOGS  NOARCHIVELOG
    MAXLOGFILES 16
    MAXLOGMEMBERS 3
    MAXDATAFILES 100
    MAXINSTANCES 8
    MAXLOGHISTORY 292
LOGFILE
  GROUP 1 '/oracle/product/oradata/REDO01.LOG'  SIZE 50M BLOCKSIZE 512,
  GROUP 2 '/oracle/product/oradata/REDO02.LOG'  SIZE 50M BLOCKSIZE 512,
  GROUP 3 '/oracle/product/oradata/REDO03.LOG'  SIZE 50M BLOCKSIZE 512
DATAFILE
  '/oracle/product/oradata/SYSTEM01.DBF',
  '/oracle/product/oradata/SYSAUX01.DBF',
  '/oracle/product/oradata/UNDOTBS01.DBF',
  '/oracle/product/oradata/USERS01.DBF',
  '/oracle/product/oradata/EXAMPLE01.DBF'
CHARACTER SET AL32UTF8
;

Now check all changes made above once more, export the ORACLE_SID environment variable and run the transport.sql command from SQL*Plus:
---------------------------------------------------------------------------------------------------------------------------------------

[oracle@prodnew dbs]$ export ORACLE_HOME=/oracle/product/11.2.0
[oracle@prodnew dbs]$ export ORACLE_SID=PRODNEW
[oracle@prodnew dbs]$ export PATH=/oracle/product/11.2.0/bin:$PATH
[oracle@prodnew dbs]$ sqlplus "/as sysdba"

SQL*Plus: Release 11.2.0.1.0 Production on Wed Jul 22 00:21:17 2015

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

Connected to an idle instance.

SQL> startup nomount
ORACLE instance started.

Total System Global Area  855982080 bytes
Fixed Size                  2218152 bytes
Variable Size             503318360 bytes
Database Buffers          343932928 bytes
Redo Buffers                6512640 bytes
SQL> CREATE CONTROLFILE SET DATABASE "PRODNEW" RESETLOGS  NOARCHIVELOG
    MAXLOGFILES 16
  2    3      MAXLOGMEMBERS 3
  4      MAXDATAFILES 100
  5      MAXINSTANCES 8
  6      MAXLOGHISTORY 292
  7  LOGFILE
  GROUP 1 '/oracle/product/oradata/REDO01.LOG'  SIZE 50M BLOCKSIZE 512,
  8    9    GROUP 2 '/oracle/product/oradata/REDO02.LOG'  SIZE 50M BLOCKSIZE 512,
  GROUP 3 '/oracle/product/oradata/REDO03.LOG'  SIZE 50M BLOCKSIZE 512
 10   11  DATAFILE
 12    '/oracle/product/oradata/SYSTEM01.DBF',
 13    '/oracle/product/oradata/SYSAUX01.DBF',
 14    '/oracle/product/oradata/UNDOTBS01.DBF',
  '/oracle/product/oradata/USERS01.DBF',
 15   16    '/oracle/product/oradata/EXAMPLE01.DBF'
CHARACTER SET AL32UTF8
 17   18  ;

Control file created.

SQL> alter database open resetlogs;

Database altered.

SQL> ALTER TABLESPACE TEMP ADD TEMPFILE '/oracle/product/oradata/temp01.dbf' size 500M;

Tablespace altered.

SQL> shut immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup upgrade
ORACLE instance started.

Total System Global Area  855982080 bytes
Fixed Size                  2218152 bytes
Variable Size             503318360 bytes
Database Buffers          343932928 bytes
Redo Buffers                6512640 bytes
Database mounted.
Database opened.
SQL> @@ ?/rdbms/admin/utlirp.sql

-- The following step will recompile all PL/SQL modules.
-- It may take serveral hours to complete.

DOC>#######################################################################
DOC>#######################################################################
DOC>   utlirp.sql completed successfully. All PL/SQL objects in the
DOC>   database have been invalidated.
DOC>
DOC>   Shut down and restart the database in normal mode and run utlrp.sql to
DOC>   recompile invalid objects.
DOC>#######################################################################
DOC>#######################################################################
DOC>#

SQL> shut immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.

Total System Global Area  855982080 bytes
Fixed Size                  2218152 bytes
Variable Size             503318360 bytes
Database Buffers          343932928 bytes
Redo Buffers                6512640 bytes
Database mounted.
Database opened.
SQL> @ ?/rdbms/admin/utlrp.sql

SQL> select a.VERSION,a.INSTANCE_NAME,b.PLATFORM_NAME from v$instance a, v$database b;

VERSION           INSTANCE_NAME    PLATFORM_NAME
----------------- ---------------- -------------------
11.2.0.1.0        PRODNEW          Linux x86 64-bit

SQL>

30 December 2012

Step by Step Migratation from NonASM to ASM database using RMAN

Step by Step Migratation from NonASM to ASM database using RMAN

Before stoping the database, we must know datafile,tempfile,logfile location .

SQL> select name from v$datafile;

NAME

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

/u02/PROD/data/system04.dbf

/u02/PROD/data/system05.dbf

/u02/PROD/data/ctxd01.dbf

/u02/PROD/data/owad01.dbf

SQL> select name from v$controlfile;

NAME

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

/u02/PROD/data/cntrl01.dbf

/u02/PROD/data/cntrl02.dbf

/u02/PROD/data/cntrl03.dbf

SQL>select GROUP#,MEMBER from v$logfile;

    GROUP#

----------

MEMBER

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

         3

/u02/PROD/data/redo03a.dbf

         3

/u02/PROD/data/redo03b.dbf

         2

/u02/PROD/data/redo02a.dbf

SQL> select FILE#,name from v$tempfile;

     FILE#

----------

NAME

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

         1

/u02/PROD/data/temp04.dbf

         2

/u02/PROD/data/temp03.dbf

         3

/u02/PROD/data/temp02.dbf

SQL> select name from v$asm_diskgroup where name='ASMPROD';

NAME

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

ASMPROD

1 rows selected.

SQL> exit

then Shutdown your database

SQL> shut immediate

Database closed.

Database dismounted.

ORACLE instance shut down.

SQL> startup mount;

ORACLE instance started.

Total System Global Area 6263357440 bytes

Fixed Size                  2171304 bytes

Variable Size            4244639320 bytes

Database Buffers         1996488704 bytes

Redo Buffers               20058112 bytes

Database mounted.

SQL>exit

Take Full backup of your Database using RMAN:-

[oraprod@prod02 ~]$ rman target / catalog rman/muthu@RMAN

Recovery Manager: Release 11.1.0.7.0 - Production on Sat Dec 29 23:22:21 2012

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

connected to target database: PROD (DBID=3877050111, not open)

connected to recovery catalog database

RMAN> backup as compressed backupset incremental level 0 cumulative tag LEVEL0_BACKUP filesperset 4 format '/l01/backup/PROD/level0/%d_LVL0_%T_%s' database;

Starting backup at 29-DEC-12

allocated channel: ORA_DISK_1

channel ORA_DISK_1: SID=1983 device type=DISK

allocated channel: ORA_DISK_2

channel ORA_DISK_2: SID=1981 device type=DISK

input datafile file number=00396 name=/u02/PROD/data/a_summ01.dbf

channel ORA_DISK_4: starting piece 1 at 29-DEC-12

channel ORA_DISK_5: starting compressed incremental level 0 datafile backup set

channel ORA_DISK_5: specifying datafile(s) in backup set

input datafile file number=00038 name=/u02/PROD/data/a_media04.dbf

input datafile file number=00085 name=/u02/PROD/data/sysaux28.dbf

channel ORA_DISK_5: backup set complete, elapsed time: 00:04:43

channel ORA_DISK_6: finished piece 1 at 30-DEC-12

piece handle=/l01/backup/PROD/level0/PROD_LVL0_20121230_19000 tag=LEVEL0_BACKUP comment=NONE

channel ORA_DISK_6: backup set complete, elapsed time: 00:04:42

Finished backup at 30-DEC-12

RMAN>exit

[oraprod@prod02 dbs]$ sqlplus "/as sysdba"

SQL*Plus: Release 11.1.0.7.0 - Production on Sun Dec 30 00:36:55 2012

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

Connected to an idle instance.

SQL> startup nomount

ORACLE instance started.

Total System Global Area 6263357440 bytes

Fixed Size                  2171304 bytes

Variable Size            4244639320 bytes

Database Buffers         1996488704 bytes

Redo Buffers               20058112 bytes

SQL> exit

[oraprod@prod02 ~]$

Chnage below parameter on initPROD.ora file

Old value :   *.control_files='/u02/PROD/data/cntrl01.dbf','/u02/PROD/data/cntrl02.dbf','/u02/PROD/data/cntrl03.dbf'

New Value :   *.control_files='+DBIMP02','+DBIMP02'

[oraprod@prod02 ~]$ rman target /

Recovery Manager: Release 11.1.0.7.0 - Production on Sun Dec 30 00:37:35 2012

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

connected to target database: PROD (not mounted)

RMAN> restore controlfile from '/u02/PROD/data/cntrl01.dbf';

Starting restore at 30-DEC-12

using target database control file instead of recovery catalog

allocated channel: ORA_DISK_1

channel ORA_DISK_1: SID=1977 device type=DISK

channel ORA_DISK_1: copied control file copy

output file name=+ASMPROD/prod/controlfile/current.256.803349501

output file name=+ASMPROD/prod/controlfile/current.257.803349503

Finished restore at 30-DEC-12

RMAN>exit

[oraprod@prod02 dbs]$ sqlplus "/as sysdba"

SQL*Plus: Release 11.1.0.7.0 - Production on Sun Dec 30 00:36:55 2012

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

Connected to an idle instance

SQL> alter database mount;

Database altered.

SQL> exit

[oraprod@prod02 ~]$ rman target /

Recovery Manager: Release 11.1.0.7.0 - Production on Sun Dec 30 00:37:35 2012

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

connected to target database: PROD (not mounted)

RMAN>backup as copy database format '+ASMPROD';

Starting backup at 30-DEC-12

released channel: ORA_DISK_1

allocated channel: ORA_DISK_1

channel ORA_DISK_1: SID=1977 device type=DISK

allocated channel: ORA_DISK_2

channel ORA_DISK_2: SID=1975 device type=DISK

channel ORA_DISK_1: starting datafile copy

input datafile file number=00030 name=/u02/PROD/data/sysaux03.dbf

channel ORA_DISK_2: starting datafile copy

input datafile file number=00034 name=/u02/PROD/data/undotbs5.dbf

output file name=+ASMPROD/prod/datafile/apps_ts_queues.364.803353979 tag=TAG20121230T004026 RECID=133 STAMP=803354005

channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:26

output file name=+ASMPROD/prod/datafile/system.361.803353939 tag=TAG20121230T004026 RECID=132 STAMP=803354002

channel ORA_DISK_6: datafile copy complete, elapsed time: 00:01:07

Finished backup at 30-DEC-12

RMAN>switch database to copy;

datafile 1 switched to datafile copy "+ASMPROD/prod/datafile/system.351.803353795"

datafile 2 switched to datafile copy "+ASMPROD/prod/datafile/system.352.803353795"

datafile 3 switched to datafile copy "+ASMPROD/prod/datafile/system.353.803353795"

datafile 4 switched to datafile copy "+ASMPROD/prod/datafile/system.354.803353795"

datafile 405 switched to datafile copy "+ASMPROD/prod/datafile/apps_ts_tx_idx.287.803351559"

datafile 406 switched to datafile copy "+ASMPROD/prod/datafile/apps_ts_tx_idx.288.803351655"

datafile 407 switched to datafile copy "+ASMPROD/prod/datafile/apps_ts_seed.333.803353361"

RMAN> run {

set newname for tempfile 1 to '+ASMPROD';

set newname for tempfile 2 to '+ASMPROD';

set newname for tempfile 3 to '+ASMPROD';

set newname for tempfile 4 to '+ASMPROD';

set newname for tempfile 5 to '+ASMPROD';

set newname for tempfile 6 to '+ASMPROD';

set newname for tempfile 7 to '+ASMPROD';

set newname for tempfile 8 to '+ASMPROD';

set newname for tempfile 9 to '+ASMPROD';

switch tempfile all;

}2> 3> 4> 5> 6> 7> 8> 9> 10> 11> 12>

executing command: SET NEWNAME

executing command: SET NEWNAME

renamed tempfile 1 to +ASMPROD in control file

renamed tempfile 8 to +ASMPROD in control file

renamed tempfile 9 to +ASMPROD in control file

RMAN>exit

[oraprod@prod02 ~]$ sqlplus "/as sysdba"

SQL*Plus: Release 11.1.0.7.0 - Production on Sun Dec 30 02:05:02 2012

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

Connected to:

Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production

With the Partitioning, Oracle Label Security, OLAP, Data Mining

and Real Application Testing options

SQL> select name from v$datafile;

NAME

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

+ASMPROD/prod/datafile/system.351.803353795

+ASMPROD/prod/datafile/system.352.803353795

+ASMPROD/prod/datafile/system.353.803353795

SQL> select name from v$tempfile;

NAME

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

+ASMPROD

+ASMPROD

+ASMPROD

SQL> alter database open;

Database altered.

SQL> SELECT a.group#, b.member, a.status FROM v$log a, v$logfile b WHERE a.group#=b.group#;

GROUP# MEMBER                                   STATUS

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

         3 /u02/PROD/data/redo03a.dbf            INACTIVE

         3 /u02/PROD/data/redo03b.dbf            INACTIVE

         2 /u02/PROD/data/redo02a.dbf            INACTIVE

         2 /u02/PROD/data/redo02b.dbf            INACTIVE

         1 /u02/PROD/data/redo01a.dbf            CURRENT

         1 /u02/PROD/data/redo01b.dbf            CURRENT

         4 /u02/PROD/data/redo04a.dbf            UNUSED

         4 /u02/PROD/data/redo04b.dbf            UNUSED

         5 /u02/PROD/data/redo05a.dbf            UNUSED

         5 /u02/PROD/data/redo05b.dbf            UNUSED

         6 /u02/PROD/data/redo06a.dbf            UNUSED

    GROUP# MEMBER                                   STATUS

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

         6 /u02/PROD/data/redo06b.dbf            UNUSED

12 rows selected.

SQL> ALTER DATABASE ADD LOGFILE MEMBER '+ASMPROD' TO GROUP 1;

Database altered.

SQL> /

Database altered.

SQL> ALTER SYSTEM SWITCH LOGFILE;

System altered.

SQL> alter system checkpoint;

System altered.

SQL> ALTER DATABASE DROP LOGFILE MEMBER '/u02/PROD/data/redo01a.dbf';

Database altered.

SQL> set line 200

SQL> col member for a40

SQL> SELECT a.group#, b.member, a.status FROM v$log a, v$logfile b WHERE a.group#=b.group#;

    GROUP# MEMBER                                   STATUS

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

         2 +ASMPROD/prod/onlinelog/group_2.387.8 CURRENT

           03355621

         1 +ASMPROD/prod/onlinelog/group_1.383.8 INACTIVE

           03355199

         1 +ASMPROD/prod/onlinelog/group_1.384.8 INACTIVE

           03355211

         2 +ASMPROD/prod/onlinelog/group_2.388.8 CURRENT

           03355625

    GROUP# MEMBER                                   STATUS

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

         3 +ASMPROD/prod/onlinelog/group_3.389.8 INACTIVE

           03355633

         3 +ASMPROD/prod/onlinelog/group_3.390.8 INACTIVE

           03355635

6 rows selected.

SQL>shut immediate

Database closed.

Database dismounted.

ORACLE instance shut down.

SQL> exit

Disconnected from Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production

With the Partitioning, Oracle Label Security, OLAP, Data Mining

and Real Application Testing options

[oraprod@prod02 ~]$ vi /u01/PROD/oracle/db/tech_st/11.1.0/db_1/dbs/initPROD.ora

Change below parameter on initPROD.ora file

Old value :   *.control_files='+DBIMP02','+DBIMP02'

New Value :   *.control_files='+ASMPROD/prod/controlfile/current.256.803349501','+ASMPROD/prod/controlfile/current.257.803349503'

[oraprod@prod02 ~]$ sqlplus "/as sysdba"

SQL*Plus: Release 11.1.0.7.0 - Production on Sun Dec 30 02:35:28 2012

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

Connected to an idle instance.

SQL> startup

ORACLE instance started.

Total System Global Area 6263357440 bytes

Fixed Size                  2171304 bytes

Variable Size            4244639320 bytes

Database Buffers         1996488704 bytes

Redo Buffers               20058112 bytes

Database mounted.

Database opened.

SQL>

29 March 2012

Step by Step Oracle EBS Database 10.2.0.4 Linux 32bit to linux 64 bit Migration

Migrating Oracle E-Business Suite R12 from Linux 32-bit to Linux 64-bit (Doc ID 471566.1)

Interoperability Notes Oracle EBS R12 with Oracle Database 10.2.0.4 [ID 1135955.1]

Source Node :- Linux 32bit
Upgrade 9.2.0.5 to 10.2.0.4  Apply all required patches
p4653225_11i_LINUX
p6521934_10204_Linux-x86
p6600051_10204_Linux-x86
p6880880_102000_LINUX
p7496636_10204_Linux-x86
p7497678_10204_Linux-x86

SQL> alter database backup controlfile to trace as '/oracle/mig.sql';

Shut down the original (source) database.

Target Node:-  Linux 64bit

Install Oracle software 10.2.0.1 64bit .

Install Companion 10.2.0.1 64bit

Install Patchset 10.2.0.4 64bit Pach set number is 6810189

https://updates.oracle.com/download/6810189.html

Apply additional 10.2.0.4 RDBMS patches 64bit

Apply the following patches:

For all UNIX/Linux platforms, apply RDBMS patches:

    4247037
    6084656
    6600051
    6870937
    6991626
    7014646

Copy all datafiles(dbf) file and logfile from source(32bit) to target(64bit)

Copy init.ora change the parameters and controlfile location.

[oracle@test oracle]$ sqlplus "/as sysdba"

SQL*Plus: Release 10.2.0.4.0 - Production on Thu Mar 29 06:20:30 2012

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

Connected to an idle instance.

SQL> startup nomount;
ORACLE instance started.

Total System Global Area  444596224 bytes
Fixed Size                  2021440 bytes
Variable Size             134219712 bytes
Database Buffers          306184192 bytes
Redo Buffers                2170880 bytes
SQL>@/oracle/mig.sql

CREATE CONTROLFILE REUSE SET DATABASE "MUT" RESETLOGS  NOARCHIVELOG
    MAXLOGFILES 32
    MAXLOGMEMBERS 5
    MAXDATAFILES 512
    MAXINSTANCES 8
    MAXLOGHISTORY 7260
LOGFILE
  GROUP 1 (
    '/oracle/MUT/mutdata/log01a.dbf',
    '/oracle/MUT/mutdata/log01b.dbf'
  ) SIZE 10M,
  GROUP 2 (
    '/oracle/MUT/mutdata/log02a.dbf',
    '/oracle/MUT/mutdata/log02b.dbf'
  ) SIZE 10M
-- STANDBY LOGFILE

DATAFILE
  '/oracle/MUT/mutdata/system01.dbf',
  '/oracle/MUT/mutdata/system02.dbf',
  '/oracle/MUT/mutdata/system03.dbf',
  '/oracle/MUT/mutdata/system04.dbf',
  '/oracle/MUT/mutdata/system05.dbf',
  '/oracle/MUT/mutdata/ctxd01.dbf',
  '/oracle/MUT/mutdata/owad01.dbf',
  '/oracle/MUT/mutdata/a_queue02.dbf',
  '/oracle/MUT/mutdata/odm.dbf',
  '/oracle/MUT/mutdata/olap.dbf',
  '/oracle/MUT/mutdata/sysaux01.dbf',
  '/oracle/MUT/mutdata/system10.dbf',
  '/oracle/MUT/mutdata/system06.dbf',
  '/oracle/MUT/mutdata/portal01.dbf',
  '/oracle/MUT/mutdata/system07.dbf',
  '/oracle/MUT/mutdata/system09.dbf',
  '/oracle/MUT/mutdata/system08.dbf',
  '/oracle/MUT/mutdata/system11.dbf',
  '/oracle/MUT/mutdata/undo01.dbf',
  '/oracle/MUT/mutdata/a_txn_data01.dbf',
  '/oracle/MUT/mutdata/a_txn_ind01.dbf',
  '/oracle/MUT/mutdata/a_ref01.dbf',
  '/oracle/MUT/mutdata/a_int01.dbf',
  '/oracle/MUT/mutdata/a_summ01.dbf',
 '/oracle/MUT/mutdata/a_nolog01.dbf',
  '/oracle/MUT/mutdata/a_archive01.dbf',
  '/oracle/MUT/mutdata/a_queue01.dbf',
  '/oracle/MUT/mutdata/a_media01.dbf',
  '/oracle/MUT/mutdata/a_txn_data02.dbf',
  '/oracle/MUT/mutdata/a_txn_data03.dbf',
  '/oracle/MUT/mutdata/a_txn_ind02.dbf',
  '/oracle/MUT/mutdata/a_txn_ind03.dbf',
  '/oracle/MUT/mutdata/a_txn_ind04.dbf',
  '/oracle/MUT/mutdata/a_txn_ind05.dbf',
  '/oracle/MUT/mutdata/a_ref02.dbf'
CHARACTER SET UTF8
;

Control file created.

SQL> alter database open resetlogs;

Database altered.

SQL>ALTER TABLESPACE TEMP ADD TEMPFILE '/oracle/MUT/mutdata/temp01.dbf' SIZE 1100M REUSE AUTOEXTEND OFF;

Tablespace altered.
SQL>

Configure Listner.ora and tnsname.ora:-

Listner.ora:-
SID_LIST_MUT =
  (SID_LIST =
    (SID_DESC =
      (SID_NAME = PLSExtProc)
      (ORACLE_HOME = /oracle/MUT/mutdb/10.2.0)
      (PROGRAM = extproc)
    )
    (SID_DESC =
      (GLOBAL_DBNAME = MUT)
      (ORACLE_HOME = /oracle/MUT/mutdb/10.2.0)
      (SID_NAME = MUT)
    )
  )

MUT =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = dev138.chainsys.com)(PORT = 1600))
    )
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
    )
  )

  Tnsnames.ora:-
 
  MUT =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = dev138.chainsys.com)(PORT = 1600))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = MUT)
    )
  )

SQL> startup upgrade
ORACLE instance started.

Total System Global Area 1145044992 bytes
Fixed Size                  2089888 bytes
Variable Size             964693088 bytes
Database Buffers          163577856 bytes
Redo Buffers               14684160 bytes
Database mounted.
Database opened.
SQL>@$ORACLE_HOME/rdbms/admin/utlirp.sql
System altered.

SQL>
SQL> Rem Continue even if there are SQL errors
SQL> WHENEVER SQLERROR CONTINUE;
SQL>
SQL> Rem ===========================================================================
SQL> Rem END utlip.sql
SQL> Rem ===========================================================================
SQL>
SQL> DOC
DOC>#######################################################################
DOC>#######################################################################
DOC>   utlirp.sql completed successfully. All PL/SQL objects in the
DOC>   database have been invalidated.
DOC>
DOC>   Shut down and restart the database in normal mode and run utlrp.sql to
DOC>   recompile invalid objects.
DOC>#######################################################################
DOC>#######################################################################
DOC>#
SQL> shut   
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.

Total System Global Area 1145044992 bytes
Fixed Size                  2089888 bytes
Variable Size             964693088 bytes
Database Buffers          163577856 bytes
Redo Buffers               14684160 bytes
Database mounted.
Database opened.
SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@test admin]$ sqlplus system/manager@MUT

SQL*Plus: Release 10.2.0.4.0 - Production on Wed Mar 28 19:22:05 2012

Copyright (c) 1982, 2007, Oracle.  All Rights Reserved.


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

SQL>