0% found this document useful (0 votes)
189 views

Common Scripts For EBS

This document provides instructions for: 1) Checking the Oracle EBS release name and database version. 2) Finding the patch level of different products in Oracle EBS. 3) Checking if the system is in maintenance mode. 4) Verifying if a patch has been applied.

Uploaded by

maruthi631
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
189 views

Common Scripts For EBS

This document provides instructions for: 1) Checking the Oracle EBS release name and database version. 2) Finding the patch level of different products in Oracle EBS. 3) Checking if the system is in maintenance mode. 4) Verifying if a patch has been applied.

Uploaded by

maruthi631
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 11

How to find Oracle EBS Release Name

All script should be run as APPS user


SQL> select release_name from apps.fnd_product_groups;

RELEASE_NAME
————————————————–
12.2.5

SQL> select version from V$INSTANCE;

VERSION
—————–
12.1.0.2.0

How to find Patch level of different product in Oracle EBS


SQL> select ABBREVIATION, CODELEVEL from AD_TRACKABLE_ENTITIES where
ABBREVIATION in (‘ad’, ‘txk’ , ‘atg_pf’);

ABBREVIATION CODELEVEL
—————————— ———————————–
ad C.10
atg_pf C.5
txk C.10

How to check Maintenance mode is enable or not


SQL>select fnd_profile.value(‘APPS_MAINTENANCE_MODE’) from dual;
FND_PROFILE.VALUE(‘APPS_MAINTENANCE_MODE’)
——————————————————————————–
NORMAL
SQL>
How to check Patch is applied or not:
SQL> select BUG_NUMBER,CREATION_DATE,LANGUAGE from ad_bugs where
BUG_NUMBER=’&a’;

Enter value for a: 14837539


old 1: select BUG_NUMBER,CREATION_DATE,LANGUAGE from ad_bugs where
BUG_NUMBER=’&a’
new 1: select BUG_NUMBER,CREATION_DATE,LANGUAGE from ad_bugs where
BUG_NUMBER=’14837539′
BUG_NUMBER CREATION_ LANG
—————————— ——— —-
14837539 24-MAY-18 US

There may be situation when you need to Kill


all FNDLIBR processes
1. Kill all processes of FNDLIBR.
ps -ef |grep FNDLIBR | grep -v grep | awk ‘{print $2}’ | xargs kill -9
Apart from that you can just modify below query to kill any apps, concurrent, database, ebs,
fndlibr, java, linux, oracle, pid, processes, session, unix related processes.

Similarly, we can kill other processes as well by replacing ‘FNDLIBR’ with other process
names.

2. Kill all processes of oracle.


ps -ef |grep oracle | grep -v grep | awk ‘{print $2}’ | xargs kill -9
If you have multiple instances on the same server, you can use the below command to kill
processes only of a particular user.

ps -fu appltest|grep FNDLIBR | grep -v grep | awk ‘{print $2}’ | xargs kill -9
Replace ‘appltest’ with your username.

Check Concurrent Manager status from Backend


