Tuesday, June 2, 2015

Common Tracing Techniques in Oracle E-Business Applications

Source:
FAQ: Common Tracing Techniques in Oracle E-Business Applications 11i and R12 (Doc ID 296559.1)
Why Can't Users Enable Forms Trace in 12.1.3 ? (Doc ID 1223753.1)
FAQ - How to Use Debug Tools and Scripts for the VCP (aka APS) and EBS Applications (Doc ID 245974.1)



Enable trace in the Oracle Application forms.

One can enable trace through the forms by using the Help menu, choosing the diagnostics menu, trace and then selecting the appropriate trace for your needs. Most commonly if debugging an error, you should at least provide trace with binds.  When debugging a performance issue, you may consider using trace with binds and waits.

For example, the following is the navigation to enable trace in a form:
1. Goto the Oracle Applications
2. Login
3. Open the form where the error occurs but do not yet cause the error.
4. Enable SQL*Trace by choosing Help > Diagnostics > Trace > Trace with binds
5. A message appears indicating that the trace will be recorded
6. Note the file name and location of the file
7. Now reproduce the error.
8. Once the error occurs, disable trace as soon as possible.
9. Disable SQL*Trace by choosing Help > Diagnostics > Trace > Trace off
10. The same file name and location will be noted in case you need it again.
11. Retrieve the trace file from the DB(user_dump_dest).



Enable trace for a Concurrent Program.

Checkbox

With system administration privileges, a simple way to enable trace in a concurrent program is to review the concurrent program definition and select trace enabled. This will enable trace without binds for all users that run the program.

For example, the following steps could be used.
1. Goto Sysadmin > Concurrent > Program > Define
2. Query the concurrent program
3. Check the trace box to enable trace

If you require bind variables for your trace file from a concurrent program, a more sophisticated method is required as noted below.

Debug Options Button! (Binds and Waits)
When submitting a concurrent program in R12.1 and higher, the concurrent program submission screen has a "Debug Options" button where you can enable trace. The button opens a window with various SQL Tracing options including Binds and Waits. The selection applies just to the current run of the program.



Enable trace for ALL user actions

How does one enable trace for all actions that occur for a user?
One can enable trace for all actions that a user takes by setting a profile option for the user. This will function when the user logs into the Oracle Applications forms or when logging into the Self Service Web Applications. This method uses an Event Trace.

The instructions for enabling the event trace follow:
1) First enable trace for a specific user:
- Bring up the Core application - System Administrator responsibility
- Move to Profile/System
- Check off the USER box - and enter your username that you are using when getting the error
- Search on the following profile option - 'Initialization SQL Statement - Custom'

Please set this at the user level with the following string:

BEGIN FND_CTL.FND_SESS_CTL('','', '', 'TRUE','','ALTER SESSION SET TRACEFILE_IDENTIFIER='||''''||'4269824.999' ||''''||' EVENTS ='||''''||' 10046 TRACE NAME CONTEXT FOREVER, LEVEL 12 '||''''); END; 


This must be one complete line of text - so may be best to copy the string into notepad prior to putting it into the profile.


2) Once the profile is set, please change responsibilities and directly go and reproduce the problem.
To locate the trace file, use the following sql in sqlplus:

SQL> select name, value from v$parameter where name like 'user_dump_dest'; 

- The value is the location of the trace file on the database server.

- This is the trace file created - please tkprof and upload BOTH the raw and tkprof trace file to My Oracle Support.

3) Ensure that the profile option is unset before exiting the Application.
This is a very important step. If this is not unset, unnecessary trace files will be generated.

4) Note that a similar technique can be used for enabling trace with binds for a user in SQL*Plus. The commands would look like the following:

SQL> ALTER SESSION SET TRACEFILE_IDENTIFIER='577' EVENTS ='10046 TRACE NAME CONTEXT FOREVER, LEVEL 12';
SQL> select 'x' from dual; -- or any SQL that you want to trace
SQL> alter session set sql_trace = false;


How To Generate and Retrieve Trace Files for SSA (Self Service Applications)

1.Have DBA or someone with APPS access to SQL run
    alter system set max_dump_file_size = 'unlimited';
    This will prevent trace being cutoff and not usable.


2.The profile FND: Diagnostics = Yes is required to have the Diagnostics button appear in Self Service menus.
    1.IF setup for the first time, THEN exit and sign on again to the SSA


3.Click on Diagnostics button (In 12.2 - click the GEAR icon and choose Diagnostics)
    1.Choose Set Trace Level from the drop down, the press Go
    2.Choose the trace level - Trace with BINDS (or for performance issue, then Trace with Binds and Waits)
    and press Save
    3.A single trace number will be shown… This is NOT usually the trace that is needed.
    4.As more steps are performed, more trace numbers will be written to this screen and they will be the ones that be for the functionality that is being tested


4.Perform the actions necessary in Self Service Applications - Note: Use the least number of steps possible!


5.Then click on Diagnostics button again
    1.Choose Set Trace Level from the drop down, the press Go
    2.Now there will be multiple trace file numbers showing on the screen.
    3.Write down the trace numbers and then click Disable Trace and press Save (the number will disappear when you press Save)


6.Have the DBA retrieve the trace files from the user_dump_dest of the database.





