Tuesday, August 10, 2010

Compile Forms and Reports in 11.5.10.2

1) How to compile a form?

A) Open the source code in the client PC using X-Server
---------------------------------------------------------
i) Configure X-Server to access the GUI of the server.
ii) Open the form from the X-Server by using f60desm
iii) Make the changes in the forms according to your needs and save the form. The form will be saved in the server itself.
iv) Compile and generate the forms by using f60gen from the Putty / telnet session by using the following syntax.
f60gen module=form_name.fmb userid=apps/apps
or
f60gen module=form_name.fmb userid=apps/apps output_file=form_name.fmx
module_type=form batch=yes compile_all=special

v) f60gen will generate the run time executable .fmx file, move the file to the appropriate product top.

2) How To Compile Reports for Release 11i Applications?

A)
1. cd to where the .rdf files reside.
$cd /reports

2. Logon as applmgr

3. Use rwcon60 syntax for converting a .rdf file to a .rex file:

$ rwcon60 userid=/ source=< report name>.rdf
stype=rdffile dtype=rexfile dest=.rex overwrite=yes batch=yes

4. Use rwcon60 syntax for converting a .rex file back to a .rdf file:

$ rwcon60 userid=/ source=< report name>.rex
stype=rexfile dtype=rdffile dest=.rdf overwrite=yes batch=yes

5. Refer to the following example:

*Note: userid is the schema owner;
If the report is a GL report then the userid will be gl/gl
If the report is a FND report then the userid will be apps/apps

For the FNDSCURS.rdf example the report reside in:
cd $FND_TOP/reports

Logon as applmgr

The command line syntax is:

rwcon60 userid=apps/apps source=FNDSCURS.rdf stype=rdffile dtype=rexfile
dest=FNDSCURS.rex overwrite=yes batch=yes

rwcon60 userid=apps/apps source=FNDSCURS.rex stype=rexfile dtype=rdffile
dest=FNDSCURS.rdf overwrite=yes batch=yes

****************************************************************************
How To Generate A Report ( .RDF File) From The Unix Command on Release 11.5.X [ID 132638.1]

How To Customize And Compile An Application Seeded Form (FMB) Or Library (PLL)? [ID 427879.1]

Monday, July 5, 2010

Temp usage SQL's

Script to find the temp usage

SELECT S.sid,S.serial# sid_serial, S.username, S.osuser, P.spid, S.module,S.program, SUM (T.blocks) * TBS.block_size / 1024 / 1024 mb_used, T.tablespace,COUNT(*) sort_ops
FROM v$sort_usage T, v$session S, dba_tablespaces TBS, v$process P
WHERE T.session_addr = S.saddr
AND S.paddr = P.addr
AND T.tablespace = TBS.tablespace_name
GROUP BY S.sid, S.serial#, S.username, S.osuser, P.spid, S.module,
S.program, TBS.block_size, T.tablespace
ORDER BY sid_serial;

To get the SQL running in the temp tablespace

SELECT S.sid || ',' || S.serial# sid_serial, S.username,
T.blocks * TBS.block_size / 1024 / 1024 mb_used, T.tablespace,
T.sqladdr address, Q.hash_value, Q.sql_text
FROM v$sort_usage T, v$session S, v$sqlarea Q, dba_tablespaces TBS
WHERE T.session_addr = S.saddr
AND T.sqladdr = Q.address (+)
AND T.tablespace = TBS.tablespace_name
ORDER BY S.sid;

Friday, April 9, 2010

Tracing

10046 Trace Level Description
1 Basic trace level. Like the standard SQL_TRACE trace file. Provides statistics for parse, execute, fetch, commit and rollback database calls.
4 Displays bind variables
8 Displays wait statistics
12 Displays wait statistics and bind variables


ALTER SESSION SET
EVENTs=’10046 trace name context forever, level 12’;


Concurren tprogram trace--level 8


How To Trace a Concurrent Request And Generate TKPROF File [ID 453527.1]
TKProf Interpretation (9i and below) [ID 32951.1]

**************************************************************************
Login as Sysadmin -> System Administrator -> Concurrent : Program -> Define
Press F11 -> Enter the COncurrent Program Name (Eg. Active Users) -> Press Ctrl + F11
Enable the check box “Enable Trace” above “Copy To” button.
Click on Save.
Close the window.
Select Requests -> Run
Submit the concurrent request.

After completion or during execution of the request, you should see a trace file generated on the database server under udump directory.

SQL to identify the trace file

select oracle_process_id from fnd_concurrent_requests where request_id=[request_id];

