30 March 2012

Step by Step Oracle ASM Disk creation on Linux 4.5 32bit

[root@primary ~]# oracleasm configure -i
Configuring the Oracle ASM library driver.

This will configure the on-boot properties of the Oracle ASM library
driver.  The following questions will determine whether the driver is
loaded on boot and what permissions it will have.  The current values
will be shown in brackets ('[]').  Hitting <ENTER> without typing an
answer will keep that current value.  Ctrl-C will abort.

Default user to own the driver interface []: oracle
Default group to own the driver interface []: dba
Start Oracle ASM library driver on boot (y/n) [n]: y
Scan for Oracle ASM disks on boot (y/n) [y]: y
Writing Oracle ASM library driver configuration: done
[root@primary ~]#oracleasm init
Creating /dev/oracleasm mount point: /dev/oracleasm
Loading module "oracleasm": oracleasm
Mounting ASMlib driver filesystem: /dev/oracleasm
[root@primary ~]# oracleasm createdisk DISK01 /dev/sdb1
Writing disk header: failed
Unable to label device "/dev/sdb1"
[root@primary ~]# fdisk /dev/sdb

The number of cylinders for this disk is set to 2610.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
   (e.g., DOS FDISK, OS/2 FDISK)
Warning: invalid flag 0x0000 of partition table 5 will be corrected by w(rite)

Command (m for help): d
Selected partition 1

Command (m for help): p

Disk /dev/sdb: 21.4 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-2610, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-2610, default 2610):
Using default value 2610

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.
[root@primary ~]# oracleasm createdisk DISK01 /dev/sdb1
Writing disk header: done
Instantiating disk: done
[root@primary ~]# oracleasm createdisk DISK02 /dev/sdc1
Writing disk header: done
Instantiating disk: done
[root@primary ~]# oracleasm listdisks
DISK01
DISK02

Step by Step Raw Device creation on OEL4.5 Linux32bit

Raw Device Setup:-

This step is only necessary if you want ASM to access the disks as raw devices.

Edit the "/etc/sysconfig/rawdevices" file, adding the following lines.

    /dev/raw/raw1 /dev/sdb1
    /dev/raw/raw2 /dev/sdc1

[root@primary dev]# service rawdevices restart
Assigning devices:
           /dev/raw/raw1  -->   /dev/sdb1
/dev/raw/raw1:  bound to major 8, minor 17
           /dev/raw/raw2  -->   /dev/sdc1
/dev/raw/raw2:  bound to major 8, minor 33
done
[root@primary dev]#

Run the following commands and add them the "/etc/rc.local" file.
chown oracle:oinstall /dev/raw/raw1
chown oracle:oinstall /dev/raw/raw2
chmod 600 /dev/raw/raw1
chmod 600 /dev/raw/raw2

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>

ORA-06553: PLS-801: internal error

I am Doing EBS database 10.2.0.4 32bit to 10.2.0.4 64bit Migration Work That time i faced below Issue .

Error:-   In alert log entry
Errors in file /oracle/MUT/mutdb/10.2.0/admin/MUT_test/bdump/mut_mmon_3862.trc:
ORA-06553: PLS-801: internal error [56319]
Wed Mar 28 18:52:19 2012
Errors in file /oracle/MUT/mutdb/10.2.0/admin/MUT_test/udump/mut_ora_4058.trc:
ORA-00604: error occurred at recursive SQL level 1
ORA-06553: PLS-801: internal error [56319]
Wed Mar 28 18:52:25 2012
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>
Solution :-
We need to run utlirp.sql because i received lot of invalid objects.

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>

28 March 2012

SP2-1503: Unable to initialize Oracle call interface SP2-0152: ORACLE may not be functioning properly


[oracle@ebus bin]$ ./adconfig.sh

adcrobj.sh started at Thu Mar  1 15:31:59 IST 2012

Parameters passed are : -nopromptmsg