Using TKPROF

A trace file can be reviewed using TKPROF. TKPROF reformats the raw data so that it is easier to review. The TKPROF commands are normally run at the operating system command prompt.  This will be signified with a $ as this is a common prompt in UNIX.
1. Retrieve the trace file.
2. Issue a command like the following to create a TKPROF version of the trace file.  The explain option will look to see how each query is handled by the database in terms of what tables and indexes are referenced.

$ tkprof sys=no explain=apps/

However, TKPROF does not take into account bind variables. Therefore, these are ignored in the output. When you need to analyze bind variables, consider using TraceAnalyzer.
A handy technique when trouble shooting performance issues is to use TKPROF to look at the longest running queries.  Since trace files related to performance can be huge, one might spend hours looking through the results to find the queries causing the issue.  If you sort the file by the longest running queries first, it makes it much easier to investigate.  The following example sorts by longest running queries first with the sort options selected as "sort='(prsela,exeela,fchela)'" and limits the results to the "Top 10" long running queries with the "print=10" command:

$ tkprof sys=no explain=apps/ sort='(prsela,exeela,fchela)' print=10 
 

What is a trace file?

A trace file is a log of SQL run in a particular session or sessions focused on selects, inserts, updates, and deletes. A trace file can be used in many circumstances including reviewing performance, finding tables and views referenced, or finding the root of an error. More details about trace files can be read in the database user's guide related to your version.




What are bind variables?

A bind variable is a substitution value used within a trace file. To improve performance, the Oracle database will reuse SQL substituting values for variables as necessary. For example, the same SQL statement could be run for each
of your employees. The employee id might be a variable that is changed before you run each SQL. This could be translated to the database as a bind variable so that the same SQL can be used each time but the correct variable can be substituted just before the SQL is run.

If someone requests that you enable bind variables for your trace file, this causes the database to document the substitution variables within the trace file as well as the SQL run. For example, we may see that a select statement ran against the employee table ten times, but without the binds, we would not know what employee was selected each time.




Tuesday, May 5, 2015

Patching & Maintenance Advisor: E-Business Suite




Friday, April 17, 2015

WebLogic Server fails to start with SecurityServiceRuntimeException Error

WebLogic Server does not start, showing the following stack trace, soon after Domain creation:


weblogic=>./startWebLogic.sh
.
.
JAVA Memory arguments: -Xms256m -Xmx512m  -XX:MaxPermSize=256m
.
WLS Start Mode=Production
.
CLASSPATH=/app01/oracle/Middleware/patch_wls1036/profiles/default/sys_manifest_classpath/weblogic_patch.jar:/app01/oracle/Middleware/patch_ocp371/profiles/default/sys_manifest_classpath/weblogic_patch.jar:/app01/java/jdk1.6.0_43/lib/tools.jar:/app01/oracle/Middleware/wlserver_10.3/server/lib/weblogic_sp.jar:/app01/oracle/Middleware/wlserver_10.3/server/lib/weblogic.jar:/app01/oracle/Middleware/modules/features/weblogic.server.modules_10.3.6.0.jar:/app01/oracle/Middleware/wlserver_10.3/server/lib/webservices.jar:/app01/oracle/Middleware/modules/org.apache.ant_1.7.1/lib/ant-all.jar:/app01/oracle/Middleware/modules/net.sf.antcontrib_1.1.0.0_1-0b2/lib/ant-contrib.jar:/app01/oracle/Middleware/wlserver_10.3/common/derby/lib/derbyclient.jar:/app01/oracle/Middleware/wlserver_10.3/server/lib/xqrl.jar
.
PATH=/app01/oracle/Middleware/wlserver_10.3/server/bin:/app01/oracle/Middleware/modules/org.apache.ant_1.7.1/bin:/app01/java/jdk1.6.0_43/jre/bin:/app01/java/jdk1.6.0_43/bin:/app01/oracle/Middleware/wlserver_10.3/server/bin:/app01/oracle/Middleware/modules/org.apache.ant_1.7.1/bin:/app01/java/jdk1.6.0_43/jre/bin:/app01/java/jdk1.6.0_43/bin:/app01/oracle/Middleware/wlserver_10.3/server/bin:/app01/oracle/Middleware/modules/org.apache.ant_1.7.1/bin:/usr/lib64/qt-3.3/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/weblogic/bin:/home/weblogic/bin:/home/weblogic/bin:/app01/java/jdk1.6.0_43
.
***************************************************
*  To start WebLogic Server, use a username and   *
*  password assigned to an admin-level user.  For *
*  server administration, use the WebLogic Server *
*  console at http://hostname:port/console        *
***************************************************
starting weblogic with Java version:
java version "1.6.0_43"
Java(TM) SE Runtime Environment (build 1.6.0_43-b01)
Java HotSpot(TM) 64-Bit Server VM (build 20.14-b01, mixed mode)
Starting WLS with line:
/app01/java/jdk1.6.0_43/bin/java -server   -Xms256m -Xmx512m  -XX:MaxPermSize=256m -Dweblogic.Name=MedRecAdmServer -Djava.security.policy=/app01/oracle/Middleware/wlserver_10.3/server/lib/weblogic.policy  -Dweblogic.ProductionModeEnabled=true  -Xverify:none  -da -Dplatform.home=/app01/oracle/Middleware/wlserver_10.3 -Dwls.home=/app01/oracle/Middleware/wlserver_10.3/server -Dweblogic.home=/app01/oracle/Middleware/wlserver_10.3/server   -Dweblogic.management.discover=true  -Dwlw.iterativeDev=false -Dwlw.testConsole=false -Dwlw.logErrorsToConsole=false -Dweblogic.ext.dirs=/app01/oracle/Middleware/patch_wls1036/profiles/default/sysext_manifest_classpath:/app01/oracle/Middleware/patch_ocp371/profiles/default/sysext_manifest_classpath  weblogic.Server
<Apr 17, 2015 8:44:26 AM EDT> <Info> <Security> <BEA-090905> <Disabling CryptoJ JCE Provider self-integrity check for better startup performance. To enable this check, specify -Dweblogic.security.allowCryptoJDefaultJCEVerification=true>
<Apr 17, 2015 8:44:26 AM EDT> <Info> <Security> <BEA-090906> <Changing the default Random Number Generator in RSA CryptoJ from ECDRBG to FIPS186PRNG. To disable this change, specify -Dweblogic.security.allowCryptoJDefaultPRNG=true>
<Apr 17, 2015 8:44:26 AM EDT> <Info> <WebLogicServer> <BEA-000377> <Starting WebLogic Server with Java HotSpot(TM) 64-Bit Server VM Version 20.14-b01 from Sun Microsystems Inc.>
<Apr 17, 2015 8:44:27 AM EDT> <Info> <Management> <BEA-141107> <Version: WebLogic Server 10.3.6.0  Tue Nov 15 08:52:36 PST 2011 1441050 >
<Apr 17, 2015 8:44:28 AM EDT> <Info> <Security> <BEA-090065> <Getting boot identity from user.>
Enter username to boot WebLogic server:weblogic
Enter password to boot WebLogic server:
<Apr 17, 2015 8:44:35 AM EDT> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to STARTING>
<Apr 17, 2015 8:44:35 AM EDT> <Info> <WorkManager> <BEA-002900> <Initializing self-tuning thread pool>
<Apr 17, 2015 8:44:35 AM EDT> <Notice> <Log Management> <BEA-170019> <The server log file /app01/oracle/Middleware/user_projects/domains/MedRecDomain/servers/MedRecAdmServer/logs/MedRecAdmServer.log is opened. All server side log events will be written to this file.>
<Apr 17, 2015 8:44:38 AM EDT> <Warning> <Security> <BEA-090076> <A failure occurred attempting to load LDIF for provider Authorizer from file /app01/oracle/Middleware/wlserver_10.3/server/lib/XACMLAuthorizerInit.ldift.>
<Apr 17, 2015 8:44:38 AM EDT> <Error> <Security> <BEA-090870> <The realm "myrealm" failed to be loaded: weblogic.security.service.SecurityServiceException: com.bea.common.engine.ServiceInitializationException: weblogic.security.spi.ProviderInitializationException: A failure occurred attempting to load LDIF for provider Authorizer from file /app01/oracle/Middleware/wlserver_10.3/server/lib/XACMLAuthorizerInit.ldift..
weblogic.security.service.SecurityServiceException: com.bea.common.engine.ServiceInitializationException: weblogic.security.spi.ProviderInitializationException: A failure occurred attempting to load LDIF for provider Authorizer from file /app01/oracle/Middleware/wlserver_10.3/server/lib/XACMLAuthorizerInit.ldift.
    at weblogic.security.service.CommonSecurityServiceManagerDelegateImpl.initializeRealm(CommonSecurityServiceManagerDelegateImpl.java:466)
    at weblogic.security.service.CommonSecurityServiceManagerDelegateImpl.loadRealm(CommonSecurityServiceManagerDelegateImpl.java:841)
    at weblogic.security.service.CommonSecurityServiceManagerDelegateImpl.initializeRealms(CommonSecurityServiceManagerDelegateImpl.java:870)
    at weblogic.security.service.CommonSecurityServiceManagerDelegateImpl.initialize(CommonSecurityServiceManagerDelegateImpl.java:1032)
    at weblogic.security.service.SecurityServiceManager.initialize(SecurityServiceManager.java:873)
    Truncated. see log file for complete stacktrace
Caused By: com.bea.common.engine.ServiceInitializationException: weblogic.security.spi.ProviderInitializationException: A failure occurred attempting to load LDIF for provider Authorizer from file /app01/oracle/Middleware/wlserver_10.3/server/lib/XACMLAuthorizerInit.ldift.
    at com.bea.common.engine.internal.ServiceEngineImpl.findOrStartService(ServiceEngineImpl.java:365)
    at com.bea.common.engine.internal.ServiceEngineImpl.findOrStartService(ServiceEngineImpl.java:315)
    at com.bea.common.engine.internal.ServiceEngineImpl.lookupService(ServiceEngineImpl.java:257)
    at com.bea.common.engine.internal.ServicesImpl.getService(ServicesImpl.java:72)
    at weblogic.security.service.CSSWLSDelegateImpl.getService(CSSWLSDelegateImpl.java:155)
    Truncated. see log file for complete stacktrace
