Pages

Monday, December 31, 2012

Could Not Reserve Records Due to Database Record Lock



 Could Not Reserve Records Due to Database Record Lock [ID 140969.1]



fix:

1. Identify the Oracle serial ID, SID ID and terminate without shutting the
   database down.

   1.1 Make sure that the user is logged off.
 
       1.1.1  Type ps -ef |grep
 
       1.1.2  Kill all processes related to that user.

   1.2 Identify SID, serial#
 
       select  distinct
               acc.object, ses.osuser, ses.process,
               ses.sid, ses.serial#
       from    v$access  acc,
               v$session ses
       where   (acc.owner != 'SYS'
       or      acc.object = 'PLAN_TABLE')
       and     acc.sid    = ses.sid
       and     ses.status != 'INACTIVE'
       and ses.type  != 'BACKGROUND'
       and     acc.object not in ('V$ACCESS','V$SESSION')
       and     ses.audsid != userenv('SESSIONID')
       order by 1,2,3
       /

   1.3. Double-check the identified SID and serial ID:

        SELECT  osuser,
                username,
                process,
                sid,
                serial#,
                status,
                to_char(logon_time,'DD-MON HH24:MI:SS') logon_time,
                machine,
                program
        FROM    v$session
        WHERE   sid     = &SID_NUM
        /

   1.4. ALTER SYSTEM KILL SESSION '&SID_NUM,&SERIAL_NUM';
Alternatively use the following scripts to identify the blocking session:

-- check for locked tables
select a.object_id, a.session_id, substr(b.object_name, 1, 40)
from v$locked_object a,
dba_objects b
where a.object_id = b.object_id
order by b.object_name ;

--find_blocked.sql
select sid,
decode(block ,0,'NO','YES') BLOCKER,
decode(request,0,'NO','YES') WAITER
from v$lock
where request > 0 or block > 0 order by block desc
/

SELECT 'alter system kill session '''||vs.sid||','||vs.serial#||'''' ,al.
object_name, al.object_type, vs.status,
fu.user_name,vs.process,vs.osuser,vs.username,
to_char(vs.logon_time,'DD-MON HH24:MI:SS') logon_time, vs.program
FROM fnd_logins fl, fnd_user fu, all_objects al, v$lock vl, v$session vs
WHERE fl.pid = vl.sid
AND vl.id1 = al.object_id (+)
AND fl.user_id = fu.user_id
AND to_char (start_time, 'DD-MON-RR') = to_char (sysdate, 'DD-MON-RR')
and vs.sid=vl.sid
and vl.sid = &sid

'ALTERSYSTEMKILLSESSION'''||VS.SID||','||VS.SERIAL#||''''




Release 12 : ADSTRTAL.sh returns error : TIMED OUT( 100000 ): INTERRUPTED EXCEPTION


Release 12 : ADSTRTAL.sh returns error : TIMED OUT( 100000 ): INTERRUPTED EXCEPTION [ID 564536.1]


When starting Application Server 10g services with EBusiness Suite Release 12, if the server is heavily loaded you may sometimes receive a timeout message from one or more startup scripts called by adstrtal.sh:-
  adoacorectl.sh
  adformsctl.sh
  adoafmctl.sh

This note describes how you can increase the default timeout values for the startup scripts, which may prevent this issue from occurring.

Solution

The OC4J containers (JVMs) with AS10g are given a certain amount of time to startup.  If the time taken to startup the process is longer than

this value, you will see an error returned by the startup script.

NOTE : despite the error being thrown, the process may actually startup correctly.  You can use the following command to check the
status of the processes:-

 $ADMIN_SCRIPTS_HOME/adopmnctl.sh status
The error seen for a timeout will normally be similar to that shown below:-

****************************************************
        Executing service control script:
        /oracle/VIS/inst/apps/VIS_myhost/admin/scripts/adoafmctl.sh start
        script returned:
****************************************************
        ERROR : Timed out( 100000 ): Interrupted Exception
        You are running adoafmctl.sh version 120.6.12000000.2
        Starting OPMN managed OAFM OC4J instance  ...
****************************************************


The timeout value is defined in the $ORA_CONFIG_HOME/10.1.3/opmn/conf/opmn.xml file   There are three entries to be concerned about, one for
each of the managed OC4J containers (oacore, forms and oafm).  The entry is shown below the appropriate "process-type id=" section and looks
 like shown below by default:-



Modifying the timeout value from "600" to "1800" may resolve the timeout error

For example you may see entry similar to shown below for the "oacore" JVM group (lines omitted for brevity)

   
     
       ...............
       ...............
     
     
     
     
       ...............
       ...............

These default timeout values cannot be changed using Autoconfig variables, so any change needs to be implemented using the "Configuration Customizations" section in Note 387859.1 : Using AutoConfig to Manage System Configurations in Oracle Applications Release 12

If you are running into this issue and want to change the timeout as described in this note, these are the recommended steps:

If your problem is occurring in a TEST environment

1.  Shutdown all AS10g services
2.  Manually edit the opmn.xml file as described above
3.  Restart AS10g services to confirm the timeout message is no longer seen
4.  Implement this new timeout value by modifying the AutoConfig template for opmn.xml

Filename "opmn_xml_1013.tmp" located in $FND_TOP/admin/template
5.  Run AutoConfig to regenerate the configuration files with your changes
6.  Check the changes have taken effect in the opmn.xml file correctly
7.  Restart AS10g services and confirm the timeout message no longer appears

If your problem is occurring in a PRODUCTION environment

1.  Shutdown all AS10g services on a TEST environment
2.  Modify the AutoConfig template for opmn.xml for your TEST environment
3.  Run AutoConfig on TEST environment to regenerate the configuration files with your changes
4.  Check the files in TEST environment to be sure the change has taken effect as expected
5.  Restart AS10g Service on TEST environment and ensure the services all startup correctly
6.  Promote this change to your PROD instance



Note: You may see adoacorectl.sh or other OPMN managed scripts fail with message "exiting with status 150"

This may indicate that the script has not started/stopped within the timeout defined for the service control infrastructure

"s_oacoretimeout" is an AutoConfig variable whose value is used internally by the service control infrastructure to determine how much time it should wait before giving up on a script that starts/stops a service.
The above error likely indicates this OACore timeout has been hit. The default is 100 seconds, but can be increased if necessary.
The variables for the OPMN managed processes are:
s_oacoretimeout
s_formstimeout
s_oafmtimeout

ORA-01403: No data found and FRM-40735: PRE-FORM trigger raised unhandled




Setting up a Receivable Activity Raises Error: ORA-01403: No data found and FRM-40735: PRE-FORM trigger raised unhandled


Oracle Receivables - Version 12.0.0 and later
Information in this document applies to any platform.
This problem can occur on any platform.
ARXSUMRT

Symptoms

When attempting to create or update a Receivables Activity, the following error occurs.

ERROR:
ORA-01403: No data found
FRM-40735: PRE-FORM trigger raised unhandled exception ORA-1403.

Steps to Reproduce:
Respopnsibility: Receivables Manager
Navigation: Setup > Receipts > Receivables Activities

1. Enter an operating unit
2. Enter a Name
3. Change Type

Cause

No Party Tax Profile (eBusiness Tax) has been setup for this Operating Unit.
Creating a Party Tax Profile for the operating unit is required to Setup in Receivable Activities in Oracle Receivables.

A better error message mechanism is provided via Bug 7677429 ARXSUMRT SETUP RECEIVABLE ACTIVITY ERROR FRM-40735 WHEN-VALIDATE-ITEM ORA-1


Solution

1. A Party Tax Profile is a pre-requisite to creating Receivable Activities, Please create Party Tax Profile for this OU

Responsibility: Tax Managers
Navigation: Party Tax Profile

Choose Party Type= Operating Unit owing Tax Content
Select Party Name= Operating Unit
Create Party Tax Profile for the new operating unit.
2. For a better error message raised by the form, please apply the following:

1. Bug Summary

Description
Unhandled exception in creating a Receivable Activity Raises ORA and FRM errors

Workaround
None

Resolution
Provided better error handling by providing a user-friendly error message.
2. Fixed Files


R12.AR.A:
ARXSUMRT.fmb 120.25.12000000.7

R12.AR.B:
ARXSUMRT.fmb 120.25.12010000.5

3. Recommended Patches

R12.AR.A and R12.AR B: Patch 7677429
R12.AR.B: No standalone patch released. However, the fix is included in R12.1.1

4. Solution Steps

Ensure that you have taken a backup of your system before applying the recommended patch.
Apply the patch in a test environment.
Confirm the file versions listed above.
You can use the commands like the following:
strings -a $AR_TOP/filename |grep '$Header'
Retest the issue.
Migrate the solution as appropriate to other environments.
If the patch for your release is unavailable for download or needs a password, please contact Oracle Support for Assistance.
References

How to change hostname for E-Business Suite Release 12 on single node




How to change hostname for E-Business Suite Release 12 on single node

Oracle Applications Manager - Version 12.0.1 to 12.1.2 [Release 12 to 12.1]
Information in this document applies to any platform.



Oracle E-Business Suite is dependent to hostname and domain. Assume that E-Business Suite has just one node so that all Tiers and Servers reside on this node. Please refer to following to modify the hostname on EBS R12.

For Windows EBS server users,  that have to open a command window and source the mks Enviroenment to be able to execute below Unix commands.



Fix

1. DB Tier: Deregister the current database server

As the database hostname and domain will be changed, the current database server node needs to be de-registered.

select NAME, SERVER_TYPE
from FND_APP_SERVERS, FND_NODES
where FND_APP_SERVERS.NODE_ID = FND_NODES.NODE_ID
and SERVER_TYPE='DB'
and FND_NODES.NODE_NAME='old_hostname';


NAME SERVER_TYPE
--------------- -----------
oldhost__DB DB 

Executing following commands to deregister the current database server:
cd $ORACLE_HOME/appsutil
perl ./bin/adgentns.pl appspass= contextfile=./_oldhost.xml -removeserver

select NAME, SERVER_TYPE
from FND_APP_SERVERS, FND_NODES
where FND_APP_SERVERS.NODE_ID = FND_NODES.NODE_ID
and SERVER_TYPE='DB'
and FND_NODES.NODE_NAME='old_hostname';


no rows selected.

2. DB Tier: Create a new Context file

You can create the new context file using whichever of the following methods:

a. Manual Method:
cd $ORACLE_HOME/appsutil
cp _oldhost.xml _newhost.xml

Edit _newhost.xml manually: 
Replace all oldhost with newhost
b. Script Method:(The command below will create a new Context file of the format _newhost.xml in the current working directory.) 
cd $ORACLE_HOME/appsutil
perl ./clone/bin/adclonectx.pl contextfile=./_oldhost.xml

**************************************************************************************************************************

