Quantcast
Channel: Doyensys Allappsdba Blog..
Viewing all 1640 articles
Browse latest View live

Script to know the status of jobs Currently Running

$
0
0
SETPAUSEON
SETPAUSE'Press Return to Continue'
SETPAGESIZE60
SETLINESIZE300
SETVERIFYOFF

SELECTa.job"Job",
a.sid,
a.failures"Failures",
Substr(To_Char(a.last_date,'DD-Mon-YYYY HH24:MI:SS'),1,20)"Last Date",
Substr(To_Char(a.this_date,'DD-Mon-YYYY HH24:MI:SS'),1,20)"This Date"
FROMdba_jobs_runninga
/

Script to know the disk file operations

$
0
0
SETPAUSEON
SETPAUSE'Press Return to Continue'
SETPAGESIZE60
SETLINESIZE300
COLUMN"File Type"fora20
COLUMN"File Operation"fora80

select
decode(p3,0 ,'Other',
1 ,'Control File',
2 ,'Data File',
3 ,'Log File',
4 ,'Archive Log',
6 ,'Temp File',
9 ,'Data File Backup',
10,'Data File Incremental Backup',
11,'Archive Log Backup',
12,'Data File Copy',
17,'Flashback Log',
18,'Data Pump Dump File',
'unknown '||p3)"File Type",
decode(p1,1 ,'file creation',
2 ,'file open',
3 ,'file resize',
4 ,'file deletion',
5 ,'file close',
6 ,'wait for all aio requests to finish',
7 ,'write verification',
8 ,'wait for miscellaneous io (ftp, block dump, passwd file)',
9 ,'read from snapshot files',
'unknown '||p1)"File Operation",
decode(p3,2,-1,p2)file#,
count(*)
fromdba_hist_active_sess_history
whereevent ='Disk file operations I/O'
groupbyp1,p3,
decode(p3,2,-1,p2)
/

Number of accounts with passwords that have never been changed

$
0
0


select count(*) from sys.user$
where user# in (select user_id from dba_users
where account_status = 'OPEN')
and (
(ptime is null)
or
(ptime is not null
and ptime <= ctime)
);

Oldest Password Change Time

$
0
0
select min(ptime) from sys.user$
where user# in (select user_id from dba_users
where account_status = 'OPEN')
and ptime is not null
and ptime > ctime;

How to purge/flush a single SQL PLAN from shared pool in Oracle

$
0
0


Purging a SQL PLAN from shared pool is not a frequent activity , we generally do it when a query is constantly picking up the bad plan and we want the sql to go for a hard parse next time it runs in database.

Obviously we can pass a hint in the query to force it for a Hard Parse but that will require a change in query , indirectly change in the application code , which is generally not possible in a business critical application.

We can flush the entire shared pool but that will invalidate all the sql plans available in the database and all sql queries will go for a hard parse. Flushing shared pool can have adverse affect on your database performance.

Flush the entire shared pool :-

Alter system flush shared_pool;

Flushing a single SQL plan from database will require certain details for that sql statement like address of the handle and hash value of the cursor holding the SQL plan.

Steps to Flush/purge a particular sql plan from Shared pool :-

SQL>  select ADDRESS, HASH_VALUE from GV$SQLAREA where SQL_ID like '';

ADDRESS   HASH_VALUE
---------------- ----------
000000085FD77CF0  808321886

Now we have the address of the handle and hash value of the cursor holding the sql. Flush this from shared pool.

SQL> exec DBMS_SHARED_POOL.PURGE ('000000085FD77CF0, 808321886', 'C');

PL/SQL procedure successfully completed.

SQL>  select ADDRESS, HASH_VALUE from GV$SQLAREA where SQL_ID like '';

no rows selected

SQL plan flushed for above particlar sql, Now next time above sql/query will go for a hard parse in database.

Article 4

$
0
0
                                     Query to check the concurrent manager lock 


This query is used for finding out the concurrent manager locks when shutdown takes long time to down the ICM/CM . Mostly we find this type of locks in RAC ebs setup environments.



