Sunday, May 20, 2012

Mobile Application Services in Oracle Apps R12

Login as applmgr user :
Go to $ADMIN_SCRIPTS_HOME

Stop Mobile Application Services :

./mwactl.sh -login apps/apps_password stop_force
./mwactlwrpr.sh stop apps/apps_password

Start Mobile Application Services :

./mwactl.sh -login apps/apps_password start
./mwactlwrpr.sh start apps/apps_password

Check Mobile Services are up and Runing:

ps -ef | grep mwa

Find port Number of Mobile Services :

grep mwa $CONTEXT_FILE

Connect to Mobile Services :
telnet hostname.domainname portnumber(mobile application service port_number)
++++++++++++++++++++++++++++++++++++
Hot to configure Mobile applications on EBS – 11i
++++++++++++++++++++++++++++++++++++
1. Stop the current servers.
a. $ cd $MWA_TOP/bin
b. $ nohup mwactl.sh -login SYSADMIN/sysadmin1 stop 10260
    $ netstat -na  | grep 10260
c. $ ./mwactl.sh stop_dispatcher
2. Verify that MWA servers are stopped.
a. $ ps -ef | grep mwa
b. No processes should be found.
3. Locate the mwa.cfg file in the $MWA_TOP/secure directory.
4. Edit the mwa.cfg file and configure following parameters
a. Set mwa.DbcFolder=full directory of folder containing the .dbc file ending with “/”:
mwa.DbcFolder=/d01/oracle/SVRSUPTappl/fnd/11.5.0/secure/SVRSUPT_svrsuptsql1
b. Set mwa.DbcFile=dbc file name with extension:
mwa.DbcFile=SVRSUPT
c. Set mwa.logdir=full directory of log file without the trailing “/”:
mwa.logdir=/d01/oracle/SVRSUPTcomn/admin/log/SVRSUPT_svrsuptsql1
d. Set mwa.LogLevel=error or trace:
mwa.LogLevel=error
e. Set mwa.TelnetPortNumber=port number
mwa.TelnetPortNumber=10240
f. Set mwa.DropConnectionTimeout= no. of minutes:
mwa.DropConnectionTimeout=5
g. Set mwa.StaleSessionTimeout= no. of minutes:
mwa.StaleSessionTimeout=60
h. Specify the port number and machine for running the dispatcher:
mwa.Dispatcher=svrsuptsql1.d-rco.com:10328
i. Specify the server manager telnet server information
mwa.TelnetServer=svrsuptsql1.d-rco.com:10260;10262
5. Start the MWA telnet servers
a. $ cd $MWA_TOP/bin
b. $ nohup ./mwactl.sh start 10260 &
6. Start the dispatcher
a. $ nohup ./mwactl.sh start_dispatcher &

++++++++++++++++++++++++++++++++
how to check it is working or not:
Start  à  Run à cmd à telnet hostame:portnumber  ß press enter  , it will show 4 options select , appropriate option & give username & password.

++++++++++++++++++++++++++++++++
ID 1393369.1 , 782162.1 & 269991.1


Target node/queue unavailable or Concurrent Manager Issue’s after cloning or DB-Refresh

Target node/queue unavailable or Concurrent Manager Issue’s after cloning or DB-Refresh

Concurrent Processing - After Cloning All the Concurrent Managers Do Not Start for the Clone [ID 555081.1]

Conflict Resolution Manager Shows Target Node/Queue Unavailable [ID 732709.1]

Concurrent Managers Do Not Start After Cloning Nodes Not Updated In Conc_queues [ID 466532.1]


EXEC FND_CONC_CLONE.TARGET_CLEAN;

Run autoconfig on dbtier then appsTier.

Run cmclean.sql script  Non destructive script this can also be tried-->>

Start all application services and check whether managers are up.

Apply this solution in last when the above one doesnt work.

select node_name,target_node,control_code from fnd_concurrent_queues;

update apps.fnd_concurrent_queues set node_name = 'Node NAME' where node_name='Existing Node Name'; 

select NODE_NAME,NODE_MODE,STATUS from fnd_nodes;

desc fnd_concurrent_queues

select control_code,target_node,node_name,CONCURRENT_QUEUE_NAME from fnd_concurrent_queues;

UPDATE fnd_concurrent_queues set control_code = null;

UPDATE fnd_concurrent_queues set target_node = 'Node Name';

UPDATE fnd_concurrent_queues set node_name = 'Node Name';

update FND_CONCURRENT_QUEUES set control_code = null where concurrent_queue_name = 'OAMGCS_NODENAME'; -- supply the node name..(Ur Existing Node Name)

Commit;

select control_code,target_node,node_name,CONCURRENT_QUEUE_NAME from fnd_concurrent_queues;

