How to view the external cursor opened in a session

Hi all
Is there a way to display a cursor open external in a session? Suppose if I want to check if there is a public and open cursor that has been defined in a package, how can I do? I try to play with v$ open_cursor, but I can't make sense.

Best regards
Val

Valerie Debonair wrote:
I want to test a lifetime of a cursor in a session. I don't want to interrogate another session but the same session where the open cursor.

This probably more experimentation rather than useful in the real world. Suppose I have a package that sets a public cursor (as defined in the package spec) but for reasons of bad programming practice, the cursor is not closed and remains in session until the end view of v$ open_cursor can you tell me if an open cursor exists in the session?

How do you know if this open cursor has been consumed (not more data), or not? It might be half an hour old, but still perfectly valid (if using the snapshot has not expired).

I wouldn't say a cursor that was opened for x times a problem. The problem is to have multiple copies of the same open cursor - like which indicates a cursor leak.

Anyway, you can watch the view V$ OPEN_CURSORS performance virtual - but in my test below, that time is is filled not doing a calculation of time would not work. You can continue this and dig deeper into the data dictionary (and the behavior of the Oracle) to determine if your needs can be met.

SQL> --// package defines a static session PL/SQL cursor
SQL> create or replace package FooLib as
  2
  3          cursor c is select object_name from user_objects;
  4
  5  end;
  6  /

Package created.

SQL>  --// open the cursor
SQL> begin
  2          open fooLib.c;
  3  end;
  4  /

PL/SQL procedure successfully completed.

SQL> --// do at least one fetch making sure that the cursor has been "touched"
SQL> declare
  2          s       varchar2(30);
  3  begin
  4          fetch fooLib.c into s;
  5          DBMS_OUTPUT.put_line( s );
  6  end;
  7  /
SYSLIB

PL/SQL procedure successfully completed.

SQL>
SQL> --// the data in v$open_cursor for the PL/SQL cursors we have opened in our session
SQL> select
  2          c.sid,
  3          c.user_name,
  4          c.cursor_type,
  5          c.last_sql_active_time,
  6          t.sql_text
  7  from       v$sqltext t,
  8          v$open_cursor c
  9  where      c.address = t.address
 10  and        c.hash_value =  t.hash_value
 11  and        c.sid = (select sid from v$session where audsid =SYS_CONTEXT('userenv','sessionid') )
 12  and        c.cursor_type = 'OPEN-PL/SQL';

       SID USER_NAME  CURSOR_TYPE          LAST_SQL_ACTIVE_TIME SQL_TEXT
---------- ---------- -------------------- -------------------- ----------------------------------------------------------------
        25 BILLY      OPEN-PL/SQL                               SELECT OBJECT_NAME FROM USER_OBJECTS

SQL>
SQL>
SQL> begin
  2          close fooLib.c;
  3  end;
  4  /

PL/SQL procedure successfully completed.

SQL>
SQL>  --// cursor should now be gone as it was closed
SQL> select
  2          c.sid,
  3          c.user_name,
  4          c.cursor_type,
  5          c.last_sql_active_time,
  6          t.sql_text
  7  from       v$sqltext t,
  8          v$open_cursor c
  9  where      c.address = t.address
 10  and        c.hash_value =  t.hash_value
 11  and        c.sid = (select sid from v$session where audsid =SYS_CONTEXT('userenv','sessionid') )
 12  and        c.cursor_type = 'OPEN-PL/SQL';

no rows selected

SQL> 

Tags: Database

