Re: adrci getting access denied trying to delete a file

From: Niall Litchfield <niall.litchfield_at_gmail.com>
Date: Wed, 1 Jun 2011 14:55:18 +0100
Message-ID: <BANLkTi=TjCSvfCp8Xu+cCTC8UwoaBSrOow_at_mail.gmail.com>



That likely means that a background process has the trace file open (if it's a background trace) or else that someone has some form of tracing enabled in their session. In general oracle trace files have an indicator of the os pid in their name on Windows that corresponds to the thread id.

In sqlplus if you have this information you can query v$session and v$process using a query like the one below to find out who is running the session.

/*

Name: GetProcessDetails

Purpose: Script to obtain activity of High CPU os processes/threads

*/

col sql_text format a30 wrapped
col event format a30 wrapped
set lines 120

ACCEPT OSPID PROMPT 'Enter PID/TID of Process to examine '

select
sess.sid

, sess.serial#
, s.sql_text
, sess.event
, decode(sess.wait_time,0,sess.seconds_in_wait,sess.wait_time) time_waited
, decode(sess.wait_time,0,'Waiting','Waited') State
from
v$process p
join v$session sess
on (p.addr = sess.paddr)
left outer join v$sql s
on (s.sql_id = sess.sql_id) --10gr1 and above where
p.spid = &OSPID;

(should work on all versions from 10gR1 up when sql_id made it into v$session. )

If there is no 'process' in v$process with that id then have a look in the thread tab of process explorer - you are looking for a thread with that TID. Process Explorer gives you the option to kill the thread - but this is a nuclear option a bit like killing a unix process with kill -9. Obviously if it's a user trace and shows up in dba_enabled_traces then stopping the trace would be the clean way to do this.

If the trace file name belongs to a background job or other background process more care is needed.

On Wed, Jun 1, 2011 at 2:07 PM, Jeffrey Beckstrom <JBECKSTROM_at_gcrta.org>wrote:

> I ran Process Explorer from Sysinternals/Microsoft and did a find for
> F:\oracle\diag. The problem file shows up as belonging to the oracle.exe
> process. How can I make Oracle close the file?
> ++++++++++++++
> adrci is tring to delete a *diag* trace file and is getting access denied.
> This is happening on multiple databases on multiple servers. Right clicking
> a file in this directory and selecting properties gives you a "security"
> tab. However, the *diag* files only have a "general" tab. How can I
> determine what is locking the file?
>
>
> Jeffrey Beckstrom
> Database Administrator
> Greater Cleveland Regional Transit Authority
> Information Systems
> 1240 W. 6th Street
> Cleveland, Ohio 44113
>

-- 
Niall Litchfield
Oracle DBA
http://www.orawin.info

--
http://www.freelists.org/webpage/oracle-l
Received on Wed Jun 01 2011 - 08:55:18 CDT

Original text of this message