Monday, October 31, 2011

AppsDBA Issuess

1. How do you compile a form command line?

appltop/apps/ora/8.0.6/bin/f60gen module=/appltop/apps/au/11.5.0/forms/US/FNDRSRUN.fmb userid=APPS/apps output_file=/appltop/apps/fnd/11.5.0/forms/US/FNDRSRUN.fmx module_type=form batch=yes compile_all=special

2. how do you generate a report command line?

/appltop/apps/ora/8.0.6/bin/rwcon60 userid=APPS/apps source=/tappltop/apps/pa/11.5.0/reports/US/PAXPCEGS.rdf dest=/tappltop/apps/admin/INTGBL/out/tmp001.rdf stype=rdffile dtype=rdffile logfile=/tappltop/apps/admin/INTGBL/out/adrep001.txt overwrite=yes batch=yes compile_all=yes

3. How do you load data to db using FNDLOAD?

/appltop/apps/fnd/11.5.0/bin/FNDLOAD &ui_apps 0 Y UPLOAD @FND:patch/115/import/afsload.lct @PJI:patch/115/import/US/pji115fn.ldt
Patching Issues/Sollutions/WorkArounds

During Patching, If you get different AD Worker Errors:

1. AD Worker error:
The following ORACLE error:
occurred while executing the SQL statement:
GRANT select on GV$LOGFILE to em_oam_monitor_role
Error occurred in file
/appltop/apps/ad/11.5.0/patch/115/sql/ademusr.sql

Work Around:

->connect DB / as sysdba
->grant select on GV_$LOGFILE to system with grant option.
->connect system/systempwd.
->grant select on GV$LOGFILE to em_oam_monitor_role.
-> Restart the failed worker using adctrl.
2.AD Worker error:
The following ORACLE error:ORA-12801: error signaled in parallel query server P000ORA-01452: cannot CREATE UNIQUE INDEX; duplicate keys foundoccurred while executing the SQL statement:CREATE UNIQUE INDEX ICX.ICX_TRANSACTIONS_U1 ON ICX.ICX_TRANSACTIONS(TRANSACTION_ID) LOGGING STORAGE (INITIAL 4K NEXT 104K MINEXTENTS 1MAXEXTENTS UNLIMITED PCTINCREASE 0 FREELIST GROUPS 4 FREELISTS 4 ) PCTFREE10 INITRANS 11 MAXTRANS 255 COMPUTE STATISTICS PARALLEL TABLESPACE ICXXAD Worker error:Unable to compare or correct tables or indexes or keysbecause of the error above

Work Around

->Execute the following SQL to prevent errors during Patch Application through adpatch:
->SELECT TRANSACTION_ID, count(*)FROM ICX.ICX_TRANSACTIONSGROUP BY TRANSACTION_IDHAVING count(*)>1
->If the Above query returns any Row then Please execute the following SQL :

->$ICX_TOP/sql (named ICXDLTMP.sql).
1. How do you enable/disable a trace to a Oracle Application Forms Session?

solution:

1. Connection to Oracle Applications
2. Navigate to the particular form, which you want trace to be enabled
3. Goto Menu Help->Diagnostics->Trace->Regular Trace and select it
4. It will ask you for Apps Password. Provide it
5. Then it will show the file path where trace is going to be generated
6. Ask developer to perform their transactions, once they are done disable the trace
7. Goto to that location to get the trace file
8. Get the trace out put file using tkprof with different options

To disable Trace Session

Goto Menu Help-> Diagnostics->Trace->No Trace

2. How do you enable/disable a trace to a Oracle Application Forms Session? (Other Way)

Solution:

1. Get the serial #, sid of particular form session by navigating Help->about Oracle applicatins
2. Connect to database using sqlplus with relavant user
3. execute dbms_system.set_sql_trace_in_session(2122,332,TRUE);
4. Select spid from v$process where addr=(select paddr from v$session where sid=2122);
5. You will get spid like 4515 for above statement
6. Goto udump location and type ls -ltr *4515* you will get trace file

To disable Trace Session

1. execute dbms_system.set_sql_trace_in_session(2122,332,FALSE);

3. How do you enable/disable a trace to a Concurrent Program?

Solution:

1. Connect to Oracle Applications
2. Navigate to System Administrator->Concurrent->Program->Define
3. Query the concurrent program on which you want to enable trace.
4. Check the enable trace check box bottom of the screen, Save it.
5. Ask the developer to submit the request, Once the request got submitted and completed normal.
6. Get the spid as select oracle_process_id from apps.fnd_concurrent_requests where request_id=456624.
7. You will get a spid like 12340.
8. Goto Udump and ls -ltr *12344*.
9 . You will get trace file.
How to convert Forms server to Socket mode  from Servlet mode in Oracle Apps R12