Caused By: weblogic.security.spi.ProviderInitializationException: A failure occurred attempting to load LDIF for provider Authorizer from file /app01/oracle/Middleware/wlserver_10.3/server/lib/XACMLAuthorizerInit.ldift.
    at com.bea.common.store.bootstrap.internal.BootStrapServiceImpl.loadFullLDIFTemplate(BootStrapServiceImpl.java:910)
    at com.bea.common.store.bootstrap.internal.BootStrapServiceImpl.loadLDIFTemplate(BootStrapServiceImpl.java:688)
    at com.bea.common.store.bootstrap.internal.BootStrapServiceImpl.loadLDIFXACMLAuthorizerTemplate(BootStrapServiceImpl.java:176)
    at com.bea.common.store.bootstrap.internal.BootStrapServiceImpl.loadLDIFXACMLAuthorizerTemplate(BootStrapServiceImpl.java:160)
    at com.bea.common.security.internal.service.BootStrapServiceImpl.loadLDIFXACMLAuthorizerTemplate(BootStrapServiceImpl.java:106)
    Truncated. see log file for complete stacktrace
Caused By: <openjpa-1.1.1-SNAPSHOT-r422266:1172209 fatal store error> kodo.jdo.FatalDataStoreException: The transaction has been rolled back.  See the nested exceptions for details on the errors that occurred.
    at org.apache.openjpa.kernel.BrokerImpl.newFlushException(BrokerImpl.java:2170)
    at org.apache.openjpa.kernel.BrokerImpl.flush(BrokerImpl.java:2017)
    at org.apache.openjpa.kernel.BrokerImpl.flushSafe(BrokerImpl.java:1915)
    at org.apache.openjpa.kernel.BrokerImpl.beforeCompletion(BrokerImpl.java:1833)
    at org.apache.openjpa.kernel.LocalManagedRuntime.commit(LocalManagedRuntime.java:81)
    Truncated. see log file for complete stacktrace
Caused By: <openjpa-1.1.1-SNAPSHOT-r422266:1172209 nonfatal store error> kodo.jdo.DataStoreException: ORA-00942: table or view does not exist
 {prepstmnt 1198520800 INSERT INTO BEAXACMLAP (DOMN, REALMN, TYPEN, CN, XVER, CTS, WCN, WCI, WXF, XD, XS, MTS) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [params=(String) MedRecDomain, (String) myrealm, (String) Policies, (String) urn:bea:xacml:2.0:entitlement:resource:type@E@Fmbean@G, (String) 1.0, (null) null, (null) null, (null) null, (Blob) oracle.sql.BLOB@315cb235, (InputStream) java.io.ByteArrayInputStream@3cb7cee4, (String) 3, (Timestamp) 2015-04-17 08:44:38.792] [reused=0]} [code=942, state=42000]
FailedObject: com.bea.common.security.store.data.XACMLAuthorizationPolicy@55ab3cda
    at org.apache.openjpa.jdbc.sql.DBDictionary.narrow(DBDictionary.java:4207)
    at org.apache.openjpa.jdbc.sql.DBDictionary.newStoreException(DBDictionary.java:4171)
    at org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:102)
    at org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:72)
    at kodo.jdbc.kernel.BatchingPreparedStatementManager.flushInternal(BatchingPreparedStatementManager.java:214)
    Truncated. see log file for complete stacktrace
Caused By: org.apache.openjpa.lib.jdbc.ReportingSQLException: ORA-00942: table or view does not exist
 {prepstmnt 1198520800 INSERT INTO BEAXACMLAP (DOMN, REALMN, TYPEN, CN, XVER, CTS, WCN, WCI, WXF, XD, XS, MTS) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [params=(String) MedRecDomain, (String) myrealm, (String) Policies, (String) urn:bea:xacml:2.0:entitlement:resource:type@E@Fmbean@G, (String) 1.0, (null) null, (null) null, (null) null, (Blob) oracle.sql.BLOB@315cb235, (InputStream) java.io.ByteArrayInputStream@3cb7cee4, (String) 3, (Timestamp) 2015-04-17 08:44:38.792] [reused=0]} [code=942, state=42000]
    at org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator.wrap(LoggingConnectionDecorator.java:192)
    at org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator.access$700(LoggingConnectionDecorator.java:57)
    at org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator$LoggingConnection$LoggingPreparedStatement.executeUpdate(LoggingConnectionDecorator.java:866)
    at org.apache.openjpa.lib.jdbc.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:269)
    at org.apache.openjpa.jdbc.kernel.JDBCStoreManager$CancelPreparedStatement.executeUpdate(JDBCStoreManager.java:1453)
    Truncated. see log file for complete stacktrace
>
<Apr 17, 2015 8:44:38 AM EDT> <Notice> <Security> <BEA-090082> <Security initializing using security realm myrealm.>
<Apr 17, 2015 8:44:38 AM EDT> <Critical> <WebLogicServer> <BEA-000362> <Server failed. Reason:

There are 1 nested errors:

weblogic.security.service.SecurityServiceRuntimeException: [Security:090399]Security Services Unavailable
    at weblogic.security.service.CommonSecurityServiceManagerDelegateImpl.doBootAuthorization(CommonSecurityServiceManagerDelegateImpl.java:917)
    at weblogic.security.service.CommonSecurityServiceManagerDelegateImpl.initialize(CommonSecurityServiceManagerDelegateImpl.java:1054)
    at weblogic.security.service.SecurityServiceManager.initialize(SecurityServiceManager.java:873)
    at weblogic.security.SecurityService.start(SecurityService.java:141)
    at weblogic.t3.srvr.SubsystemRequest.run(SubsystemRequest.java:64)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:256)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:221)

>
<Apr 17, 2015 8:44:38 AM EDT> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to FAILED>
<Apr 17, 2015 8:44:38 AM EDT> <Error> <WebLogicServer> <BEA-000383> <A critical service failed. The server will shut itself down>
<Apr 17, 2015 8:44:38 AM EDT> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to FORCE_SHUTTING_DOWN>
weblogic.oraclesys.com /app01/oracle/Middleware/user_projects/domains/MedRecDomain/bin
weblogic=>cd $WL_HOME/server/lib
weblogic.oraclesys.com /app01/oracle/Middleware/wlserver_10.3/server/lib
weblogic=>ls



Probable Solution:

The database administrator needs to run the SQL script that creates the RDBMS tables in the datastore which are used by the RDBMS security store. A set of SQL scripts for creating and removing these tables for each supported RDBMS system is available in WL_HOME/server/lib
During the process of configuring the RDBMS security store via the Configuration Wizard, you are presented with the option of testing the database connection. Oracle strongly recommends using this option because it can verify that the connection is set up properly. If there were a problem with the database connection, you might not be able subsequently to boot the domain if the security providers that control access to that domain are unable to obtain the necessary security policies.

Create RDBMS Tables in the Security Datastore

Prior to booting the domain, the database administrator needs to run the SQL script that creates the RDBMS tables in the datastore used by the RDBMS security store. A set of SQL scripts for creating these tables for, and also removing them from, each supported RDBMS system is available in the following WebLogic Server installation directory:
WL_HOME/server/lib

When running the appropriate SQL script for the database serving as the RDBMS security store, be sure to specify the same connection properties, including the credentials of the user who has access, the database URL, etc., as specified for that RDBMS during domain creation.
Oracle 9i, 10g, 11g
———————————————
CREATE- rdbms_security_store_oracle.sql

REMOVE- rdbms_security_store_oracle_remove.sql
MS-SQL 2000, 2005
———————————————
rdbms_security_store_sqlserver.sql

rdbms_security_store_sqlserver_remove.sql
DB2 9.2, 9.5
———————————————

rdbms_security_store_db2.sql
rdbms_security_store_db2_remove.sql
Derby
———————————————

rdbms_security_store_derby.sql

Monday, April 13, 2015

Automate file transfer from FTP to UNIX server



#!/bin/sh
set -x
rm commands.txt

echo "Enter the Path... example:"
echo "/oraftp/OraFin"
echo "/oraftp/OraFin/mm541"
read pth
        echo "cd $pth" > commands.txt

echo "Name of the file?"
read file_name
        echo "get $file_name" >> commands.txt

echo "Below are the Path and the file name you entered"
cat commands.txt

sftp -b commands.txt oraftp@10.10.10.10


#Note: This setup works only when passwordless authentication is eanbled b/w the servers.

https://libsys.kctcs.edu/stapleton/file-xfer/scripting.html
http://linuxcommand.org/wss0090.php

Saturday, March 28, 2015

Configuring a new disk in Linux


[root@ebsapp01 ~]# cd /dev/
[root@ebsapp01 dev]# ls -l sd*
brw-rw----  1 root disk 8,  0 Aug 29  2014 sda
brw-rw----  1 root disk 8,  1 Aug 29  2014 sda1
brw-rw----  1 root disk 8,  2 Aug 29  2014 sda2
brw-rw----  1 root disk 8, 16 Aug 29  2014 sdb
brw-rw----  1 root disk 8, 17 Aug 29  2014 sdb1
brw-rw----  1 root disk 8, 32 Aug 29  2014 sdc

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

[root@ebsapp01 dev]# fdisk sdc

Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklab el
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that, of course, the previous
content won't be recoverable.


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

Command (m for help): p

Disk sdc: 214.7 GB, 214748364800 bytes
255 heads, 63 sectors/track, 26108 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot      Start         End      Blocks   Id  System

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

Command (m for help): p

Disk sdc: 214.7 GB, 214748364800 bytes
255 heads, 63 sectors/track, 26108 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot      Start         End      Blocks   Id  System
  sdc1               1       26108   209712478+  83  Linux

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

Calling ioctl() to re-read partition table.
Syncing disks.

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

[root@ebsapp01 dev]# mkdir -p /db01

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

[root@ebsapp01 ~]# mkfs.ext3 /dev/sdc1

mke2fs 1.35 (28-Feb-2004)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
26214400 inodes, 52428119 blocks
2621405 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=54525952
1600 block groups
32768 blocks per group, 32768 fragments per group
16384 inodes per group
Superblock backups stored on blocks:
        32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
        4096000, 7962624, 11239424, 20480000, 23887872

Writing inode tables: done
Creating journal (8192 blocks): done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 37 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.

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

[root@ebsapp01 ~]# mount -t ext3 /dev/sdc1 /db01/