DB Node
cd $ORACLE_HOME/admin/[SID]_[hostname]/udump
ls -latr *[oracle_process_id]*.*

Thursday, April 8, 2010

What is enq: TX - row lock contention

Enqueues are locks that coordinate access to database resources. enq: wait event indicates that the session is waiting for a lock that is held by another session. The name of the enqueue is as part of the form enq: enqueue_type - related_details.

The V$EVENT_NAME view provides a complete list of all the enq: wait events.

TX enqueue are acquired exclusive when a transaction initiates its first change and held until the transaction does a COMMIT or ROLLBACK.

Several Situation of TX enqueue:
--------------------------------------
1) Waits for TX in mode 6 occurs when a session is waiting for a row level lock that is already held by another session. This occurs when one user is updating or deleting a row, which another session wishes to update or delete. This type of TX enqueue wait corresponds to the wait event enq: TX - row lock contention.

The solution is to have the first session already holding the lock perform a COMMIT or ROLLBACK.

2) Waits for TX in mode 4 can occur if a session is waiting due to potential duplicates in UNIQUE index. If two sessions try to insert the same key value the second session has to wait to see if an ORA-0001 should be raised or not. This type of TX enqueue wait corresponds to the wait event enq: TX - row lock contention.

The solution is to have the first session already holding the lock perform a COMMIT or ROLLBACK.

3)Waits for TX in mode 4 is also possible if the session is waiting due to shared bitmap index fragment. Bitmap indexes index key values and a range of ROWIDs. Each ‘entry’ in a bitmap index can cover many rows in the actual table. If two sessions want to update rows covered by the same bitmap index fragment, then the second session waits for the first transaction to either COMMIT or ROLLBACK by waiting for the TX lock in mode 4. This type of TX enqueue wait corresponds to the wait event enq: TX - row lock contention.

Troubleshooting:

for which SQL currently is waiting to,

select sid, sql_text
from v$session s, v$sql q
where sid in (select sid
from v$session where state in ('WAITING')
and wait_class != 'Idle' and event='enq: TX - row lock contention'
and (
q.sql_id = s.sql_id or
q.sql_id = s.prev_sql_id));

The blocking session is,
SQL> select blocking_session, sid, serial#, wait_class, seconds_in_wait from v$session
where blocking_session is not NULL order by blocking_session;



select a.sid, a.event, a.total_waits, a.time_waited, a.average_wait
from v$session_event a, v$session b
where time_waited > 0
and a.sid=b.sid
and b.username is not NULL
and a.event='enq: TX - row lock contention';


Select blocking_session, sid, serial#, wait_class,seconds_in_wait
From v$session where blocking_session is not NULL
order by blocking_session;

Saturday, January 2, 2010

CM scripts

CMCLEAN.sql Non Destructive Script to Clean Concurrent Manager Tables
ICMLOG.sql This Script will provide the location for Retrieving the Internal
Manager log file.
CMLOGS.txt Script for Retrieving Log files associated to a Concurrent Request.
CCM.sql This script will diagnose Concurrent Managers and Concurrent
Requests.
REQCHECK.sql  Script for diagnosing problematic Concurrent Requests.
ANALYZEPENDING.sql Script for diagnosing Pending Concurrent Requests.
WHOCANRUN.sql  Script that lists Responsibilities that can Run a Given
Concurrent Program.

Friday, January 1, 2010

How to find the versions

Q. How to find Apps Version (11i/R12/12i).
A. Connect to database as user apps
SQL> select release_name from apps.fnd_product_groups;
Output like 12.0.4 or 11.5.10.2
Q. Web Server/Apache or Application Server in Apps 11i/R12
A. Log in as Application user, set environment variable and run below query $IAS_ORACLE_HOME/Apache/Apache/bin/httpd -version
Output for 11i should be like
Server version: Oracle HTTP Server Powered by Apache/1.3.19 (Unix)
Server built: Jan 26 2005 11:06:44 (iAS 1.0.2.2.2 rollup 5)
Output for R12 should be like
Server version: Oracle-Application-Server-10g/10.1.3.0.0Oracle-HTTP-Server
Server built: Dec 4 2006 14:44:38
Q. Forms & Report version (aka developer 6i) in 11i
A. Log in as Application user, set environment variable and run below query
$ORACLE_HOME/bin/f60run | grep Version | grep Forms
output like
Forms 6.0 (Forms Runtime) Version 6.0.8.25.2 (Production)
Check fourth character in version 25 which means Forms 6i patchset 16 (25-9)