Run the following command to enable Forms Socket Mode on Forms/web nodes (Place correct context file name and port value)

$FND_TOP/bin/txkrun.pl -script=ChangeFormsMode -contextfile=$CONTEXT_FILE -mode=socket  -port=9030 -runautoconfig=No

Where port = forms port and contextfile=your environment contextfile

To Start/Stop/check Status of forms servers use following scripts

cd $ADMIN_SCRIPTS_HOME
./adformsrvctl.sh status/stop/start
How to drop and recreate TEMP Tablespace in Oracle 9i/10g/11g

1. Create Temporary Tablespace Temp

CREATE TEMPORARY TABLESPACE TEMP2 TEMPFILE  ‘/u01/app/oradata/temp01′ SIZE 2000M, ‘/u01/app/oradata/temp02′ SIZE 2000M';

2. Move Default Database temp tablespace

ALTER DATABASE DEFAULT TEMPORARY TABLESPACE temp2;

3. Make sure No sessions are using your Old Temp tablespace

   a.  Find Session Number from V$SORT_USAGE:
       SELECT USERNAME, SESSION_NUM, SESSION_ADDR FROM V$SORT_USAGE;

   b.  Find Session ID from V$SESSION:

       If the resultset contains any tows then your next step will be to find the SID from the V$SESSION view. You can find session id by using SESSION_NUM or SESSION_ADDR from previous resultset.

       SELECT SID, SERIAL#, STATUS FROM V$SESSION WHERE SERIAL#=SESSION_NUM;
       OR
       SELECT SID, SERIAL#, STATUS FROM V$SESSION WHERE SADDR=SESSION_ADDR;

    c.  Kill Session:

    Now kill the session with IMMEDIATE.

    ALTER SYSTEM KILL 'SID,SERIAL#' IMMEDIATE;

4. Drop temp tablespace

DROP TABLESPACE temp INCLUDING CONTENTS AND DATAFILES;

5. Recreate Tablespace Temp

CREATE TEMPORARY TABLESPACE TEMP TEMPFILE /u01/app/temp/temp01′ SIZE 2000M;

6 Move Tablespace Temp, back to new temp tablespace

ALTER DATABASE DEFAULT TEMPORARY TABLESPACE temp;

7. Drop temporary for tablespace temp

DROP TABLESPACE temp2 INCLUDING CONTENTS AND DATAFILES

Unable to launch forms when logging to Application:

[ ]cd /d01/oracle/svrqatcomn/conf/svrqat_msvrqatebsal2/iAS/Apache/Apache/logs
cat error_log_pls.1099966600
After the Forms page timed out we received error on fnd_icx_launch.launch searching this on we reached file error_log_pls.1099966600
where in 2 port where not binding.
[oracle@msvrqatebsal2 logs]$ cat error_log_pls.1099966600
[Tue Aug 6 13:47:44 2011] [crit] (98)Address already in use: make_sock: could not bind to port 8202
[Tue Aug 6 16:26:12 2011] [crit] (98)Address already in use: make_sock: could not bind to port 8202
[Tue Aug 6 19:00:42 2011] [warn] pid file /d01/oracle/svrqatcomn/conf/svrqat_msvrqatebsal2/iAS/Apache/Apache/logs/httpd_pls.pid overwritten -- Unclean shutdown of previous Apache run
[Tue Aug 6 19:00:42 2011] [notice] FastCGI: process manager initialized (pid 5187)
[Tue Aug 6 19:00:43 2011] [notice] Oracle HTTP Server Powered by Apache/1.3.19 configured -- resuming normal operations

Solution:

1). Rebot the Particular Forms Server --> at UNIX lever
2). kill the processes like command (fi any seheduled requests are not in client like aventx)
             kill -9 -1

Tuesday, September 27, 2011

high consuming sql...

SQL> select s.sid,s.username,s.serial#,p.spid from v$session s,v$process p where s.paddr=p.addr and p.spid=5156;(pid which is come from prstat -a command)

       SID USERNAME                          SERIAL# SPID
---------- ------------------------------ ---------- ------------
        40 APPS                                14047 5156

SQL> select SQL_HASH_VALUE,PREV_HASH_VALUE from v$session where sid=40;

SQL_HASH_VALUE PREV_HASH_VALUE
-------------- ---------------
    1529310018      1529310018

SQL> select sql_text from v$sql where HASH_VALUE='1529310018';