Enter the APPS password :   
Log file located at /appsutil/CloneContext_1223165155.log 
Provide the values required for creation of the new Database Context file.
Target System Hostname (virtual or normal) [nascapp6] :
It is recommended that your inputs are validated by the program.
However you might choose not to validate them under following circumstances:
-If cloning a context on source system for a remote system.
-If cloning a context on a machine where the ports are taken and
you do not want to shutdown the services at this point.
-If cloning a context but the database it needs to connect is not available.
Do you want the inputs to be validated (y/n) [n] ? :
Target Instance is RAC (y/n) [n] :
Target System Database SID :  
Target System Base Directory :  
Oracle OS User [oravis] :
Oracle OS Group [dba] :
Target System utl_file_dir Directory List :/usr/tmp
Number of DATA_TOP's on the Target System [4] : 1
Target System DATA_TOP Directory 1 : /d01/oracle/PROD/db/apps_st/data <------- data="data" files="files" input="input" nbsp="nbsp" of="of" p="p" path="path" the="the" your="your">Target System RDBMS ORACLE_HOME Directory [/d01/oracle/PROD/db/tech_st/11.1.0] :
Do you want to preserve the Display [null] (y/n) ? : n
Target System Display [newhost:0.0] :
Do you want the the target system to have the same port values as the source system (y/n) [y]?:
Complete port information available at /appsutil/out/_nascapp6/portpool.lst 
New context path and file name [/appsutil/PROD_nascapp6.xml] : 
Creating the new Database Context file from :
/appsutil/template/adxdbctx.tmp 
The new database context file has been created :
/appsutil/PROD_nascapp6.xml 
Log file located at /appsutil/CloneContext_1223170424.log 
contextfile=/appsutil/PROD_nascapp6.xml 
Check Clone Context logfile /appsutil/CloneContext_1223170424.log for details. 
**************************************************************************************************************************
3. APPS Tier: Deregister the current Applications server

As the Applications hostname and domain will be changed, the current Applications server node needs to be de-registered.

select NAME, SERVER_TYPE
from FND_APP_SERVERS, FND_NODES
where FND_APP_SERVERS.NODE_ID = FND_NODES.NODE_ID
and SERVER_TYPE='APPS'
and FND_NODES.NODE_NAME='old_hostname';


NAME SERVER_TYP
----------------- ----------
oldhost__APPS APPS 

Executing following commands to deregister the current Applications server:
cd $APPL_TOP/admin
perl $AD_TOP/bin/adgentns.pl appspass= contextfile=./_oldhost.xml -removeserver

select NAME, SERVER_TYPE
from FND_APP_SERVERS, FND_NODES
where FND_APP_SERVERS.NODE_ID = FND_NODES.NODE_ID
and SERVER_TYPE='APPS'
and FND_NODES.NODE_NAME='old_hostname';


no rows selected.
 4. APPS Tier: Create a new Context file

You can create the new context file using whichever of the following methods:

a. Manual Method:
cd $APPL_TOP/admin
cp _oldhost.xml _newhost.xml

Edit _newhost.xml manually: 
Replace all oldhost with newhost
b. Script Method:(The command below will create a new Context file of _newhost.xml in new _newhost directory.) 
cd $INST_TOP/appl/admin
perl $COMMON_TOP/clone/bin/adclonectx.pl contextfile=./_oldhost.xml


**************************************************************************************************************************

Enter the APPS password : apps
Log file located at $INST_TOP/appl/admin/CloneContext_1223173053.log
Provide the values required for creation of the new APPL_TOP Context file.
Target System Hostname (virtual or normal) [nascapp6] :
It is recommended that your inputs are validated by the program.
However you might choose not to validate them under following circumstances:
-If cloning a context on source system for a remote system.
-If cloning a context on a machine where the ports are taken and
you do not want to shutdown the services at this point.
-If cloning a context but the database it needs to connect is not available.
Do you want the inputs to be validated (y/n) [n] ? :
Target System Database SID :  
Target System Database Server Node [nascapp6] :
Target System Base Directory :  
Target System Tools ORACLE_HOME Directory [<10 .1.2=".1.2">] : 
Target System Web ORACLE_HOME Directory [<10 .1.3=".1.3">] : 
Target System APPL_TOP Directory [<$APPL_TOP>] :
Target System COMMON_TOP Directory [<$COMMON_TOP>] :
Target System Instance Home Directory [<$INST_TOP>] :
Username for the Applications File System Owner [applvis] :
Group for the Applications File System Owner [dba] :
Target System Root Service [enabled] :
Target System Web Entry Point Services [enabled] :
Target System Web Application Services [enabled] :
Target System Batch Processing Services [enabled] :
Target System Other Services [disabled] :
Do you want to preserve the Display [oldhost:0.0] (y/n) ? : newhost:0.0
Target System Display [newhost:0.0] :
New context path and file name [$INST_TOP/appl/admin/_newhost.xml] : 
**************************************************************************************************************************

5. APPS Tier: Shutdown the Application Tier Services

cd $INST_TOP/admin/scripts
./adstpall.sh apps/

6. Change the server machine hostname.

Please contact your IT administrator to change the machine hostname.
7. DB Tier: Reseed the Net Services Topology Model

cd $ORACLE_HOME/appsutil
./bin/adconfig.sh contextfile=./_newhost.xml

8. APPS Tier: Reseed the Net Services Topology Model

The Net Services Topology Model is automatically updated by running AutoConfig.
$AD_TOP/bin/adconfig.sh contextfile= $INST_TOP/../_newhost//appl/admin/_newhost.xml appspass=

9. DB Tier: Shutdown the database and listener

$ORACLE_HOME/appsutil/scripts/_oldhost/addbctl.sh stop 
$ORACLE_HOME/appsutil/scripts/_oldhost/addlnctl.sh stop

10. DB Tier: Start the listener and database

$ORACLE_HOME/appsutil/scripts/_newhost/addlnctl.sh start  
$ORACLE_HOME/appsutil/scripts/_newhost/addbctl.sh start

11. APPS Tier: Start the Application Tier Services

$INST_TOP/admin/scripts/_newhost/adstrtal.sh apps/


Thursday, December 27, 2012

How to Start and Stop Financial Management (HFM) Server Windows Processes



How to Start and Stop Financial Management (HFM) Server Windows Processes

  What are the main Windows processes of an HFM application server?
  What happens when I start the HFM Windows Service?
  What happens when I stop the HFM Windows Service?
  Why should I use the HFM Windows Service?
  When should I not use the HFM Windows Service?
  Allowing HFM to start and stop as needed.
  Why do I see multiple HsvDataSource.exe processes on an HFM application server?
  When does the HsvDataSource.exe process stop itself?
  Why might the HsvDataSource.exe not stop by itself?
  What is the CASSecurity.exe process?
  In what order should the HFM processes be stopped?

Applies to:

Hyperion Financial Management - Version 1.0.0.0.00 to 11.1.2.0.00 [Release 1.0 to 11.1]
Information in this document applies to any platform.
Purpose

This document describes the starting and stopping of the main Windows processes that are seen in the Windows Task Manager of a HFM application server.

Scope

This document is intended for use by Hyperion Financial Management administrators with a good understanding of the Windows Task Manager, in particular the Processes tab.

Details

What are the main Windows processes of an HFM application server?

The main Windows processes of a HFM application server are HsxService.exe, HsxServer.exe, CASSecurity.exe and HsvDatasource.exe.

What happens when I start the HFM Windows Service?

Oracle's Hyperion Financial Management can be started by starting the Windows Service "Hyperion Financial Management - Management Service". When this service is started, a process called HsxService.exe will become visible in the Windows Task Manager, and will remain running until the Windows Service is stopped. The HsxServer.exe, CASSecurity.exe and HsvDataSource.exe processes are also started.

What happens when I stop the HFM Windows Service?

When the Hyperion Financial Management Windows service is stopped, the HsxService.exe process will be stopped along with the HsvDataSource.exe, CASSecurity.exe and HsxServer.exe processes.

Why should I use the HFM Windows Service?

Oracle typically recommends that customers use the Windows Service approach only when their individual applications within their HFM database are known to take several minutes to start up. By starting the Windows Service, the application server will pre-launch each application, which will then be "active" and already started when the first user attempts to connect to the application. In this way, the user will not experience any "delay" while logging in, due to application startup time.

Applications may take longer to start up when their metadata dimensions are very large, when an application server or database is under heavy load, or when the rules file of the application contains a slow performing "NoInput" rules section. This section may take longer to execute if it contains many loop statements through many different metadata Point of View (POV) members. Care should be taken when designing metadata and NoInput rules routines to reduce the start up time of an individual application.

When should I not use the HFM Windows Service?

A potential disadvantage of using the Windows Service approach is that all applications are started, regardless of the true requirement and usage of the end users. If there are many applications that exist in the HFM database, unnecessary memory and CPU cycles may be used launching applications which are not needed by the end users. For this reason, Oracle recommends that customers not keep unused HFM applications in production environment HFM databases, or to not use the HFM Windows Service approach if there are known unused HFM applications in the database.

Allowing HFM to start and stop as needed.

If the HFM Windows Service is not being used as above, Financial Management will start itself when end users attempt to log on to an HFM application. When any end user connects to HFM for the first time on a particular application server, the process HsxServer.exe will be started. This process builds connections to the HFM database repository, authenticates the user connecting, and returns a list of available HFM applications within the database. There will only be one HsxServer.exe process on each application server. If the end user who connected to the HFM application server then proceeds to select an HFM application name to open, the HsxServer.exe process will then launch the HsvDataSource.exe Windows process to start that application. The HsxServer.exe process will remain running until there are no users logged on to that application server and all HsvDataSource.exe processes have also stopped.

Why do I see multiple HsvDataSource.exe processes on an HFM application server?

Hyperion Financial Management opens one HsvDataSource.exe (HSVDAT~1.EXE) process on the HFM server per active application. Connections are application specific. If multiple applications are opened, multiple HsvDataSource.exe processes will be launched.

When an application is opened, a database connection pool is created between the application process and the relational database (SQL Server / Oracle / DB2 etc). However, connections are not released on an application basis - they are released on an application server basis. All connections are not released until the application server has no Financial Management users accessing any application.

When does the HsvDataSource.exe process stop itself?

When an application server determines that all users of a particular application on that application server have correctly logged off or timed out (e.g. web time out), then it sends a signal to the HsvDataSource.exe process running that application to stop itself.

When all HsvDataSource.exe processes on a particular application server have stopped themselves, then the HsxServer.exe and CASSecurity.exe processes will also be stopped. After a short delay, under normal circumstances, all HFM processes will stop themselves. Only when all HFM processes on all HFM application servers have been stopped is it safe to make changes to the relational database for example, copying applications, taking or restoring backups of the database or powering down the database. Changes to the database should NOT be made while any HsvDataSource.exe process is seen running in the Windows Task Manager.

Why might the HsvDataSource.exe not stop by itself?

If end users log off incorrectly, their sessions may not have stopped. Hyperion Reports, Financial Reporting, Web Analysis, Financial Data Quality Management, Shared Services task flows or other modules may be holding open connections to Financial Management applications. All other Hyperion processes and services which may be connecting to Financial Management should be stopped first. Financial Management administrators may like to use the "Users on System" module of Financial Management to stop end user connections. When Financial Management decides that all connections have stopped, it should proceed to shut itself down automatically.

What is the CASSecurity.exe process?

Another Windows process is CASSecurity.exe. This is a process that manages the interface between Financial Management and Hyperion Shared Services modules. It handles some of the authorization and authentication processes of HFM, as well as security related features while the application is running.  Important Note:  Any change in the Shared Services external provider configuration REQUIRES the CASSecurity.exe process to be recycled in order gain access to the provider changes.  Follow the "In what order should the HFM processes be stopped" section.