Query
--------

SELECT gv$access.sid, gv$session.serial#,gv$session.inst_id,gv$session.status,gv$session.process  FROM gv$session,gv$access WHERE gv$access.sid = gv$session.sid and gv$access.object ='FND_CP_FNDSM' GROUP BY gv$access.sid, gv$session.serial#,gv$session.inst_id,gv$session.status,gv$session.process;

Article 3

$
0
0
                                                   

                                                             Library cache lock



What is  "Library cache lock" ?

This event controls the concurrency between clients of the library cache. It acquires a lock on the object handle so that either:
  • One client can prevent other clients from accessing the same object.
  • The client can maintain a dependency for a long time (for example, so that no other client can change the object).
This lock is also obtained to locate an object in the library cache.
Library cache lock will be obtained on database objects referenced during parsing or compiling of SQL or PL/SQL statements (table, view, procedure, function, package, package body, trigger, index, cluster, synonym). The lock will be released at the end of the parse or compilation.

Cursors (SQL and PL/SQL areas), pipes and any other transient objects do not use this lock.
Library cache lock is not deadlock sensitive and the operation is synchronous.

Parameters:
  • handle address:
    Address of the object being loaded.
  • lock address:
    Address of the load lock being used. This is not the same thing as a latch or an enqueue, it is a State Object.
  • Mode:
    Indicates the data pieces of the object which need to be loaded.
  • Namespace:
    The name of the object namespace as it is displayed in V$DB_OBJECT_CACHE view

While deploying/Compiling PL/SQL package or spec no response/hangs on current session

$
0
0
Issue:

While deploying/Compiling PL/SQL package or spec no response/hangs on current session

If you find the session details for your session the event will be as " Library Cache Load Lock"

SQL> alter PACKAGE "APPS".XXXS_XXXR compile body;
^C
Warning: Package Body altered with compilation errors.

We need to interrupt the session to get out from this session.

Cause:

This is mainly because of the package body which is in use with some other on going programs

we cannot find this as blocking session

We need to find by finding sql_text from v$sql related to package body

Solution:

Just wait the process to complete or kill the process and try to compile the body again

SQL> alter PACKAGE "APPS".XXXS_XXXR compile body;

Package body altered.

SQL> show errors;
No errors.

EBS 12.2 adcfgclone.pl on AP Tier failed with ERROR: Script failed, exit code 255 when creating new wls domain

$
0
0
ERROR

Creating new WLS domain.
Running /app/xxx/fs1/FMW_Home/oracle_common/bin/pasteConfig.sh -javaHome /app/xxx/fs1/EBSapps/comn/clone/FMW/t2pjdk -al /app/xxx/fs1/EBSapps/comn/clone/FMW/WLS/EBSdomain.jar -tdl /app/xxx/fs1/FMW_Home/user_projects/domains/EBS_domain_xxx -tmw /app/xxx/fs1/FMW_Home -mpl /app/xxx/fs1/EBSapps/comn/clone/FMW/WLS/plan/moveplan.xml -ldl /app/xxx/fs1/inst/apps/xxx_xxx/admin/log/clone/wlsT2PApply -silent true -domainAdminPassword /app/xxx/fs1/EBSapps/comn/clone/FMW/tempinfo.txt
Script Executed in 4712761 milliseconds, returning status 255
Script failed, exit code 255

Cause:

file already available in patch directory

for example fmw_home,inst etc..

Solution:

Remove below directory and try to the adcfgclone.pl again

oraInst.loc

xxxx/fs2/FMw_home

xxxx/fs2/inst

Reference - Doc ID 1986208.1

EBS 12.2 adcfgclone.pl on AP Tier failed with ERROR: Script failed, exit code 255 when creating new wls domain

UDE-31623: operation generated ORACLE error 31623

$
0
0
Issue:

UDE-31623: operation generated ORACLE error 31623

oracle@SAMPLEEBS:~$  expdp oracle/XXXX schemas=Something  directory=DUMP_DIR dumpfile=something.dmp logfile=something.log