SQL_TEXT
--------------------------------------------------------------------------------
insert into ra_customer_trx ( customer_trx_id, last_update_date, last_updated_by
, creation_date, created_by, last_update_login, trx_number, cust_trx_type_id, tr
x_date, set_of_books_id, ct_reference, interface_header_context, interface_heade
r_attribute1, interface_header_attribute2, interface_header_attribute3, interfac
e_header_attribute4, interface_header_attribute5, interface_header_attribute6, i
nterface_header_attribute7, interface_header_attribute8, interface_header_attrib
ute9, interface_header_attribute10, interface_header_attribute11, interface_head
er_attribute12, interface_header_attribute13, interface_header_attribute14, inte
rface_header_attribute15, bill_to_contact_id, batch_id, batch_source_id, sold_to
_customer_id, bill_to_customer_id, bill_to_address_id, ship_to_customer_id, ship
_to_contact_id, ship_to_address_id, ship_to_site_use_id, term_id, previous_custo

SQL_TEXT
--------------------------------------------------------------------------------
mer_trx_id, primary_salesrep_id, purchase_order, purchase_order_revision, purcha
se_order_date, comments, internal_notes
================================================================

+++++++++++++++++++++++++++++++++++++++++++++locked objects

select 
  oracle_username
  os_user_name,
  locked_mode,
  object_name,
  object_type
from 
  v$locked_object a,dba_objects b
where 
  a.object_id = b.object_id
 +++++++++++++++++++++++++++++++++++++++++++++++++++++ select SID, SPID VALUES
 


select s.sid,s.username,s.serial#,p.spid from v$session s,v$process p where s.paddr=p.addr and p.spid=4197;
       SID    SERIAL# SPID
---------- ---------- ------------
      1359        249 23851


select SQL_HASH_VALUE,PREV_HASH_VALUE from v$session where sid=1359
             
SQL> select sql_text from v$sql where HASH_VALUE='682811033';

SQL_TEXT
--------------------------------------------------------------------------------
SELECT SUM (A.QUANTITY) FROM OKE_K_DELIVERABLES_VL A   WHERE A.DIRECTION =  'IN'
  AND A.PROJECT_ID =  :b1  AND A.ITEM_ID =  :b2

 select sql_text from v$sql where HASH_VALUE='682811033';
SQL_TEXT
--------------------------------------------------------------------------------
SELECT SUM (A.QUANTITY) FROM OKE_K_DELIVERABLES_VL A   WHERE A.DIRECTION =  'IN'
  AND A.PROJECT_ID =  :b1  AND A.ITEM_ID =  :b2



..............................................................................Manju
 




Saturday, August 6, 2011

Create defaults file for adpatch defaultsfile:



adpatch defaultsfile=$APPL_TOP/admin/SUPT/defaults.txt

Using Defaults file with adpatch (Non Interactive)

How to create defaults file ?

adpatch defaultsfile=$APPL_TOP/admin/$SID/defaults.txt ( You can keep this txt file in any location of your choice)

Now abort autopatch section at point where it asks for patch directory by ctrl +c or ctrl+d

Now check if this file exists

Note : You have to do above steps only once in an environment to create defaults file.

How to apply patches in future ?

adpatch defaultsfile=$APPL_TOP/admin/$SID/defaults.txt

Now any future patches you apply non interactive using defaults file like

adpatch defaultsfile=$APPL_TOP/admin/$SID/defaults.txt logfile=654321.log patchtop=/patches/654321 driver=u654321.drv interactive=no

You will see that it will apply patch by itself using defaults file , adpatch will pick APP_TOP, ORACLE_HOME information, system password and apps password from defaults file.

This will save lot of time & you can reduce your patch timing usign defaults file

+++++++++Manjunatha+++++++++

Saturday, July 30, 2011

To Find 32/64 bit processer

#getconf  LONG_BIT

#uname -a (***i686 <processor_name> i386) is a 32 bit .

scripts

ManjunathaReddy
+++++++++++++++++++++++++++++++++ Node Details +++++++++++++++++++++++++++++++

SELECT node_name,
support_cp,
support_forms,
support_web,
support_admin,
status
FROM apps.fnd_nodes
ORDER BY 2,3,4;

+++++++++++++++++++++++++++++++++++ Find URL +++++++++++++++++++++++++++++++

select name from v$database;

select home_url from apps.icx_parameters;

grep login $CONTEXT_FILE

+++++++++++++++++++++++++++++++++++ tkprof usage  +++++++++++++++++++++++++++++++

tkprof coestg1_ora_14984_XXCSE_EMAIL__CR3167157.trc coestg1_ora_14984_XXCSE_EMAIL__CR3167157.trc_tkprof sys=no explain=apps/b1ue2uth sort='(fchela,exeela,prsela)'

+++++++++++++++++++++++++++++++++++ FNDCPASS  usage +++++++++++++++++++++++++++++++

FNDCPASS apps/g00g1e 0 Y system/dv1s4seme USER sysadmin dv1admeme

+++++++++++++++++++++++++++++++++++ zip usage +++++++++++++++++++++++++++++++

zip -rl foldername.zip folder

+++++++++++++++++++++++++++++++++++ Scp usage +++++++++++++++++++++++++++++++

scp trace_aug1.zip /tmp@dev-db3, scrp trace_aug1 bgembali@dev-db3:/tmp

+++++++++++++++++++++++++++++++++++  If you give concurrent request name it will show concurrent program details

col Program format a40;
col ARGUMENT_TEXT format a30;
col Interval format a10;
col requestor format a20;
set linesize 140;
set pagesize 999;
select distinct a.request_id,a.user_concurrent_program_name "Program",a.ARGUMENT_TEXT,to_char(a.REQUESTED_START_DATE,'DD/MM/YYYY HH24:MI:SS') "Start Date" ,a.RESUBMIT_INTERVAL||' '||a.RESUBMIT_INTERVAL_UNIT_CODE "Interval",requestor FROM apps.FND_CONC_REQUESTS_FORM_V a where
a.concurrent_program_id in (select CONCURRENT_PROGRAM_ID from apps.fnd_concurrent_programs_tl where
USER_CONCURRENT_PROGRAM_NAME like '&1') and a.phase_code='P';

+++++++++++++++++++++++++++++++++ Get oracle process id for a request for trace +++++++++++++++++++++++++++++++

select request_id,to_char(ACTUAL_START_DATE,'DD-MM-YYYY HH24:MI:SS'),to_char(ACTUAL_COMPLETION_DATE,'DD-MM-YYYY HH24:MI:SS'),phase_code,status_code,os_process_id,oracle_process_id from apps.fnd_concurrent_requests where request_id=&req_id;

+++++++++++++++++++++++++++++++++ Kill Sessions syntax +++++++++++++++++++++++++++++++

select 'alter system kill session '||''''||sid||','||serial#||''''||';' from V$session where username='XXNTF' AND status='ACTIVE';

+++++++++++++++++++++++++++++++++ Find Which manager took care of request +++++++++++++++++

$FND_TOP/sql/@afcmcreq.sql

+++++++++++++++++++++++++++++++++ Know front end nodes from database node +++++++++++++++++

select distinct machine from gv$session where osuser='oa&sid';

+++++++++++++++++++++++++++++++++ Script Locations  ++++++++++++++++++++++++++++++++++++++

/usr/tools/oracle/scripts - Script location
/usr/tools/oracle/Standard/onCall/core - Another script location for core db
/usr/tools/oracle/Standard/onCall/11i - Script location for Apps db


setdb <sid> -- For CTS and COE instances

    eg: setdb CTSPRD
   
    cd $APPL_TOP/admin/$TWO_TASK/log
   
+++++++++++++++++++++++++++++++++ Gather Table level stats ++++++++++++++++++++++++++++++++

exec dbms_stats.gather_table_stats(OWNNAME=>'MRP',TABNAME=>'MRP_FORECAST_INTERFACE','ESTIMATE_PERCENT' =>20, DEGREE=>20,CASCADE=>TRUE) ;

++++++++++++++++++++++++++++++++++ Screen Usage ++++++++++++++++++++++++++++++++++++++++++++

screen -S ganesh1
screen -x screen1
screen -list

++++++++++++++++++++++++++++++++++ Gather Schema level stats ++++++++++++++++++++++++++++++++
set time on;
set timing on;
select name from v$database;
exec dbms_stats.gather_schema_stats(OWNNAME=>'AR','ESTIMATE_PERCENT' =>20, DEGREE=>20,CASCADE=>TRUE) ;
exec dbms_stats.gather_schema_stats(OWNNAME=>'JTF','ESTIMATE_PERCENT' =>20, DEGREE=>20,CASCADE=>TRUE) ;
exec dbms_stats.gather_schema_stats(OWNNAME=>'OKC','ESTIMATE_PERCENT' =>23, DEGREE=>20,CASCADE=>TRUE) ;
exit;

++++++++++++++++++++++++++++++++++ Recompile invalid objects +++++++++++++++++++++++++++++++++

exec sys.utl_recomp.recomp_parallel(32);

++++++++++++++++++++++++++++++++++ Temp File Info ++++++++++++++++++++++++++++++++++++++++++++

select (select sum(Bytes)/1024/1024/1024 from dba_temp_files) "TOTAL SPACE in GB",(select decode(sum(blocks),null,0,sum(blocks)*8192/1024/1024/1024) from v$sort_usage) "CURRENT USAGE in GB",(select count(*) from v$sort_usage where blocks>(100000000/8192))"SESSIONS USING > 1000MB" from dual;

+++++++++++++++++++++++++++++++++++ Grants to apps schema ++++++++++++++++++++++++++++++++++++

col grantee format a20
col owner format a15
col TABLE_NAME format a15
col GRANTOR format a15
col PRIVILEGE format a10
set pagesize 100

select grantee,owner, table_name, grantor,PRIVILEGE from dba_tab_privs where TABLE_NAME='RVTAB';

/usr/tools/oracle/.refresh/password_TS1KPR.sql --- Get the pwd of the schema

grant select on AQADM.RVTAB to apps_read_only;

+++++++++++++++++++++++++++++++++++++++ start oracle script usage +++++++++++++++++++++++++++++++++++++++++++++++++++++++++==

/usr/tools/oracle/Standard/script/start_oracle -s YCODV1
/usr/tools/oracle/Standard/script/stop_oracle -s TS3ECP -t 300 -m immediate

++++++++++++++++++++++++++++++++++++++++++++++ Concurrent mangers Log locatoin +++++++++++++++++++++++++++++++++++++++++++++


cd $FND_TOP/log -- concurrent program log

++++++++++++++++++++++++++++++++++++++++++++++++++++++

1. @lock_holder
2. Note process id which causes lock say 1214
3. @sid
4. Give Enter value for sid: 1214
5. NOte os process id say 2803
6. select request_id,phase_code,status_code from apps.fnd_concurrent_requests where oracle_process_id=2803;

++++++++++++++++++++++++++++++++++++++++++++++++++++++

TS1OAS - tst-db5/tst-db6

R3 Internal BPEL - oa1-itst-16/oa1-itst-17 (oaoasts1)
    sudo su - oaoasts1
    status
    stop
    status
    start
    status

R3 Internal J2EE - oa1-itst-03/oa1-itst-04 (oaj2ets1)
R3 Internal OHS - oa1-itst-05/oa1-itst-06 (oaj2ets1/oaoasts1)

++++++++++++++++++++++To create new user for dart request+++++++++++

/usr/tools/oracle/Standard/script/Create_User.ksh

++++++++++++++++++++++ Password Reset ++++++++++++++++++++++++++++++

SQL> select name from v$database;

NAME
---------
TS1BVP

SQL> select USERNAME,PASSWORD,PROFILE from dba_users where username like 'UNI%';

USERNAME PASSWORD PROFILE
------------------------------ ------------------------------
UNIVDB F84281E3BA66D865 SOX_PROFILE

SQL> select * from dba_profiles where PROFILE='SOX_PROFILE' and RESOURCE_NAME like 'PASSWORD_VERIFY_FUNCTION';

PROFILE RESOURCE_NAME RESOURCE
------------------------------ -------------------------------- --------
LIMIT
----------------------------------------
DEFAULT PASSWORD_VERIFY_FUNCTION PASSWORD
PASSWORD_DONTCHANGE_FUNCTION


SQL> alter profile default limit password_verify_function null;

Profile altered.

SQL> alter user UNIVDB identified by "univdb123";

User altered.

SQL> alter profile SOX_PROFILE limit password_verify_function PASSWORD_DONTCHANGE_FUNCTION;

Profile altered.

++++++++++++++++++++++++++ create soft link +++++++++++++++++++++++++++++++++

ln -s /usr/tools/oracle/Standard/script/free_vol.sh .

+++++++++++++++++++++++++++++ When Jiniatior crashes

C:\Program Files\Oracle\JInitiator 1.1.8.7\bin\symcjit_old.dll

++++++++++++++++++++++++++++++ To know whether trace enabled or not

select CONCURRENT_PROGRAM_ID,USER_CONCURRENT_PROGRAM_NAME from apps.fnd_concurrent_programs_tl where USER_CONCURRENT_PROGRAM_NAME like '%Cisco%RMA%and%2Tier%Report%';

select concurrent_program_id,enable_trace from apps.fnd_concurrent_programs where concurrent_program_id in (45394,45395);

+++++++++++++++++++++++++++++++ Create Index Syntax
CREATE UNIQUE INDEX "XXCSS_O"."XXCSS_QOT_LINES_ALL_STG_PK" ON "XXCSS_O"."XXCSS_QOT_LINES_ALL_STG" ("PROC_ID", "QUOTE_LINE_ID") PCTFREE 10 INITRANS 10 MAXTRANS 255 COMPUTE STATISTICS STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "XXCSSD1" PARALLEL 32;

drop index "XXCSS_O"."XXCSS_QOT_LINES_ALL_STG_PK" force;

++++++++++++++++++++++++++++++++++++++++= oracle session trace (ora debug)++++++++++++++++++++

oradebug setospid 420
oradebug unlimit
oradebug EVENT 10046 trace name context forever, level 12
oradebug tracefile_name
oradebug event 10046 trace name context off

++++++++++++++++++++++++++++++++++++++++++++++++++++

Make an entry in jserv.properties under Classpath section.
Add a new liine as "wrapper.classpath=<path>".
Bounce the Apache.

++++++++++++++++++++++++++++++++++++++++++++++++++++Concurrent requests show Inactive NoManager

Get the request id from the user,
Go to SYSADMIN --> System Administrator --> Others --> View Requests screen, search for the request. Click on Tools --> Manager log to see under which manager this program is being executed. Check the status of the manager in Concurrent --> Manager --> Administer and take necessary action.

If the Manager screen does not show any entry, this means the program is not attached to any manager. The application team needs to include this program under one of the managers

+++++++++++++++++++++++++++++++++++++++++++++++++++ Analyzing a table partition ++++++++++++++++++++++++++++++++++++++++++++

exec dbms_stats.gather_table_stats(ownname=>'ctsblr_o',tabname=>'ss_incide', partname=>'ss_incide1', 'estimate_percent' =>20, degree=>20,granularity=>'partition',cascade=>true)

++++++++++++++++++++++ Temp Usage ++++++++++++++++++++++++++++++.Give DB block size as input. show parameter db_block_size

SELECT inst_id "instid",
SUBSTR(tablespace_name,1,15) "ts",
used_blocks*&bs/1048/1048/1048 "used mb",
free_blocks*&bs/1048/1048/1048 "free mb",
total_blocks*&bs/1048/1048/1048 "total mb"
FROM gv$sort_segment;

++++++++++++++++++++++++++++++++++ Tablespace Info


select round((bytes/1024)/1024,0) "Used Space(MB)",
round(total,0) "Allocated size(MB)",
round(max,0) "Maximum allowable(MB)",
round(max-(BYTES/1024)/1024,0) "Effective free(MB)",
round(((max-(BYTES/1024)/1024)/max)*100,2) "FREE(%)"
from SYS.SM$TS_USED,
(select sum((BYTES/1024)/1024) total, sum((decode(MAXBYTES,0,bytes,maxbytes)/1024)/1024) max
from dba_data_files where tablespace_name='&1') where tablespace_name='&1';


+++++++++++++++++++++++++++++++++++++== LDAP

select fnd_preference.eget('#INTERNAL', 'LDAP_SYNCH','EPWD','LDAP_PWD') from dual;

+++++++++++++++++++++++++++++++++++++ package locks

select inst_id,sid,serial#,status from gv$session where sid in ( select sid from gv$access where object like '%CTS_CSS_QOT_LINES_ALL%');
select inst_id,sid,serial#,status from v$session where sid in ( select sid from v$access where object='CTS_CSS_QOT_LINES_ALL');
select inst_id,session_id from gv$locked_object where object_id=3253564


+++++++++++++++++++++++++++++++++++++ R12 URL

http://wwwin-dv2coe.cisco.com:8044/OA_HTML/dare2use.jsp

++++++++++++++++++++++++++++++++++++++++ Bulk concurrent program termination

update apps.fnd_concurrent_requests set phase_code='C',status_code='T' where concurrent_program_id= and phase_code='P' and status_code='Q'

select concurrent_program_id from apps.fnd_concurrent_programs_tl where user_concurrent_program_name like

Phase_Code :

'C', 'Completed',
'I', 'Inactive',
'P', 'Pending',
'R', 'Running',

Status_Code :

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

++++++++++++++++++++++++++++ find command usage

find . -size +1000000000c -exec ls -l {} \;
find ./ -size +1000000000c -exec ls -l {} \; hp unix
find .  -name *.trc -mtime +2 -exec ls -ltr {} \;
find ./ -size +500000000c -exec ls -l {} \;

+++++++++++++++++++++++++++ Parallel sessions that are  running

col username for a12
col "QC SID" for A6
col SID for A6
col "QC/Slave" for A10
col "Requested DOP" for 9999
col "Actual DOP" for 9999
col "slave set" for A10
set pagesize 100

SELECT DECODE(px.qcinst_id, NULL, username, ' - '||LOWER(SUBSTR(s.program, LENGTH(s.program)-4,4) ) ) "Username",
DECODE(px.qcinst_id, NULL, 'QC', '(Slave)') "QC/Slave",
TO_CHAR(px.server_set) "Slave Set",
TO_CHAR(s.sid) "SID",
DECODE(px.qcinst_id, NULL, TO_CHAR(s.sid), px.qcsid) "QC SID",
px.req_degree "Requested DOP",
px.degree "Actual DOP"
FROM v$px_session px,
v$session s
WHERE px.sid=s.sid (+)
AND px.serial#=s.serial#
ORDER BY 5, 1 DESC
/

++++++++++++++++++++++++++++++++ Disable trigger for db link

ALTER TRIGGER CISCO_DBLINKADM.DB_LINK_CHECK enable;


+++++++++++++++++++++++++++++++ checking restricted db info

SET LINESIZE 165
COLUMN "Host Name" FORMAT a20
COLUMN "Start Time" FORMAT a25
SELECT instance_number,instance_name,instance_role,host_name "Host Name",TO_CHAR(startup_time, 'DD-MON-YYYY HH24:MM:SS') "Start Time",status,logins,database_status,thread#,archiver from gv$instance;


++++++++++++++++++++++++++++++ srs services start/stop

sudo /oracle/product/crs_home/bin/crsctl stop crs
sudo /oracle/product/crs_home/bin/crsctl start crs

++++++++++++++++++++++++++++++ To check How many Redo log swithces happened on hour

select (to_char(first_time,'mm/dd')), (to_char(first_time,'HH24')), count(*)
from v$log_history
group by (to_char(first_time,'HH24'))
,(to_char(first_time,'mm/dd'))
order by 1,2 asc
/

+++++++++++++++++++++++++++++ To check you own session id
select distinct sid from v$mystat

++++++++++++++++++++++++++++++ To get SID for particular sql running

SELECT s.sid FROM   v$session s, v$sqlarea a,v$process p WHERE  s.SQL_HASH_VALUE = a.HASH_VALUE AND s.SQL_ADDRESS = a.ADDRESS AND s.PADDR = p.ADDR and  a.sql_text like '%EXTR_BE_GEO_QUAL_HIERARCHY%';

+++++++++++++++++++++++++++++++++++ DB link info
col OWNER for a15
col DB_LINK for a45
col USERNAME for a15
col HOST for a25
set linesize 120
select OWNER,DB_LINK,USERNAME,HOST from dba_db_links where DB_LINK like '%&DB_LINK_NAME%';

++++++++++++++++++++++++++++++++++++ To check concurrent Queue status

select CONCURRENT_QUEUE_NAME,max_processes,running_processes,decode(control_code,
'A','Activating',
'B','Activated',
'D','Deactivating',
'E','Deactivated',
'N','Target node/queue unavailable',
'O','Suspending concurrent manager',
'P','Suspended',
'Q','Resuming concurrent manager',
'R','Restarting',
'T','Terminating',
'U','Updating environment information',
'V','Verifying',
'X','Terminated')
from apps.fnd_concurrent_queues
where
MAX_PROCESSES <> RUNNING_PROCESSES or
(control_code is not null and control_code not in ('B','E'));


++++++++++++++++++++++++++++++++++++++++ How to enable write mode to form to add responsibtility

QUERY_ONLY="YES"

Goto Application

+++++++++++++++++++++++++++++++++++++++ Compile package body  in bulk

select 'alter ' || owner || '.' || object_name || ' compile body;' from dba_objects where object_type='PACKAGE BODY' and owner='XXCD';


+++++++++++++++++++++++++++++++++++++++++++ Get the high rbs consumption info:-

select KTUXEUSN,KTUXESIZ,KTUXESTA,KTUXECFL from x$ktuxe where KTUXESTA='ACTIVE' and KTUXESIZ>10000 order by KTUXESIZ;

Get Session info (Enter the ktuxeusn obtained from the previous query):-

SELECT s.inst_id,s.sid, s.serial#, s.username, s.program,t.xidusn,t.used_ublk, t.used_urec FROM gv$session s, gv$transaction t WHERE s.taddr = t.addr and xidusn in(&rbsn);


+++++++++++++++++++++++++++++++++++++++++++ FND_STATS usage

exec FND_STATS.GATHER_TABLE_STATS (ownname => '&owner', tabname => '&table_name', percent => 20 ,degree => 30 , granularity => 'ALL', cascade => TRUE);

------------AFOCPS8R.sql

++++++++++++++++++++++++++++++++++++++++++++ Parallism query example
Select /*+ parallel (a,32) */ * from dba_segments a;

+++++++++++++++++++++++++++++++++++++++++++++ Tablespace usage in percentage

select * from DBA_TABLESPACE_USAGE_METRICS where tablespace_name like 'OKCD1'

++++++++++++++++++++++++++++++++++++++++++++ To check form or program from sid
select FND_USER_NAME,sid,module,process,action,status,to_char(logon_time,'DD-MON-YYYY HH24:MI:SS') from apps.XXV$SESSION where sid=&amp;no;