In what order should the HFM processes be stopped?

If Financial Management appears to have frozen / crashed it may be necessary to stop the processes. Processes should be stopped in the following order:

The Hyperion Financial Management Windows Service (HsxService.exe) should be stopped via the Windows Services if it seen to be running.
The HsvDataSource.exe for each application should be shut down. Ideally it should be observed that the HsvDataSource.exe is using 00% CPU in the Windows Task Manager before it is stopped using "End Process". Care should be taken when stopping running processes.
Any CASSecurity.exe process which is still running in the Windows Task Manager should be stopped using "End Process"
If any HsxServer.exe process is still running, it should be stopped using "End Process"

CAUTION: In a multi-server environment where multiple application servers are connecting to the same relational database, the process of stopping HFM should be repeated on ALL HFM application servers before attempting to restart any HFM processes or "bring up" the applications once again. It is not recommended to stop and start any one server independently but instead to stop the whole environment and then bring it back up.


Wednesday, December 26, 2012

Helpful scripts working with oracle applications


Do you have suggestions on some helpful SQL scripts when working with the Oracle Applications?



1. Database

1.1 General Objects / Tables / Columns

PROMPT Find Object by Type, Name, Status
select object_name, object_type, owner, status
  from dba_objects
 where upper(object_name) like upper('%&object_name%')
   and object_type like upper('%'|| NVL('&object_type', 'TABLE')|| '%')
   and status like upper('%'|| NVL('&Status', '%')|| '%')
order by object_name, object_type;

PROMPT Find table indexes, keys, columns
select index_name,column_position,column_name
from all_ind_columns
where table_name = '&EnterTableName'
order by index_name, column_position;

PROMPT Find tables and columns that include a table and/or column name specified.
select table_name, column_name
from  dba_tab_columns
where column_name like NVL(UPPER('&COLUMN_NAME'), column_name)
  and table_name like NVL(UPPER('&TABLE_NAME'), table_name);


1.2 Invalids / Compiling

PROMPT Find Invalids
select object_name, object_type, owner, status
  from dba_objects
 where status = 'INVALID';

PROMPT Compile Packages
select 'alter package '|| object_name || ' compile '|| decode(object_type, 'PACKAGE', '', 'PACKAGE BODY', 'body')|| ';'
  from dba_objects
 where status = 'INVALID'
and object_type like 'PACK%';


1 .3 Bugs and Patching

PROMPT Find specific package version
select text from dba_source
where
   name = upper( '&PackageName')
    and line < 3;

PROMPT Find bugs already installed fixed in your system
select bug_number
  from ad_bugs
  where bug_number  ='&Bug_Number';

PROMPT Find patches applied
select substr(patch_name,1,12) patch_num
  from ad_applied_patches
 where patch_name like '%&Patch_Number%';

NOTE: A specific bug maybe fixed by multiple patches so it might be good to look for the bug number, instead of the patch number to see if that bug is fixed already on your system. Another way is to look at the file version mentioned in the patch and check if you have that version or higher.

1.4 Other Objects

PROMPT Query view details of a specific view.
SELECT VIEW_NAME, TEXT
  FROM DBA_VIEWS
WHERE VIEW_NAME = UPPER('&VIEW_NAME')
  and owner = 'APPS';

PROMPT Trigger details on a table.
select TABLE_NAME, COLUMN_NAME, trigger_name, trigger_type, TRIGGER_BODY
from dba_TRIGGERS
WHERE TABLE_NAME like '%&EnterTableName%';



1.5 Helpful SQL Syntax

1.5.1 Rowid:
Working with Rowids: rowidtochar(rowid) and chartorowid('AAABUeAAQAAACsjAAg')

1.5.2 Date Columns
a. Converting dates to show date with time: to_char( 'DD-MON-YYYY HH24:MI:SS') 
For example: select to_char(sysdate, 'DD-MON-YYYY HH24:MI:SS') from dual;
b. Comparing date columns -- Sometimes handy to skip the time portion when searching for dates. You can use the trunc command to strip the time off. This resets the time to midnight.
For example: select to_char(trunc(sysdate), 'DD-MON-YYYY HH24:MI:SS') from dual;



2. Foundation (FND/ATG/AOL)

2.1 SQL related to Oracle Application Messages


PROMPT ATG
PROMPT Find Messages by Message Text
select m.message_name, m.message_text, m.message_number, a.application_short_name
from fnd_new_messages m, fnd_application a
where upper(m.message_text) like upper('%&EnterMessageText%')
and m.language_code = 'US'
and m.application_id = a.application_id;

PROMPT Find Messages by Message Short Name
select m.message_name, m.message_text, m.message_number, a.application_short_name
from fnd_new_messages m, fnd_application a
where m.message_name like '%&EnterMessageName%'
and m.language_code = 'US'
and m.application_id = a.application_id;


2.2. Review Oracle Application Programs

a. Looking for trace files (Also see Note 296559.1 for more examples on various versions / releases.)
PROMPT IDENTIFY CONCURRENT REQUEST FILE
PROMPT From Bug.3211206
PROMPT Use the following query to identify the correct trace file:
PROMPT where "request" is the concurrent request id for the inventory transaction
PROMPT worker.
SELECT 'Request id: '||request_id ,
'Trace id: '||oracle_Process_id,
'Trace Flag: '||req.enable_trace,
'Trace Name:
'||dest.value||'/'||lower(dbnm.value)||'_ora_'||oracle_process_id||'.trc',
'Prog. Name: '||prog.user_concurrent_program_name,
'File Name: '||execname.execution_file_name|| execname.subroutine_name ,
'Status : '||decode(phase_code,'R','Running')
||'-'||decode(status_code,'R','Normal'),
'SID Serial: '||ses.sid||','|| ses.serial#,
'Module : '||ses.module
from fnd_concurrent_requests req, v$session ses, v$process proc,
v$parameter dest, v$parameter dbnm, fnd_concurrent_programs_vl prog,
fnd_executables execname
where req.request_id = &request
and req.oracle_process_id=proc.spid(+)
and proc.addr = ses.paddr(+)
and dest.name='user_dump_dest'
and dbnm.name='db_name'
and req.concurrent_program_id = prog.concurrent_program_id
and req.program_application_id = prog.application_id
and prog.application_id = execname.application_id
and prog.executable_id=execname.executable_id;

b. Another for programs and managers:
PROMPT Programs and Managers
PROMPT Provide various output of concurrent managers related to a specific program.
PROMPT In this case using default of Item Supply/Demand program.
SELECT
fcq.processor_application_id, fcp.concurrent_program_name,
fr.responsibility_id, fr.responsibility_key, fr.data_group_id, fr.request_group_id,
fr.application_id, fa.application_short_name,
fcq.concurrent_queue_id, fcq.CONCURRENT_QUEUE_NAME,
fcq.MIN_PROCESSES, fcq.TARGET_PROCESSES, fcq.TARGET_NODE, fcq.SLEEP_SECONDS, fcq.CONTROL_CODE, fcq.DIAGNOSTIC_LEVEL,
fcpr.*
FROM fnd_application fa,
fnd_concurrent_programs fcp,
fnd_conc_processor_programs fcpp,
fnd_responsibility fr,
fnd_concurrent_queues fcq,
fnd_concurrent_processes fcpr
WHERE fcq.processor_application_id = fcpp.processor_application_id
AND fcq.concurrent_processor_id = fcpp.concurrent_processor_id
AND fcpp.concurrent_program_id = fcp.concurrent_program_id
AND fcpp.program_application_id = fcp.application_id
AND fcp.application_id = fa.application_id
AND fcp.concurrent_program_name = NVL('&EnterProgramShortName', 'INXDSD')
AND fr.application_id = 401
AND fr.data_group_id = fcq.data_group_id
AND fcq.manager_type = '3'
AND fcpr.concurrent_queue_id = fcq.concurrent_queue_id
AND fcpr.queue_application_id = fcq.application_id
-- AND fcpr.process_status_code = 'A'
AND fcpr.instance_number = userenv('instance')
ORDER BY dbms_random.random;

c. Concurrent program statuses
PROMPT Concurrent program values
Select distinct lookup_code, meaning From Fnd_Lookup_Values
Where Lookup_Type = 'CP_STATUS_CODE'
order by lookup_code;

A Waiting
B Resuming
C Normal
D Cancelled
E Error
G Warning
H On Hold
I Normal
M No Manager
P Scheduled
Q Standby
R Normal
S Suspended
T Terminating
U Disabled
W Paused
X Terminated
Z Waiting

d. Submitted Concurrent Programs
Select * From Fnd_Concurrent_Requests
Where Request_Id = &YourRequestID;

Example Output:
Phase_Code: C
Status_Code: G
Argument_Text: 207, 2, , Jbp1-M1-10, ,
Argument1: 207
Argument2: 2
Argument3: Null
Argument4: JTP1-M1-10
CONCURRENT_PROGRAM_ID: 31534

e. Ensure trace is disabled
The best way is to check via the forms System Administrator > Concurrent > Programs > Define. This is just a quick update to change trace enabled to no.
Update Fnd_Concurrent_Programs
Set Enable_Trace = 'N'
where ENABLE_TRACE = 'Y';


2.3. Users and Responsibilities

a. Basic user check
PROMPT Basic check for user details
select user_id, user_name, employee_id
from fnd_user
where user_name like '&EnterUserName%';

b. Active users

PROMPT Active Users
select fnd.user_name, icx.responsibility_application_id, icx.responsibility_id, frt.responsibility_name,
icx.session_id, icx.first_connect,
icx.last_connect,
DECODE ((icx.disabled_flag),'N', 'ACTIVE', 'Y', 'INACTIVE') status
from
fnd_user fnd, icx_sessions icx, fnd_responsibility_tl frt
where
fnd.user_id = icx.user_id
and icx.responsibility_id = frt.responsibility_id
and icx.disabled_flag <> 'Y'
and trunc(icx.last_connect) = trunc(sysdate)
order by icx.last_connect;

c. Users with a responsibility
There is also a similar concurrent program "Users of a Responsibility".
PROMPT Find users who have a responsibility
select usr.user_id, usr.user_name, res.RESPONSIBILITY_ID, res.RESPONSIBILITY_NAME
from apps.FND_USER usr, apps.FND_RESPONSIBILITY_TL res, apps.FND_USER_RESP_GROUPS grp
where upper(res.RESPONSIBILITY_NAME) like upper('%' || NVL('&EnterRespName', 'INV')|| '%')
and upper(res.RESPONSIBILITY_NAME) NOT like '%AX%'
and upper(res.RESPONSIBILITY_NAME) NOT like '%OPM%'
and grp.responsibility_id = res.responsibility_id
and grp.user_id = usr.user_id;