The environment settings are as follows ...
       ORACLE_HOME : /disk2/PROD11/prod11db/11.2.0/dbhome_1
        ORACLE_SID : TEST
          TWO_TASK :
              PATH : /usr/bin:/usr/kerberos/bin:/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/home/oracle/bin:/disk2/PROD11/prod11db/11.2.0/dbhome_1/bin:/disk2/PROD11/prod11db/11.2.0/dbhome_1/OPatch:.
      Library Path : /disk2/PROD11/prod11db/11.2.0/dbhome_1/lib:/usr/X11R6/lib:/usr/openwin/lib:/disk2/PROD11/prod11db/11.2.0/dbhome_1/lib:/usr/dt/lib:/disk2/PROD11/prod11db/11.2.0/dbhome_1/ctx/lib
SQLPLUS Executable : /disk2/PROD11/prod11db/11.2.0/dbhome_1/bin/sqlplus
SP2-1503: Unable to initialize Oracle call interface
SP2-0152: ORACLE may not be functioning properly
adcrobj.sh exiting with status 1
ERRORCODE = 1 ERRORCODE_END
.end std out.
.end err out.
[PROFILE PHASE]
  AutoConfig could not successfully execute the following scripts:
    Directory: /disk2/PROD11/prod11db/11.2.0/dbhome_1/appsutil/install/TEST_ebus
      afdbprf.sh              INSTE8_PRF         1

  [APPLY PHASE]
  AutoConfig could not successfully execute the following scripts:
    Directory: /disk2/PROD11/prod11db/11.2.0/dbhome_1/appsutil/install/TEST_ebus
      adcrobj.sh              INSTE8_APPLY       1

complete with error..

Reference:-

Autoconfig On Db Tier Fails With Error - SP2-1503: Unable to initialize Oracle call interface [ID 1187616.1]

Solution :-
 
I applied below patch 7651166 – R12.TXK.B.delta.2 using adpatch in R12.1.1
 
[oracle@ebus bin]$ ./adconfig.sh
Enter the full path to the Context file: /disk2/PROD11/prod11db/11.2.0/dbhome_1/appsutil/TEST_ebus.xml
Enter the APPS user password:
The log file for this session is located at: /disk2/PROD11/prod11db/11.2.0/dbhome_1/appsutil/log/TEST_ebus/03011750/adconfig.log

AutoConfig is configuring the Database environment...

AutoConfig will consider the custom templates if present.
        Using ORACLE_HOME location : /disk2/PROD11/prod11db/11.2.0/dbhome_1
        Classpath                   : :/disk2/PROD11/prod11db/11.2.0/dbhome_1/jdbc/lib/ojdbc5.jar:/disk2/PROD11/prod11db/11.2.0/dbhome_1/appsutil/java/xmlparserv2.jar:/disk2/PROD11/prod11db/11.2.0/dbhome_1/appsutil/java:/disk2/PROD11/prod11db/11.2.0/dbhome_1/jlib/netcfg.jar:/disk2/PROD11/prod11db/11.2.0/dbhome_1/jlib/ldapjclnt11.jar

        Using Context file          : /disk2/PROD11/prod11db/11.2.0/dbhome_1/appsutil/TEST_ebus.xml

Context Value Management will now update the Context file

        Updating Context file...COMPLETED

        Attempting upload of Context file and templates to database...COMPLETED

Updating rdbms version in Context file to db112
Updating rdbms type in Context file to 32 bits
Configuring templates from ORACLE_HOME ...

AutoConfig completed successfully.

AC-00005: No write permissions for creating the Context file - /appsutil/temp.xml


Recently i Upgraded 11.5.10.2 to R12.1.1 That time i faced below issue .
[oracle@dev147 bin]$ perl ./adcfgclone.pl dbTier

Copyright (c) 2002 Oracle Corporation
Redwood Shores, California, USA

Oracle Applications Rapid Clone

Version 12.0.0

adcfgclone Version 120.31.12010000.1

Enter the APPS password :

