Wednesday, October 19, 2011

Huge Events*.log files in $APPLCSF/$APPLLOG?

The other day I received an automated email alert that a partition was running low on available space. Its the partition which contains $APPLCSF/$APPLLOG (ie. $COMMON_TOP/admin/log/). This directory stores concurrent manager logs, concurrent request logs, etc.

I noticed one file, Events01.log was 7GB in size. I should add that this environment is pretty static, so there aren’t log of changes and it doesn’t get restarted often.

The issue is described in Note:601375.1, which says the culprit is the Fulfillment Server having a high level of debugging enabled. The fix is to change the parameter s_jto_debug_string = OFF in your context file. (Don’t edit this manually, use OAM.) However, to enable this change you’ll need to execute autoconfig.

If your not able to run autoconfig at this time (I prefer to bundle these types of changes with patches so that users will do a quick sanity check of the environment), you can manually edit the file $COMMON_TOP/admin/scripts//jtffmctl.sh and remove the references to:

-Dengine.LogLevel=9

-Ddebug=full

Once that change is made you need to stop apache (adapcctl.sh), the fulfillment server (jtffmctl.sh) and restart them. You can now remove that huge Events log file.

Note: If you remove an active file while a process is still pointing to it, the space will not be released. I’ve been asked by people many times why they removed a file but did not see the available space increase.

----------------
Source:-http://newappsdba.blogspot.com/search/label/E-Business%20Suite
----------------

Stuck Concurrent Requests

Stuck Concurrent Requests
Every now and then users call us with a concurrent request that is running longer than normal and/or blocking other batch jobs because of incompatibilities. Upon investigation we'll see that there is no database session for the request. Since there isn't a database session users may not be unable to cancel the request themselves. The cancel button will be grayed out. The solution is to clean the fnd_concurrent_requests table.

Background: Concurrent programs may be incompatible with other programs which means they cannot execute at the same time. If the stuck concurrent request has such rules defined, then programs it is incompatible with will not run until the problem is solved.

There are 2 ways to do this, update the table manually or run the Oracle provided cmclean.sql script. Depending on the method you choose, you'll need the request id. This can be provided by the user or you can look at the running requests via Oracle Applications Manager (OAM). To navigate there click on Site Map on the top left hand corner of the page. Under Concurrent requests click on Running.




Once your in the Running requests screen you'll see which programs are currently being executed. With the help of your users, find the request id in question and make note of it. The recommended approach from Oracle will be:

1. Kill the database sessions for the requests. (In our case there weren't any.)
2. Shutdown the concurrent managers.
3. Run the cmclean.sql script Note: 134007.1
4. Start your concurrent managers.

The other method is to update the bad rows in the fnd_concurrent_requests table manually.

update fnd_concurrent_requests set STATUS_CODE='D',phase_code='C' where request_id=

STATUS_CODE of D means Cancelled and a phase_code of C is completed.

For a list of status, phase_codes and what they mean, refer to Note: 297909.1.

The benefit to updating the fnd_concurrent_requests table manually is that no downtime is required. If you are using cmclean.sql remember to shutdown the concurrent managers first!

--------------------------
Source:--http://newappsdba.blogspot.com/search/label/EBS%20Concurrent%20Processing
--------------------------

Tuesday, October 18, 2011

Correcting invalid spfile parameters

Correcting invalid spfile parameters
tnsManager - Distribute tnsnames the easy way and for free!



Consider the following situation. An alteration is made to the spfile which results in the instance being unable to start. Because the instance will not start, the mistake can not be corrected:



SQL> show parameter sga_max_size
sga_max_size big integer 537989896

SQL> alter system set sga_max_size=99999999999 scope=spfile;
System altered.

SQL> shut immediate
Database closed.
Database dismounted.
ORACLE instance shut down.

SQL> startup
ORA-27102: out of memory

SQL> startup nomount
ORA-27102: out of memory

SQL> alter system set sga_max_size=537989896 scope=spfile;
alter system set sga_max_size=537989896 scope=spfile
*
ERROR at line 1:
ORA-01034: ORACLE not available
How annoying! The usual way to fix this problem (apart from being more careful in the first place) is to:
•create pfile from spfile
•edit the pfile
•startup nomount
•create spfile from pfile
•shutdown
•startup
•remove the pfile
There is another way however - and one that I prefer. It relies on the fact that a database can have a spfile and a pfile at the same time, and furthermore parameters specified in the pfile override those in the spfile! The spfile location must be specified in the pfile for this to work. Check out the following trace:

SQL> !
oracle@bloo$ vi $ORACLE_HOME/dbs/init${ORACLE_SID}.ora

spfile=/u02/oradata/scr9/spfilescr9.ora
sga_max_size=537989896
:wq
oracle@bloo$ exit

SQL> startup
ORACLE instance started.

Total System Global Area 554767132 bytes
Fixed Size 451356 bytes
Variable Size 402653184 bytes
Database Buffers 150994944 bytes
Redo Buffers 667648 bytes
Database mounted.
Database opened.

SQL> alter system set sga_max_size=537989896 scope=spfile;
System altered.



SQL> !rm $ORACLE_HOME/dbs/init${ORACLE_SID}.ora
SQL>





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


Source :-

Saturday, June 11, 2011

Error while running ./adautocfg.sh after applying RUP6 patch on 11.5.10.2

Error while running ./adautocfg.sh after applying RUP6 patch on 11.5.10.2

sriappl@linux5 sridb_linux5]$./adautocfg.sh

Enter the APPS user password :

Invalid range "a-Z" in transliteration operator at/u05/shashi/sridbora/iAS/Apache/perl/lib/5.00503/vars.pm line 17.

Compilation failed in require at

/u05/shashi/sridbora/iAS/Apache/perl/lib/5.00503/AutoLoader.pm line 3.

BEGIN failed--compilation aborted at

/u05/shashi/sridbora/iAS/Apache/perl/lib/5.00503/AutoLoader.pm line 3.

Compilation failed in require at /opt/ActivePerl-5.8/lib/POSIX.pm line 11.

BEGIN failed--compilation aborted at /opt/ActivePerl-5.8/lib/POSIX.pm line 11.

Compilation failed in require at /u05/shashi/sridbappl/ad/11.5.0/bin/adconfig.pl line 88.

BEGIN failed--compilation aborted at /u05/shashi/sridbappl/ad/11.5.0/bin/adconfig.pl line

88.

[sriappl@linux5 sridb_linux5]$


Solution:

Open $IAS_ORACLE_HOME/Apache/perl/lib/5.00503/vars.pm and change (line 17):