Export: Release 12.1.0.2.0 - Production on Sat Jan 16 14:43:03 2016

Copyright (c) 1982, 2014, Oracle and/or its affiliates.  All rights reserved.

Connected to: Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options

UDE-31623: operation generated ORACLE error 31623
ORA-31623: a job is not attached to this session via the specified handle
ORA-06512: at "SYS.DBMS_DATAPUMP", line 3905
ORA-06512: at "SYS.DBMS_DATAPUMP", line 5203
ORA-06512: at line 1

Cause:

its because stream pool issue

SQL> show parameter streams_pool_size;

NAME                                 TYPE             VALUE
------------------------------------ ----------- ------------------------------
streams_pool_size                    big integer      0


Solution:

keep some value to the streams parameter

SQL> alter system set streams_pool_size=1G scope=both;

System altered.

Retest the issue.

Reusable Component - Script to Identify previous day job failure list.

$
0
0


/*This query gives previous day  job failure list*/


SELECT   j.name [Job Name],
         h.step_id [Step_ID],
         h.step_name [Step Name],
         h.run_date [Run Date],
         h.run_time [Run Time],
         h.sql_severity [SQL_Severity],
         h.message [Error Message]
FROM     msdb.dbo.sysjobhistory h
         INNER JOIN msdb.dbo.sysjobs j
         ON h.job_id = j.job_id
         INNER JOIN msdb.dbo.sysjobsteps s
         ON j.job_id = s.job_id
         AND h.step_id = s.step_id
WHERE    h.run_status = 0 -- Failure
and CAST(CONVERT(VARCHAR, h.run_date) + '' + STUFF(STUFF(RIGHT('000000'+ CONVERT(VARCHAR,h.run_time),6),5,0,':'),3,0,':') AS DATETIME)
between dateadd(DD, -01,getdate()) and getdate()
ORDER BY h.instance_id DESC  

Reusable Components - Script to Identify Blocking and Missing Indexes in SQL Server.

$
0
0



Max Blocks
--NOTE: From the results in the below script, pick out the Stored Proc from the parent query and
--underlying tables from the individual query columns..

SELECT TOP 10
[Average Time Blocked] = (total_elapsed_time - total_worker_time) / qs.execution_count
,[Total Time Blocked] = total_elapsed_time - total_worker_time
,[Execution count] = qs.execution_count
,[Individual Query] = SUBSTRING (qt.text,qs.statement_start_offset/2,
(CASE WHEN qs.statement_end_offset = -1
THEN LEN(CONVERT(NVARCHAR(MAX), qt.text)) * 2
ELSE qs.statement_end_offset END - qs.statement_start_offset)/2)
,[Parent Query] = qt.text
,DatabaseName = DB_NAME(qt.dbid)

FROM sys.dm_exec_query_stats qs
CROSS APPLY sys.dm_exec_sql_text(qs.sql_handle) as qt
--WHERE qt.dbid IN(35,39) ---Chg db_id as reqd.or completely comment the where filter

ORDER BY [Average Time Blocked] DESC;

--Missing Index count

SELECT
@@servername as ServerName
,DatabaseName = DB_NAME(database_id)
,[Number Indexes Missing] = count(*)
,[Date Captured] = getdate()

FROM sys.dm_db_missing_index_details
--WHERE database_id IN(35,39)
GROUP BY DB_NAME(database_id)
ORDER BY 2 DESC;

Enable/Add new langauge in Oracle Apps R12

$
0
0
Enable/Add new langauge in Oracle Apps R12

1. Check the Character set whether new language you are enabling is supporing or not? 

2. Activate new language from License Manager from Oracle Application Manager

3. Check from the tables, new language is activated or not?

SQL> select NLS_LANGUAGE from FND_LANGUAGES where INSTALLED_FLAG in ('B','I');

NLS_LANGUAGE
------------------------------
AMERICAN
SPANISH
FRENCH

4. Run Maintain Multi-lingual Tables from Adadmin

