Wednesday, October 10, 2012

Usefull Shell Script Commands

1) Editing the FILE:-
   -----------------

       *) To come to end of file:-  G
       
       *) To delete the single word(can be free space):- dw

       *) to delete the current single char:- (Esc and x)

       *) To delete the complete line:- dd

       *) To right over in the file:- cw

       *) To remove the case sensitive:- :set ic
   
       *) To Enable the case sensitive:- :set noic

       *) Copy the complete line:- yy

       *) Paste what ever copied:- p


2) GUN ZIP the file:-
   -----------------

   gzip   

Note:- While trying to download gunzip file from server to local machine it should be done in binary mode. Then it can exact using the wipzip software.

  After gzip, if we want to unzip the file then use the following.

   gunzip


2.1) To unzip or gunzip the file
     ---------------------------
 
    gunzip

    Example:-

    gunzip LAOA_obt_5.1.0_5.tar.gz

2.2) To untar the file:-
     ------------------
 
     tar -xvf

     Example:-

     tar -xvf LAOA_obt_5.1.0_5.tar


3) To run the strings for the spawand program:-
   ------------------------------------------

     strings -a (shell_script_file_name) >  (logfile.log)

     Example:-

     strings -a GLPURGE > /home/partners-home/hexaware/preddy/phani1.log

3.1) Basic grep command:-
     --------------------

grep 'DROP index' adwork001.log > /home/partners-home/hexaware/preddy/dropindex.txt


4) Specfic to History upgrade project:-
   -----------------------------------

To check the number lst files:-
-------------------------------
ls -altr *.lst | wc -l


To check the number of sql files with hit files :-
-----------------------------------
grep '\.sql' *.lst | wc -l


To check the number of files with hits in the lst file:-
--------------------------------------------------------
grep 'Number of files with hits : [1-9]' *.lst


To create the file of the complete module:-
-------------------------------------------
grep '\.sql' *.lst > lst_sql_.txt


5) To find the file in the current folder and subfolder:-
   --------------------------------------

   find . -name ‘*.sql’ -print

  Example:-

   find -i . -name 'poXWFUNT*.sql' -print

POXWFUNT.sql

6) To grep the file for a specific word:-
   ------------------------------------

   grep  -i ''   >

   Example:-

   grep  -i 'ALTER table' adwork001.log > altertable.txt


7) To Know the PORT number of Env file:-
   ------------------------------------

   setenv | grep PORT

7.1) For specfic session we can change the variable value.
     -----------------------------------------------------

     setenv

     Example :-  The following was the current value.

                  OBTADMIN_ENVID=AE12O

(Used the following command to check the value (setenv | grep OBT)).
  
      setenv OBTADMIN_ENVID OBT_AA

    The above command has changed the value of the variable.
    --------------------------------------------------------

                  OBTADMIN_ENVID=OBT_AA

Note:-  If you exit from the session and then variable value will be revert back.


8) To know the path of the log and out files of the application:-
    -------------------------------------------------------------

>>cd $APPLCSF
 
There you will have the log and out folders.

You can also try the following command to know the value of the APPLCSF variable.

env | grep log

9) Turn-on the application server:-
   -------------------------------

    ./oraWebAndForms.sh start

   Example:-

    ./oraWebAndForms.sh start BG11510O

Note:-
----
      After turnning the Database and concurrent manager up. still the application front end will not open.
 The you need to run the above script in the applmgr user

 sudo su - applmgr

9.1) If you are getting 500 Internal error message after bounce back then try this:-
     ------------------------------------------------------------------------------

...would've been good to have this info when the bugs were filed for logon issues--  If you cleared _pages in R12, you'll need to recompile because the default mode is 'justrun' instead of 'recompile' as was in 11i.  I did the following while applmgr in AD12O env and the login now works:


1. cd $FND_TOP/patch/115/bin
2. ./ojspCompile.pl --compile --flush -p 2

(You can check if you are able to open the application or not). If you are still facing the issue then try rebounce the application and see if it resolve the issue).

3. /home/applmgr/oraWebAndForms.sh bounce AD12O

(./oraWebAndForms.sh bounce AD12O)

Note:-
----
You need to run the above script in the applmgr user

sudo su - applmgr

10) To start or stop the concurrent program:-
---------------------------------------

cd $ADMIN_SCRIPTS_HOME/

./adcmctl.sh start apps/apps


./adcmctl.sh stop apps/apps

Note:- This need to be run from applmgr user
---- 

sudo su - applmgr

11) To stop the database or start the database:-
-------------------------------------------

cd $ORACLE_HOME/appsutil/scripts/AD12O_oscar/