d. Values of a profile option
It is sometimes hard to know where a profile option is set. A user might have a profile option set, an application, responsibility, and these might result in unexpected results. The following prompts for the profile name that a user sees. You could also query for the internal profile code instead by using the column a.profile_option_name instead.
select
b.user_profile_option_name "Long Name"
, a.profile_option_name "Short Name"
, decode(to_char(c.level_id),'10001','Site'
,'10002','Application'
,'10003','Responsibility'
,'10004','User'
,'Unknown') "Level"
, decode(to_char(c.level_id),'10001','Site'
,'10002',nvl(h.application_short_name,to_char(c.level_value))
,'10003',nvl(g.responsibility_name,to_char(c.level_value))
,'10004',nvl(e.user_name,to_char(c.level_value))
,'Unknown') "Level Value"
, c.PROFILE_OPTION_VALUE "Profile Value"
, c.profile_option_id "Profile ID"
, to_char(c.LAST_UPDATE_DATE,'DD-MON-YYYY HH24:MI') "Updated Date"
, nvl(d.user_name,to_char(c.last_updated_by)) "Updated By"
from
apps.fnd_profile_options a
, apps.FND_PROFILE_OPTIONS_VL b
, apps.FND_PROFILE_OPTION_VALUES c
, apps.FND_USER d
, apps.FND_USER e
, apps.FND_RESPONSIBILITY_VL g
, apps.FND_APPLICATION h
where
--a.application_id = nvl(401, a.application_id)
--and a.profile_option_name = nvl('INV', a.profile_option_name)
b.user_profile_option_name like '&ProfileName' -- 'AFLOG_ENABLED'
and a.profile_option_name = b.profile_option_name
and a.profile_option_id = c.profile_option_id
and a.application_id = c.application_id
and c.last_updated_by = d.user_id (+)
and c.level_value = e.user_id (+)
and c.level_value = g.responsibility_id (+)
and c.level_value = h.application_id (+)
order by
b.user_profile_option_name, c.level_id,
decode(to_char(c.level_id),'10001','Site'
,'10002',nvl(h.application_short_name,to_char(c.level_value))
,'10003',nvl(g.responsibility_name,to_char(c.level_value))
,'10004',nvl(e.user_name,to_char(c.level_value))
,'Unknown');


2.4 Set Context / Initialize

Sometimes you want to run queries that reference profile options. To do this, you should first initialize the context of the current session to the user, responsibility and application being used. You can also set the context of the current inventory organization for queries that reference the organization context.

a. Set context
PROMPT Initialize context of profiles, etc.
PROMPT Note you can query the user id, responsibility id,
PROMPT and application id from the FND tables.
execute fnd_global.APPS_INITIALIZE(&UserID, &ResponsibilityID, &ApplicationID);

b. Set organization
PROMPT Set organization
PROMPT Note you can query the organization idea from mtl_parameters.
execute fnd_client_info.set_org_context('&OrganizationID');



3. Manufacturing

3.1 Manufacturing General


PROMPT MANUFACTURING
PROMPT Find standard codes and their meanings
select
   lookup_type,
   lookup_code,
   substr(meaning, 1, 60) "Meaning"
from mfg_lookups
where
upper(lookup_type) like upper('%'||NVL('&YourType', 'N/A')||'%')
or lookup_type IN('SERIAL_NUM_STATUS', 'MTL_PRIMARY_COST', 'MTL_CC_ENTRY_STATUSES', 'MTL_TXN_REQUEST_STATUS', 'MOVE_ORDER_TYPE')
order by lookup_type, lookup_code;



3.2. Setup

3.2.1. Inventory

a. Transaction types

PROMPT MANUFACTURING: INVENTORY
PROMPT Transaction Type
SELECT transaction_type_id, transaction_action_id, TRANSACTION_SOURCE_TYPE_ID, TRANSACTION_TYPE_NAME
FROM MTL_TRANSACTION_TYPES
WHERE to_char(transaction_type_id) like ('%&YourTransactionTypeID%')
ORDER BY transaction_type_id;


b. Transaction sources:
PROMPT Transaction Source
select transaction_source_type_id, transaction_source_type_name
from mtl_txn_source_types
where transaction_source_type_id like NVL('&TransSourceID', '%');
3.3. Transactions

3.3.0 Inventory + Order Management

a. View orders and lines of a given order number:
SELECT oh.order_number, oh.header_id, oh.ordered_date, oh.partial_shipments_allowed, oh.open_flag, oh.booked_flag, oh.cancelled_flag, oh.drop_ship_flag, ol.line_number, ol.line_id, ol.org_id, ol.order_quantity_uom, ol.shipping_quantity_uom, ol.cancelled_quantity, ol.shipped_quantity, ol.ordered_quantity, ol.fulfilled_quantity, ol.shipping_quantity, ol.ship_from_org_id, ol.ship_to_org_id, ol.inventory_item_id
FROM OE_ORDER_HEADERS_ALL OH, OE_ORDER_LINES_ALL OL
WHERE ol.header_id = oh.header_id
  AND oh.order_number like '%&EnterOrderNumber%';

