Monday, July 29, 2013

Enable the (Hidden) Administrator Account on Windows 8 / 7 or Vista

The Administrator account is created in Windows 8 / 7 or Vista, but since it’s not enabled you can’t use it. If you are troubleshooting something that needs to run as administrator, you can enable it with a simple command.

Windows Vista / 7

Enable Built-in Administrator Account
First you’ll need to open a command prompt in administrator mode by right-clicking and choosing “Run as administrator” (or use the Ctrl+Shift+Enter shortcut from the search box)
image

Windows 8

To run Command Prompt in administrative mode in Windows 8 operating system:
1. Right-click at the screen's bottom-left corner and from the pop-up menu, choose "Command Prompt (Admin)".

windows-8-admininstator-command-prompt


Now type the following command:
net user administrator /active:yes

You should see a message that the command completed successfully. Log out, and you’ll now see the Administrator account as a choice. (Note that the screenshots are from Vista, but this works on Windows 7)

You’ll note that there’s no password for this account, so if you want to leave it enabled you should change the password.

For security, don't forget to specify a password* for Administrator account after you have enable it.

(To specify a user password in Windows 7 or 8 go to: Control Panel > User Accounts options)


Disable Built-in Administrator Account
Make sure you are logged on as your regular user account, and then open an administrator mode command prompt as above. Type the following command:
net user administrator /active:no

The administrator account will now be disabled, and shouldn’t show up on the login screen anymore.

Friday, July 19, 2013

Terminating a Concurrent Requests from backend AND Concurrent Request Status Codes and Phase Codes


Concurrent Requests can be terminated from front end. But we can also terminate the Concurrent Request from the back end.

SQL> update apps.fnd_concurrent_requests set phase_code='C' , status_code='X' where request_id='&REQUEST_ID';


SQL> commit;

Note: Please remember to kill the process for that request first before terminating the concurrent request .

The related process Id for the Concurrent Requests can be determined by

SQL> select ORACLE_PROCESS_ID from apps.fnd_concurrent_requests where REQUEST_ID='&REQUEST_ID';


Concurrent Request Status Codes and Phase Codes

PHASE_CODE
MEANING
C
Completed
I
Inactive
P
Pending
R
Running

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

Normally a concurrent request proceeds through three, possibly four, life cycle stages or phases,

Phase Code
Meaning with Description
Pending
Request is waiting to be run
Running
Request is running
Completed
Request has finished
Inactive
Request cannot be run

Within each phase, a request's condition or status may change. Below appears a listing of each phase and the various states that a concurrent request can go through.

The status and the description of each meaning given below:

Phase
Status
Description
PENDING
Normal
Request is waiting for the next available manager.
Standby
Program to run request is incompatible with other program(s) currently running.
Scheduled
Request is scheduled to start at a future time or date.
Waiting
A child request is waiting for its Parent request to mark it ready to run. For example, a report in a report set that runs sequentially must wait for a prior report to complete.



RUNNING
Normal
Request is running normally.
Paused
Parent request pauses for all its child requests to complete. For example, a report set pauses for all reports in the set to complete.
Resuming
All requests submitted by the same parent request have completed running. The Parent request is waiting to be restarted.
Terminating
Running request is terminated, by selecting Terminate in the Status field of   the Request Details zone.



COMPLETED
Normal
Request completes normally.
Error
Request failed to complete successfully.
Warning
Request completes with warnings. For example, a report is generated successfully but fails to print.
Cancelled
Pending or Inactive request is cancelled, by selecting Cancel in the Status field of the Request Details zone.
Terminated
Running request is terminated, by selecting Terminate in the Status field of   the Request Details zone.



INACTIVE
Disabled
Program to run request is not enabled. Contact your system administrator.
On Hold
Pending request is placed on hold, by selecting Hold in the Status field of the Request Details zone.
No Manager
No manager is defined to run the request. Check with your system administrator.

