view sid & serial of the current user

Hello

I want to display the sid and serial of the currently logged in user but the sid & serial # must be displayed immediately after the connection. I mean, once a user enters the name of user/pass and press ENTER, the SQL command prompt before, sid & serial # must be display. I tried to run Select sid, serial # session $ v where username = user; statement file glogin.sql before setting the prompt but of no use. Even I tried to create a folder, but could not. Here's my glogin.sql:

fixed lines 120
set of 1000 pages
termout off Set
Col sid1 new_value in sid
Prom prom col new_value
Select sys_context ('USERENV', 'SESSION_USER') | » @'|| sys_context ('USERENV', 'DB_NAME') | ' > ' ball
Double;

the value of sqlprompt "
Select sid, serial # of v_$ session where username = user;
Set sqlprompt '& prom '.
Set termout on
fixed lines 120
set of 1500 pages

Although Oracle and operating system version is not applicable for this but still, I'm under Oracle (9i, 10g and 11g) on win xp. This is just a test system which I use for small orders/triggers test before you deploy in any official environment.

TIA
-Onkar

Add the request to the file below glogin.sql

select sid SID,serial# Serial# from v$session where AUDSID = USERENV('SESSIONID');

Then start your session.

SQL*Plus: Release 10.2.0.3.0 - Production on Wed Feb 29 15:22:28 2012

Copyright (c) 1982, 2006, Oracle.  All Rights Reserved.

Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - Production
With the Partitioning, OLAP and Data Mining options

       SID     SERIAL#
---------- ----------
       137       2649

SQL> 

Hope this helps you

Tags: Database