Q. Forms & Report version in R12/12i
A. Log in as Application user, set environment variable and run below query
$ORACLE_HOME/bin/rwrun | grep Release
Output should be like
Report Builder: Release 10.1.2.2.0
You can safely ignore warnings
Q. Database Version in 11i/R12/12i
A. Go to database section below.
Q. Oracle Jinitiator in 11i/R12/12i
A. Log in as Application user, set environment variable and run below query
grep jinit_ver_comma $CONTEXT_FILE

(Default is Java Plug-In for R12/12i )
Q. Oracle Java Plug-in in 11i/R12/12i
A. Log in as Application user, set environment variable and run below query
grep plugin $CONTEXT_FILE
Q. File Version on file system
adident Header
or
strings | grep Header
Here adident is AD Utility (Oracle Apps) and strings is Unix utility
Q. Version of pld file
*.pld are source code of *.pll which are inturn source of *.plx. *.pll is in $AU_TOP/resource and to find its version check
adident Header $AU_TOP/resource/.pll
IGSAU012.pll:
$Header IGSAU012.pld 115.1.115100.1 2004/04/01 05:40:18 appldev ship $
or
strings $AU_TOP/resource/.pll | grep -i header
FDRCSID(’$Header: IGSAU012.pld 115.1.115100.1 2004/04/01 05:40:18 appldev ship $’);
Q. OA Framework Version
A.http:// hostname.domainName:port/OA_HTML/OAInfo.jsp (Only for 11i)
A. Log in as Application user, set environment variable and run below query
adident Header $FND_TOP/html/OA.jsp
adident Header $OA_HTML/OA.jsp
output for both should look like
$Header OA.jsp 115.60 2006/03/31 00:47:28 atgops1 noship $
120.21 means OA Framework Version (coming soon..)
115.60 means OA Framework Version (coming soon..)
115.56 means OA Framework Version (coming soon..)
115.36 means OA Framework Version 5.7
115.27 means OA Framework Version 5.6E
115.26 means OA Framework Version 5.5.2E
Q. Discoverer Version for 11i (3i or 4i)
A. Log in as Application user, set environment variable and run below query
$ORACLE_HOME/bin/disc4ws | grep -i Version
Q. Discoverer Version for 11i or R12 (10g AS)
Check under Application Server Section as 10g AS Discoverer is on standalone
Q. Workflow Version with Apps
A. Connect to Database as apps user
SQL> select TEXT Version from WF_RESOURCES where NAME = ‘WF_VERSION’;
Output like 2.6.0 means workflow version 2.6.0
Oracle Single Sign On
Connect to database which holds SSO repository
SQL>select version from orasso.wwc_version$;
Oracle Internet Directory
There are two component in OID (Software/binaries & Schema/database)
>>> To find software/binary version
$ORACLE_HOME/bin/oidldapd -version
output should look like
oidldapd: Release 10.1.4.0.1 - Production on mon jul 14 14:14:21 2008
Copyright (c) 1982, 2006 Oracle. All rights reserved.
To find Schema Version/ database use
ldapsearch -h -p -D “cn=orcladmin” -w “” -b “” \
-s base “objectclass=*” orcldirectoryversion
and output should be like
version: 1
dn:
orcldirectoryversion: OID 10.1.4.0.1
or run following query in database
SQL> select attrval from ods.ds_attrstore where entryid = 1 and attrname = ‘orcldirectoryversion’;
Output should be like OID 10.1.4.0.1
C. Application Server
1. Oracle Application Server 10g Rel 3 (10.1.3.X)
cat $ORACLE_HOME/config/ias.properties | grep Version
Version=10.1.3.0.0
2. For Oracle Application Server 10.1.2 (Prior to Oracle WebLogic Server)
If application server is registered in database (Portal, Discoverer) check from database
SQL> select * from ias_versions;
or
SQL>select * from INTERNET_APPSERVER_REGISTRY.SCHEMA_VERSIONS;
AOC4J (Oracle Container for J2EE)
Set ORACLE_HOME
cd $ORACLE_HOME/j2ee/home
java -jar oc4j.jar -version
Oracle Portal
SQL> select version from portal.wwc_version$;
Database Component
I) Oracle Database
To find database version
SQL> select * from v$version;
or
All component version in database
$ORACLE_HOME/OPatch/opatch lsinventory -detail
Oracle Enterprise Manager
Metalink Note 605398.1 How to to find the version of the main EM components
Unix Operating System
Solaris -> cat /etc/release
Red Hat Linux -> cat /etc/redhat-release

user level export and import

expdp parfile=PLCT170.par oracle@uslp123sd7dfcvxsza > more PLCT050.par userid= "/ as sysdba" dumpfile=T050.dmp logfile=expdpT0...