b. Sales orders and deliveries for a stuck interface transaction:
select
substr(mti.transaction_interface_id,1,7) "Txn Id",
wdd.inv_interfaced_flag,
wdd.source_code,
wdd.released_status,
wdd.delivery_detail_id,
wda.delivery_id,
substr(mti.inventory_item_id,1,12) "Item Id",
substr(mti.organization_id,1,4) "Org Id",
substr(mti.subinventory_code,1,12) "Subinv",
substr(decode(mti.locator_id,NULL, 'No Loc',mti.locator_id),1,9) "Loc Id",
substr(decode(mti.revision,NULL, 'No Rev',mti.revision),1,7) "Rev",
substr(mti.transaction_quantity,1,9) "Txn Qty",
substr(mti.transaction_date,1,9) "Txn Date",
substr(mti.transaction_type_id,1,7) "Type",
substr(decode(mti.transaction_source_id,NULL, 'Not Source
Id',mti.transaction_source_id),1,15) "Src Id",
substr(decode(mti.transfer_subinventory,NULL, 'Not a Transfer',
mti.transfer_subinventory),1,15) "XFR Subinv",
substr(decode(mti.transfer_locator,NULL, 'Not a Transfer',
mti.transfer_locator),1,15) "XFR Loc",
substr(decode(mti.trx_source_line_id,NULL,'Not Source
Line',mti.trx_source_line_Id),1,15) "Src Line",
substr(mti.process_flag,1,7) "PFlag",
substr(mti.lock_flag,1,7) "LFlag",
substr(mti.transaction_mode,1,5) "Mode",
substr(mti.error_code,1,20) "E Code",
substr(mti.error_explanation,1,300) "Explanation"
from
mtl_transactions_interface mti,
oe_order_headers_all ooh,
oe_order_lines_all ool,
wsh_delivery_details wdd,
wsh_delivery_assignments wda
where
ool.line_id = mti.trx_source_line_id
and ool.header_id = ooh.header_id
and mti.trx_source_delivery_id = wda.delivery_id
and wda.delivery_detail_id = wdd.delivery_detail_id
order by transaction_source_id, trx_source_line_id;

c. View sales orders of a given stuck, pending temporary allocation:
SELECT mmtt.transaction_temp_id, mmtt.transaction_header_id, oh.order_number, ol.line_number, ol.line_id
FROM
MTL_MATERIAL_TRANSACTIONS_TEMP MMTT,
OE_ORDER_HEADERS_ALL OH,
OE_ORDER_LINES_ALL OL
WHERE mmtt.trx_source_line_id = ol.line_id
AND ol.header_id = oh.header_id
AND mmtt.transaction_source_type_id IN (2, 8);

3.3.1. Inventory Transactions

a. Stuck interface transactions (Group By)
PROMPT Stuck Transactions - GroupBy MTI
select transaction_type_id, organization_id, substr(error_code, 1, 30),
substr(error_explanation, 1, 50), to_char(transaction_date, 'YYYY-MM'),
count(*)
from mtl_transactions_interface
group by transaction_type_id, organization_id, to_char(transaction_date, 'YYYY-MM'),
substr(error_code, 1, 30), substr(error_explanation, 1, 50);

b. Stuck pending transactions (Group By)
PROMPT Stuck Transactions - GroupBy MMTT
select transaction_type_id, organization_id, substr(error_code, 1, 30),
substr(error_explanation, 1, 50), to_char(transaction_date, 'YYYY-MM'),
count(*)
from mtl_material_transactions_temp
group by transaction_type_id, organization_id, to_char(transaction_date, 'YYYY-MM'),
substr(error_code, 1, 30), substr(error_explanation, 1, 50);
c. Stuck move order transactions (Group By)
PROMPT Stuck Transactions - GroupBy Move Order
select transaction_type_id, to_char(transaction_date,'YYYY-MON'),
decode(transaction_status,2,'Untransacted Move order', transaction_status),
error_code, error_explanation,
count(*)
from mtl_material_transactions_temp
where organization_id = &Org_id
group by transaction_type_id, to_char(transaction_date,'YYYY-MON'),
decode(transaction_status,2,'Untransacted Move order', transaction_status),
error_code, error_explanation;

d. Uncosted transactions (Group By)
PROMPT Uncosted Transactions - GroupBy MMT
select transaction_type_id, organization_id, costed_flag,
to_char(transaction_date, 'YYYY-MM'), error_code, substr(error_explanation, 1, 50),
count(*)
from mtl_material_transactions
where costed_flag IN ('N','E')
group by transaction_type_id, organization_id, costed_flag, to_char(transaction_date, 'YYYY-MM'),
error_code, substr(error_explanation, 1, 50);

e. Dump information about transaction tables
PROMPT Stuck Transactions Dump - MTI
select transaction_interface_id, inventory_item_id, organization_id, subinventory_code,
locator_id, revision, transaction_quantity, transaction_date, transaction_type_id,
transaction_source_id, transfer_subinventory, transfer_locator,
trx_source_line_id, cost_group_id, process_flag, lock_flag, transaction_mode,
error_explanation, error_code
from mtl_transactions_interface
order by transaction_source_id, trx_source_line_id;

PROMPT Stuck Transactions Dump - MMTT
select transaction_temp_id, inventory_item_id, organization_id, subinventory_code, locator_id, revision,
transaction_quantity, transaction_date, transaction_type_id, transaction_source_id, transfer_subinventory,
transfer_to_location, trx_source_line_id, cost_group_id, process_flag, lock_flag, transaction_mode,
error_explanation, error_code
from mtl_material_transactions_temp
order by transaction_source_id, trx_source_line_id;

PROMPT Stuck Transactions Dump - MMT
select
transaction_id, inventory_item_id, organization_id, subinventory_code,
locator_id, revision, transaction_quantity, transaction_date,
transaction_type_id, transaction_source_id, transfer_subinventory,
transfer_locator_id, trx_source_line_id, cost_group_id,
error_explanation, error_code,
from mtl_material_transactions
where costed_flag IN ('N','E')
order by transaction_source_id, trx_source_line_id;


Preventing access via "/forms/frmservlet/" in Release 12



Oracle Applications Technology Stack - Version: 10.1.2
Information in this document applies to any platform.
Goal

Document a procedure to prevent end users from accessing the Forms "BackDoor" via /forms/frmservlet/

Solution

If you wish to block access to the Form's "back door" which is permitted in your instance by invoking

http://server.domain.port/forms/frmservlet/



Here is the reset procedure to prevent such access:

[ Please use the name of your $FND_SECURE/  DBC file ]



A. Stop services with adstpall.sh

B. Execute these commands in order

1. java oracle.apps.fnd.security.AdminAppServer apps/apps AUTHENTICATION OFF DBC=$FND_SECURE/VIS.dbc

2. java oracle.apps.fnd.security.AdminAppServer apps/apps AUTHENTICATION ON DBC=$FND_SECURE/VIS.dbc

3. java oracle.apps.fnd.security.AdminAppServer apps/apps AUTHENTICATION SECURE DBC=$FND_SECURE/VIS.dbc


C. Restart services with adstrtal.sh

D. Test your access with forms/frmservlet/

     http://server.domain.port/forms/frmservlet/




Thursday, December 20, 2012

WSH Forms Compilation Error In Adadmin




Oracle Shipping Execution - Version 11.5.10.2 and later
Information in this document applies to any platform.
Checked for relevance on 05-Mar-2012


Goal


The following Oracle Forms objects did not generate successfully:

wsh forms/US WSHSTREF.fmx
wsh forms/US WSHQSSUI.fmx
wsh forms/US WSHFSTRX.fmx

Compiling package body DLVB_EVENT...
Compilation error on package body DLVB_EVENT:
PL/SQL ERROR 907 at line 1, column 1
cannot load library unit APPS.WSH_DELIVERY_DETAILS_PKG (referenced by APPS.WSH_
DELIVERY_DETAILS_GRP)
PL/SQL ERROR 0 at line 474, column 5
Statement ignored

Compiling package body TRIP...
Compilation error on package body TRIP:
PL/SQL ERROR 907 at line 1, column 1
cannot load library unit APPS.WSH_TRIPS_PVT (referenced by APPS.WSH_TRIPS_GRP)
PL/SQL ERROR 0 at line 541, column 5
Statement ignored



Fix


Go to $WSH_TOP/patch/115/sql and execute the following :

1. sqlplus apps/apps@db @WSHDDTHS.pls
2. sqlplus apps/apps@db @WSHDDTHB.pls

3. sqlplus apps/apps@db @WSHTRTHS.pls
4. sqlplus apps/apps@db @WSHTRTHB.pls

Now Go to $WSH_TOP/forms/US and compile the files using the command f60genm.

f60genm
@dbsid compile_all=YES








Monday, December 17, 2012

Unable to Create Essbase 11.1.2 Private Connection in SmartView



Applies to:
Hyperion Essbase - Version: 11.1.2.0.00 and later   [Release: 11.1 and later ]
Information in this document applies to any platform.
Symptoms
Unable to create Essbase 11.1.2 private connection in SmartView on Excel 2003 and 2007.
Provider Services 11.1.2.
Entering the URL http://hostname:port/aps/SmartView does not populate server list in the "Application/Cube" connection dialog.
Cause
During configuration it did not update all the files.
Solution
1. Stop all the services where Shared Services installed.
2. Reconfigure Web Server.
3. Start first Oracle ohsinstance, then Hyperion Foundation service, then the rest.
4. Configure Shared Connections first. Here is the URL.
5. Add Essbase servers.
 
6. If the first steps did not fix the issue, then do the following manual steps:

A: Connect to the interop url: http://:19000/interop

B: Expand Application group->Foundation->Deployment Metadata->Shared Services Registry->Essbase-> And locate APS LWA

C: Right click on the 'datasources.xml' file and select “Export for Edit”

D: Modify the file add APS servers under Essbase type:





E: Right click on datasource.xml and select “Import after Edit” and import the file back in.
For further details regarding working with the registry please refer to the following guide:

http://download.oracle.com/docs/cd/E12825_01/epm.111/epm_backup_recovery.pdf
Chapter 3


F: Restart the APS Server.


Utilities for Troubleshooting Oracle Hyperion Enterprise Performance Management 11.1.2.0 or 11.1.2.1 or 11.1.2.2




Utilities for Troubleshooting Oracle Hyperion Enterprise Performance Management 11.1.2.0 or 11.1.2.1 or 11.1.2.2

Hyperion Essbase - Version 11.1.2.1.000 to 11.1.2.2.000 [Release 11.1]
Hyperion Planning - Version 11.1.2.0.00 to 11.1.2.2.000 [Release 11.1]
Hyperion Financial Management - Version 11.1.2.0.00 to 11.1.2.2.000 [Release 11.1]
Hyperion BI+ - Version 11.1.2.0.00 to 11.1.2.2.000 [Release 11.1]
Information in this document applies to any platform.
(1) \Oracle\Middleware\user_projects\epmsystem1\bin\ziplogs.bat|.sh
(2) \Oracle\Middleware\ohs\ccr\bin\
(3) \Oracle\Middleware\ohs\rda\rda.cmd
(4) \Oracle\Middleware\user_projects\epmsystem1\bin\epmsys_registry.bat|.sh
(5) \Oracle\Middleware\user_projects\epmsystem1\bin\validate.bat


Goal

This article aims to help users use various troubleshooting tools to validate or troubleshoot an installation of Oracle EPM 11.1.2.0. or 11.1.2.1

Fix

(1) Ziplogs A troubleshooting tool introduced in Oracle EPM 11.1.2.1 is \Oracle\Middleware\user_projects\epmsystem1\bin\ziplogs.bat|.sh file. The output of this is generated in \Oracle\Middleware\user_projects\epmsystem1\diagnostics\ziplogs\EPM_logs__11.1.2.1.0.zip Starting with EPM 11.1.2.2 the logs under \Oracle\Middleware\user_projects\domains\EPMSystem\servers\\logs are also collected. 

(2) Oracle Configuration Manager (OCM) is an advanced tool which collects and evaluates settings from configuration files (but not Hyperion Registry) and stores them in a central database administered by Oracle. It was first introduced into EPM in version 11.1.2.0

(3) Remote Desktop Assistant (RDA) collects and zips up a large amount of information concerning the software and hardware environments of Oracle products. If Perl 5.005 or later is installed on the computer and accessible from the command line (test: perl -version), then run: \Oracle\Middleware\ohs\rda\perl rda.pl from the command line to access the RDA tool. Alternately, precompiled RDA executables are available for several platforms (rda.cmd, rda.sh, rda.bat). View an RDA webcast from the https://oracleaw.webex.com reference site listed below. This tool is frequently updated.

(4) epmsys_registry Configuration settings have been moved from configuration files to a database repository associated with Shared Services. These may be extracted to an HTML formatted file by running \Oracle\Middleware\user_projects\epmsystem1\bin\epmsys_registry.bat|.sh without parameters from the command line. The output is generated to file \Oracle\Middleware\user_projects\epmsystem1\diagnostics\reports\registry.html The username/login/jdbc URL for the Hyperion/HSS registry are kept in \Oracle\Middleware\user_projects\epmsystem1\config\foundation\11.1.2.0\reg.properties file. 'epmsys_registry.bat|.sh report deployment' will generate a file named deployment_report.html in the same \reports\ directory starting with EPM version 11.1.2.2.

(5) Validate A validation tool is available in \Oracle\Middleware\user_projects\epmsystem1\bin\validate.bat. In EPM 11.1.2.1 and later the output files are of the form \Oracle\Middleware\user_projects\epmsystem1\diagnostics\reports\instance_report_20YYMMDD_######.html (where YY is the year, MM is the month, DD is the day, and ###### is a unique integer). It also runs the tool under (1) and gives the output of that tool.

(6) Non-ziplog Individual log files may be found in subdirectories under (those 'starred' are not collected by ziplogs prior to EPM 11.1.2.2):
\Oracle\Middleware\user_projects\domains\EPMSystem\servers\\logs *
\Oracle\Middleware\logs *
\Oracle\Middleware\wlserver_10.3 *
\Oracle\Middleware\user_projects\epmsystem1\tmp *
\Oracle\Middleware\ohs\cfgtoollogs\opatch *
\Oracle\Middleware\EPMSystem11R1\diagnostics\logs
\Oracle\Middleware\user_projects\epmsystem1\diagnostics\logs\
\Program Files\Oracle\Inventory\logs
C:\Users\\Oracle\oradiag_\diag\
C:\Users\\.oracle\logs\

(7) Client Debug Some debug tools (*) can be activated if under http://:19000/workspace/index.jsp > Navigate > Administration > Workspace Server Settings > Client Debug Enabled: is set to Yes (then click 'OK' button, close all browser windows, and restart browser).
* http://hostname:19000/workspace/debug/configInfo.jsp
* http://hostname:19000/workspace/debug/userInfo.jsp
* http://hostname:19000/workspace/debug/userGroupQuery.jsp



Other tools are available at these URLs (largely derived from validate.bat output). A non-Error response indicates that the web service of each particular application is active.:
http://hostname:19000/workspace/status
http://hostname:19000/workspace/BPMContext
http://hostname:8600/mappingtool/faces/info.jspx
http://hostname:10080/easconsole/console.html
http://hostname:16000/WebAnalysis
http://hostname:6373/oracle-epm-fm-webservices/ApplicationService
http://hostname:8300/HyperionPlanning/
http://hostname:13080/aps/APS
http://hostname:8200/hr/status.jsp
http://hostname:19091/awb/conf/AwbConfig.xml
http://hostname:8500/calcmgr/index.htm

(8) Enterprise Manager Fusion Middleware is the standard Oracle graphic user interface debugging and configuration tool. Although advanced versions require extra cost licensing, there is a bundled version of Enterprise Manager Fusion Middleware control available by default with EPM.  It is hoped that ECID (Execution Context ID) functionality will be widely incorporated with the 'Hyperion' product stack after EPM version 11.1.2.2.


(9) registry-cleanup From EPM 11.1.2.2 a new tool has been made available to clean the Hyperion Registry: \Oracle\Middleware\user_projects\epmsystem1\bin\registry-cleanup.bat|.sh.

(10) resetConfigTask From EPM 11.1.2.2 another new tool has been made available to reset configurations: \Oracle\Middleware\user_projects\epmsystem1\bin\resetConfigTask.bat|.sh.

(11) epmsys_hostname checker From EPM 11.1.2.2 another new tool has been made available from the install directory: epmsys_hostname.bat|.sh which confirms the hostname in the network environment.

References

NOTE:1435695.1 - Enterprise Performance Management 11.1.2 Client RDA Preinstall Health Check (HCVE) [Video]
NOTE:1100612.1 - How to Use Remote Diagnostic Agent (RDA) to Gather Diagnostic Information On Oracle Hyperion Financial Management Servers to Help Resolve Service Requests Faster
NOTE:1304885.1 - Using Remote Diagnostic Agent (RDA) to Troubleshoot Oracle Hyperion EPM 11.1.2.x
NOTE:1092825.1 - Using RDA To Collect Configuration, Diagnostic and Log Files on an Oracle Essbase Server
NOTE:1404239.1 - Oracle Configuration Manager (OCM) and Oracle Hyperion Enterprise Performance Management (EPM)



Recommended Startup Order for Hyperion Product Services and Processes




Recommended Startup Order for Hyperion Product Services and Processes

Applies to:

Hyperion Planning - Version: 9.3.1.0.00 to 9.3.3.0.00 - Release: 9.3 to 9.3
Hyperion Essbase - Version: 9.3.1.0.00 to 9.3.3.0.00   [Release: 9.3 to 9.3]
Hyperion BI+ - Version: 9.3.1.0.00 to 9.3.3.0.00   [Release: 9.3 to 9.3]
Hyperion BI+ - Version: 9.3.1.0.00 to 9.3.3.0.00   [Release: 9.3 to 9.3]
Microsoft Windows (32-bit)
Purpose

This article provides recommended startup order for most Hyperion services and processes.
Scope

This points to the recommended start order when you use the following Hyperion products:

Foundation Services
Essbase
Planning
Performance Management Architect
Reporting and Analysis
For more details, also see the Hyperion System 9 Installation Start Here.


Recommended Startup Order for Hyperion Product Services and Processes

Here is some reference information for the various product components.

The RDBMS Database houses the product repositories for each of the products, so it should be started before starting any Oracle Hyperion applications (and should not be shut down until until all of those applications have been stopped):

Shared Services
Hyperion S9 OpenLDAP
Hyperion S9 Shared Services
The Shared Services start-up may take more than two minutes, so allow a delay before starting the following services.
Reporting and Analysis Core Services
Hyperion S9 BI+ 9.3 Core Services 1. Note the configuration in HYPERION_HOME\BIPlus\common\config\RMService8.properties.

BI+ Analytics
Hyperion S9 BI+ Analytic Services 9.3.1 -
Hyperion S9 Administration Services ATS5
Hyperion S9 Provider Services ATS5

Performance Management Architect Services
Hyperion S9 EPM Architect Process Manager
IIS Admin Service

Note: Process Manager automatically starts the following services:
Hyperion S9 EPM Architect Engine Manager
Job Manager: Hyperion S9 EPM Architect Job Manager
Event Manager: Hyperion S9 EPM Architect Event Manager

Reporting and Analysis UIServices
Hyperion S9 BI+ 9.3 Financial Reporting Java RMI Registry
Hyperion S9 BI+ 9.3 Financial Reporting Print Server
Hyperion S9 BI+ 9.3 Financial Reporting Report Server
Hyperion S9 BI+ 9.3 Financial Reporting Scheduler Server
Hyperion S9 Apache 2.0
Hyperion S9 BI+ 9.3 Workspace Web
Hyperion S9 BI+ 9.3 Financial Reporting Web application
Hyperion S9 BI+ 9.3 Web Analysis

Performance Management Architect Application Server
Hyperion S9 EPM Architect Web ATS5
Hyperion S9 EPM Architect Data Synchronization ATS5

Planning Services
Hyperion S9 Planning
HyperionRMIRegistry



Where are Smart View’s Shared Connections Stored and How to Configure them?







Where are Smart View’s Shared Connections Stored and How to Configure them?


Hyperion Essbase - Version 11.1.2.0.00 and later
Information in this document applies to any platform.
***Checked for relevance on 26-Nov-2012***


Where are Smart View’s shared connections stored and how do you configure them?

Fix

Smart View Shared connections are stored in a central location and are available to multiple users through the SmartView Panel. They are created and maintained by your administrator.

These connections are stored in the Shared Services Registry, which is part of the Shared Services relational database schema.  Access to them is via a web services call to the EPM Workspace Web application.

To configure Smart View Shared Connections:

1. Launch Excel and go to the Smart View -> Options -> Advanced tab
2. Enter the EPM Workspace URL as the Shared Connections URL in the format of:

http://:/workspace/SmartViewProviders 

For example: http://MyServer:19000/workspace/SmartViewProviders




Will FDM Work On A Machine Where IIS 7.0 And HFM 11.1.2.1 Are Installed





Will FDM Work On A Machine Where IIS 7.0 And HFM 11.1.2.1 Are Installed

Hyperion Financial Data Quality Management - Version: 11.1.2.1.000 and later  

Information in this document applies to any platform.

Goal


Will FDM work on a machine where IIS 7.0 and HFM 11.1.2.1 are installed?


Solution


Performance Management Architect and Financial Management both require that a 64-bit Oracle Database client be installed. Strategic Finance and FDM both require that a 32-bit Oracle Database client be installed. Note that Strategic Finance only uses the Oracle OLEDB driver supplied in the Oracle Database client install.
Financial Management and FDM can coexist on Windows 2008 64-bit systems using IIS7; however, there is a required sequence for installing the Oracle Database clients to support this scenario. You must install the Oracle Database 32-bit client first, then install the Oracle Database 64-bit client. If you already have installed both Oracle Database clients and did not install Oracle Database 32-bit client first, remove both clients from the server and install the 32 bit client followed by the 64 bit client.

- If you are using FDM or Performance Management Architect Dimension Server, Oracle Data Provider (ODP) for .NET 2.0 (from the Oracle Data Access Component (ODAC) package) is required and must be installed by a user with Windows administrator rights.

- In order to use Oracle RAC/SCAN, install OCI (Oracle Call Interface) as part of the Oracle database client installation.
- If your database resides on a remote computer, create a Net Service Name that enables the product to connect to the remote database.
- Use the global database server name when specifying locations and paths. Do not use localhost as a server name.

For more details please see the EPM System Install Start Here Guide (epm_install_start_here.pdf)

Monday, December 10, 2012

What Is The Fastest Way To Cleanly Shutdown An Oracle Database?



Oracle Server - Enterprise Edition - Version 9.0.1.0 to 11.2.0.2 [Release 9.0.1 to 11.2]
Information in this document applies to any platform.
Oracle Server Enterprise Edition - Version: 9.0.1.0 to 11.2.0.1.0

***Checked for relevance on 01-Nov-2011***


Goal



What is the fastest way to shutdown an Oracle database?


Fix

SHUTDOWN ABORT is the fastest way to shutdown an Oracle database.  However, this type of shutdown leaves the database in a inconsistent state (non-rolled back) any backups taken at this point would require recovery at the next startup (See NOTE 1 below)

*** NOTE *** SHUTDOWN ABORT is not recommended for databases prior to 8.1.6 as the chances of corrupting the database are much higher in such older versions.


1) Determine how much rollback (in bytes) is needed for a clean shutdown using the following query:


select sum(used_ublk) * from v$transaction;


2) SHUTDOWN ABORT

This will terminate all processes (CLIENT and BACKGROUND) as quickly as possible with no transaction rollback.



A SHUTDOWN IMMEDIATE will cause SMON to try to terminate all client processes (SIGKILL) but there are many cases where SMON cannot do so in a timely manner hence the reason for the SHUTDOWN ABORT. (See NOTE 2 below)

3) From the results in #1 and your experience with your database, determine if you can wait for a clean shutdown (shutdown immediate).  If you cannot wait for a shutdown immediate, then skip the remaining steps and at the next startup SMON will rollback the transactions.

4) STARTUP RESTRICT

