Saturday, July 30, 2016

How to check JDK bit version (32 or 64 bit)?

Run the commands: java -d64 -version or java -d32 -version and you will get an error for the version that is not supported.

Example :

On 64bit JDK:

$java -d64  -version
$java version "1.7.0_111"Java(TM) SE Runtime Environment (build 1.7.0_111-b13)Java HotSpot(TM) 64-Bit Server VM (build 24.111-b13, mixed mode)

$java -d32 -version 
Error: This Java instance does not support a 32-bit JVM.Please install the desired version.


On 32 bit JDK:
$java -d32 -version
java version "1.6.0_07"Java(TM) SE Runtime Environment (build 1.6.0_07-b06)Java HotSpot(TM) Server VM (build 10.0-b23, mixed mode)

$java -d64  -versionRunning a 64-bit JVM is not supported on this platform.

Friday, July 29, 2016

How to check versions in Oracle Apps R12?

To check 10.1.3 $ORACLE_HOME Patch set information:

$cat $CONTEXT_FILE | grep -i ias_version

                          [or]
$cat $ORACLE_HOME/config/ias.properties | grep Version  (12.0)
$cat $ORA_CONFIG_HOME/10.1.3/config/ias.properties | grep Version(12.1)


To check File version:
 adident Header $JAVA_TOP/oracle/apps/jtf/regress/qatool/testcase/JavaVersionTest.class

$Header JavaVersionTest.java 120.3 2008/04/29 19:18:28 rlandows ship $

Thursday, July 28, 2016

How to set 32 bit emulation mode in linux 64bit

During oracle application server IAs 10g (32 bit) installation got below error because we tried in 64 bit OS.

Now we need to change the current terminal session environment to 32 bit OS by using " linux32 bash" command.

Error:

$ ./runInstaller 
On a 64-bit Linux operating system, Oracle Applicaton Server 10g needs 32-bit emulation mode in this release. Please set 32-bit emulation mode by running following command and restart the installation.
# linux32 bash


Solution:

$ linux32 bash

[applmgr@ofapjay2 Disk1]$ ./runInstaller
Starting Oracle Universal Installer...


Wednesday, July 27, 2016

How to drop and recreate TEMP Tablespace in Oracle 11g

Today we had one request to shrink temp tablespace ..For this task we dont need any downtime.

High level steps:

a. Create tablespace temp2
b.Make temp2 as default
c.Drop tablespace temp
d.Make tablespace temp
e.Make temp as default.
f.Drop temp2 tablespace.


Output:

1.Create Temporary Tablespace Temp2:

SQL> CREATE TEMPORARY TABLESPACE TEMP2 TEMPFILE  '/backup/JAY_TMP/temp01.dbf' SIZE 4096M;

Tablespace created.

2. Move Default temp tablespace as temp2

SQL> ALTER DATABASE DEFAULT TEMPORARY TABLESPACE temp2;

Database altered.


3. Make sure No sessions are using your Old Temp tablespace

  a.  Find Session Number from V$SORT_USAGE: 
      
 SELECT USERNAME, SESSION_NUM, SESSION_ADDR FROM V$SORT_USAGE; 

   b.  Find Session ID from V$SESSION:

If the resultset contains any tows then your next step will be to find the SID from the V$SESSION view. You can find session id by using SESSION_NUM or SESSION_ADDR from previous resultset.

   SELECT SID, SERIAL#, STATUS FROM V$SESSION WHERE SERIAL#=SESSION_NUM;
       OR

  SELECT SID, SERIAL#, STATUS FROM V$SESSION WHERE SADDR=SESSION_ADDR; 

Kill the sessions.


4. Drop temp tablespace

SQL> DROP TABLESPACE temp INCLUDING CONTENTS AND DATAFILES;

Tablespace dropped.

5. Recreate Tablespace Temp

SQL> CREATE TEMPORARY TABLESPACE TEMP TEMPFILE '/backup/JAY_TMP/temp1.dbf' SIZE 4096M,'/backup/JAY_TMP/temp2.dbf' SIZE 4096M;

Tablespace created.

6 Move Tablespace Temp, back to new temp tablespace

SQL> ALTER DATABASE DEFAULT TEMPORARY TABLESPACE temp;

Database altered.

7. Drop temporary tablespace temp2:

SQL> DROP TABLESPACE temp2 INCLUDING CONTENTS AND DATAFILES;

Tablespace dropped.


No need to do shutdown when drop temp tablespace and the recreate it. If something happen with temp tablespaces e.g. : crash, corrupt, etc. Oracle database will ignore the error, but DML (insert,update,delete) and SELECT Query will suffer.

Database crashed due to 100% usage of datfile mountpoint & Recovery steps

Today one of my database was crashed due to 100% usage of datafile mountpoint. We are getting below error in alert logs.


