11g and v$ session

Hello

I have 11g database. When I do the desc on session of v$ I can see table and select from this point of view.

The question is when I write process I get an error. Pls see below.

I must be missing something. Pls let me know.

Thank you very much
Laba

SQL * more: version 8.0.6.0.0 - Production on Fri Jan 8 10:48:21 2010

(c) Copyright 1999 Oracle Corporation. All rights reserved.


Connected to:
Oracle Database 11g Release 11.1.0.6.0 - Production

SQL > CREATE PROCEDURE ABCD IS
HOLD_NAME 2 VARCHAR2 (100);
3 BEGIN
4. SELECT USERNAME
5 IN HOLD_NAME
6 FROM V$ SESSION
7. WHERE USERNAME = "EDUMET";
8 END;
9.

CAUTION: Procedure created with compilation errors.

SQL > SHOW ERRORS
ABCD PROCEDURAL errors:

LINE/COL ERROR
-------- -----------------------------------------------------------------
4/1 PL/SQL: statement ignored
6/6 PL/SQL: ORA-00942: table or view does not exist

SQL > DESC V$ SESSION
Name Null? Type
------------------------------- -------- ----
SADDR RAW (4)
SID NUMBER
SERIAL NUMBER #.
NUMBER OF AUDSID
PADDR RAW (4)
USER NUMBER #.
NAME VARCHAR2 (30)
ORDER NUMBER
OWNERID NUMBER
........................
.............


SQL > SELECT name from USER OF V$ SESSION;

USERNAME
------------------------------
SYSMAN
EDUMET
SYSMAN
EDUMET
SYSMAN

Emeric wrote:

SQL * more: release of * 8.0.6 *.0.0 - Production on Fri Jan 8 10:48:21 2010

You should really spend your client to connect to an 11g database, otherwise you could be facing several problems.

That said, you should have the concession on this point of view given directly to your user, not by a role, to use it in a procedure.

SQL> conn titi/titi
SQL> CREATE PROCEDURE ABCD IS
  2   HOLD_NAME VARCHAR2(100);
  3  BEGIN
  4   SELECT USERNAME
  5   INTO HOLD_NAME
  6   FROM V$SESSION
  7   WHERE USERNAME = 'EDUMET';
  8  END;
  9  /

Warning: Procedure created with compilation errors.

SQL> show err
Errors for PROCEDURE ABCD:

LINE/COL ERROR
-------- --------------------------------------------------
4/2      PL/SQL: SQL Statement ignored
6/7      PL/SQL: ORA-00942: table or view does not exist

SQL> desc V$SESSION
 Name                                      Null?    Type
 ----------------------------------------- -------- -----------
 SADDR                                              RAW(8)
 SID                                                NUMBER
 SERIAL#                                            NUMBER
...

SQL> conn / as sysdba
SQL> grant select on sys.v_$session to titi;

Grant succeeded.

SQL> conn titi/titi

Connected.

SQL> CREATE or replace PROCEDURE ABCD IS
  2   HOLD_NAME VARCHAR2(100);
  3  BEGIN
  4   SELECT USERNAME
  5   INTO HOLD_NAME
  6   FROM V$SESSION
  7   WHERE USERNAME = 'EDUMET';
  8  END;
  9  /

Procedure created.

Nicolas.

added example
Published by: Gasparotto N on January 8, 2010 17:26

Tags: Database