Friday, July 12, 2013

adchkcfg.sh utility

This script is useful to run the autoconfig in test mode for knowing changes that will effect after next autoconfig run.It generates both html and text reports for viewing the current and changed information once you run this utility. These files are divided into two parts and each one contains the following information.

Cfgcheck report contains,

AutoConfig Context File Changes
  • It shows current AutoConfig Context File, the changed AutoConfig Context File, and a difference report
Service Group Status
  • it shows Status of the Service Groups and corresponding Services. Eg: Root service, Web Application Services.
Changed Configuration Files
  • It shows list of files which will be changed in the next normal AutoConfig execution and the difference report for each file
New Configuration Files
  • It shows list of new files which will be created in the next normal AutoConfig execution
 Legend
  •  It shows Legend and syntax translations

Run Check Config Utility on the Application Tier:


1> Run adchkcfg.sh

[ebspas@igrexandc002cn05 appl]$ adchkcfg.sh
Enter the full path to the Applications Context file:
/ebspas/app/applmgr/IREBSPAS/inst/apps/IREBSPAS_ebspasportal1/appl/admin/IREBSPAS_ebspasportal1.xml
Enter the APPS password:

The log file for this session is located at: /ebspas/app/applmgr/IREBSPAS/inst/apps/IREBSPAS_ebspasportal1/admin/log/04171603/adconfig.log

AutoConfig is running in test mode and building diffs...

AutoConfig will consider the custom templates if present.
        Using CONFIG_HOME location     : /ebspas/app/applmgr/IREBSPAS/inst/apps/IREBSPAS_ebspasportal1
        Classpath                   : /ebspas/app/applmgr/IREBSPAS/comn/java/lib/appsborg2.zip:/ebspas/app/applmgr/IREBSPAS/comn/java/classes

        Using Context file          : /ebspas/app/applmgr/IREBSPAS/inst/apps/IREBSPAS_ebspasportal1/admin/out/04171603/IREBSPAS_ebspasportal1.xml

Context Value Management will now update the test Context file

        Updating test Context file...COMPLETED

        [ Test mode ]
        No uploading of Context File and its templates to database.

Testing templates from all of the product tops...
        Testing AD_TOP........COMPLETED
        Testing FND_TOP.......COMPLETED
        Testing ICX_TOP.......COMPLETED
        Testing MSC_TOP.......COMPLETED
        Testing IEO_TOP.......COMPLETED
        Testing BIS_TOP.......COMPLETED
        Testing AMS_TOP.......COMPLETED
        Testing CCT_TOP.......COMPLETED
        Testing WSH_TOP.......COMPLETED
        Testing CLN_TOP.......COMPLETED
        Testing OKE_TOP.......COMPLETED
        Testing OKL_TOP.......COMPLETED
        Testing OKS_TOP.......COMPLETED
        Testing CSF_TOP.......COMPLETED
        Testing IGS_TOP.......COMPLETED
        Testing IBY_TOP.......COMPLETED
        Testing JTF_TOP.......COMPLETED
        Testing MWA_TOP.......COMPLETED
        Testing CN_TOP........COMPLETED
        Testing CSI_TOP.......COMPLETED
        Testing WIP_TOP.......COMPLETED
        Testing CSE_TOP.......COMPLETED
        Testing EAM_TOP.......COMPLETED
        Testing FTE_TOP.......COMPLETED
        Testing ONT_TOP.......COMPLETED
        Testing AR_TOP........COMPLETED
        Testing AHL_TOP.......COMPLETED
        Testing OZF_TOP.......COMPLETED
        Testing IES_TOP.......COMPLETED
        Testing CSD_TOP.......COMPLETED
        Testing IGC_TOP.......COMPLETED

Differences text report is located at: /ebspas/app/applmgr/IREBSPAS/inst/apps/IREBSPAS_ebspasportal1/admin/out/04171603/cfgcheck.txt

        Generating Profile Option differences report...COMPLETED