5. Run Maintain Snapshot information from Adadmin

6. Run the Translation Synchronization Patch utility (adgennls.pl) using below command

 perl $AD_TOP/bin/adgennls.pl

 The manifest generated from the tool is located at : $APPL_TOP/admin/$TWO_TASK/out/adgennls.txt

7. After you generate your manifest, you can go to http://updates.oracle.com/TransSync (use your My Oracle Support username and password).
   Follow the instructions on the screen to upload the manifest file. A Translation synchronization patch will be generated specifically based    on your manifest for each of your active language. The patch will synchronize the language file versions and American English file versions    in your Applications instance.

8. Install the Release 12 NLS Help for the new language (optional)

How to use FND debug Log

$
0
0



Step 1: Set up profiles for the User / Responsibility to be used to reproduce the issue

FND: Debug Log Enabled -> YES This turns the debugging feature on
FND: Debug Log Filename -> NULL Use when you want debug messages to get stored to a file FND: Debug Log Level -> STATEMENT
FND: Debug log module -> %
If the error pertains to a specific module use the application short name.
Ex: For receivable use FND: Debug log module -> ar%

Log into the Oracle application

Step 2: Since the debugging routine will start writing messages to the table, we want to know which messages pertain to our test. If you are tracking the debug messages for a concurrent request, note down the Concurrent Request id. Otherwise, note down current max value of log sequence retrieved as follows :

SELECT MAX(LOG_SEQUENCE) FROM FND_LOG_MESSAGE 

Step 3: Run the test case, avoiding extraneous steps to avoid stacking the table.

Step 4:

a) For a concurrent process:

  SELECT LOG.module, LOG.MESSAGE_TEXT MESSAGE
    FROM fnd_log_messages LOG, fnd_log_transaction_context con
   WHERE     request_id = <Conc Req ID>
         AND con.transaction_type = 'REQUEST'
         AND con.transaction_context_id = LOG.transaction_context_id
ORDER BY LOG.log_sequence;


b) For any other debugging:

SELECT module, MESSAGE_TEXT
  FROM fnd_log_messages
 WHERE log_sequence = (SELECT MAX (LOG_SEQUENCE) FROM FND_LOG_MESSAGE);


 Obtaining the log messages via Oracle Application:

1) Query Profile: %FND%DEBUG%
2) Set the FND: Debug Log Enabled: Yes

3) System Administrator > Help > Debug Logging > View
4) set the values and run any concurrent program
 

5) Then navigate to the above screen and download the complete fnd log messages report by exporting as a CSV.

ORA-04062: signature of package APPS.FND_DATE has been changed APP-FND-01926

$
0
0


ORA-04062: signature of package APPS.FND_DATE has been changed APP-FND-01926


Solution :
=======

There is a de-synchronization in the time stamps between the package FND_DATE
and the program that called it so you need to re-synchronize all.

To implement the solution, please execute the following steps:

Stop your Midle Tier Services : adstpall.sh

1. Stop/restart the database.

2. Recreate the APPS.FND_DATE package:
From Uinx with applmgr user
cd $FND_TOP/patch/115/sql
sqlplus apps/… @AFDDATES.pls
sqlplus apps/… @AFDDATEB.pls

3. Run adadmin / Compile Apps Schema.

4. Restart your middle Tier Services : Retest the issue.



ORA-00955: name is already used by an existing object

$
0
0
ORA-00955: name is already used by an existing object"
 
Issue
The utl_recomp package errors out trying to compile invalids


SQL> exec sys.utl_recomp.recomp_parallel(20);


BEGIN SYS.UTL_RECOMP.RECOMP_PARALLEL;END;
*
ERROR at line 1:
ORA-00955: name is already used by an existing object
ORA-06512: at "SYS.UTL_RECOMP", line 662
ORA-06512: at "SYS.UTL_RECOMP", line 715
ORA-06512: at line 1


Cause
Bug:9881143 where an index is left from a previous failed execution of utl_recomp.  The following commands can be used to generate a trace file to verify.