Running:
/oracle/PROD11/proddb/11.2.0/dbhome_1/appsutil/clone/bin/../jre/bin/java -Xmx600M -cp /oracle/PROD11/proddb/11.2.0/dbhome_1/appsutil/clone/jlib/java:/oracle/PROD11/proddb/11.2.0/dbhome_1/appsutil/clone/jlib/xmlparserv2.jar:/oracle/PROD11/proddb/11.2.0/dbhome_1/appsutil/clone/jlib/ojdbc5.jar oracle.apps.ad.context.CloneContext -e /oracle/PROD11/proddb/11.2.0/dbhome_1/appsutil/clone/bin/../context/db/CTXORIG.xml -validate -pairsfile /tmp/adpairsfile_9850.lst -stage /oracle/PROD11/proddb/11.2.0/dbhome_1/appsutil/clone 2> /tmp/adcfgclone_9850.err; echo $? > /tmp/adcfgclone_9850.res

Log file located at /oracle/PROD11/proddb/11.2.0/dbhome_1/appsutil/clone/bin/CloneContext_0322113458.log

Provide the values required for creation of the new Database Context file.

Target System Hostname (virtual or normal) [dev147] :

Target Instance is RAC (y/n) [n] :

Target System Database SID : PROD

Target System Base Directory : /oracle/PROD11

Target System utl_file_dir Directory List : /usr/tmp

Number of DATA_TOP's on the Target System [1] :

Target System DATA_TOP Directory 1 [/oracle/PROD11/proddata] :

Do you want to preserve the Display [dev147:0.0] (y/n) ? : y

Target System Port Pool [0-99] : 3

Checking the port pool 3
done: Port Pool 3 is free
Report file located at /appsutil/out/portpool.lst
RC-00203: Unable to create/write to file /appsutil/out/portpool.lst.
Complete port information available at /appsutil/out/portpool.lst
RC-50004: Error occurred in CloneContext:
AC-00005: No write permissions for creating the Context file - /appsutil/temp.xml
Raised by oracle.apps.ad.context.AppsContext
Check Clone Context logfile /oracle/PROD11/proddb/11.2.0/dbhome_1/appsutil/clone/bin/CloneContext_0322113458.log for details.

ERROR: Context creation not completed successfully.
For additional details review the file /tmp/adcfgclone_9850.err if present.

[oracle@dev147 bin]$

Issue :

 Target System RDBMS ORACLE_HOME Directory [/oracle/PROD/db/tech_st/11.1.0] :   below variable not found . 

Solution:-
I applied Latest ATG patch 8919491the My issue resolved .
 
Result :-

[oracle@dev147 bin]$ ./adcfgclone.pl dbTier

                     Copyright (c) 2002 Oracle Corporation
                        Redwood Shores, California, USA

                        Oracle Applications Rapid Clone

                                 Version 12.0.0

                      adcfgclone Version 120.31.12010000.8

Enter the APPS password :

Running:
/oracle/PROD11/proddb/11.2.0/dbhome_1/appsutil/clone/bin/../jre/bin/java -Xmx600M -cp /oracle/PROD11/proddb/11.2.0/dbhome_1/appsutil/clone/jlib/java:/oracle/PROD11/proddb/11.2.0/dbhome_1/appsutil/clone/jlib/xmlparserv2.jar:/oracle/PROD11/proddb/11.2.0/dbhome_1/appsutil/clone/jlib/ojdbc5.jar oracle.apps.ad.context.CloneContext -e /oracle/PROD11/proddb/11.2.0/dbhome_1/appsutil/clone/bin/../context/db/CTXORIG.xml -validate -pairsfile /tmp/adpairsfile_14154.lst -stage /oracle/PROD11/proddb/11.2.0/dbhome_1/appsutil/clone  2> /tmp/adcfgclone_14154.err; echo $? > /tmp/adcfgclone_14154.res

Log file located at /oracle/PROD11/proddb/11.2.0/dbhome_1/appsutil/clone/bin/CloneContext_0326094922.log

Provide the values required for creation of the new Database Context file.

Target System Hostname (virtual or normal) [dev147] :

Target Instance is RAC (y/n) [n] :

Target System Database SID : PROD

Target System Base Directory : /oracle/PROD

Target System utl_file_dir Directory List : /usr/tmp

Number of DATA_TOP's on the Target System [1] :

Target System DATA_TOP Directory 1 [/oracle/PROD11/proddata] :

Target System RDBMS ORACLE_HOME Directory [/oracle/PROD/db/tech_st/11.1.0] : ^C
ERROR: Context creation not completed successfully.

Now my issue Resolved  .