To stop the database:- adstopdb.sql*

To start the database:-  adstrtdb.sql*


Note:-   This need to be run from Oracle user.
------

sudo su - oracle

12) Converting all the tabs to space in the file:-
    ---------------------------------------------

By setting the following options in your ~/.vimrc file,
when you use tabs, spaces are actually entered into the file,
although it "feels" like there are tabs because backspaces work as they would with tabs.

You'll never have to worry about differing tabstop standards again.
Try it out, I promise you’ll be completely sold!

set softtabstop=4
set expandtab
set shiftwidth=4

Note also that if you want to convert a file with tabs to all spaces, set the above options and then use:

:retab!

13) To know the Operating system on server (unix):-
    ----------------------------------------------

    >uname

Example:-
--------

2007.08.06-3:18:03 preddy@oscar[6]/home/partners-home/hexaware/rloya/RIMforDatabases499_AH12O_23Jul/obt/la/utils > uname
HP-UX

13.1) To know the Operating system on server from database:-
      -----------------------------------------------------

begin
    dbms_output.put_line('Port String: '||dbms_utility.port_string);
end;


14) To Import page to server and export page to your local machine:-
    ---------------------------------------------------------------

   i) Need to run the command from your local machine command promote(from the following path).
      ----------------------------------------------------------------------------------------
 
          cd C:\jbuilder\p4045639_11i_GENERIC\jdevbin\jdev\bin

   ii) import command to import the page from your local machine to server.
       -------------------------------------------------------------------

  import C:\jbuilder\p4045639_11i_GENERIC\jdevhome\jdev\myprojects\hp\oracle\apps\icx\scott\webui\SCOTTDEPTPG.xml
 -username apps
 -password apps
 -rootdir C:\jbuilder\p4045639_11i_GENERIC\jdevhome\jdev\myprojects\hp\oracle\apps\icx
 -rootPackage /hp/oracle/apps/icx
 -dbconnection "(DESCRIPTION =(ADDRESS_LIST =(ADDRESS = (PROTOCOL = TCP)(HOST = 10.1.32.198)(PORT = 1546)))
  (CONNECT_DATA =(SERVICE_NAME = HR1200V)))"
 
   iii) To verify the import command, run the following command on server in sqlplus:-
        ----------------------------------------------------------------------------
 
  set serveroutput on;
  exec jdr_utils.printDocument('/hp/oracle/apps/icx/scott/webui/SCOTTDEPTPG');


   iiii) use the following command to export the page from server to your local machine.
         ------------------------------------------------------------------------------

export /oracle/apps/csi/counter/instance/webui/CountersSearchPG
-rootdir C:\jbuilder\p4045639_11i_GENERIC\jdevhome\jdev\myprojects
-username apps
-password apps
-dbconnection "(DESCRIPTION =(ADDRESS_LIST =(ADDRESS = (PROTOCOL = TCP)(HOST = OSCAR)(PORT = 1571)))
    (CONNECT_DATA =(SERVICE_NAME = AD12O)))"


15) Admin utility to compile all the invalid objects:-
    -------------------------------------------------

i) This utility is avilable for the applmgr user. Use the following command to login with applmgr user.

   >>sudo su - applmgr

ii) Choose the Intance and then use the following command to run the adadmin utility.

   >>adadmin

{ Note:- It will ask for the $APPL_TOP path. If the default path is not the correct one then provide the correct path.
         It will ask for the Log file name. (Default name willl be (adadmin.log)).
         It will ask if you can be notified by email if a failure occurs. (Default will be set for NO).
         It will ask for the Batchsize (Default is 1000).
         It will ask for the correct database name.
         It will ask to enter the password for your 'SYSTEM' ORACLE schema.("manager" will be the password).
    (manager password will be only one you enter manually. Rest of things you take the default values.)
         It will ask to enter the ORACLE password of Application Object Library (default will be [APPS]).
}

iii) To will give the menu with different options.
     ---------------------------------------------

 We will choose the "Compile/Reload Applications Database Entities menu" option. It will be 3 option normally.

iv)  To will again give the other set of menu optins.
     -----------------------------------------------

 We will choose "Compile APPS schema" option to compile all the Invalid objects in APPS schema.

(Note:- You can also use $ORACLE_HOME/rdbms/admin/utlrp.sql (which will compile all invalid objects thru SVRMGRL.)).

16) HBC Specfic:-
     -----------------------
----

HBC:-

su - aplcdv

aplcdv1

------

17) To know apps password:-
    -------------------------------------

cd $ORACLE_HOME/reports60/server

more CGIcmd.dat

You will find userid=APPS/@




No comments:

Post a Comment