Similar Questions

  • Why Wizard does not start when the current user?

    Program does not RUN. Wizard does not open after you select the Option for the current user

    P.S. If you can't always install Firefox, even using the FULL Installer:

    Reinstalling but this time download the file on your computer. When the download is complete, install it as an administrator by right clicking the configuration file and select "Run as Administrator".

  • Y at - it a registry key to check if the current user can install a windows updates? also, what registry key that is used to verify whether a user is an administrator or not. Thank you...

    Y at - it a registry key to check if the current user can install a windows updates? also, what registry key that is used to verify whether a user is an administrator or not. Thank you...

    There is no need to check the registry keys to see if you can install updates or not.

    You just need to be connected to an administrator account to install the Windows updates.

    You can check if you are in an administrator account by trying taks simple administrattor. For example. Try to change the time system.

    If you can change the time, you are an administrator; no other.

  • The message I get is Microsoft word has not been installed for the current user. Please run set up to install the application. I reinstalled the software, but get the same message.

    The message I get is Microsoft word has not been installed for the current user.   Please run set up to install the application.   I reinstalled the software, but get the same message.

    Hello

    See the methods listed in the articles below and check.
    You receive an error "Microsoft has not been installed for the current user" message when you try to start an Office 2003 program or an Office XP program for the first time
    http://support.Microsoft.com/kb/898512
     
    You receive a message "Microsoft has not been installed for the current user" when you start an Office XP program or start of Microsoft Office Maintenance mode
    http://support.Microsoft.com/kb/298022

    I hope this helps.

    Thank you, and in what concerns:
    Shekhar S - Microsoft technical support.

    Visit our Microsoft answers feedback Forum and let us know what you think.
    If this post can help solve your problem, please click the 'Mark as answer' or 'Useful' at the top of this message. Marking a post as answer, or relatively useful, you help others find the answer more quickly.

  • Age of Empires III has not been installed for allusers or the current user.

    I have 64-bit Windows 7 Home Premium.  AOE II runs correctly, but I can't install war chiefs expansion packs.  the "Age of Empires III has not been installed for allusers or the current user." Please sign in with the correct account. This configuration will be output. "error still appears.  How can I make it work?

    Create the directory here: -.

    C:\ProgramData\Microsoft\Windows\Start start\program

    So after you have created the files, it should look like:-

    C:\ProgramData\Microsoft\Windows\Start Menu\Programs\ Microsoft Age of Empires III

    If this post answers your question, click mark as answer .

  • How can I get the user name of the current user? Not the name of the user, but the user name is connected to.

    Anyone know how I can get the username of the current user? Not the name of the user, but the user name is connected to.

    Thank you!

    Only two variables that Captivate allows to work with are cpQuizInfoStudentName and cpQuizInfoStudentID, but the latter is only really designed to be used for the internal information server, not a typical SCORM LMS solution.

    Sounds to me like you may need to get hands on with the services of a JavaScript programmer.

  • Retrieve the current user info

    Hello

    I have a dynamic form created using the LC Designer. Is it possible to extract the details of the current user who looks at the form in the form itself?

    Hi Pierre,.

    If you create a file with the following code .js and place in the JavaScripts folder under the directory of installation of the reader (or Acrobat), it's C:\Program Files (x 86) \Adobe\Reader 11.0\Reader\Javascripts on my machine and I called my getIdentityLoginName.js file, then all defined functions will be available as a global function in your JavaScript forms and will also have access to secure items such as identity.  The code is so;

    var getIdentityLoginName = app.trustedFunction (function () {}

    app.beginPriv ();

    return (identity.loginName);

    app.endPriv ();

    });

    And can be called from a form as;

    App.Alert (getIdentityLoginName ());

    Concerning

    Bruce

  • The current user is not allowed to call this method. in CF10

    Hi all

    After installing CF10 and our report, I am able to connect to the report.

    After awhile all of a sudden I get the below error and I am unable to connect to our reporting module.

    "" the current user is not allowed to invote this error of method".

    When I checkd surprised newspapers that CF is looking for some files under E:\cf10_final\cfusion\wwwroot\CFIDE\adminapi\accessmanager.cfc

    I don't have E drive in my pc.

    can someone help me to solv the problem? (any patches / workarounds), installed the hotfix7 and mandatory patch in our computer.

    Thanks in advance.

    ------------------------------- logs start---------------------------------------------

    "The current user is not allowed to call this method. «The specific sequence of files included or processed is: C:\inetpub\wwwroot\da-idcsap001_TM\index.cfm, line: 48»

    coldfusion.runtime.CustomException: the current user is not allowed to call this method.

    at coldfusion.tagext.lang.ThrowTag.doStartTag(ThrowTag.java:142)

    at coldfusion.runtime.CfJspPage._emptyTcfTag(CfJspPage.java:2799)

    to cfaccessmanager2ecfc974154242$ funcCHECKADMINROLES.runFunction (E:\cf10_final\cfusion\wwwro ot\CFIDE\adminapi\accessmanager.cfc:48)

    at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:472)

    at coldfusion.filter.SilentFilter.invoke(SilentFilter.java:47)

    to coldfusion.runtime.UDFMethod$ ArgumentCollectionFilter.invoke (UDFMethod.java:368)

    at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:55)

    at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:321)

    at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:220)

    at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:655)

    at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:444)

    at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:414)

    at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:2432)

    to cfdatasource2ecfc1679861966$ funcSETODBCSOCKET.runFunction (E:\cf10_final\cfusion\wwwroot\C FIDE\adminapi\datasource.cfc:814)

    at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:472)

    to coldfusion.runtime.UDFMethod$ ReturnTypeFilter.invoke (UDFMethod.java:405)

    to coldfusion.runtime.UDFMethod$ ArgumentCollectionFilter.invoke (UDFMethod.java:368)

    at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:55)

    at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:321)

    at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:518)

    at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:660)

    at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:469)

    at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:2373)

    at cfcreateCFDatasource2ecfm667208776.runPage (C:\inetpub\wwwroot\da-idcsap001_TM\createCFDat asource.cfm:41)

    at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:244)

    at coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:444)

    at coldfusion.runtime.CfJspPage._emptyTcfTag(CfJspPage.java:2799)

    at cfsecure_init2ecfm1698353119.runPage (C:\inetpub\wwwroot\da-idcsap001_TM\secure_init.cfm:2 31)

    at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:244)

    at coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:444)

    at coldfusion.runtime.CfJspPage._emptyTcfTag(CfJspPage.java:2799)

    to cfApplication2ecfm465443671.runPage(C:\inetpub\wwwroot\da-idcsap001_TM\Application.cfm:5)

    at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:244)

    at coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:444)

    at coldfusion.filter.CfincludeFilter.invoke(CfincludeFilter.java:65)

    at coldfusion.filter.CfincludeFilter.include(CfincludeFilter.java:33)

    at coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java:346)

    at coldfusion.filter.RequestMonitorFilter.invoke(RequestMonitorFilter.java:48)

    at coldfusion.filter.MonitoringFilter.invoke(MonitoringFilter.java:40)

    at coldfusion.filter.PathFilter.invoke(PathFilter.java:112)

    at coldfusion.filter.LicenseFilter.invoke(LicenseFilter.java:30)

    at coldfusion.filter.ExceptionFilter.invoke(ExceptionFilter.java:94)

    at coldfusion.filter.ClientScopePersistenceFilter.invoke (ClientScopePersistenceFilter.java:2 8)

    at coldfusion.filter.BrowserFilter.invoke(BrowserFilter.java:38)

    at coldfusion.filter.NoCacheFilter.invoke(NoCacheFilter.java:46)

    at coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:38)

    at coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22)

    at coldfusion.filter.CachingFilter.invoke(CachingFilter.java:62)

    to coldfusion. CfmServlet.service (CfmServlet.java:219)

    at coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:89)

    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter (ApplicationFilterChain.j ava: 305)

    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)

    at coldfusion.monitor.event.MonitoringServletFilter.doFilter (MonitoringServletFilter.java:42)

    at coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:46)

    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter (ApplicationFilterChain.j ava: 243)

    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)

    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224)

    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)

    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)

    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)

    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)

    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:928)

    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)

    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:414)

    at org.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:204)

    to org.apache.coyote.AbstractProtocol$ AbstractConnectionHandler.process (AbstractProtocol.jav one: 539)

    to org.apache.tomcat.util.net.JIoEndpoint$ SocketProcessor.run (JIoEndpoint.java:298)

    to java.util.concurrent.ThreadPoolExecutor$ Worker.runTask (ThreadPoolExecutor.java:886)

    to java.util.concurrent.ThreadPoolExecutor$ Worker.run (ThreadPoolExecutor.java:908)

    at java.lang.Thread.run(Thread.java:662)

    --------------------End logs------------------------

    Hello

    Solved the problem by installing the latest pathces CF.

    Kind regards

    Phani

  • Windows path on the desktop of the current user

    Under MacOS ' ~ / Desktop "is the path to the current user's desktop. I would use in Windows? I tried Folder("%username%/Desktop"), but that has not worked. Any suggestions?

    You would use neither Extendscript allows instant access to the office of the current user through the predefined folder class member:

    Alert (Folder.desktop);

    Folder.Desktop is a fully functional pointer in a regular folder, as seen with

    Alert (Folder.desktop.getFiles().join("\r"));

    (see http://jongware.mit.edu/idcs5js/pc_Folder.html#desktop)

  • Record file in the folder of the local settings of the current user in windows and Mac.

    Hello

    Could you please help me for the following:

    We need to write javascript to read some data Indesign file and save it as a file text in the local folder for the current user in Windows and Mac.

    We use the CS4 version.

    1. how to get the path of the local folder of the current user to save the file in both windows and Mac?

    2. we need to write a javascript for Windows and Mac code. How to identify the operating system in the script?

    Concerning

    Khathija,

    Through the file class, you can get the current user data folder.

    This example will point to / create "My Custom Folder" inside the user data folder.

    var userFolder = Folder ( Folder.userData.absoluteURI + "/My Custom Folder" );
    
    if ( !userFolder.exists )
        userFolder.create ();
    

    Hope that helps.

    --

    Marijan (tomaxxi)

    http://tomaxxi.com

  • How can I get the current user?

    I want to combine the logic of Publisher and Subscriber in a Flex application. To do this, I need to know what role has the current user (I do not change user roles implementation plan).

    Is this possible?

    Thank you.

    Hello

    I googled: "current user lccs. The 2nd shot gave me the answer =).

    Nigel

  • PLEASE, I BEG YOU! How can I have a label dynamically see the current user loggedin FirstName and LastName in my database?

    I have a HBox that becomes visible when a user is valid. The HBox contains a logout button, and a label. How can I get the label dynamically see the current user loggedin FirstName and LastName in my database? Below, I have included my element HBox and ColdFusion. ANY helpwould be appreciated!



    < < < < < < MY component LoginHBox.mxml starts HERE > > > > > > >
    < mx:HBox
    ' xmlns:MX =' http://www.adobe.com/2006/mxml '
    Width = '100% '.
    height = "28".
    horizontalAlign = "right."
    verticalAlign = "middle".
    paddingRight = "10" >

    "" < mx:Script source = "... / actionScript/logout.as" / >

    <!-App connects to ColdFusion using Flash Remoting STARTS->
    < mx:RemoteObject
    ID = "cfService_LoginCFC".
    destination = "ColdFusion".
    source="WebsiteApplication.CFC.LoginCFC"/ >
    <!-App connects to ColdFusion using Flash Remoting END->

    < mx:Label id = "welcomeLabel".
    Text = "Welcome"... "/ > < < < < HOW can I get the text dynamically see the users registered in FirstName and LastName?

    <! - logoutResultHandler() of the points of function in the file logout.as - >
    < mx:Button id = "logoutButton.
    label = "Log" Out
    Click = "logoutResultHandler ()" / >

    < / mx:HBox >
    < < < < < < MY component LoginHBox.mxml ends HERE > > > > > > >



    < < < < < < MY component LoginCFC.cfc starts HERE > > > > > > >
    < cfproperty >

    <!-function loginUser STARTS->
    < name cffunction = "loginUser" access = "remote" returntype = "WebsiteApplication.cfc.UserCFC" >
    < cfargument = 'user name' name type = "string" required = "true" >
    < name cfargument = "password" type = "string" required = "true" >

    <!-the default user is not logged in->
    < cfset var user = createObject ("component", "UserCFC") >

    < cfquery name = "loginQuery" dataSource = "TheChurchOnFire" >
    SELECT the name of user, password, AccessLevelID, FirstName, LastName
    FROM dbo. MembershipInfo
    WHERE
    Username = "#username #
    AND password = ' #password #
    < / cfquery >
    <!-the cfif instructionsuivante is absolutely fundamental in the achievement of the
    fully functional authentication-> process
    < cfif EQ loginQuery.Username ' #username # ' loginQuery.Password AND EQ ' #password # ' >
    < cfset user .loggedin = true >
    < cfset user .username = "#username #" >
    < cfset user .roles = "#loginQuery.AccessLevelID #" >
    < cfreturn user >
    < cfelseif > #username # EQ 'username' AND #password # EQ 'password '.
    < cfset user .loggedin = true >
    < cfset user .username = "#username #" >
    < cfset user .roles = "6" >
    < cfreturn user >
    < cfelse >
    < cfreturn user >
    < / cfif >

    < / cffunction >
    <! - function loginUser ENDS - >

    < / cfproperty >
    < < < < < < MY component LoginCFC.cfc ends HERE > > > > > > >

    Thank you

    John

    I finally thought to it! PRAISE BE TO GOD!

    I had to add...

    welcomeLabel.text ='Welcome, you are currently logged in as + currentUser.fullname + '!';

    .. .for my loginResultHandler.

    function loginResultHandler
    private void loginResultHandler(event:ResultEvent):void
    {
    currentUser = event.result as a user;
    If (currentUser.loggedIn)
    {
    If successful login
    If (currentUser.roles == '5')
    {
    this.currentState = 'Youth';
    welcomeLabel.text ='Welcome, you are currently logged in as + currentUser.fullname + '!';
    }
    Else if (currentUser.roles == '4')
    {
    this.currentState = 'Member';
    welcomeLabel.text ='Welcome, you are currently logged in as + currentUser.fullname + '!';
    }
    Else if (currentUser.roles == '3')
    {
    this.currentState = 'PowerMember';
    welcomeLabel.text ='Welcome, you are currently logged in as + currentUser.fullname + '!';
    }
    Else if (currentUser.roles == '2')
    {
    this.currentState = 'AssistantAdministrator';
    welcomeLabel.text ='Welcome, you are currently logged in as + currentUser.fullname + '!';
    }
    Else if (currentUser.roles == '1')
    {
    this.currentState = 'SeniorAdministrator';
    welcomeLabel.text ='Welcome, you are currently logged in as + currentUser.fullname + '!';
    }
    on the other
    {
    currentUser.roles == "6";
    this.currentState = 'Visitor';
    welcomeLabel.text = 'Welcome, you are currently logged in as visitor!';
    }
    }
    on the other
    {
    If unsuccessful login
    Alert.Show ("unsuccessful Login", "Server authentication");
    }
    }

    Michael_ramirez44 thanks for your help!

    John

  • The arrays pointed to by table_alias must be in the same schema as the current user

    I have another question regarding the use of table aliases. When I tried to create a structure of the event with the table alias pointing to a table not in the schema of the current user, I get errors when trying to create the rule class.

    I don't know if it's because the Policy Manager cannot use a table alias pointing to the tables of other users.

    Hello

    The following script works for me. If it works, please send me your script to Yao aravind [dot] [at] oracle [dot] com.

    Thank you
    -Aravind.

    connect scott/tiger 
    
    grant select on scott.emp to a;
    grant select on scott.dept to a;
    
    connect a/a
    
    begin
       dbms_rlmgr.create_event_struct(event_struct => 't_a');
       dbms_rlmgr.add_elementary_attribute(event_struct => 't_a',
                                           attr_name    => 'a_employees',
                                           tab_alias    => exf$table_alias('scott.emp'));
       dbms_rlmgr.add_elementary_attribute(event_struct => 't_a',
                                           attr_name    => 'a_departments',
                                           tab_alias    => exf$table_alias('scott.dept'));
    end;
    /
    
    BEGIN
       dbms_rlmgr.create_rule_class(rule_class   => 't_alia',
                                    event_struct => 't_a',
                                    action_cbk   => 't_acb',
                                    rslt_viewnm  => 't_arv',
                                    rlcls_prop   => '');
    END;
    /
    

    Solution: In order to use aliases for tables in schemas, SELECT on tables privileges must be explicitly granted to the schema in which the class rule is created. Also, DMLEVENTS and CNFEVENTS the configuration of the rule can be used only when the paintings and the rule class are defined in the same schema.

  • Sending mail to the current user

    Hi all

    I want to send the mail to failure to connect currently user.
    I know how to send the mail to a perticular user, but my requirement is I want to send the mail to the currently logged in user.
    Is there a way to do this. Help, please.

    Thank you
    Ravi.

    Assuming that the field of the target user's e-mail address is filled in access to its user FDM profile, you should be able to use the following syntax:

    strUserID = API. DataWindow.Connection.PstrUserID' this is the Userid of the active user of FDM
    strUserEmail = API. DataWindow.Security.fUserEmailGet (strUserID)' returns the e-mail address of the user

  • the current user of the session &amp; current schema

    Hi all


    ACC to a url
    "
    o CURRENT_USER: the name of the user whose privilege the session is running
    in the framework.

    o SESSION_USER: the name of the user who originally created this session? who is online
    in. It is constant for a session.

    o CURRENT_SCHEMA: the name of the default schema that will be used to resolve references
    for objects not qualified.
    "

    Session user is clearly making the distinction. My question is that is there any situation when the CURRENT_USER and CURRENT_SCHEMA is different? My understanding is that when we have a program of sup with authid define, then the user of the session I (if another user not the define called)
    is different and the current_schema is different. The current_schema is definers schema while the user of the session is the Summoner of the program overtime. I guess that this is a good understanding.


    Is EQUIVALENT to current_user, current_schema? If this is not the case, if someone can cite a small program to show the difference?

    As others have said, current_schema contols which schema for unqualified names are resolved in. It can be changed using:

    alter session set current_schema = 
    

    or in a stored procedure liike authid clause:

    SQL> Create Procedure test_definer as
      2     l_user           VARCHAR2(30);
      3     l_current_user   VARCHAR2(30);
      4     l_session_user   VARCHAR2(30);
      5     l_current_schema VARCHAR2(30);
      6  begin
      7     select user into l_user from dual;
      8
      9     select Sys_Context('USERENV', 'CURRENT_USER')
     10     into l_current_user
     11     from dual;
     12
     13     select Sys_Context('USERENV', 'SESSION_USER')
     14     into l_session_user
     15     from dual;
     16
     17     select Sys_Context('USERENV', 'CURRENT_SCHEMA')
     18     into l_current_schema
     19     from dual;
     20
     21     Dbms_Output.Put_Line ('User is: '||l_user);
     22     Dbms_Output.Put_Line ('Current User is: '||l_current_user);
     23     Dbms_Output.Put_Line ('Session User is: '||l_session_user);
     24     Dbms_Output.Put_Line ('Current_schema is: '||l_current_schema);
     25  end;
     26  /
    
    Procedure created.
    
    SQL> Create Procedure test_current
      2     authid Current_user as
      3     l_user           VARCHAR2(30);
      4     l_current_user   VARCHAR2(30);
      5     l_session_user   VARCHAR2(30);
      6     l_current_schema VARCHAR2(30);
      7  begin
      8     select user into l_user from dual;
      9
     10     select Sys_Context('USERENV', 'CURRENT_USER')
     11     into l_current_user
     12     from dual;
     13
     14     select Sys_Context('USERENV', 'SESSION_USER')
     15     into l_session_user
     16     from dual;
     17
     18     select Sys_Context('USERENV', 'CURRENT_SCHEMA')
     19     into l_current_schema
     20     from dual;
     21
     22     Dbms_Output.Put_Line ('User is: '||l_user);
     23     Dbms_Output.Put_Line ('Current User is: '||l_current_user);
     24     Dbms_Output.Put_Line ('Session User is: '||l_session_user);
     25     Dbms_Output.Put_Line ('Current_schema is: '||l_current_schema);
     26  end;
     27  /
    
    Procedure created.
    

    Copyright being the default, test_definer procedure works with the privileges and in the schema of the user Thatcreated in this oracle of $ case ops. The test_current procedure operates in the schema of the user calling him and privileges. So if we call both in the scheme of the owner that they are actually the same:

    SQL> exec test_definer;
    User is: OPS$ORACLE
    Current User is: OPS$ORACLE
    Session User is: OPS$ORACLE
    Current_schema is: OPS$ORACLE
    
    PL/SQL procedure successfully completed.
    
    SQL> exec test_current;
    User is: OPS$ORACLE
    Current User is: OPS$ORACLE
    Session User is: OPS$ORACLE
    Current_schema is: OPS$ORACLE
    
    PL/SQL procedure successfully completed.
    

    However, if we create a new user and give that run them both, we'll see a feel:

    SQL> create user a identified by a;
    
    User created.
    
    SQL> grant create session to a;
    
    Grant succeeded.
    
    SQL> grant execute on test_definer to a;
    
    Grant succeeded.
    
    SQL> grant execute on test_current to a;
    
    Grant succeeded.
    
    SQL> connect a/a
    Connected.
    SQL> exec ops$oracle.test_definer;
    User is: A
    Current User is: OPS$ORACLE
    Session User is: A
    Current_schema is: OPS$ORACLE
    
    PL/SQL procedure successfully completed.
    
    SQL> exec ops$oracle.test_current;
    User is: A
    Current User is: A
    Session User is: A
    Current_schema is: A
    
    PL/SQL procedure successfully completed.
    

    John

Maybe you are looking for