select decode(CONCURRENT_QUEUE_NAME,
‘FNDICM’,’Internal Manager’,
‘FNDCRM’,’Conflict Resolution Manager’,
‘AMSDMIN’,’Marketing Data Mining Manager’,
‘C_AQCT_SVC’,’C AQCART Service’,
‘FFTM’,’FastFormula Transaction Manager’,
‘FNDCPOPP’,’Output Post Processor’,
‘FNDSCH’,’Scheduler/Prereleaser Manager’,
‘FNDSM_AQHERP’,’Service Manager: AQHERP’,
‘FTE_TXN_MANAGER’,’Transportation Manager’,
‘IEU_SH_CS’,’Session History Cleanup’,
‘IEU_WL_CS’,
‘UWQ Worklist Items Release for Crashed session’,
‘INVMGR’,’Inventory Manager’,’
INVTMRPM’,’INV Remote Procedure Manager’,’OAMCOLMGR’,
‘OAM Metrics Collection Manager’,
‘PASMGR’,’PA Streamline Manager’,
‘PODAMGR’,’PO Document Approval Manager’,
‘RCVOLTM’,’Receiving Transaction Manager’,
‘STANDARD’,’Standard Manager’,
‘WFALSNRSVC’,’Workflow Agent Listener Service’,
‘WFMLRSVC’,’Workflow Mailer Service’,’WFWSSVC’,
‘Workflow Document Web Services Service’,
‘WMSTAMGR’,’WMS Task Archiving Manager’,
‘XDP_APPL_SVC’,’SFM Application Monitoring Service’,
‘XDP_CTRL_SVC’,
‘SFM Controller Service’,
‘XDP_Q_EVENT_SVC’,’SFM Event Manager Queue Service’,
‘XDP_Q_FA_SVC’,’SFM Fulfillment Actions Queue Service’,
‘XDP_Q_FE_READY_SVC’,’SFM Fulfillment Element Ready Queue Service’,
‘XDP_Q_IN_MSG_SVC’,’SFM Inbound Messages Queue Service’,
‘XDP_Q_ORDER_SVC’,
‘SFM Order Queue Service’,
‘XDP_Q_TIMER_SVC’,’SFM Timer Queue Service’,
‘XDP_Q_WI_SVC’,’SFM Work Item Queue Service’,
‘XDP_SMIT_SVC’,’SFM SM Interface Test Service’) as “Concurrent Manager’s Name”,
max_processes as “TARGET Processes”,
running_processes as “ACTUAL Processes”
from apps.fnd_concurrent_queues
where CONCURRENT_QUEUE_NAME
in
(‘FNDICM’,’FNDCRM’,’AMSDMIN’,’C_AQCT_SVC’,’FFTM’,’FNDCPOPP’,’FNDSCH’
,’FNDSM_AQHERP’,’FTE_TXN_MANAGER’,’IEU_SH_CS’,’IEU_WL_CS’,’INVMGR’,
’INVTMRPM’,
‘OAMCOLMGR’,’PASMGR’,’PODAMGR’,’RCVOLTM’,’STANDARD’,’WFALSNRSV
C’,’WFMLRSVC’,’WFWSSVC’,’WMSTAMGR’,’XDP_APPL_SVC’,’XDP_CTRL_SVC’,
’XDP_Q_EVENT_SVC’,
‘XDP_Q_FA_SVC’,’XDP_Q_FE_READY_SVC’,’XDP_Q_IN_MSG_SVC’,’XDP_Q_ORD
ER_SVC’,’XDP_Q_TIMER_SVC’,’XDP_Q_WI_SVC’,’XDP_SMIT_SVC’)
order by max_processes
/

Output will be as below


How to submit active user request from backend
Run below command from Putty session:

CONCSUB apps/appstest SYSADMIN ‘System Administrator’ SYSADMIN WAIT=N


CONCURRENT FND FNDSCURS

Now once your concurrent request is submitted ,then you need to check the status of it in
sqlplus as apps user

set lines 150


col COMPLETION_TEXT for a50
col USER_CONCURRENT_PROGRAM_NAME for a50
select a.user_concurrent_program_name , a.CONCURRENT_PROGRAM_ID ,
REQUEST_ID
,REQUEST_TYPE,PHASE_CODE , STATUS_CODE ,
ACTUAL_START_DATE ,COMPLETION_TEXT
from fnd_concurrent_programs_tl a, fnd_concurrent_requests b
where a.concurrent_program_id=b.concurrent_program_id
and program_application_id=0
and REQUEST_ID =&requestid;

output will be as below

Check Table space having less than 2 GB freespace and


PCT used is more than 90%.
select name, kbytes/1024 total, used/1024 Used, free/1024 free_mb, pct_used,largest/1024
max_chunk_available_MB
from ( select nvl(b.tablespace_name,
nvl(a.tablespace_name,’UNKOWN’)) name,
kbytes_alloc kbytes,
kbytes_alloc-nvl(kbytes_free,0) used,
nvl(kbytes_free,0) free,
((kbytes_alloc-nvl(kbytes_free,0))/
kbytes_alloc)*100 pct_used,
nvl(largest,0) largest
from ( select sum(bytes)/1024 Kbytes_free,
max(bytes)/1024 largest,
tablespace_name
from sys.dba_free_space
group by tablespace_name ) a,
( select sum(bytes)/1024 Kbytes_alloc,
tablespace_name
from sys.dba_data_files
group by tablespace_name )b
where a.tablespace_name (+) = b.tablespace_name
)
where pct_used >=90 and free/1024 <=2500;

Check Total_Space,Free_Space & Used_Space in