[root@ebsapp01 ~]# mount -a

[root@ebsapp01 ~]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda1             7.9G  2.1G  5.5G  28% /
none                  506M     0  506M   0% /dev/shm
/dev/sdb1             2.0G  270M  1.8G  14% /app01
/dev/sdc1             197G   93M  187G   1% /db01

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


[root@ebsapp01 ~]# grep "/dev/sdc1" /etc/fstab

/dev/sdc1               /db01                   ext3    defaults        0 0
[root@ebsapp01 ~]#


http://geektnt.com/how-to-format-and-mount-second-hard-drive-on-linux.html

Saturday, March 21, 2015

Debugging Guide for Reports Issues in Oracle E-Business Suite Release 12 (Doc ID 1669163.1)

Section 1: Overview

Oracle Forms and Reports 10.1.2.x as used by Oracle E-Business Suite Release 12 are components of Oracle Application Server 10.1.2. The latest version in Oracle E-Business Suite Release 12 is Oracle Reports version 10.1.2.3.

In Oracle E-Business Suite Release 12, all reports are submitted online through the concurrent manager, as there is no standalone reports server.

When a customer submits a report through the concurrent request screen, the $INST_TOP/ora/10.1.2/bin/appsrwrun.sh script is called. This script sets Oracle Application specific settings required for running the report, executes $ORACLE_HOME/bin/reports.sh to set the reports environment, and then calls 10.1.2 $ORACLE_HOME/bin/rwrun to execute the report.

Reports (rdf files) are placed under $PROD_TOP/reports/US in Release 12. The Oracle Reports user exits available in Oracle E-Business Suite are found in $FND_TOP/bin/fndrwxit.so (or fndrwxit.sl).

In UNIX, we have an environment variable REPORTS_DEFAULT_DISPLAY (defined under 10.1.2 $ORACLE_HOME/bin/reports.sh). This tells reports to use DISPLAY of a third party like XVFB,VNC or to use headless operations available in JDK on 10.1.2 ORACLE_HOME. 

REPORTS_DEFAULT_DISPLAY=YES means DISPLAY is not needed and the report is able to use headless operations from JDK for operations that need graphical or image generation work.
REPORTS_DEFAULT_DISPLAY=NO means DISPLAY is needed and the report depends on the DISPLAY parameter set correctly to the third party XVNC/XVBF displays. REPORTS_DEFAULT_DISPLAY=NO is set for AIX only.

REPORTS_SERVER_CONFDIR is used to specify where the rwbuilder.conf file will reside. This can be set to a directory that the user running the reports can write. The rwbuilder.conf file will be copied into this directory and used by the reports executables. This variable is set to $INST_TOP/ora/10.1.2/reports/conf in APPS instance.

Section 2: How to Debug Report Issues

2.1 Steps to Run a Report from Command Line
2.2 Further Debugging
When you receive a report issue, you must first assess whether the issue stems from the reports layer or is a concurrent program issue. To figure this out, you need to run a report from the command line.

2.1 Steps to Run a Report from Command Line

Take the following steps to run a report from the command line.
  1. Enable trace in the report so the command used to submit it will appear in the log file.

    1. Log in to Oracle Applications as a user who has system administrator responsibilities.

    2. As system administrator, navigate to the Define Concurrent Program Screen and query the report.

    3. Check the box next to Enable Trace.

    4. Save the record.
  2. Switch responsibilities and submit the concurrent request to run the report.

  3. You will get full reports command in concurrent program log file.

  4. Log into the middle tier and source the environment.

  5. Now run the command from the command line after adding userid=userid/password with this command.
If you see that the issue is reproduced after the completion of step 5, then it is confirmed that the issue is within the reports layer. If this is the case, you must check whether all patches listed in My Oracle Support Knowledge Document 437878.1, Upgrading OracleAS 10g Forms and Reports in Oracle E-Business Suite Release 12, have been properly applied in the customer's instance. You can verify this using the opatch lsinventory command.

2.2 Further Debugging

