Return-Path: <oracle-l-bounce@freelists.org>
X-Original-To: oracle-l@orafaq.com
Delivered-To: oracle-l@orafaq.com
Received: from puck1183.startdedicated.com (localhost [127.0.0.1])
 by puck1183.startdedicated.com (Postfix) with ESMTP id 43EEF1961041
 for <oracle-l@orafaq.com>; Fri, 10 Oct 2014 15:10:52 +0200 (CEST)
Received: from turing.freelists.org (freelists-180.iquest.net [206.53.239.180])
 by puck1183.startdedicated.com (Postfix) with ESMTP
 for <oracle-l@orafaq.com>; Fri, 10 Oct 2014 15:10:52 +0200 (CEST)
Received: from localhost (localhost [127.0.0.1])
 by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 7262F3199B;
 Fri, 10 Oct 2014 09:10:51 -0400 (EDT)
Authentication-Results: turing.freelists.org; dkim=fail
 (verification failed; insecure key) header.i=@gmail.com;
 dkim-adsp=none (insecure policy)
X-Virus-Scanned: Debian amavisd-new at turing.freelists.org
Received: from turing.freelists.org ([127.0.0.1])
 by localhost (turing.freelists.org [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id BJeeXN0sdngT; Fri, 10 Oct 2014 09:10:51 -0400 (EDT)
Received: from turing.freelists.org (localhost [127.0.0.1])
 by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id BD73A31990;
 Fri, 10 Oct 2014 09:10:36 -0400 (EDT)
Received: with ECARTIS (v1.0.0; list oracle-l); Fri, 10 Oct 2014 09:09:15 -0400 (EDT)
Received: from localhost (localhost [127.0.0.1])
 by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id C847E31978
 for <Oracle-L@freelists.org>; Fri, 10 Oct 2014 09:09:14 -0400 (EDT)
Received: from turing.freelists.org ([127.0.0.1])
 by localhost (turing.freelists.org [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id 3q5doJaKwfT4 for <Oracle-L@freelists.org>;
 Fri, 10 Oct 2014 09:09:14 -0400 (EDT)
Received: from mail-ig0-f177.google.com (mail-ig0-f177.google.com [209.85.213.177])
 by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 9412E31973
 for <Oracle-L@freelists.org>; Fri, 10 Oct 2014 09:08:50 -0400 (EDT)
Received: by mail-ig0-f177.google.com with SMTP id a13so2570159igq.10
        for <Oracle-L@freelists.org>; Fri, 10 Oct 2014 06:08:50 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20120113;
        h=content-type:mime-version:subject:from:in-reply-to:date:cc
         :content-transfer-encoding:message-id:references:to;
        bh=Fem/In3e+6H2dmPXk9T/xGG0/CmfcjuDZlAQ7VbTo2w=;
        b=yqkdouD6cswu9iykf4I5aN9LjiQdtllrT5ffBykucfNMMgsTE7eHXV73wNWv81YNrC
         lplsebD2eUiodpOHPgtsflMcAKMKFWj8gsfxlur3n2QOxTf3uoGwOcz/WwT7IANyCZ/i
         3jTYI06aEQIrVhPqvlaLz69ZKPIQuDhoyLeCkrYKAOtijZU59QliLEloKIiFy7JG/qsf
         EYWr8gUJYx2crqKh41M/WBQRNXPepkWPsT+On8jcUs67zF4CwE2xHflGxLmMm7mH1ops
         ggHSHczwjbuw/LoMWPn8R/NqWG9UHW2nXlnuTbotdcnqe8FRCw9Ow6hZ18A9d2+a+oBI
         UYzw==
X-Received: by 10.43.151.5 with SMTP id kq5mr3262171icc.87.1412946530100;
        Fri, 10 Oct 2014 06:08:50 -0700 (PDT)
Received: from [10.187.194.101] (mobile-166-147-101-048.mycingular.net. [166.147.101.48])
        by mx.google.com with ESMTPSA id n8sm1818139igj.9.2014.10.10.06.08.49
        for <multiple recipients>
        (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
        Fri, 10 Oct 2014 06:08:49 -0700 (PDT)
Content-Type: multipart/alternative;
 boundary=Apple-Mail-377C7766-A0FB-470F-A518-16BEAB785F7C
Mime-Version: 1.0 (1.0)
Subject: Re: Logout system trigger
From: Andrew Kerber <andrew.kerber@gmail.com>
In-Reply-To: <CAMNhnU3VLDVv8uxzic6zGmdF_uWqkkgnYb5XfDeRp2h5eYCP9A@mail.gmail.com>
Date: Fri, 10 Oct 2014 08:08:48 -0500
Cc: Fergal Taheny <ftaheny@gmail.com>,
 "rajendra.pande@ubs.com" <rajendra.pande@ubs.com>,
 "mark.powell2@hp.com" <mark.powell2@hp.com>,
 oracle-l <Oracle-L@freelists.org>,
 "jure.bratina@gmail.com" <jure.bratina@gmail.com>
Content-Transfer-Encoding: 7bit
Message-Id: <19311A05-718F-4241-8DEF-B7A9FA6E8729@gmail.com>
References: <926014D1-15A3-4A43-9CD3-D5B3647E463E@gmail.com> <85C82328-6830-4AD5-B533-A1771FF0890E@gmail.com> <1E24812FBE5611419EFAFC488D7CCDD126F0D55C@G6W2491.americas.hpqcorp.net> <D8360D9F-876E-4D3B-ACA7-91D2396C8C09@gmail.com> <CAC08BH+dHWgOMquXLS-jUtjPUigpM9FjUr+JvrrNt79yoEs-cQ@mail.gmail.com> <7E4D006EA3F0D445B62672082A16A56502E3F3E1@NSTMC703PEX.ubsamericas.net> <CAOuMUT6SFi+QCV3H5Pqgy9_s+GiT=hxHzHAuj3daYYh7TeuLXA@mail.gmail.com> <CAMNhnU3VLDVv8uxzic6zGmdF_uWqkkgnYb5XfDeRp2h5eYCP9A@mail.gmail.com>
To: Ethan Post <post.ethan@gmail.com>
X-archive-position: 56918
X-ecartis-version: Ecartis v1.0.0
Sender: oracle-l-bounce@freelists.org
Errors-to: oracle-l-bounce@freelists.org
X-original-sender: andrew.kerber@gmail.com
Precedence: normal
Reply-To: andrew.kerber@gmail.com
List-help: <mailto:ecartis@freelists.org?Subject=help>
List-unsubscribe: <oracle-l-request@freelists.org?Subject=unsubscribe>
List-software: Ecartis version 1.0.0
List-Id: oracle-l <oracle-l.freelists.org>
X-List-ID: oracle-l <oracle-l.freelists.org>
List-subscribe: <oracle-l-request@freelists.org?Subject=subscribe>
List-owner: <mailto:mark.bobak@proquest.com>
List-post: <mailto:oracle-l@freelists.org>
List-archive: <http://www.freelists.org/archives/oracle-l>
X-list: oracle-l
--Apple-Mail-377C7766-A0FB-470F-A518-16BEAB785F7C
Content-Type: text/plain;
 charset=us-ascii
Content-Transfer-Encoding: quoted-printable

Ok, I did track this down. It can be done with dbms_scheduler, but I have to=
 set the parameter use_current_session =3D> false in the call to dbms_schedu=
ler.  And here I thought a call to dbms_scheduler would automatically be in t=
he schedulers own session.

Sent from my iPhone

> On Oct 9, 2014, at 4:37 PM, Ethan Post <post.ethan@gmail.com> wrote:
>=20
> Can you lock an account while a user is connected? If no, then perhaps the=
 user is not technically disconnected and perhaps that is the issue, in that=
 case a dbms_job with a wait to ensure no more sessions connected before loc=
king is the trick.=20
>=20
>> On Thu, Oct 9, 2014 at 3:52 PM, Fergal Taheny <ftaheny@gmail.com> wrote:
>> Hi,
>>=20
>> If the autonomous transaction doesn't work (from memory i think it won't b=
ut can't remember why) but you can submit a dbms_job which locks the account=
. Submitting a dmbs_job is dml so no problem there and then the job does the=
 ddl.
>>=20
>> I have used this approach for other ddl
>> a few times and it works fine. And yeah you can use dbms_scheduler if you=
 prefer but I prefer dbms_job for one off jobs.
>>=20
>> Regards,
>> Fergal
>>=20
>>> On 9 Oct 2014 21:02, <rajendra.pande@ubs.com> wrote:
>>> Nice!!
>>>=20
>>> =20
>>>=20
>>> Maybe an autonomous transaction?
>>>=20
>>> =20
>>>=20
>>> Regards
>>>=20
>>> =20
>>>=20
>>> - Raj Pande
>>>=20
>>> UBS AG
>>>=20
>>>   Platform Services - Operations
>>>=20
>>>   Global Service Delivery (GSDM)
>>>=20
>>>   480 Washington Blvd. Jersey City, NJ 07310
>>>=20
>>>   TEL# - External - +1 201 318 7597
>>>=20
>>>              Internal - 19 436 7597
>>>=20
>>> =20
>>>=20
>>> From: oracle-l-bounce@freelists.org [mailto:oracle-l-bounce@freelists.or=
g] On Behalf Of Jure Bratina
>>> Sent: Thursday, October 09, 2014 3:58 PM
>>> To: andrew.kerber@gmail.com
>>> Cc: mark.powell2@hp.com; Oracle-L Freelists
>>> Subject: Re: Logout system trigger
>>>=20
>>> =20
>>>=20
>>> Hi,
>>>=20
>>> when tracing the session when such a trigger fires, an ORA-30511 is foun=
d in the trace:=20
>>>=20
>>> PARSING IN CURSOR #10476772 len=3D76 dep=3D1 uid=3D553 oct=3D47 lid=3D55=
3 tim=3D1412883002571503 hv=3D1931945942 ad=3D'45bd7ad0' sqlid=3D'11j0qr5tkf=
9yq'
>>> begin
>>>   execute immediate 'alter user u1 identified by a account lock';
>>> end;
>>> END OF STMT
>>> PARSE #10476772:c=3D2999,e=3D3411,p=3D0,cr=3D0,cu=3D0,mis=3D1,r=3D0,dep=3D=
1,og=3D1,plh=3D0,tim=3D1412883002571501
>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
>>> PARSING IN CURSOR #10473708 len=3D41 dep=3D2 uid=3D553 oct=3D43 lid=3D55=
3 tim=3D1412883002593638 hv=3D1975896108 ad=3D'4752a160' sqlid=3D'ca8n0fxuwb=
k1c'
>>> alter user u1 identified=20
>>> END OF STMT
>>> PARSE #10473708:c=3D0,e=3D21909,p=3D0,cr=3D0,cu=3D0,mis=3D1,r=3D0,dep=3D=
2,og=3D1,plh=3D0,tim=3D1412883002593636
>>> CLOSE #10473708:c=3D0,e=3D5,dep=3D2,type=3D0,tim=3D1412883002593965
>>> EXEC #10476772:c=3D0,e=3D22382,p=3D0,cr=3D0,cu=3D0,mis=3D0,r=3D0,dep=3D1=
,og=3D1,plh=3D0,tim=3D1412883002594025
>>> ERROR #10476772:err=3D30511 tim=3D1412883002594048
>>>=20
>>>=20
>>> $ oerr ora 30511
>>> 30511, 00000, "invalid DDL operation in system triggers"
>>> // *Cause:  An attempt was made to perform an invalid DDL operation
>>> //          in a system trigger. Most DDL operations currently are not
>>> //          supported in system triggers. The only currently supported D=
DL
>>> //          operations are table operations and ALTER?COMPILE operations=
.
>>> // *Action: Remove invalid DDL operations in system triggers.
>>>=20
>>>=20
>>> Might be because of this restriction: http://docs.oracle.com/cd/E11882_0=
1/appdev.112/e25519/triggers.htm#LNPLS797
>>> Restrictions (for BEFORE LOGOFF triggers): DDL on other objects is limit=
ed to compiling an object, creating a trigger, and creating, altering, and d=
ropping a table.
>>>=20
>>>=20
>>> Regards,
>>>=20
>>> Jure Bratina
>>>=20
>>> =20
>>>=20
>>> =20
>>>=20
>>> On Thu, Oct 9, 2014 at 9:41 PM, Andrew Kerber <andrew.kerber@gmail.com> w=
rote:
>>>=20
>>> The syntax is valid. I was just adding an extra level of complexity by c=
hanging the password again.
>>>=20
>>> Sent from my iPad
>>>=20
>>>=20
>>> > On Oct 9, 2014, at 2:02 PM, Powell, Mark <mark.powell2@hp.com> wrote:
>>> >
>>> > Shouldn't the command to lock the account just be: 'alter user my acco=
unt lock' ?
>>> >
>>> > -----Original Message-----
>>> > From: oracle-l-bounce@freelists.org [mailto:oracle-l-bounce@freelists.=
org] On Behalf Of Andrew Kerber
>>> > Sent: Thursday, October 09, 2014 12:14 PM
>>> > To: Oracle-L Freelists
>>> > Subject: Re: Logout system trigger
>>> >
>>> > Here is the trigger so far:
>>> >
>>> > create or replace trigger my_logoff_trigger before logoff on my.schema=
 declare
>>> >  sql_cmd varchar2(200);
>>> >  pwd varchar2(30);
>>> > begin
>>> >  dbms_output.enable(10000);
>>> >    update my_audit
>>> >    set logoff_time=3Dsystimestamp
>>> >    where os_pid=3D(SELECT P.SPID FROM V$PROCESS P INNER JOIN V$SESSION=
 S ON
>>> >               S.PADDR =3D P.ADDR WHERE S.AUDSID =3D sys_context('USERE=
NV', 'SESSIONID'))
>>> >    and oracle_session_id=3DSYS_CONTEXT('USERENV','SESSIONID');
>>> >    commit;
>>> >    pwd:=3Dgenerate_password();
>>> >    sql_cmd:=3D'alter user my identified by '||pwd||' account lock';
>>> >    execute immediate sql_cmd;
>>> >  end if;
>>> > exception
>>> >  when others then
>>> >  RAISE;
>>> > end;
>>> >
>>> > Sent from my iPad
>>> >
>>> >> On Oct 9, 2014, at 11:00 AM, Andrew Kerber <andrew.kerber@gmail.com> w=
rote:
>>> >>
>>> >> I am trying to create a trigger that locks an account after a user di=
sconnects.  It also writes a record to an auditing table.  It writes the rec=
ord successfully, then I use execute immediate to lock the account, but the l=
ock command seems to be ignored.  I expect there is some special processing I=
 need to do.  Does anyone have an example of how to do this?  11.2.0.4 EE on=
 Linux.
>>> >>
>>> >> Sent from my iPad
>>> > --
>>> > http://www.freelists.org/webpage/oracle-l
>>> >
>>> >
>>> > --
>>> > http://www.freelists.org/webpage/oracle-l
>>> >
>>> >
>>>=20
>>> --
>>> http://www.freelists.org/webpage/oracle-l
>>>=20
>>>=20
>>> =20
>>>=20
>>>=20
>>> Please visit our website at
>>> http://financialservicesinc.ubs.com/wealth/E-maildisclaimer.html
>>> for important disclosures and information about our e-mail
>>> policies. For your protection, please do not transmit orders
>>> or instructions by e-mail or include account numbers, Social
>>> Security numbers, credit card numbers, passwords, or other
>>> personal information.
>=20

--Apple-Mail-377C7766-A0FB-470F-A518-16BEAB785F7C
Content-Type: text/html;
 charset=utf-8
Content-Transfer-Encoding: quoted-printable

<html><head><meta http-equiv=3D"content-type" content=3D"text/html; charset=3D=
utf-8"></head><body dir=3D"auto"><div>Ok, I did track this down. It can be d=
one with dbms_scheduler, but I have to set the parameter use_current_session=
 =3D&gt; false in the call to dbms_scheduler. &nbsp;And here I thought a cal=
l to dbms_scheduler would automatically be in the schedulers own session.<br=
><br>Sent from my iPhone</div><div><br>On Oct 9, 2014, at 4:37 PM, Ethan Pos=
t &lt;<a href=3D"mailto:post.ethan@gmail.com">post.ethan@gmail.com</a>&gt; w=
rote:<br><br></div><blockquote type=3D"cite"><div><div dir=3D"ltr">Can you l=
ock an account while a user is connected? If no, then perhaps the user is no=
t technically disconnected and perhaps that is the issue, in that case a dbm=
s_job with a wait to ensure no more sessions connected before locking is the=
 trick. <br></div><div class=3D"gmail_extra"><br><div class=3D"gmail_quote">=
On Thu, Oct 9, 2014 at 3:52 PM, Fergal Taheny <span dir=3D"ltr">&lt;<a href=3D=
"mailto:ftaheny@gmail.com" target=3D"_blank">ftaheny@gmail.com</a>&gt;</span=
> wrote:<br><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;bor=
der-left:1px #ccc solid;padding-left:1ex"><p dir=3D"ltr">Hi,</p>
<p dir=3D"ltr">If the autonomous transaction doesn't work (from memory i thi=
nk it won't but can't remember why) but you can submit a dbms_job which lock=
s the account. Submitting a dmbs_job is dml so no problem there and then the=
 job does the ddl. </p>
<p dir=3D"ltr">I have used this approach for other ddl<br>
a few times and it works fine. And yeah you can use dbms_scheduler if you pr=
efer but I prefer dbms_job for one off jobs.</p>
<p dir=3D"ltr">Regards,<br>
Fergal</p>
<div class=3D"gmail_quote"><div><div class=3D"h5">On 9 Oct 2014 21:02,  &lt;=
<a href=3D"mailto:rajendra.pande@ubs.com" target=3D"_blank">rajendra.pande@u=
bs.com</a>&gt; wrote:<br type=3D"attribution"></div></div><blockquote class=3D=
"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-=
left:1ex"><div><div class=3D"h5"><div link=3D"blue" vlink=3D"purple" lang=3D=
"EN-US"><div><p class=3D"MsoNormal"><span style=3D"font-size:11.0pt;font-fam=
ily:&quot;Tahoma&quot;,&quot;sans-serif&quot;;color:#002060">Nice!! <u></u><=
u></u></span></p><p class=3D"MsoNormal"><span style=3D"font-size:11.0pt;font=
-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;;color:#002060"><u></u>&nbs=
p;<u></u></span></p><p class=3D"MsoNormal"><span style=3D"font-size:11.0pt;f=
ont-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;;color:#002060">Maybe an=
 autonomous transaction?<u></u><u></u></span></p><p class=3D"MsoNormal"><spa=
n style=3D"font-size:11.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&=
quot;;color:#002060"><u></u>&nbsp;<u></u></span></p><p class=3D"MsoNormal"><=
span style=3D"font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-ser=
if&quot;;color:#002060">Regards </span><span style=3D"font-size:11.0pt;font-=
family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#002060"><u></u><u><=
/u></span></p><p class=3D"MsoNormal"><span style=3D"font-size:11.0pt;font-fa=
mily:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#002060">&nbsp;<u></u>=
<u></u></span></p><p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;fon=
t-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;;color:#002060">- Raj Pand=
e</span><span style=3D"font-size:11.0pt;font-family:&quot;Calibri&quot;,&quo=
t;sans-serif&quot;;color:#002060"><u></u><u></u></span></p><p class=3D"MsoNo=
rmal"><span style=3D"font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;s=
ans-serif&quot;;color:#002060">UBS AG</span><span style=3D"font-size:11.0pt;=
font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#002060"><u></u=
><u></u></span></p><p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;fo=
nt-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;;color:#002060">&nbsp;&nb=
sp;Platform Services - Operations </span><span style=3D"font-size:11.0pt;fon=
t-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#002060"><u></u><u=
></u></span></p><p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-=
family:&quot;Tahoma&quot;,&quot;sans-serif&quot;;color:#002060">&nbsp; Globa=
l Service Delivery (GSDM) </span><span style=3D"font-size:11.0pt;font-family=
:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#002060"><u></u><u></u></s=
pan></p><p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:&=
quot;Tahoma&quot;,&quot;sans-serif&quot;;color:#002060">&nbsp; 480 Washingto=
n Blvd. Jersey City, NJ 07310</span><span style=3D"font-size:11.0pt;font-fam=
ily:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#002060"><u></u><u></u>=
</span></p><p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-famil=
y:&quot;Tahoma&quot;,&quot;sans-serif&quot;;color:#002060">&nbsp; TEL# - Ext=
ernal - <a href=3D"tel:%2B1%20201%20318%207597" value=3D"+12013187597" targe=
t=3D"_blank">+1 201 318 7597</a></span><span style=3D"font-size:11.0pt;font-=
family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#002060"><u></u><u><=
/u></span></p><p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-fa=
mily:&quot;Tahoma&quot;,&quot;sans-serif&quot;;color:#002060">&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Internal - 19 436=
 7597</span><span style=3D"font-size:11.0pt;font-family:&quot;Calibri&quot;,=
&quot;sans-serif&quot;;color:#002060"><u></u><u></u></span></p><p class=3D"M=
soNormal"><span style=3D"font-size:11.0pt;font-family:&quot;Tahoma&quot;,&qu=
ot;sans-serif&quot;;color:#002060"><u></u>&nbsp;<u></u></span></p><p class=3D=
"MsoNormal"><b><span style=3D"font-size:10.0pt;font-family:&quot;Tahoma&quot=
;,&quot;sans-serif&quot;">From:</span></b><span style=3D"font-size:10.0pt;fo=
nt-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;"> <a href=3D"mailto:orac=
le-l-bounce@freelists.org" target=3D"_blank">oracle-l-bounce@freelists.org</=
a> [mailto:<a href=3D"mailto:oracle-l-bounce@freelists.org" target=3D"_blank=
">oracle-l-bounce@freelists.org</a>] <b>On Behalf Of </b>Jure Bratina<br><b>=
Sent:</b> Thursday, October 09, 2014 3:58 PM<br><b>To:</b> <a href=3D"mailto=
:andrew.kerber@gmail.com" target=3D"_blank">andrew.kerber@gmail.com</a><br><=
b>Cc:</b> <a href=3D"mailto:mark.powell2@hp.com" target=3D"_blank">mark.powe=
ll2@hp.com</a>; Oracle-L Freelists<br><b>Subject:</b> Re: Logout system trig=
ger<u></u><u></u></span></p><p class=3D"MsoNormal"><u></u>&nbsp;<u></u></p><=
div><div><div><p class=3D"MsoNormal" style=3D"margin-bottom:12.0pt">Hi,<u></=
u><u></u></p></div><p class=3D"MsoNormal" style=3D"margin-bottom:12.0pt">whe=
n tracing the session when such a trigger fires, an ORA-30511 is found in th=
e trace: <br><br><span style=3D"font-family:&quot;Courier New&quot;">PARSING=
 IN CURSOR #10476772 len=3D76 dep=3D1 uid=3D553 oct=3D47 lid=3D553 tim=3D141=
2883002571503 hv=3D1931945942 ad=3D'45bd7ad0' sqlid=3D'11j0qr5tkf9yq'<br>beg=
in<br>&nbsp; execute immediate 'alter user u1 identified by a account lock';=
<br>end;<br>END OF STMT<br>PARSE #10476772:c=3D2999,e=3D3411,p=3D0,cr=3D0,cu=
=3D0,mis=3D1,r=3D0,dep=3D1,og=3D1,plh=3D0,tim=3D1412883002571501<br>=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D<br>PARSING IN CURSOR #=
10473708 len=3D41 dep=3D2 uid=3D553 oct=3D43 lid=3D553 tim=3D141288300259363=
8 hv=3D1975896108 ad=3D'4752a160' sqlid=3D'ca8n0fxuwbk1c'<br>alter user u1 i=
dentified <br>END OF STMT<br>PARSE #10473708:c=3D0,e=3D21909,p=3D0,cr=3D0,cu=
=3D0,mis=3D1,r=3D0,dep=3D2,og=3D1,plh=3D0,tim=3D1412883002593636<br>CLOSE #1=
0473708:c=3D0,e=3D5,dep=3D2,type=3D0,tim=3D1412883002593965<br>EXEC #1047677=
2:c=3D0,e=3D22382,p=3D0,cr=3D0,cu=3D0,mis=3D0,r=3D0,dep=3D1,og=3D1,plh=3D0,t=
im=3D1412883002594025<br>ERROR #10476772:<b>err=3D30511</b> tim=3D1412883002=
594048</span><br><br><br><span style=3D"font-family:&quot;Courier New&quot;"=
>$ oerr ora 30511<br>30511, 00000, "invalid DDL operation in system triggers=
"<br>// *Cause:&nbsp; An attempt was made to perform an invalid DDL operatio=
n<br>//&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; in a system tr=
igger. Most DDL operations currently are not<br>//&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp;&nbsp; supported in system triggers. The only currentl=
y supported DDL<br>//&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; o=
perations are table operations and ALTER?COMPILE operations.<br>// *Action: R=
emove invalid DDL operations in system triggers.</span><br><br><u></u><u></u=
></p></div><p class=3D"MsoNormal">Might be because of this restriction: <a h=
ref=3D"http://goog_1416375729" target=3D"_blank">h</a><a>ttp://docs.oracle.c=
om/cd/E11882_01/appdev.112/e25519/triggers.htm#LNPLS797</a><br>Restrictions (=
for BEFORE LOGOFF triggers): DDL on other objects is limited to compiling an=
 object, creating a trigger, and creating, altering, and dropping a table.<u=
></u><u></u></p><div><p class=3D"MsoNormal"><br>Regards,<u></u><u></u></p></=
div><div><p class=3D"MsoNormal">Jure Bratina<u></u><u></u></p></div><div><p c=
lass=3D"MsoNormal"><u></u>&nbsp;<u></u></p></div></div><div><p class=3D"MsoN=
ormal"><u></u>&nbsp;<u></u></p><div><p class=3D"MsoNormal">On Thu, Oct 9, 20=
14 at 9:41 PM, Andrew Kerber &lt;<a href=3D"mailto:andrew.kerber@gmail.com" t=
arget=3D"_blank">andrew.kerber@gmail.com</a>&gt; wrote:<u></u><u></u></p><p c=
lass=3D"MsoNormal">The syntax is valid. I was just adding an extra level of c=
omplexity by changing the password again.<br><br>Sent from my iPad<u></u><u>=
</u></p><div><div><p class=3D"MsoNormal"><br>&gt; On Oct 9, 2014, at 2:02 PM=
, Powell, Mark &lt;<a href=3D"mailto:mark.powell2@hp.com" target=3D"_blank">=
mark.powell2@hp.com</a>&gt; wrote:<br>&gt;<br>&gt; Shouldn't the command to l=
ock the account just be: 'alter user my account lock' ?<br>&gt;<br>&gt; ----=
-Original Message-----<br>&gt; From: <a href=3D"mailto:oracle-l-bounce@freel=
ists.org" target=3D"_blank">oracle-l-bounce@freelists.org</a> [mailto:<a hre=
f=3D"mailto:oracle-l-bounce@freelists.org" target=3D"_blank">oracle-l-bounce=
@freelists.org</a>] On Behalf Of Andrew Kerber<br>&gt; Sent: Thursday, Octob=
er 09, 2014 12:14 PM<br>&gt; To: Oracle-L Freelists<br>&gt; Subject: Re: Log=
out system trigger<br>&gt;<br>&gt; Here is the trigger so far:<br>&gt;<br>&g=
t; create or replace trigger my_logoff_trigger before logoff on my.schema de=
clare<br>&gt;&nbsp; sql_cmd varchar2(200);<br>&gt;&nbsp; pwd varchar2(30);<b=
r>&gt; begin<br>&gt;&nbsp; dbms_output.enable(10000);<br>&gt;&nbsp; &nbsp; u=
pdate my_audit<br>&gt;&nbsp; &nbsp; set logoff_time=3Dsystimestamp<br>&gt;&n=
bsp; &nbsp; where os_pid=3D(SELECT P.SPID FROM V$PROCESS P INNER JOIN V$SESS=
ION S ON<br>&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;S.PAD=
DR =3D P.ADDR WHERE S.AUDSID =3D sys_context('USERENV', 'SESSIONID'))<br>&gt=
;&nbsp; &nbsp; and oracle_session_id=3DSYS_CONTEXT('USERENV','SESSIONID');<b=
r>&gt;&nbsp; &nbsp; commit;<br>&gt;&nbsp; &nbsp; pwd:=3Dgenerate_password();=
<br>&gt;&nbsp; &nbsp; sql_cmd:=3D'alter user my identified by '||pwd||' acco=
unt lock';<br>&gt;&nbsp; &nbsp; execute immediate sql_cmd;<br>&gt;&nbsp; end=
 if;<br>&gt; exception<br>&gt;&nbsp; when others then<br>&gt;&nbsp; RAISE;<b=
r>&gt; end;<br>&gt;<br>&gt; Sent from my iPad<br>&gt;<br>&gt;&gt; On Oct 9, 2=
014, at 11:00 AM, Andrew Kerber &lt;<a href=3D"mailto:andrew.kerber@gmail.co=
m" target=3D"_blank">andrew.kerber@gmail.com</a>&gt; wrote:<br>&gt;&gt;<br>&=
gt;&gt; I am trying to create a trigger that locks an account after a user d=
isconnects.&nbsp; It also writes a record to an auditing table.&nbsp; It wri=
tes the record successfully, then I use execute immediate to lock the accoun=
t, but the lock command seems to be ignored.&nbsp; I expect there is some sp=
ecial processing I need to do.&nbsp; Does anyone have an example of how to d=
o this?&nbsp; 11.2.0.4 EE on Linux.<br>&gt;&gt;<br>&gt;&gt; Sent from my iPa=
d<br>&gt; --<br>&gt; <a href=3D"http://www.freelists.org/webpage/oracle-l" t=
arget=3D"_blank">http://www.freelists.org/webpage/oracle-l</a><br>&gt;<br>&g=
t;<br>&gt; --<br>&gt; <a href=3D"http://www.freelists.org/webpage/oracle-l" t=
arget=3D"_blank">http://www.freelists.org/webpage/oracle-l</a><br>&gt;<br>&g=
t;<u></u><u></u></p></div></div><p class=3D"MsoNormal" style=3D"margin-botto=
m:12.0pt">--<br><a href=3D"http://www.freelists.org/webpage/oracle-l" target=
=3D"_blank">http://www.freelists.org/webpage/oracle-l</a><br><br><u></u><u><=
/u></p></div><p class=3D"MsoNormal"><u></u>&nbsp;<u></u></p></div></div></di=
v><br></div></div>Please visit our website at<br>
<a href=3D"http://financialservicesinc.ubs.com/wealth/E-maildisclaimer.html"=
 target=3D"_blank">http://financialservicesinc.ubs.com/wealth/E-maildisclaim=
er.html</a><br>
for important disclosures and information about our e-mail<br>
policies. For your protection, please do not transmit orders<br>
or instructions by e-mail or include account numbers, Social<br>
Security numbers, credit card numbers, passwords, or other<br>
personal information.<br></blockquote></div>
</blockquote></div><br></div>
</div></blockquote></body></html>=

--Apple-Mail-377C7766-A0FB-470F-A518-16BEAB785F7C--
--
http://www.freelists.org/webpage/oracle-l