Database(In MB)
SELECT Total.name “Tablespace Name”,
Free_space, (total_space-Free_space) Used_space, total_space
FROM
(select tablespace_name, sum(bytes/1024/1024) Free_Space
from sys.dba_free_space
group by tablespace_name
) Free,
(select b.name, sum(bytes/1024/1024) TOTAL_SPACE
from sys.v_$datafile a, sys.v_$tablespace B
where a.ts# = b.ts#
group by b.name
) Total
WHERE Free.Tablespace_name = Total.name;
2nd query for the same:
select t.tablespace_name “TABLESPACE”, t.TOTAL “TOTAL SIZE”,
nvl(f.FREE,0) “FREE SPACE”,round(nvl(f.FREE,0)*100/t.TOTAL) “% FREE”
FROM
(select tablespace_name,trunc(sum(bytes)/1024/1024) as “TOTAL” from dba_data_files
group by tablespace_name) t,
(select tablespace_name,trunc(sum(bytes)/1024/1024) as “FREE” from dba_free_space group
by tablespace_name) f
where t.tablespace_name=f.tablespace_name(+)
order by 4
/

Check only free space in all tablespace


SELECT TABLESPACE_NAME, SUM(BYTES/1024/1024) “Size (MB)” FROM
DBA_FREE_SPACE GROUP BY TABLESPACE_NAME;

Add/Resize Data file in Database


Find out file name & free space in particular Tablespace
set lines 150
col FILE_NAME for a60
select FILE_NAME,BYTES/1024/1024,TABLESPACE_NAME from dba_data_files where
TABLESPACE_NAME=’APPS_TS_TX_IDX’;

Now resize datafile as below:


alter database datafile ‘/oradata/prod/data08/APPS_TS_TX_IDX20.dbf’ resize 20G;

Add Datafile:
alter tablespace  APPS_TS_TX_IDX add datafile ‘/oradata/prod/data063/prod_123.dbf’ size
30720M;

Make datafile Auto-extendable:


alter database datafile ‘/oradata/prod/data063/prod_123.dbf’ autoextend on next 100m
maxsize 30720M;
Working on ASM/RAC
SQL> select name from v$asm_diskgroup;

NAME
——————————
FLASH
DATA

SQL> SELECT name, free_mb, total_mb, free_mb/total_mb*100 as percentage FROM


v$asm_diskgroup;

NAME FREE_MB TOTAL_MB PERCENTAGE


—————————— ———- ———- ———-
FLASH 8868 512000 1.73203125
DATA 197372 1536000 12.8497396

SQL> alter tablespace APPS_TS_TX_DATA add datafile ‘+DATA’ SIZE 5120M;

Tablespace altered.

SQL> select FILE_NAME,BYTES/1024/1024,TABLESPACE_NAME from dba_data_files


where TABLESPACE_NAME=’APPS_TS_TX_DATA’;

FILE_NAME BYTES/1024/1024 TABLESPACE_NAME


———————————————————— ————— ——————————
+DATA/TEST/DATAFILE/apps_ts_tx_data.355.977729061 5120 APPS_TS_TX_DATA
+DATA/TEST/DATAFILE/apps_ts_tx_data.356.977729163 5120 APPS_TS_TX_DATA
Invalid Object Count after DB upgrade:
set lines 200
col OBJECT_NAME for a30
col OWNER for a20
select owner,object_name,object_type,timestamp from dba_objects where status=’INVALID’
order by 1;

Findout 30 days old files and then delete it in Oracle


EBS/APPS Side/Linux system
find . -mtime +30 -exec ls -ltr {} \;

find . -mtime +30 -exec rm -rf {} \;

find . -size +1G -mtime +30 -type f -print


find . -type f -size +500M -exec basename {} \;
Findout particular string in any directory or mount point.
find . -type f -exec grep -il “a425917/search string” {} \;

Findput file which is more than 100MB in Oracle


EBS/APPS Side/Linux system
find . -size +99999 -exec ls -ltr {} \;
find *.RTF -size +99999 -exec ls -ltr {} \;
find *.xls -size +99999 -exec ls -ltr {} \;

Now once you are okay with all search results,just do gzip
to make some space on mount points:
gzip ./o43350984.out ./XLAACCPB_43402739_1.RTF

 How to set OPatch path in Oracle Home:


export PATH=$ORACLE_HOME/OPatch:$PATH

opatch lsinventory|egrep ‘Home|12949905’


Oracle Home : /u01/oracle/TEST122/oracle11204/11.2.0
There are 1 products installed in this Oracle Home.
Patch 12949905 : applied on Tue Jul 17 05:04:17 CDT 2018
12949905
[oratest@test12upg]\ /u01/dbpatches/11204Patches/12949905
>
How to find trace file generated in Database server:
1. select name, value from v$diag_info where name = ‘Default Trace File’;
2. select value from v$parameter where name=’user_dump_dest’;

3. show parameter diag;