Linux-x86_64 Error: 28: No space left on device
ORA-63999: data file suffered media failure
ORA-01114: IO error writing block to file 14 (block # 2039938)
ORA-01110: data file 14: '/db05/oradata/JC2INT/vino_data05.dbf'


This is due to hidden parameter _datafile_write_errors_crash_instance  .  Due to this  ANY write error to a datafile will cause the instance to abort.

We need to increase the storage.As a temporary solution, I thought to move tempfiles to another mountpoint and tried to start the database.


In our case DB is already down.Then we need to move the temp files from /db05  to /backup mountpoint to get some freespace.

cd /db05/oradata/JC2INT
mv temp05.dbf   /backup/JC_TMP


SQL> startup mount;
ORACLE instance started.

Total System Global Area 2137886720 bytes
Fixed Size                  2254952 bytes
Variable Size             637536152 bytes
Database Buffers         1493172224 bytes
Redo Buffers                4923392 bytes
Database mounted.
SQL> SELECT name FROM v$tempfile;

NAME
--------------------------------------------------------------------------------
/db05/oradata/JC2INT/temp05.dbf
/db05/oradata/JC2INT/temp04.dbf
/db05/oradata/JC2INT/temp03.dbf
/db05/oradata/JC2INT/temp02.dbf
/db05/oradata/JC2INT/TEMP01.dbf

SQL> ALTER DATABASE RENAME FILE '/db05/oradata/JC2INT/temp05.dbf' TO '/backup/JC_TMP/temp05.dbf';

Database altered.

SQL> SELECT name FROM v$tempfile;

NAME
--------------------------------------------------------------------------------
/backup/JC_TMP/temp05.dbf
/db05/oradata/JC2INT/temp04.dbf
/db05/oradata/JC2INT/temp03.dbf
/db05/oradata/JC2INT/temp02.dbf
/db05/oradata/JC2INT/TEMP01.dbf

SQL> alter database open;

Database altered.


_datafile_write_errors_crash_instance

If _datafile_write_errors_crash_instance = TRUE (default in 11gR2 & after)  then any write to a datafile which fails due to an IO error causes  an instance crash.

 If _datafile_write_errors_crash_instance = FALSE(default before 11gR2) then the behaviour reverts to the previous behaviour (before this fix) such that a write error to a datafile offlines the file if the DB is in archivelog mode and the file is not in system tablespace. If DB in noarchivelog mode , instance will be still aborted.

Monday, July 25, 2016

APEX Images not rendered after refresh

We have refreshed one of our database which is being used by apex applications.We used to store most of the images in the file system.Some of the images are being stored in database.After refresh,when we tried to access application ,apex images which are stored in database is not displayed .

Solution :

We need to reset the password (as same as before refresh) and unlock the below user accounts.

APEX_PUBLIC_USER
APEX_REST_PUBLIC_USER
APEX_LISTENER


Wednesday, July 20, 2016

How To Clear The Cache Using Functional Administrator?

Examples that may require this action to be taken are as follows:
-  iProcurement Preferences (these values actually are User level profile options)
- FND Diagnostics - to enable diagnostics
- FND Debug Log Enabled 
- Personalize Self Service Defn - commonly used  to enable the Personalization Links
- Newly added responsibility is not visible

The following steps are to be utilized to clear all the cache, forcing a refresh and requery of all profile values for the user in question.


1. Login and choose the Functional Administrator responsibility - then choose Home.


2.  Choose the Core Services Tab - then the Caching Framework Sub-Menu (In the dark blue region). - Proceed to choose 'Global Configuration' from the left hand side menu that appears - In the far right choose 'Clear all Cache' button

3. A screen prompts and confirms that the action will clear all cache on the middle tier server - choose Yes. Essentially, this just forces all user sessions to engage and validate - rather than using cached values.

4.A confirmation message is displayed, confirming that all cache has been cleared across middle tiers.

Tuesday, July 19, 2016

Add Responsibility/End-date User through API in R12

How to End-date user & Add Responsibility through API:


Applications users cannot be deleted since records belonging to users are kept for security and monitoring purposes. In addition, the user is recorded in Who columns, so deleting would cause foreign table data integrity problems. Instead, set "End Date" for that user.

Also same for the responsibility. We cannot delete a responsibility. We can only end-date a responsibility.

So Users and responsibilities cannot be deleted, instead you should end-date it.
For menus, functions, custom applications, it is to delete them -- Navigate to the form, query the record, and click on the delete button (or Edit > Delete).

There is no API or scripts to delete user accounts in FND_USER. Deletion of an an e-business suite user account is not possible and not supported.

API To End-Date FND_USER:



begin
fnd_user_pkg.updateuser(x_user_name=>'RJAY',x_owner=>'CUST',x_end_date=>SYSDATE-5);
commit;
end;
/


x_owner can be either SEED or CUST:
To end date seeded users (i.e. sysadmin) x_owner= SEED
To end date custom users x_owner = CUST


API To add responsibility:



-- ---------------------------------------------------------- 
-- Add Responsibility to Oracle FND User 
-- ----------------------------------------------------------- 
DECLARE 
    lc_user_name                        VARCHAR2(100)    := 'RJAY'; 
    lc_resp_appl_short_name   VARCHAR2(100)    := 'SYSADMIN'; 
    lc_responsibility_key          VARCHAR2(100)    := 'SYSTEM_ADMINISTRATOR'; 
    lc_security_group_key        VARCHAR2(100)    := 'STANDARD'; 
    ld_resp_end_date                 DATE                        := NULL; 

BEGIN 
     fnd_user_pkg.addresp 
     (   username           => lc_user_name, 
        resp_app             => lc_resp_appl_short_name, 
        resp_key             => lc_responsibility_key, 
        security_group  => lc_security_group_key, 
        description         => NULL, 
        start_date           => SYSDATE-10, 
        end_date            => ld_resp_end_date 
    );

 COMMIT; 

EXCEPTION 
            WHEN OTHERS THEN 
                        ROLLBACK; 
                        DBMS_OUTPUT.PUT_LINE(SQLERRM); 
END; 
/

SHOW ERR;



How to Compile Forms , Reports & Custom.pll in R12.2

How to Compile Custom.pll   cd $AU_TOP/resource  cp CUSTOM.plx CUSTOM.plx_bkup  cp CUSTOM.pll CUSTOM.pll_bkup  frmcmp_batch module=CUSTOM.pl...