If all patches have been properly applied in the customer's instance and the customer is still receiving this error, it may be a new issue. Review the following points for further debugging:
    2.2.1:df -kh output of $REPORTS_TMP

    • As the reports temp file is created here, check to make sure enough space is available for reports temp file creation in this directory.
    2.2.2:df -kh output of $INST_TOP/logs/ora/10.1.2/reports/cache

    • The reports cache file is created in this directory. Check $INST_TOP/ora/10.1.2/reports/conf/rwbuilder.conf file for REPORTS_CACHE directory path. Enough space should be available for reports cache file creation in this directory.
    2.2.3:If the core file has been generated by the failed reports process, you need to review the stacktrace generated from the core file.

    • Please follow My Oracle Support Knowledge Document 1812.1, TECH: Getting a Stack Trace from a CORE file on Unix, for generating stacktrace from reports core file.
    2.2.4:Check output of ls -ltr 10.1.2 $ORACLE_HOME/bin/reports.sh. You must verify whether customer has the latest reports.sh under $ORACLE_HOME/bin. We have seen some report issues where the customer has an old reports.sh file in 10.1.2 $ORACLE_HOME/bin which will set the wrong LD_LIBRARY_PATH.

    2.2.5:Review the strace output of reports command. You can take strace output of reports command with the following command (you need to run the report from command line here):
    strace -o reports .out -f <entire reports command with userid/password>
    2.2.6:Excessive amounts of the srw.message included in the rdf file can cause signal 6/11 or out of memory error or performance issues in reports. These messages must be removed from the rdf file.

    2.2.7:Customers often cite a crash when they are running reports containing a large volume of data. Currently, there is no limitation on the reports temp file size and output file size, provided that the customer has applied all reports one-off patches from My Oracle Support Knowledge Document 437878.1, Upgrading OracleAS 10g Forms and Reports in Oracle E-Business Suite Release 12, and CA_FILEIO_64 is defined to YES in the customer's instance (already included in template fix 9413844).

    • Verify whether all reports one-off patches have been applied in the customer's instance and all post-installation steps are executed properly if they are still receiving errors when dealing with a large volume of data.

      You can also check the size of reports temp and cache file with the following commands in Linux (during reports execution).
      lsof|grep <reports process id>|grep dat
      lsof|grep <reports process id>|grep cache)
      You may also need to review the strace output of report command.
       
    2.2.8:Reports may consume 100% CPU or may run for 2-3 days and never finish or crashes in function 'rwfpngposition' when number of pages in report output exceeds 65535 and the report uses page numbering format "m of N". There is no fix for this issue yet. Respective product teams need to change their page numbering format to "m" to avoid such issues. The customer may be hit by this also while running a report with a large volume of data. We need to contact owner of the rdf file to modify the page numbering format.

    2.2.9:You can increase the heap size in jvmOptions in $INST_TOP/ora/10.1.2/reports/conf/rwbuilder.conf to check the reports execution with more jvm memory.

    Change the following lines:
    <engine id="rwEng" class="oracle.reports.engine.EngineImpl"
    initEngine="1" maxEngine="1" minEngine="0" engLife="50" maxIdle="30"
    callbackTimeOut="60000">
    to:
    <engine id="rwEng" class="oracle.reports.engine.EngineImpl" initEngine="1"
    maxEngine="1" minEngine="0" engLife="50" maxIdle="30"
    callbackTimeOut="60000"
    jvmOptions="-Xms512m -Xmx512m">
    You should suggest this to your customer when report fails with the error -java.lang.OutOfMemoryError.

    2.2.10:You may need to review the reports trace for debugging a report issue. Enabling reports tracing generates a text file that describes the series of steps completed during the execution of the reports. Tracing can be set to capture all events or just specific types of events.

    Under the system administrator responsibility, navigate to the Define Concurrent Programs form.

    From here, click on Concurrent -> Program -> Define.
    Query the report by entering the report name in the Program field.

    Check 'Enable Trace' in the 'Request' section. Enter your trace options in the 'Options' field in the 'Executable' section using the format:

    TRACEOPTS=< >TRACEFILE=< > TRACEMODE=< >


    The following table is a list of possible trace options:

    Trace Options Description
    TRACE_ALL Log all possible trace information in the trace file (default option).
    TRACE_APP Log trace information on all the reports objects in the trace file.
    TRACE_BRK List all breakpoints in the trace file.
    TRACE_DBG Log debug information.
    TRACE_DST List distribution lists in the trace file.
    TRACE_ERR List error messages and warnings in the trace file.
    TRACE_EXC List Reports Server exceptions.
    TRACE_INF Dumps any information not covered by the other options.
    TRACE_LOG Duplicate log information in your trace file.
    TRACE_PLS Log trace information on all the PL/SQL objects in the trace file.
    TRACE_PRF Log performance statistics in the trace file.
    TRACE_SQL Log trace information on all the SQL in the trace file (includes binds).
    TRACE_STA Provide server and engine state information.
    TRACE_TMS Enter a timestamp for each entry in the trace file.
    TRACE_WRN List server warning messages.
    TRACEOPTS=(TRACE_APP, TRACE_PRF) To use multiple options, list options in parentheses.
    TRACEFILE=Any valid file name including the full path to the file Specify the report trace file name.
    TRACEMODE=TRACE_APPEND Add the new information to the end of the file.
    TRACEMODE=TRACE_REPLACE Overwrite the file.
    TRACEOPTS=< >TRACEFILE=< > TRACEMODE=<> Collect reports trace file by adding tracing options to the end of the reports command line.

     
    Note: You will receive the following exception in the reports trace file:
    Exception 50125 (org.omg.CORBA.OBJ_ADAPTER: vmcid: SUN minor code: 202 completed: Maybe
    at com.sun.corba.se.internal.corba.ORB.disconnect(Unknown Source)
    at oracle.reports.server.ConnectionManager.release(ConnectionManager.java:183)
    at oracle.reports.server.ConnectionImpl.disconnect(ConnectionImpl.java:660)
    at oracle.reports.client.ReportRunner.releaseConnection(ReportRunner.java:333)
    at oracle.reports.definition.RWServerInProcess.release(RWServerInProcess.java:368)
    at oracle.reports.definition.RWServerInProcess.showProgress(RWServerInProcess.java:360)
    at oracle.reports.definition.RWServerInProcess.run(RWServerInProcess.java:198)
    ): Internal error org.omg.CORBA.OBJ_ADAPTER: vmcid: SUN minor code: 202 completed: Maybe
    This is not an error message. This exception is found in all reports trace files. This can be ignored while analyzing the report trace files.You can also apply Patch 5659594 in 10.1.2 ORACLE_HOME.With this patch you will not see these warning messages in reports trace file.

    2.2.11:If you want to check the values of environment variables during reports execution, you need to run modify appsrwrun.sh. To do so, add env> /tmp/envvalues.out just before -exec $ORACLE_HOME/bin/rwrun "$@" command in $INST_TOP/ora/10.1.2/bin/appsrwrun.sh.

    You can also modify appsrwrun.sh to take strace output of the report command if your customer does not feel comfortable with running the report from command line or if the report is executed from some product executable file. For that you need to modify appsrwrun.sh with the following:
    exec strace -o /tmp/strace.out -f $ORACLE_HOME/bin/rwrun "$@"
    2.2.12:If you want to generate DB trace for reports process, complete the following steps:

    1. Under the system administrator responsibility, navigate to the Define Concurrent Programs form (Concurrent -> Program -> Define).

    2. Query the reports by entering the reports name in the program field.

    3. Check 'Enable Trace' in the request section and save the record.

    4. Submit the concurrent request to run the reports. DB trace file will be generated under USER_DUMP_DEST. Check the trace file with the string *CR<concurrent_request_id>* in this directory (for example, -txkr12d2_ora_17752_SYSADMIN_CR40362585.trc). You can run tkprof TRACE_FILE_NAME to generate the tkprof output from this trace file.
    2.2.13:JVMCI161: FATAL ERROR in native method error in AIX

    • Customer may get -JVMCI161: FATAL ERROR in native method :Wrong method ID used to invoke a Java method error in AIX while executing report.Customer needs to upgrade jdk to 1.6/1.7 in 10.1.2 ORACLE_HOME for this issue.
    Note: Concerning the rwconverter issue, note that if you need to try manual recompilation while debugging rwconverter issue, you need to set DE_DISABLE_PLS_512=0 before executing rwconverter. During compilation through adadmin, this variable is set by ad scripts. During reports execution through the concurrent program, appsrwrun.sh takes care of this environment variable.

    Section 3: Known Issues

    • Reports-idleTimeout is set to 90000
      Long running reports-idleTimeout is set to 90000 in $INST_TOP/ora/10.1.2/reports/conf/rwbuilder.conf, allowing you to run reports that takes up to 90000 minutes.
       
    • Cache Directory Cleaning
      In Oracle E-Business Suite, report cache files are cleared automatically after report execution is completed if <property name="cacheSize" value="0"/> and <property name="noVoidedOutputError" value="yes"/> are in rwbuilder.conf and if Patch 14374587 is applied in 10.1.2 ORACLE_HOME.