4. show parameter user;
5. select p.value || ‘/’ || instance_name || ‘ora’ || p.spid || ‘.trc’
from v$parameter p,
v$process p, v$session s , v$instance
where
p.name = ‘user_dump_dest’
and s.username = ‘usernmae’
and s.sid = 12345
and s.serial#=11111
and p.addr=s.paddr;
How to generate tkprof for generated trace files:
tkprof 1234.trc 12345.prf sys=no waits=yes explain=apps/apps_password
sort='(prsela,exeela,fchela)’

tkprof 1234.trc 12345.prf sys=no waits=yes explain=apps/apps_password


sort='(prsela,exeela,fchela)’

tkprof 1234.trc 12345.tkprof

Working with vi Various useful tips and command used while


working vi editor
 i for insert mode.
 I inserts text at the curson
 A appends text at the end of the line.
 a appends text after cursor.
 O open a new line of text above the curson.
 o open a new line of text below the curson.
 : for command mode.
 <escape> to invoke command mode from insert mode.
 :!sh to run unix commands.
 x to delete a single character.
 dd to delete an entire line
 ndd to delete n number of lines.
 d$ to delete from cursor to end of line.
 yy to copy a line to buffer.
 P to paste text from buffer.
 nyy copy n number of lines to buffer.
 :%s/stringA/stringb /g to replace stringA with stringB in whole file.
 G to go to last line in file.
 1G to go to the first line in file.
 w to move forward to next word.
 b to move backwards to next word.
 $ to move to the end of line.
 J join a line with the one below it.
 /string to search string in file.
 n to search for next occurrence of string.
Complete RMAN information for day to day rman activity:
Getting Started with Recovery Manager (RMAN) (Doc ID 360416.1)

User Creation & Grant:


GRANT
CREATE session,
CREATE table,
CREATE view
CREATE procedure,
CREATE synonym,
ALTER ANY table,
ALTER view,
ALTER procedure,
ALTER synonym,
DROP table,
DROP view,
DROP procedure,
DROP synonym
TO myUsers;

Admin privileges:
GRANT
CREATE SESSION,
UNLIMITED TABLESPACE,
CREATE TABLE,
DROP ANY TABLE,
CREATE CLUSTER,
CREATE SYNONYM,
CREATE PUBLIC SYNONYM,
CREATE VIEW,
CREATE SEQUENCE,
CREATE DATABASE LINK,
CREATE PROCEDURE,
CREATE TRIGGER,
CREATE MATERIALIZED VIEW,
CREATE ANY DIRECTORY,
DROP ANY DIRECTORY,
CREATE TYPE,
CREATE LIBRARY,
CREATE OPERATOR,
CREATE INDEXTYPE,
CREATE DIMENSION,
CREATE ANY CONTEXT,
SELECT ANY DICTIONARY,
CREATE JOB,
ALTER ANY TABLE,
TO myAdmin;

TO find out Database Size


SELECT SUM (bytes)/1024/1024/1024 AS “Size In GB” FROM dba_segments;
SELECT SUM (bytes)/1024/1024/1024 AS “Size In GB” FROM dba_data_files;

 How to check OJVM version:

SQL> select comp_name, version, status from dba_registry;


SQL> connect / as sysdba
SQL> select owner, status, count(*) from all_objects
where object_type like ‘%JAVA%’ group by owner, status;

SQL> select role from dba_roles where role like ‘%JAVA%’;

 FIND DB lock

SELECT O.OBJECT_NAME, S.SID, S.SERIAL#, P.SPID, S.PROGRAM,S.USERNAME,


S.MACHINE,S.PORT , S.LOGON_TIME,SQ.SQL_FULLTEXT
FROM V$LOCKED_OBJECT L, DBA_OBJECTS O, V$SESSION S,
V$PROCESS P, V$SQL SQ
WHERE L.OBJECT_ID = O.OBJECT_ID
AND L.SESSION_ID = S.SID AND S.PADDR = P.ADDR
AND S.SQL_ADDRESS = SQ.ADDRESS;

Tar & Untar for Oracle EBS:

TO make tar of apps –

nohup tar -cf – apps | gzip – > /backups/appsPROD25Nov18.tgz &


To untar above tgz

Go into the directory where you have to untar and then run below:

gunzip -c /backups/appsPROD25Nov18.tgz|tar xvf –


How to create user ,group in Linux
creaet user
sudo useradd Mukesh

create group
sudo groupadd Paliwal

now to add user into group

sudo usermod -g paliwal mukesh


to change permission and owner ,group of directory

sudo chown -R mukesh:paliwal “directory name”

You might also like