5) Watch the rollback (number of blocks) with the following query:
 

select sum(distinct(ktuxesiz)) from x$ktuxe where ktuxecfl = 'DEAD';


6) When the rollback has completed (which can be immediately after startup), issue SHUTDOWN IMMEDIATE.




Once this competes ... the database will be cleanly shutdown

=============================================================

NOTE 1:

** Oracle� Database Backup and Recovery User's Guide 11g Release 1 (11.1)

7 RMAN Backup Concepts

Consistent Backups

You can use the BACKUP command to make consistent and inconsistent backups of the database. A consistent backup occurs when the database is in a consistent state. A database is in a consistent state after being shut down with the SHUTDOWN NORMAL, SHUTDOWN IMMEDIATE, or SHUTDOWN TRANSACTIONAL commands. A consistent shutdown guarantees that all redo has been applied to the datafiles. If you mount the database and make a backup at this point, then you can restore the database backup later and open it without performing media recovery.

Inconsistent Backups

Any database backup that is not consistent is an inconsistent backup. A backup made when the database is open is inconsistent, as is a backup made after an instance failure or SHUTDOWN ABORT command. When a database is restored from an inconsistent backup, Oracle must perform media recovery before the database can be opened, applying any pending changes from the redo logs.

Note:
RMAN does not permit you to make inconsistent backups when the database is in NOARCHIVELOG mode. If you employ user-managed backup techniques for a NOARCHIVELOG database, then you must not make inconsistent backups of this database.

As long as the database runs in ARCHIVELOG mode, and you back up the archived redo logs and datafiles, inconsistent backups can be the foundation for a sound backup and recovery strategy. Inconsistent backups offer superior availability because you do not have to shut down the database to make backups that fully protect the database.

=============================================================

NOTE 2:

There is a condition due to a internal only (not published) bug in SQLPLUS that prevents SQLPLUS sessions from being able to be terminated by SMON ...
    A truss / pdump etc of the client process will show that the SQLPLUS session hung waiting for WAITPID

=============================================================

NOTE 3:

** Oracle� Database Administrator's Guide 11g Release 1 (11.1)

Shutting Down a Database

Shutdown Timeout and Abort

Shutdown modes that wait for users to disconnect or for transactions to complete have a limit on the amount of time that they wait. If all events blocking the shutdown do not occur within one hour, the shutdown command aborts with the following message: ORA-01013: user requested cancel of current operation. This message is also displayed if you interrupt the shutdown process, for example by pressing CTRL-C. Oracle recommends that you do not attempt to interrupt an instance shutdown. Instead, allow the shutdown process to complete, and then restart the instance.

After ORA-01013 occurs, you must consider the instance to be in an unpredictable state. You must therefore continue the shutdown process by resubmitting a SHUTDOWN command. If subsequent SHUTDOWN commands continue to fail, you must submit a SHUTDOWN ABORT command to bring down the instance. You can then restart the instance.



Differences in shutdown and startup procedures.



Differences in shutdown and startup procedures.

 
SCOPE & APPLICATION
-------------------

This is a tutorial for new Oracle DBAs.  

For the most complete information regarding database administration, please 
refer to the Oracle Server Administrator's Guide.


STARTING AND STOPPING AN ORACLE DATABASE
----------------------------------------