alter session set events '955 trace name errorstack level 3';
exec sys.utl_recomp.recomp_parallel(20);



Solution

 
Drop the index utl_recomp_comp_idx1 left by utl_recomp and then rerun the package.

sqlplus / as sysdba
drop index utl_recomp_comp_idx1;
exec sys.utl_recomp.recomp_parallel(20);

adopmnctl.sh: exiting with status 206

$
0
0
ERROR:
 adopmnctl.sh: exiting with status 206

If we face issue while starting opmn managed services like

opmnctl startall

adopmnctl.sh: exiting with status 206

Solution:

 Step 1. cd $ORA_CONFIG_HOME/10.1.3/j2ee/oacore/persistence/
 Step 2. rm -rf *
 Step 3. Repeat the above step for oafm.
              The path will be cd $ORA_CONFIG_HOME/10.1.3/j2ee/oafm/persistence/

  Restart middle tier:

REP-0069: Internal error REP-57054: In-process job terminated:Finished successfully but output is voided

$
0
0
When any concurrent requests with the execution method Oracle Reports are submitted, temp files are created under the path of

$INST_TOP/logs/ora/10.1.2/reports/cache

These files are not purged with the "Purge Concurrent Request and/or Manager Data" program.These files can be deleted manually.

Sometimes, concurrent programs fail with following error message

"REP-0069: Internal error
REP-57054: In-process job terminated:Finished successfully but output is voided"

As workaround , setting cachesize parameter to value bigger than 0 can be used. But this workaround disables Cache cleanup functionality which is deletion of temp report file after Concurrent request completed successfully.So manual cleanup of cache will be needed.

According to Metalink Note : 1237834.1 permanent fix is as follow,

1. Apply Patch 14374587

2. Add the following property names and values into $INST_TOP/ora/10.1.2/reports/conf/rwbuilder.conf

<property name="cacheSize" value="0"/>
<property name="noVoidedOutputError" value="yes"/>

With patch and setting these properties , accumulation of temp files are prevented.

3. But Autoconfig will overwrite above these changes when executed.To prevent this ,

a. Create custom directory under $FND_TOP/admin/template
    mkdir $FND_TOP/admin/template/custom

b. Copy $FND_TOP/admin/template/rwbuilder_conf_1012.tmp to this new directory
    cp $FND_TOP/admin/template/rwbuilder_conf_1012.tmp $FND_TOP/admin/template/custom

c. Add same entries into rwbuilder_conf_1012.tmp as above

   <property name="cacheSize" value="0"/>
   <property name="noVoidedOutputError" value="yes"/>

PRC: Update Project Summary Amounts ends in error ORA-01400

$
0
0
PRC: Update Project Summary Amounts ends in error ORA-01400

On a Test instance where the issue exists please apply the steps below:

1) Backup the data:

Create table CDL_BLP as select * from pa_cost_distribution_lines_all where
project_id in (305,307);

2) Update the CDL records:

Update pa_cost_distribution_lines_all set GL_PERIOD_NAME = PA_PERIOD_NAME,
RECVR_GL_PERIOD_NAME = RECVR_PA_PERIOD_NAME
where EXPENDITURE_ITEM_ID in (118676, 118677, 118683, 118684, 118685, 118688,
118680, 118674, 118689, 118675, 118686, 118679,
118681, 118682, 118678, 118687) and GL_PERIOD_NAME is null and
RECVR_GL_PERIOD_NAME is null;

COMMIT;

3) Now run the PRC: Update Project Summary Amounts and confirm the results.

4) Migrate the solution on the appropriate environments
   
     

ORA-12537:Tns connection Closed in Toad

$
0
0
Error

ORA-12537 TNS:connection closed

 Cause:

* In the Sqlnet.ora file the parameter TCP.VALIDNODE_CHECKING is enabled and TCP.INVITEDNODES is set to some specific IP's of the Client Machine.

Solution:

Comment the following line in sqlnet.ora and  try again or restart the listener

          tcp.validnode_checking = yes
Viewing all 1640 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>