Friday, April 10, 2015

Oracle Weblogic: Setting independant JVM values for Managed Server in setDomainEnv.sh

Version: 

WLS 10.3.6 or FMW Infrastructure 12.1.3

Requirement:

Set the managed server to start with 1GB heap size and 1GB permgen space.

Steps:

1. Open the setDomainEnv.sh (under $DOMAIN_HOME/bin) in a text editor like vi

2. Search the file for the line starting with "IF USER_MEM_ARGS"

    Search for the commented out line starting with "IF USER_MEM_ARGS the environment variable     is set" in the file

3. Add the memory settings for your managed server below that line.
   
    Add the required settings for your managed server. 

Eg: 

# IF USER_MEM_ARGS the environment variable is set, use it to override ALL MEM_ARGS values

if [ "${SERVER_NAME}" == "PRD_ManServer1" ] ; then
     USER_MEM_ARGS="-Xms1024m -Xmx1024m -XX:PermSize=1024m -XX:MaxPermSize=1024m"
export USER_MEM_ARGS
fi
f [ "${USER_MEM_ARGS}" != "" ] ; then
        MEM_ARGS="${USER_MEM_ARGS}"
        export MEM_ARGS
fi

where PRD_MasServer1 is the name of my managed server. I have set both Java heap and permgen space to 1024 (both low and high values) in the above example.

4. Save the file and quit. Restart the managed service

5. Verify the change

    Grep weblogic process to make sure the change is effective

Eg: 

ps -ef|grep weblogic

/java/bin/java -server -Xms1024m -Xmx1024m -XX:PermSize=1024m -XX:MaxPermSize=1024m -Dweblogic.Name=PRD_ManServer1

Thursday, April 2, 2015

ODI-1228 with ORA-25153: Temporary Tablespace is Empty

Version : 

Oracle DB 11.2.0.4.0 - 64bit Production

Issue:

ETL using ODI failing with following error
   
ODI-1228: Task INT_HDI_ARC_HIERARCHY (Integration) fails on the target ORACLE connection HDI.
Caused By: java.sql.SQLException: ORA-25153: Temporary Tablespace is Empty

Analysis:

The error lookup with oerr command showed this

$ oerr ora 25153
25153, 00000, "Temporary Tablespace is Empty"
// *Cause: An attempt was made to use space in a temporary tablespace with no files.
// *Action: Add files to the tablespace using ADD TEMPFILE command.

Verified that the default tablespace of both DB and the DB user doing the ETL is temp1

SQL>  select property_value from database_properties where property_name like '%DEFAULT_TEMP_TABLESPACE%';

PROPERTY_VALUE
--------------------------------------------------------------------------------
TEMP1

SQL> select TEMPORARY_TABLESPACE from dba_users where USERNAME='HDI_UPGR2';

TEMPORARY_TABLESPACE
------------------------------
TEMP1

But when we select the tablepace name based on dba_temp_files view, TEMP1 is missing and onlt TEMP tablespace is seen as shown below.

SQL> select tablespace_name from dba_temp_files;

TABLESPACE_NAME
------------------------------
TEMP

Reason:

The file is deleted at OS level.

We cannot recreate the TEMP1 tablespace because the entry is still available in data dictionary and only the temp file associated with the tablespace is physically removed. If we try to recreate we will get following error.

ORA-01543: tablespace 'TEMP1' already exists

Solution:

Add a file to the TEMP1 tablespace using ALTER TABLESPACE command as shown here

SQL> alter tablespace temp1 add tempfile '<FILE_PATH>/temp01.dbf' size 100m autoextend on next 1m maxsize unlimited;

Tablespace altered.

Now when we query dba_temp_files, we can get TEMP1 as well.


SQL> select tablespace_name from dba_temp_files;

TABLESPACE_NAME
------------------------------
TEMP
TEMP1

ETL succeded after that