The most common tool used to startup and shutdown the Oracle database from the 
command line is Server Manager.  Beginning with Oracle8i, you can also use 
SQL*Plus.  (If you want to use Oracle Enterprise Manager GUI tools, please 
refer to the Oracle Enterprise Manager Administrator's Guide for instructions.)

You will have to login as a user with administrative privileges, specifically 
a user with SYSDBA privileges.  Most DBAs are familiar with using the INTERNAL 
user (which is a synonym for the SYS user connected as SYSDBA) to startup and 
shutdown the database.  In a future release of Oracle, however, the INTERNAL 
user will become obsolete.  Therefore, you should setup your DBAs as SYSDBA 
users.  

Please refer to Note:50507.1  "TECH: SYSDBA and SYSOPER Privileges in Oracle8 
and Oracle7" for more information about setting up privileged users.


The Startup Procedure: 
====================== 
 
There are three stages in starting an Oracle database:

· Start the instance 
· Mount the database 
· Open the database 

You can control which stage by issuing different options on the STARTUP 
command.  

 
STARTUP NOMOUNT
  
This will only start the Oracle instance.  Oracle reads the initialization 
parameter file (init.ora) to determine where the control files are located, 
how large to create the System Global Area (SGA), and what background 
processes to create.  When the instance is started, you will receive 
notification and a listing of SGA memory structures and sizes:

ORACLE instance started.
Total System Global Area                  56011696 bytes
Fixed Size                                   52144 bytes
Variable Size                             51785728 bytes
Database Buffers                           4096000 bytes
Redo Buffers                                 77824 bytes
 

STARTUP MOUNT 

This command starts the instance and mounts the database without opening it.  
Oracle reads control files for information about the data files and redo logs, 
but doesn't open the files.  This is required when performing maintenance 
operations such as renaming datafiles, altering redo logs or enabling 
archiving.  In addition to seeing the SGA listing, you will see "Database 
mounted." 
 

STARTUP

This command starts the instance, then mounts and opens the database.  The 
database opens online datafiles and online redo logs, and usually will acquire 
one or more rollback segments.  You will see "Database Open" when the database 
is ready for normal database operations.  


If you use either STARTUP NOMOUNT or STARTUP MOUNT, you must use the ALTER 
DATABASE command to proceed opening the database.  For example, from the 
NOMOUNT position (i.e., instance is started, but database is not mounted), 
you will need to issue two commands:

ALTER DATABASE MOUNT;
ALTER DATABASE OPEN;

From the MOUNT state, you will only have to issue ALTER DATABASE OPEN.


There are other options you can specify at startup:


STARTUP RESTRICT  

The database will be opened, but only privileged users (users with the DBA 
role granted) can use the database. 


STARTUP FORCE

This command does a combination of shutdown abort and startup.  Use this only
when experiencing problems in shutting down or starting the database.
 


 
The Shutdown Procedure: 
======================= 
 
There are four different shutdown options:


SHUTDOWN NORMAL
  
This is the default option for the SHUTDOWN command; therefore, you can issue 
SHUTDOWN, and your database will be shutdown NORMAL.  

No new connections are allowed after the statement is issued.  Before the 
database is shutdown, Oracle waits for all currently connected users to 
disconnect from the database.  The next startup of the database will not 
require any instance recovery.  
 

SHUTDOWN IMMEDIATE  
 
This option is used when you want to shutdown quickly, but still allow the 
database to shutdown cleanly.  

Current SQL statements being processed by Oracle are terminated immediately.  
Any uncommitted transactions are rolled back.  (If long uncommitted 
transactions exist, the shutdown might not complete as quickly.)  Oracle does 
not wait for users to disconnect; it implicitly rolls back active transactions 
and disconnects all connected users.  


SHUTDOWN TRANSACTIONAL

This option is only available in version 8.1.X.  Use this option when you want 
to perform a planned shutdown while allowing active transactions to complete.  
Any new connections or transactions will be denied.  After all active 
transactions complete, the database will be shutdown as if an IMMEDIATE option 
was used.  


SHUTDOWN ABORT 

This option should only be used as a last resort.  Use if:

· The database is functioning irregularly and you cannot do a shutdown 
        normal or shutdown immediate.  
· You need to shutdown the database instantaneously. 
· You experience problems starting the database instance. 

All current client SQL statements being processed will immediately terminate.   
Any uncommitted transactions will not be rolled back.  Oracle does not wait 
for users currently connected to the database to disconnect, but will 
disconnect all connected users. 

The next STARTUP of the database will require instance recovery; therefore, 
the next startup may take longer than usual.  

Friday, December 7, 2012

Production DBA Support scripts



To select the invalid objects

Select object_name, object_type,status from all_objects
   where status ='INVALID' and object_name like 'JA%';

                (or)

SELECT OWNER,object_name,object_type,status FROM DBA_OBJECTS  WHERE STATUS = 'INVALID'
order by owner,object_type


You can use adadmin utility to compile or you can use utlrp.sql script shipped with Oracle Database to compile Invalid Database Objects
 You can use ojspCompile.pl perl script shipped with Oracle apps to compile JSP files. This script is under $JTF_TOP/admin/scripts.
 Sample compilation method is

perl ojspCompile.pl --compile --quiet


To create user oracle and apps
 
    groupadd dba
    useradd -d /ora/oracle/9.2.3 -s /bin/sh -c "Oracle home" -g dba cmwora
    useradd -d /ora/apps/prodcomn -s /bin/sh -c "Oracle Application" -g dba cmwapps

    passwd cmwora
          enter passwd

TO start and stop

/etc/init.d/volmgt start/stop
 eject  or eject cdrom

TO be added in profile

PS1='ORACLE>/$ '
PATH="/usr/bin/zip-23:$PATH"
export PATH
. /oradb/oracle/9.2.1/DAT_projdevel.env


TO ENTER IN TO SQL Prompt  (env)
ORACLE_SID=TESTORA
export TESTORA

ORACLE_HOME=/oracle/9.2.1
export ORACLE_HOME

PATH=$ORACLE_HOME/bin:/usr/bin
export PATH

To create a NFS mount point
 Go to source node ( Ex .where the space is available (Projdevel)
      # Cd  /etc/dfs
      # more fstypes
      #more dfstab     (to view all  the sharable mountpoint)

create a backup directory where the space is available
example
root@projdevel # cd ..
root@projdevel # ls -ls
total 226
   6 drwxr-xr-x  77 oracle   dba         2560 Feb 15 11:42 9.2.3
   2 drwxr-xr-x   5 oratrg   dba          512 Nov 20 13:53 admin
   2 drwxr-xr-x   5 appltest dba          512 Nov 23 00:35 apps
 178 drwxr-xr-x   2 oratrg   dba        90624 Feb 15 14:42 archive
   2 drwxrwxrwx   2 oracle   dba         1024 Feb 17 07:50 backup
   2 drwxr-xr-x   2 root     other        512 Nov 21 15:42 rcp_scripts
  16 drwxr-xr-x   2 oracle   dba         7680 Jan 29 21:36 testdata
root@projdevel # cd backup
root@projdevel # pwd
/oracle/backup

        make the entry in dfstab
        share –F nfs –o rw /oracle/backup
example
root@projdevel # more dfstab
#       Place share(1M) commands here for automatic execution
#       on entering init state 3.
#
#       Issue the command '/etc/init.d/nfs.server start' to run the NFS
#       daemon processes and the share commands, after adding the very
#       first entry to this file.
#
#       share [-F fstype] [ -o options] [-d ""] [resource]
#       .e.g,
#       share  -F nfs  -o rw=engineering  -d "home dirs"  /export/home2
share -F nfs -o ro /ravi
share -F nfs -o rw /oracle/backup
# /etc/init.d/nfs.server start
#share    (to view the sharable paths)
create a mount point (dir) in root ( ex   rmanback)
#  mount –F nfs 172.16.1.203:/oracle/backup /rmanback
#df –h     (to verify the mount point)
   GOTO THE TARGET SERVER  ( Ex Production)
# mount –F nfs 172.16.1.203:/oracle/backup /rmanback

make the necessary changes in RMAN configuration




To create a new datafile in production (create first in SUN)

Step1)
vxassist -g racdg -U gen make 2048m layout=mirror SUN35100_0 SUN351001_0
                   (or)
vxassist -g racdg -U gen make 2048m layout=mirror SUN35100_1 SUN351001_2
Step 2)
            vxedit -g racdg set user=oracle group=dba  

Step 3)
          To verify the file name status

          vxprint –Aht| grep
                         
                    (reference
                                         vxdisk list
                                         vxprint –Aht|more  )
========================================================
to be included in system file ( /etc/system)

set shmsys:shminfo_shmmax=4294967295
set shmsys:shminfo_shmmin=1
set shmsys:shminfo_shmmni=500
set shmsys:shminfo_shmseg=50
set semsys:seminfo_semmsl=1024
set semsys:seminfo_semmns=1400
set semsys:seminfo_semopm=100
set semsys:seminfo_semvmx=32767
To selecte all invalid database objects in a schema

       Note : SGA size can be increaced upto (4294967295  ie 4 GB). If more space is needed for SGA increase the size in the above parameter
        set shmsys:shminfo_shmmax=4294967295


To select the invalid objects

select 'alter ' || decode(object_type,'PACKAGE
BODY','PACKAGE',object_type)
|| ' ' || object_name || ' compile '  ||
decode(object_type,'PACKAGE BODY',' body;',';')  from user_objects
where object_type in ('FUNCTION','PACKAGE','PACKAGE
BODY','PROCEDURE','TRIGGER','VIEW')
and status = 'INVALID'
order by object_type , object_name;

set heading off;
set pagesize 500;
spool c:\dba\compile.sql;
select 'alter ' || object_type ||' '|| OBJECT_NAME  || ' compile ' || ';'
 from dba_objects where object_type in ('FUNCTION','PACKAGE','PROCEDURE','TRIGGER','PACKAGE BODY','VIEW')
AND STATUS ='INVALID';
spool off;

for running the script
@c:\dba\compile.sql

TO KILL THE  INACTIVE  FORMS AND SESSIONS

SELECT p.spid,s.process,s.status,s.machine,
to_char(s.logon_time,'mm-dd-yy hh24:mi:ss') Logon_Time,
s.last_call_et/3600 Last_Call_ET,
s.action,s.module,s.sid,s.serial#
FROM
V$SESSION s, V$PROCESS p
WHERE
s.paddr = p.addr
AND s.username IS NOT NULL
AND s.username = 'APPS'
AND s.osuser = 'applprod'
AND s.last_call_et/3600 > 1
and s.action like 'FRM%'
and s.status='INACTIVE' order by logon_time;


           database

Select
'alter system kill session '''||s.sid||','||s.serial#||''';',s.action
FROM
V$SESSION s, V$PROCESS p
WHERE
s.paddr = p.addr
AND s.username IS NOT NULL
AND s.username = 'APPS'
AND s.osuser = 'applprod'
AND s.last_call_et/3600 > 1
and s.action like 'FRM%'
and s.status='INACTIVE';

          Forms

SELECT
' '||s.machine||' kill -9 '||s.process, s.action
FROM
V$SESSION s, V$PROCESS p
WHERE
s.paddr = p.addr
AND s.username IS NOT NULL
AND s.username = 'APPS'
AND s.osuser = 'applprod'
AND s.last_call_et/3600 > 1
and s.action like 'FRM%'
and s.status='INACTIVE';


To Compile all invalid database objects in a schema
EXEC DBMS_UTILITY.COMPILE_SCHEMA( 'schema-name' );

To Compile all invalid database objects

declare
   sql_statement varchar2(200);
   cursor_id     number;
   ret_val       number;
begin
   dbms_output.put_line(chr(0));
   dbms_output.put_line('Re-compilation of Invalid Objects');
   dbms_output.put_line('---------------------------------');
   dbms_output.put_line(chr(0));
   for invalid in (select object_type, owner, object_name
                   from   sys.dba_objects o,
                          sys.order_object_by_dependency d
                   where  o.object_id    = d.object_id(+)
                     and  o.status       = 'INVALID'
                     and  o.object_type in ('PACKAGE', 'PACKAGE BODY',
                                            'FUNCTION',
                                            'PROCEDURE', 'TRIGGER',
                                            'VIEW')
                   order  by d.dlevel desc, o.object_type) loop
      if invalid.object_type = 'PACKAGE BODY' then
         sql_statement := 'alter package '||invalid.owner||'.'||invalid.object_name||
                          ' compile body';
      else
         sql_statement := 'alter '||invalid.object_type||' '||invalid.owner||'.'||
                          invalid.object_name||' compile';
      end if;
      /* now parse and execute the alter table statement */
      cursor_id := dbms_sql.open_cursor;
      dbms_sql.parse(cursor_id, sql_statement, dbms_sql.native);
      ret_val := dbms_sql.execute(cursor_id);
      dbms_sql.close_cursor(cursor_id);
      dbms_output.put_line(rpad(initcap(invalid.object_type)||' '||
                                invalid.object_name, 32)||' : compiled');
   end loop;
end;



User's Status in the ICX_SESSIONS Table

select
  disabled_flag,
  to_char(first_connect,'MM/DD/YYYY HH:MI:SS') Start_Time,
  to_char(sysdate,'HH:MI:SS') Current_Time,
  USER_NAME,
  session_id,
  (SYSDATE-last_connect)*24*60 Mins_Idle,
  fnd_profile.value_specific
    ('ICX_SESSION_TIMEOUT',
     a.user_id,
     a.responsibility_id,
     a.responsibility_application_id,
     a.org_id,
     NULL
    ) TimeOut
from
  ICX_SESSIONS a, fnd_User b
where
  a.user_id=b.user_id
  and last_connect > sysdate-1/24;


To select the username and the process status
select a.requested_start_date,a.last_update_date,a.status_code,b.user_name
from fnd_concurrent_requests a,fnd_user b where a.requested_by = b.user_id and a.request_id = 677224


select a.requested_start_date,a.last_update_date,a.status_code,b.user_name ,a.argument_text
from fnd_concurrent_requests a,fnd_user b where a.requested_by = b.user_id and a.request_id = 677224


Steps to release the stuck for PO entry

Su – applprod
Cd $FND_TOP
Cd sql
Sqlplus apps/apps

SQL>
    Select org_id,release_num,wf_item_type,wf_item_key
From po_releases_all
Where po_header_id
In(select po_header_id from po_headers_all where segment1=’&PO_NUMBER’);

SQL>
select po_header_id,wf_item_type,wf_item_key
from po_headers_all
where segment1='168/2005'

SQL>@wfstatus.sql
 Enter value for 1:  POAPPRV
 Enter value for  2:  3319-4115


SQL>@wfretry.sql
 Enter value for 1:  POAPPRV
 Enter value for  2:  3319-4115
 Lable :  POAPPRV_TOP
Command  :RETRY
Result        :NULL

INVENTORY (STORES) COSTED ERROR

     Stop the COST manager or CONCURRENT manager

1)select * from   mtl_material_transactions where costed_flag='E'
     Confirm the error and find the organization_id and transaction_id

2)SELECT organization_id,
  default_cost_group_id
  FROM mtl_parameters
  WHERE organization_id = '155'  
   (place organization id from the step 1)