Similar Questions

  • How to view the external jsx file

    Hello

    I want to put my functions in a common jsx file and reference it in my running jsx file. What can I do for external jsx file from a jsx file?

    If your file to include in a subfolder of the folder with your active.jsx file, you add this as the first line of the active.jsx file:

    #include "subfolder/myjsxtoinclude.jsx.

    --

    Thomas B. Nielsen

    http://www.Lund-co.dk

  • How to view the settings for the sequence (info that is displayed when you open the first sequence)?

    Hi, I would like to ask how to view the current settings of the sequence, I'm already working the same information that is displayed when you open for the first time a new sequence

    for example.

    General

    Editing mode: QuickTime DV PAL

    Time Base: 25.00fps

    Video settings

    Image size: 720: 576v (1.4587)

    Frame rate: 25.00 FPS

    Format of the pixels: PAL D1/DV widescreen 16:9 (1.4587)

    Fields: Bottom field first

    Audio settings

    Sample rate: 48000 samples/second

    Default sequence

    Total of the video tracks: 3

    Master the track type: stereo

    Audio tracks:

    Audio 1: Standard

    Audio 2: Standard

    Audio 3: Standard

    I forgot what setting I chose for my current sequence and tried to look under project settings , as well as the sequence settings

    but do not show the news that you see when you open a new sequence for the first time, especially if the edit mode is PAL or NTSC etc.

    How can I find this information which my current sequence is on?

    Thank you

    Sequence / sequence of setting you will find all the information.

    If his pal, you're on 25 or 50 fps.

    the rest is ntsc.

  • I would like to know how to remove the box/cursor information dialog box that appears whenever I have stop my mouse on an object.

    I would like to know how to remove the box/cursor information dialog box that appears whenever I have stop my mouse on an object.

    Have you tried to uncheck both options via Control Panel / folder Options / View?

    "Displays the size of file in folder tips".

    "Display descriptions pop - up for folder and desktop items"

  • How to view the monthly/annual statistics in terms of time past/calories burned, broken down by each individual activity such as run elliptical/outside etc. Y at - it a third party application that can help me to collect and display these data?

    How to view the monthly/annual statistics in terms of time past/calories burned, broken down by each individual activity such as run elliptical/outside etc. Y at - it a third party application that can help me to collect and display these data?

    Hello

    It is not currently possible to review the data the application integrated in activity or training on this basis. If you want Apple to consider adding this feature, you can suggest here:

    https://www.Apple.com/feedback/watch.html

    However, health and fitness data from other sources, iPhone, and Apple Watch are registered and grouped within the health on iPhone app. These data can be exported, which you may find useful to track the cumulative progress and/or analyze your activity more in detail.

    IPhone app activity also has a button for sharing (top right of the screen) that allows to share data - including social media, Messages, Mail, Notes, and a printer.

    Include third-party applications that can be useful, for example:

    Access to QS

    -"Access your HealthKit data in a table so you can Explorer using numbers, Excel, R, or any other tool compatible CSV."

    - https://itunes.apple.com/gb/app/qs-access/id920297614?mt=8

    SpectaRun workouts

    -"View from the workouts of your Apple Watch on your iPhone and to export these workouts so you can download them to your favorite online running community."

    - https://itunes.apple.com/gb/app/spectarun-workouts/id991723862?mt=8

    Data can also be exported directly from the application of the health (Health Data > All - Share at the top button on the right).

    Check the descriptions and support resources for third party applications for supported details of import and data analysis features.

    More information:

    Use the activity on your Apple Watch - Apple Support

    Use of the workout on your Apple Watch - Apple Support

    http://www.Apple.com/watch/health-and-fitness/

  • How to view the PSA screenshot on front panel

    Anyone know how to view the screenshot of the specturm Analyzer the PSA series on the façade. I can put the JPEG file in the C drive, but I can not display on the front panel. Please see my labview code.

    Thank you, very good information

  • How to view the songs that were on the "rocket" using windows Explorer?

    How to view the songs that were on the "rocket" when buying using windows Explorer?

    Do you need the list or do you need knowledge where they are? If you are looking for the list just look for the Board of Directors. If you are looking for them on the "rocket" you must be connected in MTP Mode.

  • How to view the application menu in the app?

    Hi all

    Does anyone know how to view the application menu in the app?
    The ultimate effect is that when you see the user swipe down from the top of the screen, the menu of the application.

    Thank you very much.

    Please check the recent threads or duplicate search before posting questions: http://supportforums.blackberry.com/t5/Cascades-Development/Application-Menus/td-p/1785653

  • How to view the anticipated date of 3 days bb

    Greetings

    How to view the early date to 3 days with bb.

    I was able to view the current in bb, but can not able to display the date fututre.

    Help, please

    concerning

    Anthony singh

    Hello

    Add 3 days to the current date.

    days3 long = (3 * 24 * 60 * 60 * 1000);   MS

    TimeFormat SimpleDateFormat = new SimpleDateFormat ("YYYY/MM/DD HH: mm: EEE");
    timeString = «"+ timeFormat.formatLocal (System.currentTimeMillis () + Days3);»

    Thank you

    Stephenson

  • I forgot my password for windows 7... and please tell me how to know the password to open with?

    I forgot my password for windows 7... and please tell me how to know the password to open with?

    I forgot my password for windows 7... and please tell me how to know the password to open with?

    Keep passwords secure - Microsoft on passwords strategy
    http://support.Microsoft.com/kb/189126

    What to do if you forget your Windows password:
    http://Windows.Microsoft.com/en-us/Windows-Vista/what-to-do-if-you-forget-your-Windows-password

  • How to view the status of the battery power of the screen of boot menu showing the tiles?

    How to view the status of the battery power of the screen of boot menu showing the tiles?

    Just do the gesture of "drag the right edge" which evokes the "charms" on the right side.  It also brings a great left low Panel with date/time, battery level, and State WiFi icons.  No need to clutter up the screen with him all the time. ;)

  • How to view the log with the identifier of Eloqua UI/API?

    I am trying to import customer contact Eloqua system using a restful api in Java.

    He got 500 Internal Server Error when call POST Api/rest/1.0/data/contact.

    In fiddler, we know that answer pleased as below:

    Internal server error

    There was an internal server error.

    The error was logged with log identifier 551654381.

    Please provide this identifier to log technical support.

    I want to know how to view the log of 551654381 ?

    Anyone who has the experience to import contacts using the Restful API or API bulk?

    Screenshot of Fiddler:

    eloqua.gif

    Hi Tim,.

    The API error log is not available through the UI Eloqua, is accessible by Eloqua support only.  If you supply the ID error when you connect to a service request with the support of Eloqua, it will make it easier for them to diagnose your problem.

  • 'ERROR 01' as I have only 66 MB of free space on my MacBook Air: (how to load the external Creative cloud on a hard drive software?

    I bought the full package, but I couldn't get it to load on my laptop.

    So my question is:

    How to load the external Creative cloud on a hard drive software?

    Or do you spend, how the "Installer Creative Cloud' to load it on an external hard drive?

    Thanking you in anticipation.

    : )

    you have the cc office application installed on your computer?

    If not, install the - apps Download Adobe Creative Cloud | CC free trial Adobe

  • How to view the text onto an interactive button in Indesign CC?

    How to view the text onto an interactive button in Indesign CC?

    I'm doing my map.

    I am now able to link a button in my card to a website url, but what I really want is a way to make the text appear next to a button, it shows what kind of construction is by turning over with the mouse.

    One?

  • How to view the PDF in JavaFX?

    How to view the PDF in JavaFX? Thanks for the suggestions.

    Not with this app as written: it simply makes each page as an image. You might be able to take advantage of the API of the PDF-Converter Labs Swing that I used in this example to get more features: I have not watched which closely.

    I noticed the warnings with some codes not recognized for some PDF files. Which comes from the library of PDF-Converter, rather than any code of FX.

Maybe you are looking for

  • Replace the cookies all blocked after the installation of new

    When Firefox recently stopped working (would not not connect to the Internet), I first uninstalled Firefox. Then, I downloaded a new copy from the Internet (same version) and reinstalled from scratch. However, all my "blocked" cookies are now missing

  • Equium A100-147 will not connect wireless Internet!

    HelloFor these last months that my cell phone was able to connect to internet, I think I must have downloaded a virus that deleted the necessary drivers for the wireless card to work, it is still all access points, but it does not connect. I tried to

  • Update hard drive for Z60T model 2512

    I'm looking to upgrade my Z60t with a hard drive more and have a few questions. 1. What is the biggest hard drive I can use for example 320 GB SATA, and 2. all things special I should know when I do the installation, BIOS changes etc. Thanks a lot fo

  • How can I lock the position of thumbnail images in their files?

    Start > My Documents > folder my pictures (100 thumbnail images with names) The menu View Menu drop-down has 6 options for viewing: film, thumbnails, tiles, icons, list or details. No matter how I arrange these images by dragging them to my desired j

  • Noise suppression

    Cannot finde Z5c microphone noise suppression (was in Z1, Z3, etc.), wery need. why she is cut off from the firmware? Maybe they put in a new?