Differences text report for the Database is located at: /ebspas/app/applmgr/IREBSPAS/inst/apps/IREBSPAS_ebspasportal1/admin/out/04171603/ProfileReport.txt

        Generating File System differences report......COMPLETED

Differences html report is located at: /ebspas/app/applmgr/IREBSPAS/inst/apps/IREBSPAS_ebspasportal1/admin/out/04171603/cfgcheck.html

Differences Zip report is located at: /ebspas/app/applmgr/IREBSPAS/inst/apps/IREBSPAS_ebspasportal1/admin/out/04171603/ADXcfgcheck.zip


2> Go To Location $INST_TOP/admin/out/<Output Directory for the adchkcfg run>

Example for Above case :/ebspas/app/applmgr/IREBSPAS/inst/apps/IREBSPAS_ebspasportal1/admin/out/04171603

3> Look for Difference files
Differences file gets created with x_* . Example : x_httpd.conf

Difference Files in Internal
=============================

[ebspas@igrexandc002cn05 04171558]$ ls -lrt x_*
-rw-r--r-- 1 ebspas dba  8532 Apr 17 15:59 x_server.xml
-rw-r--r-- 1 ebspas dba 12170 Apr 17 15:59 x_oracle-webservices.xml
[ebspas@igrexandc002cn05 04171558]$


Difference Files in External
============================
[ebspas@igrexandc002cn05 04171603]$ ls -lrt x_*
-rw-r--r-- 1 ebspas dba  2392 Apr 17 16:03 x_adovars.env
-rw-r--r-- 1 ebspas dba   429 Apr 17 16:03 x_adconfig.txt
-rw-r--r-- 1 ebspas dba   836 Apr 17 16:03 x_adalldefaults.txt
-rw-r--r-- 1 ebspas dba  7817 Apr 17 16:03 x_url_fw.conf
-rw-r--r-- 1 ebspas dba  8515 Apr 17 16:03 x_server.xml
-rw-r--r-- 1 ebspas dba 12161 Apr 17 16:03 x_oracle-webservices.xml
-rw-r--r-- 1 ebspas dba  1235 Apr 17 16:03 x_httpd.conf

4> Check the differences in the difference file and resolve it.


Thank you,
Manish

Issue in compiling Code - Package body

There was an issue while compiling XXGL_JOURNAL_IMPORT_INTF_PKG package and took lot of time (still unsuccessful with timeout error message)

I was trying to find out root cause, so I looked into to v$locked_object but not found

After that, got How to: Determine if a Package that is About to be Compiled is Being Used Currently [ID 1054939.6] which says

SQL> connect / as sysdba
SQL> exec who_is_using('XXGL_JOURNAL_IMPORT_INTF_PKG');
(1-2195) - APPS
(1-3359) - APPS

Find relevant SID & Serial# and kill the session,

SQL> alter system kill session '2195,38431' immediate;

System altered.

SQL> alter system kill session '3359,1577' immediate;

System altered.

SQL> exec who_is_using('XXGL_JOURNAL_IMPORT_INTF_PKG');

PL/SQL procedure successfully completed.


Again compiled same packege, and got completed within  2 seconds.

Saturday, July 6, 2013

Simple Script to check alert.log file for errors in oracle

We have to check alert log files for errors, but its a time consuming process to read the file using less and check for errors. If you do a grep it will take the whole file and if the log rotation is done by month, you will get undesired output. Here is a script to check alert.log file in oracle for errors for today. We just have to copy this to a file and name it as alertcheck.sh and then from the OS prompt run

[oracle@igrexandc001d03 ~]$ sh alertcheck.sh <alert log file with complete path>