Similar Questions

  • How to find the lock and kill session in order to release it?

    Hi all

    EBS R12.2

    "I met ' could not book record" in our case. How to release the session locked?

    I usually do this by bouncing the apps & db level. Is their subtle way?



    Capture.PNG



    Kind regards

    JC



    Ideally, you should check for locks on the table in question where records are trying to access.

    AFAIK, you must check the v$ locked_object and find sessions.

    Hope this helps!

    Kind regards

    Hugues

  • What are the differences between pga memory max session and pga session in memory?

    Hi all

    What are the differences between pga memory max session and pga session in memory?

    SELECT s.sid, n.name, s.value FROM v$ sesstat s, v$ statname n

    WHERE s.statistic # = n.statistic #.

    AND n.name = 'pga session in memory. "

    SELECT s.sid, n.name, s.value FROM v$ sesstat s, v$ statname n

    WHERE s.statistic # = n.statistic #.

    AND n.name = 'pga memory max session ";



    Note that I have read the documentation. However, it is not clearly explained.


    Thank you

    John Stegeman wrote:

    I agree with the comments of the Ed, NightWing.

    You do not have a story to ask questions that are clearly answered in the documentation.

    Mind your own business. If you answer the question, so answer! Otherwise, please stop the thread engrossing.

  • Upgrade ERP database 11g and ATG7 with SSO integration

    Please let us know how to perform upgrade BY Database 11g and ATG7 with SSO decline.

    Kind regards.

    Is there any space stage, do we do if we have implemented SSO after upgrade DB 11 g and 7 ATG?

    You can follow the same approach to upgrade the database and apply the fixes 7 ORS ATG group level.

    Please make sure that you apply the patches in (known issues on top of 11i. ATG_PF. H.Delta.7 (RUP7) - 6241631 [858801.1 ID]). In addition, make a full backup before you start this on your instance of production and if possible get an instance cloned with SSO enabled and test all patches on an identical instance.

    Thank you
    Hussein

  • Oracle 11g and the APEX version

    Hello

    My understanding is that APEX 4.0 comes by default with Oracle 11 g. recently, we have the oracle 10 g updated to 11g and our admin has mentioned that APEX verision shows APEX 3.2.1...

    Please advice...

    Thank you

    No, you'll need to download and install 4.0.2 assuming you want the most recent apex.

  • Difference between V$ SESSION and GV$ SESSION

    Hi all

    I have a few questions:

    1. What is the difference between V$ SESSION and GV$ SESSION?

    2. is there an Oracle function defined as USERENV('SESSIONID'). to get the AUDSID of GV$ SESSION?

    Thanks in advance

    Hmmm... I had no idea... so I did some digging.

    The short answer is that other than the SYSDBA and SYSOPER, connections that all get the same AUDSID, it is unique throughout the database. The AUDSID values are generated from the SYS. Sequence of $ AUDSES.

    See MetaLink doc. ID 123128.1 and 122230.1 for more information.

    -Mark

  • Doesn't have JHeadstart capable of converting Forms 10g times 11g and 10g ADF Faces?

    We would like to buy for JDeveloper 10.1.3.3 JHeadstart generator g 10 forms to ADF Faces. This version of JHeadstart capable of converting forms 10g 10 g ADF Faces. But I want a universal JHeadstart generator ADF Faces, who will be able to convert forms 10g times 11g and 10g ADF Faces. Please help me by your valuable suggestion/advice.

    Try asking on the JHeadstart forum:
    JHeadstart

    As far as I KNOW, JHeadstart 11 g is still not released.

  • Listeners 11g and 10g

    Hello

    I have two databases 11g and 10g on a single server.
    11g uses a port 1522 10 g using port 1521.

    At the start of the 11 g database I get the following error:

    SQL > bootable media.
    ORA-00119: invalid specification for the system LOCAL_LISTENER parameter
    ORA-00132: error syntax or network name not resolved "LISTENER_DB11G."

    Can I copy my 10g listerner.ora enty in my listnerer.ora 11g and rename/edit the 10g to listener2.
    and start then 11g receiver?

    I prefer to use the two auditors.

    Thank you...

    user8969 wrote:
    I just want that my setup to work if it's easier with a listener that's fine!
    That what I have to do to get the two DB on the same listener was my question.

    I received this Burleson Oracle DBA Forum:
    http://dbaforums.org/Oracle/index.php?showtopic=9569

    Thank you.

    There is room for improvement in this other thread. Some examples of file listener.ora to a 10g R2 on Windows listener serving 10.2.0.4 11.1.0.7 database instances:

    TRACE_LEVEL_LISTENER = 0
    SID_LIST_LISTENER =
      (SID_LIST =
        (SID_DESC =
          (GLOBAL_DBNAME = VM)
          (ORACLE_HOME = C:\oracle\product\10.2.0)
          (SID_NAME = VM)
        )
        (SID_DESC =
          (GLOBAL_DBNAME = LT)
          (ORACLE_HOME = C:\oracle\product\10.2.0)
          (SID_NAME = LT)
        )
        (SID_DESC =
          (GLOBAL_DBNAME = LT2)
          (ORACLE_HOME = C:\oracle\product\10.2.0)
          (SID_NAME = LT2)
        )
        (SID_DESC =
          (GLOBAL_DBNAME = VM11)
          (ORACLE_HOME = C:\Oracle\Product\11.1.0)
          (SID_NAME = VM11)
        )
        (SID_DESC =
          (GLOBAL_DBNAME = VMTEST)
          (ORACLE_HOME = C:\Oracle\Product\11.1.0)
          (SID_NAME = VMTEST)
        )
      )
    
    LISTENER =
      (DESCRIPTION_LIST =
        (DESCRIPTION =
          (ADDRESS = (PROTOCOL = TCP)(HOST = 192.185.50.51)(PORT = 1521))
        )
      )
    
    SAVE_CONFIG_ON_STOP_LISTENER = TRUE
    

    There are probably things to improve in the above listener.ora file, but it works. It is also possible to use a 11.1.0.7 earpiece to maintain a 10.2.0.4 database instance - the listener.ora follows the same pattern.

    Charles Hooper
    IT Manager/Oracle DBA
    K & M-making Machine, Inc.

  • How to display the user id and the session on the form?

    Hi all can someone guide me how to display the user id and the session on the form? Please guide me

    Sarah

    Hi Sarah,.

    You can use GET_APPLICATION_PROPERTY (CONNECT_STRING) for this.

    BTW, have you tried search in forms online help? It has good examples explaining all the built-ins.

    Arun-

  • DB Oracle 11 g r2 Configuration process and the session

    I recently installed DB Oracle 11g R2 and 50,000 users connect to this database suggest me what would be the basic configurations.
    Sessions settings and database processes are 5000 and 5505 but it is lagging bit now so if its possible I want to make maximum processes and sessions or automatic.

    And the platform would be?
    Windows is not suitable for this number of users.
    And even on Unix, I would if I were you configure shared server or connection pooling.
    See http://docs.oracle.com/cd/E11882_01/network.112/e10836/dispatcher.htm#i453786

    ----------
    Sybrand Bakker
    Senior Oracle DBA

  • Switch between Cam ID and (LabVIEW session)?

    Hello

    I use a camera USB under LabView. So I have to implement some low level functions that happens in a provider dll. On the other hand, I have to use NOR-Imagdx function for identification. So far every part works without problem, while the cam provider uses a camera ID (integer value) to access the cam, Labview uses sessions to connect the cam.

    Question:

    -J' I need two parts for the low level functions AND the LV - fucntions in a vi. How can I connect the cam when the dll uses an ID of the Cam and the NOR-Imaqdx sessions? How can I "convert" or bring together the two parts of code?

    Thanks in advance

    Hello

    The short answer is: you can't.

    Unless the pilots IDS they allowed camera to be open simultaneously with their own SDK as well as via DirectShow (which uses the IMAQdx here) then the two cannot access the same device at the same time.

    Eric

  • Thumbnail option does not work in Terminal Server in Windows Server 2012 and server session

    This might be a stupid question.

    We have two Windows server 2012 R2 - TS and DC. The clients are connecting to TS and access the shared network drives present in DC. I always unchecked 'show icons, never thumbnails' and 'Show thumbnails in System Properties' enabled on DC and the two TS.

    No always thumbnail option.

    You will need to click on each image. Users have many files containing multiple images. It's annoying to click and view each image.

    Note: NO GPO is configured to block it. Checked.

    I can't find any object GPO to allow this option to be :)

    More info. For customers, anywhere, whether network shares or all folders in TS session. It does not work. Also tried painting and Windows Photo Viewer.

    Here, any help will be very appreciated!

    Hello

    Post your question in the TechNet Server Forums, as your question kindly is beyond the scope of these Forums.

    http://social.technet.Microsoft.com/forums/WindowsServer/en-us/home?category=WindowsServer

    See you soon.

  • IKEv1 and IKEv2 session in ASDM monitor?

    Hi all, have a question.  I have a setup of L2L tunnel between two ASA (v8.4).  I used the wizard to put these in place and selected the default values of IKEv1 and IKEv2, thinking that he would choose one or the other.  The strange thing is that, now, I see a separate session between these ASA, for IKEv1 and IKEv2.  Both pass traffic.  This is expected behavior?  Should I disable IKEv1 to force only v2, since both are v8.4?

    photo attached to explain.

    If both versions are configured then two IKE tunnels will be established.

    I don't know if that this is expected behavior. On tune ASA the tunnel manager should try IKEv2 first and if it fails try IKEv1.

    There could be some problems in which one side would launch IKEv1 while the other is IKEv2 concurrency.

    It's something we can can be studied by the tunnel manager and the two Yves debugging.

    debug crypto ike-common 5

    debug crypto ....

    I think you might want to open a TAC case, then we can this check completely.

  • How to find who holds a SQL lock when its not v$ session.sql_id and v$ session.prev_sql_id

    Hi all

    Looking a little nudge in the right direction on a strange problem with blocking locks in our database of BSE...

    We occasionally will blocking locks in our EBS 12.1.3 database (11.2.0.4 CARS on OEL5).   I can easily determine the INST_ID select and SID that keeps the lock with this:

    Select final_blocking_instance, final_blocking_session from gv$ session where lockwait is not null;

    and can use these results to find the specific object being blocked by querying a gv$ locked_object where session_id = xxx and INST_ID select = xxx.   These sessions blocker are generally inactive to an event of "SQL * Net client message"-while they seem to be connected to the database users who need simply to commit or rollback transactions.   Usually, when I see this type of behavior, the specific application involved in the unresolved external transactions is easy to find by taking the SQL_ID (or sometimes the PREV_SQL_ID) value of gv$ session and questioning gv$ sql.  I can then use this information to better understand what users are trying to accomplish and help them understand what they need to change to avoid the deadlock problem.

    But recently, we have integrated the add-on of Oracle content management and it seems to have added (I suspect indirectly) triggers for many forms EBS our users work in.  Now that we know these "locks blocking inactive form" - and the SQL_ID value is zero and related PREV_SQL_ID sql_text is

    SELECT * FROM AXF_COMMANDS_SYN WHERE FORMID =: b1 AND (MENUTYPE = 'SPÉCIAL' MENUTYPE or = "ZOOMANDSPECIAL") AND AXF_COMMANDS_SYN. SPECIAL 'n' IS NOT NULL


    Although I can see SGS $ locked_object both the text of the SQL being run by sessions which blocked the blocking the locks held by the session is on an object (for example RA_CUSTOMER_TRX_ALL) that does not seem to be at all related to AXF_COMMANDS_SYN.   The AXF schema has been added as part of the deployment of content management.


    So, my thought is that a different cursor open (previous) held by the session is the real unresolved SQL that maintains the lock.  Is there a way to determine the SQL_ID of this query "indirectly" from gv$ locked_object / gv$ transaction, gv$ open_cursor, etc.?  I can determine what is the problem and what user, we need to talk to him - but I would really like to find the exact SQL that is involved.   I am also to establish if the new behavior is somehow contributing to locking problems blocking or just 'a Kipper"- and I think I know which statement SQL Gets the lock will help me to move forward with the investigation.  I'm sure I could find this info by tracing the blocking - session but the problem occurs rarely, and I'm not able to determine which trace session until it is too late... :-)


    Any recommendations would be appreciated, and my apologies for the long post...









    A session may issue a followed LMD of 5 requests without issuing a commit.

    Another session may be attempting a DML when the 5th request session above is running.  Querying V$ session for the first session SQL_ID or PREV_SQL_ID wouldn't you say the first SQL DML.

    You can walk backwards through V$ ACTIVE_SESSION_HISTORY (if you have the License Pack diagnosis) and determine all SQL_IDs of this first session if they did get captured in V$ ACTIVE_SESSION_HISTORY or DBA_HIST_ACTIVE_SESS_HISTORY.  (Attention: not all SQLs are captured - particularly short-lived SQLs can't get captured)

    Hemant K Collette

  • v$ fixed_view_definition where and ' GV$ SESSION "= only the first 4000 characters

    Hi all

    I need to get the defeintion of the opinion GV$ SESSION.

    I get only the first 4000 characters.

    Select * from v$ fixed_view_definition where view_name = "GV$ SESSION;

    Could you please help me?

    Thank you

    Cherif.

    Cherif bh wrote:

    Hi Martin,

    Thanks for your help. I use 11.2.0.3 and is EXPAND_SQL_TEXT added 12 c.

    I try to get the definition of a problem of performance on gv$ session; I need a list of the tables and columns and add the best predicates and access them using indices

    You should be able to get the same thing on 11.2.0.3 too:

    https://jonathanlewis.WordPress.com/2012/07/10/expanding-SQL/

    The package is called DBMS_SQL2 it.

    Randolf

Maybe you are looking for