Thursday, January 22, 2015

RMAN backup or restore monitoring scripts

Backup Progress Script:

col dbsize_mbytes      for 99,999,990.00 justify right head "DBSIZE_MB"
col input_mbytes       for 99,999,990.00 justify right head "READ_MB"
col output_mbytes      for 99,999,990.00 justify right head "WRITTEN_MB"
col output_device_type for a10           justify left head "DEVICE"
col complete           for 990.00        justify right head "COMPLETE %"
col compression        for 990.00        justify right head "COMPRESS|% ORIG"
col est_complete       for a20           head "ESTIMATED COMPLETION"
col recid              for 9999999       head "ID"

select recid
     , output_device_type
     , dbsize_mbytes
     , input_bytes/1024/1024 input_mbytes
     , output_bytes/1024/1024 output_mbytes
     , (output_bytes/input_bytes*100) compression
     , (mbytes_processed/dbsize_mbytes*100) complete
     , to_char(start_time + (sysdate-start_time)/(mbytes_processed/dbsize_mbytes),'DD-MON-YYYY HH24:MI:SS') est_complete
  from v$rman_status rs
     , (select sum(bytes)/1024/1024 dbsize_mbytes from v$datafile)
 where status='RUNNING'
   and output_device_type is not null
/


Source: http://www.dba-resources.com/oracle/rman-displaying-current-backup-progress/

To see what RMAN is doing now and how much work its got left to do you can run the following SQL
select
sid,
start_time,
totalwork,
sofar,
(sofar/totalwork) * 100 pct_done
from
v$session_longops
where totalwork > sofar
AND opname NOT LIKE '%aggregate%'
AND opname like 'RMAN%'
/

 

The following query will show you a history of your BACKUP and RESTORE operations
select to_char(start_time, 'dd-mon-yyyy@hh24:mi:ss') "Date",
status,
operation,
mbytes_processed
from v$rman_status vs
where start_time >  sysdate -1
order by start_time
/




Check status of RMAN backups:
col STATUS format a9
col hrs format 999.99
select
SESSION_KEY, INPUT_TYPE, STATUS,
to_char(START_TIME,'mm/dd/yy hh24:mi') start_time,
to_char(END_TIME,'mm/dd/yy hh24:mi')   end_time,
elapsed_seconds/3600                   hrs
from V$RMAN_BACKUP_JOB_DETAILS
order by session_key;
 
Source: https://mdesouza.wordpress.com/2012/06/07/monitor-rman-backups/