FWIW, do not place the terminating semicolon in the execute string, ie,

begin
  execute immediate 'Alter session set OPTIMIZER_MODE = choose' ;
end ;
/



Ron Thomas
Hypercom, Inc
[EMAIL PROTECTED]
Each new user of a new system uncovers a new class of bugs. -- Kernighan


                                                                                       
                                    
                      [EMAIL PROTECTED]                                                 
                                    
                                               To:       [EMAIL PROTECTED]          
                                    
                      10/03/02 02:43 AM        cc:                                     
                                    
                      Please respond to        Subject:  RE: logon trigger             
                                    
                      ORACLE-L                                                         
                                    
                                                                                       
                                    
                                                                                       
                                    




Hi all





Ok if I execute these commands/SQL in sqlplus it works. When I add to the trigger for 
after logon it
does not work.





I get the feeling it is only valid for the current block, begin ->  End.





Any ideas to work around this.





grant alter session to smload;





drop trigger olap_logon_trigger;


create or replace trigger olapl_logon_trigger


  after logon on smload.schema


begin


  execute immediate 'Alter session enable parallel query;';


  execute immediate 'Alter session set SORT_AREA_SIZE = 10485760;';


           execute immediate 'Alter session set OPTIMIZER_MODE = choose;';


           execute immediate 'Alter session set CURRENT_SCHEMA = SIEBEL;';


           execute immediate 'SET TRANSACTION USE ROLLBACK SEGMENT RBBIG01;';


end;


/





George


________________________________________________


George Leonard


Oracle Database Administrator


Dimension Data (Pty) Ltd


(Reg. No. 1987/006597/07)


Tel: (+27 11) 575 0573


Fax: (+27 11) 576 0573


E-mail:[EMAIL PROTECTED]


Web:   http://www.didata.co.za





You Have The Obligation to Inform One Honestly of the risk, And As a Person


You Are Committed to Educate Yourself to the Total Risk In Any Activity!


Once Informed & Totally Aware of the Risk, Every Fool Has the Right to Kill or Injure 
Themselves as
They See Fit!


      -----Original Message-----
      From: George Leonard (ZA) [mailto:[EMAIL PROTECTED]]
      Sent: 03 October 2002 09:03 AM
      To: Multiple recipients of list ORACLE-L
      Subject: RE: logon trigger





      Thx, I also found this last night.





      I will wait for the developers so arrive so that they can test their process.





      George


      ________________________________________________


      George Leonard


      Oracle Database Administrator


      Dimension Data (Pty) Ltd


      (Reg. No. 1987/006597/07)


      Tel: (+27 11) 575 0573


      Fax: (+27 11) 576 0573


      E-mail:[EMAIL PROTECTED]


      Web:   http://www.didata.co.za





      You Have The Obligation to Inform One Honestly of the risk, And As a Person


      You Are Committed to Educate Yourself to the Total Risk In Any Activity!


      Once Informed & Totally Aware of the Risk, Every Fool Has the Right to Kill or 
Injure
      Themselves as They See Fit!


            -----Original Message-----
            From: Igor Neyman [mailto:[EMAIL PROTECTED]]
            Sent: 02 October 2002 19:09 PM
            To: Multiple recipients of list ORACLE-L
            Subject: Re: logon trigger





            Altering "current_schema", you will not see anything in "user_tables", but 
you should be
            able to reference tables in this new schema without using "siebel" prefix.





            Igor Neyman, OCP DBA
            [EMAIL PROTECTED]

             ----- Original Message -----


             From: George Leonard (ZA)


             To: Multiple recipients of list ORACLE-L


             Sent: Wednesday, October 02, 2002 12:18 PM


             Subject: RE: logon trigger





             Hi all





             Ok the trigger has been changed to this, It compiles.





             The problem now is that all the objects that need to be access is owner 
by the siebel
             user. I do not want to create synonyms. The tool being used can not 
append the siebel
             schema name in front of the objects, and it is expecting to log in as 
siebel.





             Any idea why the 'Alter session set CURRENT_SCHEMA = SIEBEL;' is not 
changing my
             current schema. I have tried executing Alter session set CURRENT_SCHEMA = 
SIEBEL; in a
             standard sqlplus window and then looking at the user_tables table and it 
is empty ?





             create or replace trigger olap1_logon_trigger


               after logon on smload.schema


             begin


               execute immediate 'SET TRANSACTION USE ROLLBACK SEGMENT RBBIG01;';


               execute immediate 'Alter session enable parallel query;';


               execute immediate 'Alter session set SORT_AREA_SIZE = 10485760;';


                     execute immediate 'Alter session set OPTIMIZER_MODE = choose;';


                     execute immediate 'Alter session set CURRENT_SCHEMA = SIEBEL;';





             end;


             /





             George


             ________________________________________________


             George Leonard


             Oracle Database Administrator


             Dimension Data (Pty) Ltd


             (Reg. No. 1987/006597/07)


             Tel: (+27 11) 575 0573


             Fax: (+27 11) 576 0573


             E-mail:[EMAIL PROTECTED]


             Web:   http://www.didata.co.za





             You Have The Obligation to Inform One Honestly of the risk, And As a 