if ($sym =~ tr/A-Za-Z_0-9//c) {

change to

if ($sym =~ tr/A-Za-z_0-9//c) {

(The change is the single character Z->z)

Tuesday, June 7, 2011

Schedule tasks on Linux using crontab



If you've got a website that's heavy on your web server, you might want to run some processes like generating thumbnails or enriching data in the background. This way it can not interfere with the user interface. Linux has a great program for this called cron. It allows tasks to be automatically run in the background at regular intervals. You could also use it to automatically create backups, synchronize files, schedule updates, and much more. Welcome to the wonderful world of crontab.

Crontab

The crontab (cron derives from chronos, Greek for time; tab stands for table) command, found in Unix and Unix-like operating systems, is used to schedule commands to be executed periodically. To see what crontabs are currently running on your system, you can open a terminal and run:

sudo crontab -l

To edit the list of cronjobs you can run:

sudo crontab -e

This wil open a the default editor (could be vi or pico, if you want you can change the default editor) to let us manipulate the crontab. If you save and exit the editor, all your cronjobs are saved into crontab. Cronjobs are written in the following format:

* * * * * /bin/execute/this/script.sh

Scheduling explained

As you can see there are 5 stars. The stars represent different date parts in the following order:

  1. minute (from 0 to 59)
  2. hour (from 0 to 23)
  3. day of month (from 1 to 31)
  4. month (from 1 to 12)
  5. day of week (from 0 to 6) (0=Sunday)

Execute every minute

If you leave the star, or asterisk, it means every. Maybe that's a bit unclear. Let's use the the previous example again:

* * * * * /bin/execute/this/script.sh

They are all still asterisks! So this means execute /bin/execute/this/script.sh:

  1. every minute
  2. of every hour
  3. of every day of the month
  4. of every month
  5. and every day in the week.

In short: This script is being executed every minute. Without exception.

Execute every Friday 1AM

So if we want to schedule the script to run at 1AM every Friday, we would need the following cronjob:

0 1 * * 5 /bin/execute/this/script.sh

Get it? The script is now being executed when the system clock hits:

  1. minute: 0
  2. of hour: 1
  3. of day of month: * (every day of month)
  4. of month: * (every month)
  5. and weekday: 5 (=Friday)

Execute on workdays 1AM

So if we want to schedule the script to Monday till Friday at 1 AM, we would need the following cronjob:

0 1 * * 1-5 /bin/execute/this/script.sh

Get it? The script is now being executed when the system clock hits:

  1. minute: 0
  2. of hour: 1
  3. of day of month: * (every day of month)
  4. of month: * (every month)
  5. and weekday: 1-5 (=Monday til Friday)

Execute 10 past after every hour on the 1st of every month

Here's another one, just for practicing

10 * 1 * * /bin/execute/this/script.sh

Fair enough, it takes some getting used to, but it offers great flexibility.

Neat scheduling tricks

What if you'd want to run something every 10 minutes? Well you could do this:

0,10,20,30,40,50 * * * * /bin/execute/this/script.sh

But crontab allows you to do this as well:

*/10 * * * * /bin/execute/this/script.sh

Which will do exactly the same. Can you do the the math? ;)

Special words

If you use the first (minute) field, you can also put in a keyword instead of a number:

@reboot     Run once, at startup @yearly     Run once  a year     "0 0 1 1 *" @annually   (same as  @yearly) @monthly    Run once  a month    "0 0 1 * *" @weekly     Run once  a week     "0 0 * * 0" @daily      Run once  a day      "0 0 * * *" @midnight   (same as  @daily) @hourly     Run once  an hour    "0 * * * * 

Leave the rest of the fields empty so this would be valid:

@daily /bin/execute/this/script.sh

Storing the crontab output

By default cron saves the output of /bin/execute/this/script.sh in the user's mailbox (root in this case). But it's prettier if the output is saved in a separate logfile. Here's how:

*/10 * * * * /bin/execute/this/script.sh 2>&1 >> /var/log/script_output.log

Explained

Linux can report on different levels. There's standard output (STDOUT) and standard errors (STDERR). STDOUT is marked 1, STDERR is marked 2. So the following statement tells Linux to store STDERR in STDOUT as well, creating one datastream for messages & errors:

2>&1

Now that we have 1 output stream, we can pour it into a file. Where > will overwrite the file, >> will append to the file. In this case we'd like to to append:

>> /var/log/script_output.log

Mailing the crontab output

By default cron saves the output in the user's mailbox (root in this case) on the local system. But you can also configure crontab to forward all output to a real email address by starting your crontab with the following line:

MAILTO="yourname@yourdomain.com"

Mailing the crontab output of just one cronjob

If you'd rather receive only one cronjob's output in your mail, make sure this package is installed:

aptitude install mailx

And change the cronjob like this:

*/10 * * * * /bin/execute/this/script.sh 2>&1 | mail -s "Cronjob ouput" yourname@yourdomain.com

Trashing the crontab output

Now that's easy:

*/10 * * * * /bin/execute/this/script.sh 2>&1 > /dev/null

Just pipe all the output to the null device, also known as the black hole. On Unix-like operating systems, /dev/null is a special file that discards all data written to it.

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

http://kevin.vanzonneveld.net/techblog/article/schedule_tasks_on_linux_using_crontab/

Wednesday, May 18, 2011

APPS - how to apply patch HOT (without enabling maintenance mode)

Use the following option when calling adpatch:     options=hotpatch  EXAMPLE:     adpatch defaultsfile=/u02/app/applmgr/11.5/admin/SIDNAME/def.txt \         logfile=all_5162862.log \         patchtop=/copy/APPS_PATCHES/2006/002/5162862 \         driver=u5162862.drv \         workers=4 \         interactive=yes \         options=novalidate,hotpatch  In the above example we will:    apply patch# 5162862    using u5162862.drv driver    using 4 workers    in interactive mode    without validating pre-reqs    without enabling maintenance mode (hotpatch)  NOTE:    you can safely drop defaultsfile from the call if you don't have one created

clone ORACLE_HOME 10gR2 to another host

 Here's a step by step process to clone 10gR2 ORACLE_HOME to another identical  server.  Since the host names are different it's advisable to follow this procedure  anytime you copy an ORACLE_HOME to another server even if directory structure  is exactly the same.   ## ## First detach ORACLE_HOME from central inventory ##  atlas.10GR2-> pwd /u01/app/oracle/oraInventory/ContentsXML  atlas.10GR2-> grep "HOME NAME" * inventory.xml: inventory.xml: atlas.10GR2->  ## detach OraDb10g_home1 home (get directory from above grep results) ## atlas.10GR2-> $ORACLE_HOME/oui/bin/runInstaller -detachhome ORACLE_HOME=/u01/app/oracle/product/10.2.0/db_1 Starting Oracle Universal Installer...  No pre-requisite checks found in oraparam.ini, no system pre-requisite checks will be executed. The inventory pointer is located at /var/opt/oracle/oraInst.loc The inventory is located at /u01/app/oracle/oraInventory 'DetachHome' was successful. atlas.10GR2->  ## verify using grep ## NOTE now it says REMOVED="T" ## atlas.10GR2-> grep "HOME NAME" * inventory.xml: inventory.xml: atlas.10GR2->   ## ## re-register ORACLE_HOME ##   ## MAKE SURE ALL PROCS ARE DOWN - it does a relink ## atlas.10GR2-> ps -ef | grep oracle   oracle  4824  4822   0   Oct 08 pts/2       0:00 -ksh   oracle  4822  4819   0   Oct 08 ?           0:00 /usr/lib/ssh/sshd   oracle  5352  4864   0 16:57:33 pts/3       0:00 ps -ef   oracle  4862  4859   0   Oct 08 ?           0:01 /usr/lib/ssh/sshd   oracle  4864  4862   0   Oct 08 pts/3       0:00 -ksh   oracle  5353  4864   0 16:57:33 pts/3       0:00 -ksh  ## run clone script ## cd $ORACLE_HOME/clone/bin perl clone.pl ORACLE_HOME="/u01/app/oracle/product/10.2.0/db_1" ORACLE_HOME_NAME="OraDb10g_home1"  Here's a sample output of above command:     atlas.10GR2-> perl clone.pl ORACLE_HOME="/u01/app/oracle/product/10.2.0/db_1" ORACLE_HOME_NAME="OraDb10g_home1"    ./runInstaller -silent -clone -waitForCompletion     "ORACLE_HOME=/u01/app/oracle/product/10.2.0/db_1"     "ORACLE_HOME_NAME=OraDb10g_home1" -noConfig -nowait    Starting Oracle Universal Installer...        No pre-requisite checks found in oraparam.ini, no system pre-requisite checks will be executed.    Preparing to launch Oracle Universal Installer from /tmp/OraInstall2007-10-    09_04-59-54PM. Please wait ...Oracle Universal Installer, Version     10.2.0.3.0 Production        Copyright (C) 1999, 2006, Oracle. All rights reserved.        You can find a log of this install session at:     /u01/app/oracle/oraInventory/logs/cloneActions2007-10-09_04-59-54PM.log    ...........................................................................    ......................... 100% Done.                Installation in progress (Tue Oct 09 17:00:23 PDT 2007)    .................................................................................                                               81% Done.    Install successful        Linking in progress (Tue Oct 09 17:00:45 PDT 2007)    Link successful        Setup in progress (Tue Oct 09 17:02:33 PDT 2007)    Setup successful        End of install phases.(Tue Oct 09 17:02:43 PDT 2007)    WARNING:    The following configuration scripts need to be executed as the "root" user.    #!/bin/sh    #Root script to run    /u01/app/oracle/product/10.2.0/db_1/root.sh    To execute the configuration scripts:        1. Open a terminal window        2. Log in as "root"        3. Run the scripts        The cloning of OraDb10g_home1 was successful.    Please check '/u01/app/oracle/oraInventory/logs/cloneActions2007-10-09_04-59-54PM.log' for more details.    atlas.10GR2->   ## after above clone completes run ROOT.SH as ROOT ##  atlas.10GR2-> su Password: # # /u01/app/oracle/product/10.2.0/db_1/root.sh Running Oracle10 root.sh script...  The following environment variables are set as:     ORACLE_OWNER= oracle     ORACLE_HOME=  /u01/app/oracle/product/10.2.0/db_1  Enter the full pathname of the local bin directory: [/usr/local/bin]: The file "dbhome" already exists in /usr/local/bin.  Overwrite it? (y/n) [n]: y    Copying dbhome to /usr/local/bin ... The file "oraenv" already exists in /usr/local/bin.  Overwrite it? (y/n) [n]: y    Copying oraenv to /usr/local/bin ... The file "coraenv" already exists in /usr/local/bin.  Overwrite it? (y/n) [n]: y    Copying coraenv to /usr/local/bin ...  Entries will be added to the /var/opt/oracle/oratab file as needed by Database Configuration Assistant when a database is created Finished running generic part of root.sh script. Now product-specific root actions will be performed. #   ## ## Verify inventory can be read by OPATCH ##  atlas.10GR2-> /u01/app/oracle/product/10.2.0/db_1/OPatch/opatch lsinventory Invoking OPatch 10.2.0.3.2  Oracle interim Patch Installer version 10.2.0.3.2 Copyright (c) 2007, Oracle Corporation.  All rights reserved..   Oracle Home       : /u01/app/oracle/product/10.2.0/db_1 Central Inventory : /u01/app/oracle/oraInventory    from           : /var/opt/oracle/oraInst.loc OPatch version    : 10.2.0.3.2 OUI version       : 10.2.0.3.0 OUI location      : /u01/app/oracle/product/10.2.0/db_1/oui Log file location : /u01/app/oracle/product/10.2.0/db_1/cfgtoollogs/opatch/opatch2007-10-09_17-09-19PM.log  Lsinventory Output file location : /u01/app/oracle/product/10.2.0/db_1/cfgtoollogs/opatch/lsinv/lsinventory2007-10-09_17-09-19PM.txt  -------------------------------------------------------------------------------- Installed Top-level Products (2):  Oracle Database 10g                                                  10.2.0.1.0 Oracle Database 10g Release 2 Patch Set 2                            10.2.0.3.0 There are 2 products installed in this Oracle Home.   Interim patches (22) :  Patch  6121268      : applied on Wed Sep 26 20:02:34 PDT 2007    Created on 11 Jun 2007, 05:26:11 hrs PST8PDT    Bugs fixed:      6121268  Patch  6121267      : applied on Wed Sep 26 20:02:27 PDT 2007    Created on 12 Jun 2007, 02:58:15 hrs PST8PDT    Bugs fixed:      6121267  Patch  6121266      : applied on Wed Sep 26 20:02:21 PDT 2007    Created on 12 Jun 2007, 02:57:08 hrs PST8PDT    Bugs fixed:      6121266  Patch  6121264      : applied on Wed Sep 26 20:02:15 PDT 2007    Created on 12 Jun 2007, 02:55:35 hrs PST8PDT    Bugs fixed:      6121264  Patch  6121263      : applied on Wed Sep 26 20:02:08 PDT 2007    Created on 12 Jun 2007, 02:54:23 hrs PST8PDT    Bugs fixed:      6121263  Patch  6121261      : applied on Wed Sep 26 20:02:02 PDT 2007    Created on 11 Jun 2007, 01:57:45 hrs PST8PDT    Bugs fixed:      6121261  Patch  6121260      : applied on Wed Sep 26 20:01:56 PDT 2007    Created on 11 Jun 2007, 00:43:23 hrs PST8PDT    Bugs fixed:      6121260  Patch  6121258      : applied on Wed Sep 26 20:01:45 PDT 2007    Created on 12 Jun 2007, 08:36:08 hrs PST8PDT    Bugs fixed:      6121258  Patch  6121257      : applied on Wed Sep 26 20:01:39 PDT 2007    Created on 12 Jun 2007, 01:54:53 hrs PST8PDT    Bugs fixed:      6121257  Patch  6121250      : applied on Wed Sep 26 20:01:32 PDT 2007    Created on 11 Jun 2007, 21:47:03 hrs PST8PDT    Bugs fixed:      6121250  Patch  6121249      : applied on Wed Sep 26 20:01:17 PDT 2007    Created on 11 Jun 2007, 21:46:24 hrs PST8PDT    Bugs fixed:      6121249  Patch  6121248      : applied on Wed Sep 26 20:01:11 PDT 2007    Created on 11 Jun 2007, 08:52:17 hrs PST8PDT    Bugs fixed:      6121248  Patch  6121247      : applied on Wed Sep 26 20:01:00 PDT 2007    Created on 10 Jun 2007, 23:58:00 hrs PST8PDT    Bugs fixed:      6121247  Patch  6121246      : applied on Wed Sep 26 20:00:55 PDT 2007    Created on 12 Jun 2007, 08:53:32 hrs PST8PDT    Bugs fixed:      6121246  Patch  6121245      : applied on Wed Sep 26 19:59:57 PDT 2007    Created on 10 Jun 2007, 23:05:51 hrs PST8PDT    Bugs fixed:      6121245  Patch  6121244      : applied on Wed Sep 26 19:59:42 PDT 2007    Created on 10 Jun 2007, 23:01:41 hrs PST8PDT    Bugs fixed:      6121244  Patch  6121243      : applied on Wed Sep 26 19:59:27 PDT 2007    Created on 10 Jun 2007, 22:16:48 hrs PST8PDT    Bugs fixed:      6121243  Patch  6121242      : applied on Wed Sep 26 19:59:21 PDT 2007    Created on 11 Jun 2007, 21:43:02 hrs PST8PDT    Bugs fixed:      6121242  Patch  6121183      : applied on Wed Sep 26 19:59:13 PDT 2007    Created on 12 Jun 2007, 01:52:07 hrs PST8PDT    Bugs fixed:      6121183  Patch  6079591      : applied on Wed Sep 26 19:59:07 PDT 2007    Created on 14 Jun 2007, 03:24:12 hrs PST8PDT    Bugs fixed:      6079591  Patch  5556081      : applied on Wed Sep 26 19:27:35 PDT 2007    Created on 9 Nov 2006, 22:20:50 hrs PST8PDT    Bugs fixed:      5556081  Patch  5557962      : applied on Wed Sep 26 19:27:24 PDT 2007    Created on 9 Nov 2006, 23:23:06 hrs PST8PDT    Bugs fixed:      4269423, 5557962, 5528974   --------------------------------------------------------------------------------  OPatch succeeded. atlas.10GR2->
source:-http://kb.dbatoolz.com/ex/pwpkg.dp?p_key=11&p_what=detail&p_sr_id=2694&p_sc_id=19&p_debug=&p_search=&p_suser=&p_sdate=#top