######################################################################################################
#
#This script can be used to check any ORA- errors are there in the alertlog file for the present day #
#
######################################################################################################
#!/sbin/bash
#alrt=/data/app/oracle/diag/rdbms/sec01/sec01/trace/alert_sec01.log
if ! [ $1 ] ; then
echo Usage:
echo "sh alertcheck.sh 'alertlogFilename'"
else
 alrt=$1
 frm=$(grep -m 1 -n  "`date '+%a %b %d'`" $alrt |awk -F[:] '{print $1}')
 if ! [ $frm ]; then
  echo -e "\033[33mWe cannot find any entry for today."
  echo -e "Please check the file you have given is correct OR check with tail command manually\033[0m"
 else
  lst=$(wc -l $alrt | awk '{print $1}')
  lns=$(awk -v a="$lst" -v b="$frm" 'BEGIN{print a-b+1}')
  lns=250
  dt=$(date '+%a %b %d')
  echo -e "\033[34m..........Checking $lns lines writen today -$dt- out of $lst lines in the alert log.........\033[0m"
  err=$(tail -$lns $alrt | grep ORA-|tail -1|awk '{print $1}')
  if [ $err ]; then
    echo -e "\033[31mErrors found:\033[0m"
    echo ------------
    tail -$lns $alrt |  grep  ORA- |grep -n ORA-
    echo ""
    echo ""
    echo -e "\033[31mCheck the details of the errors below. \033[0m (Details means the surroundig lines of the error message only)"
    echo  "-------------------------------------"
    tail -$lns $alrt |  grep -A 5 -B 2 --color ORA-
  else
    echo -e "\033[32mNo Errors Found. Enjoy \033[33m:)\033[0m"
  fi
 fi
fi
#############################End of the script ##################################

If there are errors it will list you all errors first and then a few lines around the error message with a heading error details.

If no errors it will give you corresponding message

If the script can't find any entry for the date, it will give a message for it and will remind you to check the file.

########################### Output ####################################


[oracle@igrexandc001d03 ~]$ sh alertcheck.sh /u01/app/oracle/diag/rdbms/irebsprd/IREBSPRD1/trace/alert_IREBSPRD1.log
..........Checking 250 lines writen today -Sat Jul 06- out of 1341211 lines in the alert log.........
Errors found:
------------
1:ORA-03137: TTC protocol internal error : [3149] [] [] [] [] [] [] []
2:ORA-03149: Invalid Oracle error code
3:ORA-03137: TTC protocol internal error : [3149] [] [] [] [] [] [] []
4:ORA-03149: Invalid Oracle error code


Check the details of the errors below.  (Details means the surroundig lines of the error message only)
-------------------------------------
Sat Jul 06 07:27:51 2013
Errors in file /u01/app/oracle/diag/rdbms/irebsprd/IREBSPRD1/trace/IREBSPRD1_ora_66056.trc  (incident=964624):
ORA-03137: TTC protocol internal error : [3149] [] [] [] [] [] [] []
ORA-03149: Invalid Oracle error code
Incident details in: /u01/app/oracle/diag/rdbms/irebsprd/IREBSPRD1/incident/incdir_964624/IREBSPRD1_ora_66056_i964624.trc
Errors in file /u01/app/oracle/diag/rdbms/irebsprd/IREBSPRD1/trace/IREBSPRD1_ora_66056.trc  (incident=964625):
ORA-03137: TTC protocol internal error : [3149] [] [] [] [] [] [] []
ORA-03149: Invalid Oracle error code
Incident details in: /u01/app/oracle/diag/rdbms/irebsprd/IREBSPRD1/incident/incdir_964625/IREBSPRD1_ora_66056_i964625.trc
Sat Jul 06 07:27:54 2013
Dumping diagnostic data in directory=[cdmp_20130706072754], requested by (instance=1, osid=66056), summary=[incident=964624].
Sat Jul 06 07:27:56 2013
Sweep [inc][964625]: completed
[oracle@igrexandc001d03 ~]$

############################################################################

Enjoy


I've not prepared  this script and got it from somewhere but found useful and hence wanted to share with you.

Thank you,
Manish