Person


             You Are Committed to Educate Yourself to the Total Risk In Any Activity!


             Once Informed & Totally Aware of the Risk, Every Fool Has the Right to 
Kill or Injure
             Themselves as They See Fit!


                   -----Original Message-----
                   From: JOE TESTA [mailto:[EMAIL PROTECTED]]
                   Sent: 02 October 2002 16:52 PM
                   To: [EMAIL PROTECTED]
                   Cc: [EMAIL PROTECTED]
                   Subject: re: logon trigger





                   George here is how we did ours"





                   create or replace trigger olap1_logon_trigger
                     after logon on olap1.schema
                   begin
                     execute immediate 'alter session set optimizer_mode = first_rows';
                   end;
                   /





                   Customize it to your liking.





                   Joe







             
***************************************************************************************

             This message contains information intended solely for the addressee,
             which is confidential or private in nature and subject to legal privilege.
             If you are not the intended recipient, you may not peruse, use,
             disseminate, distribute or copy this message or any file attached to this
             message. Any such unauthorised use is prohibited and may be unlawful. If
             you have received this message in error, please notify the sender
             immediately by e-mail, facsimile or telephone and thereafter delete the
             original message from your machine.

             Furthermore, the information contained in this message, and any
             attachments thereto, is for information purposes only and may contain the
             personal views and opinions of the author, which are not necessarily the
             views and opinions of Dimension Data (South Africa) (Proprietary) Limited
             or its subsidiaries and associated companies ("Dimension Data"). Dimension
             Data therefore does not accept liability for any claims, loss or damages
             of whatsoever nature, arising as a result of the reliance on such
             information by anyone.

             Whilst all reasonable steps are taken to ensure the accuracy and
             integrity of information transmitted electronically and to preserve the
             confidentiality thereof, Dimension Data accepts no liability or
             responsibility whatsoever if information or data is, for whatsoever
             reason, incorrect, corrupted or does not reach its intended destination.

             
*************************************************************************************




      
***************************************************************************************

      This message contains information intended solely for the addressee,
      which is confidential or private in nature and subject to legal privilege.
      If you are not the intended recipient, you may not peruse, use,
      disseminate, distribute or copy this message or any file attached to this
      message. Any such unauthorised use is prohibited and may be unlawful. If
      you have received this message in error, please notify the sender
      immediately by e-mail, facsimile or telephone and thereafter delete the
      original message from your machine.

      Furthermore, the information contained in this message, and any
      attachments thereto, is for information purposes only and may contain the
      personal views and opinions of the author, which are not necessarily the
      views and opinions of Dimension Data (South Africa) (Proprietary) Limited
      or its subsidiaries and associated companies ("Dimension Data"). Dimension
      Data therefore does not accept liability for any claims, loss or damages
      of whatsoever nature, arising as a result of the reliance on such
      information by anyone.

      Whilst all reasonable steps are taken to ensure the accuracy and
      integrity of information transmitted electronically and to preserve the
      confidentiality thereof, Dimension Data accepts no liability or
      responsibility whatsoever if information or data is, for whatsoever
      reason, incorrect, corrupted or does not reach its intended destination.

      
*************************************************************************************




***************************************************************************************

This message contains information intended solely for the addressee,
which is confidential or private in nature and subject to legal privilege.
If you are not the intended recipient, you may not peruse, use,
disseminate, distribute or copy this message or any file attached to this
message. Any such unauthorised use is prohibited and may be unlawful. If
you have received this message in error, please notify the sender
immediately by e-mail, facsimile or telephone and thereafter delete the
original message from your machine.

Furthermore, the information contained in this message, and any
attachments thereto, is for information purposes only and may contain the
personal views and opinions of the author, which are not necessarily the
views and opinions of Dimension Data (South Africa) (Proprietary) Limited
or its subsidiaries and associated companies ("Dimension Data"). Dimension
Data therefore does not accept liability for any claims, loss or damages
of whatsoever nature, arising as a result of the reliance on such
information by anyone.

Whilst all reasonable steps are taken to ensure the accuracy and
integrity of information transmitted electronically and to preserve the
confidentiality thereof, Dimension Data accepts no liability or
responsibility whatsoever if information or data is, for whatsoever
reason, incorrect, corrupted or does not reach its intended destination.

*************************************************************************************








-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Ron Thomas
  INET: [EMAIL PROTECTED]

Fat City Network Services    -- 858-538-5051 http://www.fatcity.com
San Diego, California        -- Mailing list and web hosting services
---------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).

Reply via email to