2) UPDATE mtl_material_transactions
   SET transfer_cost_group_id = &dcgi
   WHERE tranasction_id = &txn_id;

    (&dcgi = default_cost_group_id and &txn_id = from step1)

3) UPDATE mtl_material_transactions
     SET costed_flag = 'N',
     transaction_group_id = null,
     error_code = null,
     error_explanation = null
    WHERE transaction_id = &txn_id;

     (&txn_id= from step1)

update mtl_material_transactions
      set request_id = null,
          costed_flag = 'N',
          transaction_group_id = null,
          transaction_set_id = null,
          cost_group_id = transfer_cost_group_id
    where costed_flag = 'E'
    and   transaction_id  = '3392889'

Start the COST manager or CONCURRENT manager



To select the username,process,status,Terminal name using SID

select a.status,p.spid, a.sid, a.serial#, a.username, a.terminal,
       a.osuser, c.Consistent_Gets, c.Block_Gets, c.Physical_Reads,
       (100*(c.Consistent_Gets+c.Block_Gets-c.Physical_Reads)/
       (c.Consistent_Gets+c.Block_Gets)) HitRatio, c.Physical_Reads, b.sql_text
from v$session a, v$sqlarea b, V$SESS_IO c,v$process p
where a.sql_hash_value = b.hash_value
  and a.SID = c.SID
  and p.addr = a.paddr
  and (c.Consistent_Gets+c.Block_Gets)>0
  and a.Username is not null
  Order By a.status asc, c.Consistent_Gets desc , c.Physical_Reads desc;
                                 
                                 
To see the currently updated archive log files
          SQL> select name from v$archived_log
            where trunc(completion_time) >= trunc(sysdate)-5;
To find the BDUMP,UDUMP directory
select value from v$parameter where name = 'background_dump_dest'
select value from v$parameter where name = 'user_dump_dest'
select value from v$parameter where name in ('background_dump_dest','user_dump_dest', 'log_archive_dest')

To enable archive log
log_archive_start             = true    
log_archive_format = arch_%s_%t.arc
log_archive_dest = '/oracle/archive'

Tracing an Oracle session by SID
This code accepts an Oracle session ID [SID] as a parameter and will show you what SQL statement is running in that session and what event the session is waiting for. You simply create a SQL file of the code and run it from the SQL prompt.

prompt Showing running sql statements ...........................

select a.sid Current_SID, a.last_call_et ,b.sql_text
from v$session a
,v$sqltext b
where a.sid = 14
and a.username is not null
and a.status = 'ACTIVE'
and a.sql_address = b.address
order by a.last_call_et,a.sid,b.piece;

prompt Showing what sql statement is doing.....................

select a.sid, a.value session_cpu, c.physical_reads,
c.consistent_gets,d.event,
d.seconds_in_wait
from v$sesstat a,v$statname b, v$sess_io c, v$session_wait d
where a.sid= 14
and b.name = 'CPU used by this session'
and a.statistic# = b.statistic#
and a.sid=c.sid
and a.sid=d.sid;

Check all active processes, the latest SQL, and the SQL hit ratio

select a.status, a.sid, a.serial#, a.username, a.terminal,
       a.osuser, c.Consistent_Gets, c.Block_Gets, c.Physical_Reads,
       (100*(c.Consistent_Gets+c.Block_Gets-c.Physical_Reads)/
       (c.Consistent_Gets+c.Block_Gets)) HitRatio, c.Physical_Reads, b.sql_text
from v$session a, v$sqlarea b, V$SESS_IO c
where a.sql_hash_value = b.hash_value
  and a.SID = c.SID
  and (c.Consistent_Gets+c.Block_Gets)>0
  and a.Username is not null
  and a.status = 'ACTIVE'
 Order By a.status asc, c.Consistent_Gets desc , c.Physical_Reads desc;
    3278532


Monitoring Oracle processes

select p.spid "Thread ID", b.name "Background Process", s.username
"User Name",
            s.osuser "OS User", s.status "STATUS", s.sid "Session ID",
s.serial# "Serial No.",
            s.program "OS Program"
     from v$process p, v$bgprocess b, v$session s  
     where s.paddr = p.addr and b.paddr(+) = p.addr
order by s.status,1;

TO FIND OUT USER NAME AND PROCESS STATUS

SELECT REQUEST_ID,
       TO_CHAR(a.ACTUAL_START_DATE,'MM/DD/YY HH:MI:SS') starttime,
       TO_CHAR(a.ACTUAL_COMPLETION_DATE,'MM/DD/YY HH:MI:SS') endtime,
       ROUND((a.ACTUAL_COMPLETION_DATE - a.ACTUAL_START_DATE)*(60*24),2) rtime,
       b.user_name,a.phase_code,a.status_code,
  a.printer,a.print_style,a.description,
       SUBSTR(a.completion_text,1,20) compl_txt
  FROM fnd_concurrent_requests a,fnd_user b
 WHERE to_date(ACTUAL_START_DATE,'DD-MON-RRRR') = to_date(sysdate,'DD-MON-RRRR') and a.requested_by = b.user_id
And a.phase_code = ‘R’
 ORDER BY 1 desc,2


TO FIND OUT UGA and PGA STATUS FOR ALL SID

SELECT V.sid,
 P.SPID     "OS_PID",
       P.USERNAME "OS_USERNAME",
       U.USERNAME "USERNAME",
       P.PROGRAM  "PROGRAM",
       B.NAME,
       TO_CHAR(V.VALUE,'999,999,999.99')
FROM V$SESSTAT V, V$STATNAME B, V$SESSION U, V$PROCESS P
WHERE V.STATISTIC# = B.STATISTIC# AND
      U.SID = V.SID AND
      (B.NAME LIKE '%pga%' OR B.NAME LIKE '%uga%') AND
      U.USERNAME <> ' ' AND
      U.PADDR = P.ADDR
ORDER BY V.SID,B.NAME;

Displays concurrent requests that have run times longer than one hour (3600 seconds)

SELECT REQUEST_ID,
       TO_CHAR(ACTUAL_START_DATE,'MM/DD/YY HH:MI:SS') starttime,
       TO_CHAR(ACTUAL_COMPLETION_DATE,'MM/DD/YY HH:MI:SS') endtime,
       ROUND((ACTUAL_COMPLETION_DATE - ACTUAL_START_DATE)*(60*24),2) rtime,
       OUTCOME_CODE,phase_code,status_code,
  printer,print_style,description,
       SUBSTR(completion_text,1,20) compl_txt
  FROM fnd_concurrent_requests
 WHERE to_date(ACTUAL_START_DATE,'DD-MON-RRRR') = to_date(sysdate,'DD-          
                        MON-RRRR')
 ORDER BY 2 desc

This script will map concurrent manager process information about current concurrent managers.
SELECT proc.concurrent_process_id concproc,
       SUBSTR(proc.os_process_id,1,6) clproc,
       SUBSTR(LTRIM(proc.oracle_process_id),1,15) opid,
       SUBSTR(vproc.spid,1,10) svrproc,
       DECODE(proc.process_status_code,'A','Active',
              proc.process_status_code) cstat,
       SUBSTR(concq.concurrent_queue_name,1,30) qnam,
--       SUBSTR(proc.logfile_name,1,20) lnam,
       SUBSTR(proc.node_name,1,10) nnam,
       SUBSTR(proc.db_name,1,8) dbnam,
       SUBSTR(proc.db_instance,1,8) dbinst,
       SUBSTR(vsess.username,1,10) dbuser
  FROM fnd_concurrent_processes proc,
       fnd_concurrent_queues concq,
       v$process vproc,
       v$session vsess
 WHERE proc.process_status_code = 'A'
   AND proc.queue_application_id = concq.application_id
   AND proc.concurrent_queue_id = concq.concurrent_queue_id
   AND proc.oracle_process_id = vproc.pid(+)
   AND vproc.addr = vsess.paddr(+)
 ORDER BY proc.queue_application_id,
       proc.concurrent_queue_id

Show currently running concurrent requests
SELECT SUBSTR(LTRIM(req.request_id),1,15) concreq,
       SUBSTR(proc.os_process_id,1,15) clproc,
       SUBSTR(LTRIM(proc.oracle_process_id),1,15) opid,
       SUBSTR(look.meaning,1,10) reqph,
       SUBSTR(look1.meaning,1,10) reqst,
       SUBSTR(vsess.username,1,10) dbuser,
       SUBSTR(vproc.spid,1,10) svrproc,
       vsess.sid sid,
       vsess.serial# serial#
FROM   fnd_concurrent_requests req,
       fnd_concurrent_processes proc,
       fnd_lookups look,
       fnd_lookups look1,
       v$process vproc,
       v$session vsess
WHERE  req.controlling_manager = proc.concurrent_process_id(+)
AND    req.status_code = look.lookup_code
AND    look.lookup_type = 'CP_STATUS_CODE'
AND    req.phase_code = look1.lookup_code
AND    look1.lookup_type = 'CP_PHASE_CODE'
AND    look1.meaning = 'Running'
AND    proc.oracle_process_id = vproc.pid(+)
AND    vproc.addr = vsess.paddr(+);

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