V$views not available in PL/SQL scripts why?

I created a procedure as follows
create or replace procedure log_user_count
     (pi_directory in varchar2, pi_file_name in varchar2)
as
     v_file_handle utl_file.file_type;
     v_user_count number;
begin
     execute immediate 'select count(*) from v$session where username is not null' into v_user_count;
     v_file_handle := utl_file.fopen(pi_directory, pi_file_name, 'A');
     utl_file.new_line(v_file_handle);
     utl_file.put_line(v_file_handle, '--- User Log --- ');
     utl_file.new_line(v_file_handle);
     utl_file.put_line(v_file_handle, ' on ' || to_char(sysdate, 'MM/DD/YYYY HH24:MI'));
     utl_file.put_line(v_file_handle, 'Number of users logged on : '||v_user_count);
     utl_file.put_line(v_file_handle , ' --- End Log --- ');
     utl_file.new_line(v_file_handle);
     utl_file.fclose(v_file_handle);
exception
     when utl_file.invalid_filename then
          dbms_output.put_line('File is invalid');
     when utl_file.write_error then
          dbms_output.put_line('Oracle is not able to write to file');
end;
Procedure was created without any errors but when executed I got an error message showing the table or view is not present.
When I tried with user tables I got successful completion of the plsql procedure.
Why it happened? How can I correct the error? Plz advice.

And you give the grant to V_$SESSION because V$SESSION is a synonym...
SYS@DEMO102> grant select on v$session to scott;
grant select on v$session to scott
ERROR at line 1:
ORA-02030: can only select from fixed tables/views
SYS@DEMO102> select * from dba_synonyms where synonym_name = 'V$SESSION';
OWNER                          SYNONYM_NAME
TABLE_OWNER                    TABLE_NAME
DB_LINK
PUBLIC                         V$SESSION
SYS                            V_$SESSION
SYS@DEMO102> grant select on v_$session to scott;
Grant succeeded.
SYS@DEMO102> Nicolas.

Similar Messages

  • Windows 8 - Adobe PDF Viewer Not Available

    I have two new Dell touchscreen laptops with Windows 8 (not 8.1).
    I am unable to get the tile/app integrated browser to open PDF files.   Upon downloading a PDF it reports "Adobe PDF Viewer Not Available".
    I've gone to the app store from Microsoft, and downloaded the tile/app reader, and it reports being installed....but no joy.  I've gone to the Adobe site, and looked for and installed any/all Windows 8 viewers I can find, but it still doesn't work.
    I CAN view PDF files by clicking on the Windows key, clicking on the desktop, opening IE, then using the Adobe Reader 11 that was installed.  This seems so pointless, because the only way to view a PDF is to take about 4 extra clicks than I do in Ubuntu, Windows 7, or a Mac.
    What's up with this?

    Internet Explorer has two versions on Windows 8/RT.
    (a) The desktop version of IE supports plugins and accelerators.  This is the version that you launch from the Windows 8/RT desktop.
    (b) The Windows Store app version (with "Modern" or "Metro" UI) of IE is touch-optimized, full screen, and plugin free. This is the version that you launch by tapping/clicking the tile in the Start screen.
    See the Microsoft documentation titled Get ready for plug-in free browsing.
    "Starting with Windows 8, IE is one web platform that provides two browsing experiences: the new IE in the new Windows UI optimized for touch devices, and the traditional browsing experience of Internet Explorer for the desktop. As a Windows app, Internet Explorer runs without plug-ins so that you have a clean, fast, and secure web browsing experience, while also providing a native Adobe Flash player. "
    Similarly, Adobe Reader also has two versions on Windows 8/RT.
    (a) The desktop version is called Adobe Reader XI. It is a mature product that has been available in the market for the past 20 years and offers a rich set of features.  It supports in-browser viewing of PDFs by installing the browser plugin to the desktop version of IE.  However, the downsides of the desktop version are the incompatibility with the Windows RT operating system and security vulnerabilities. In general, the desktop version is less secure than the Windows Store app version.
    (b) The Windows Store app version is called Adobe Reader Touch.  It is a relatively new product that was introduced a year ago.  It does not support in-browser viewing of PDFs because of the security restrictions that are imposed on all Windows Store apps. It is compatible with both Windows 8 and RT operating systems. 
    Because the Windows Store app version of IE is designed to be plugin-free, no other desktop/Windows Store apps (hence, not even Adobe Reader XI) can install additional plugins (other than the Flash support that is built-in by default).
    If you want the in-browser PDF viewing support, you need to use the desktop version of IE and the desktop version of a PDF viewer like Adobe Reader XI.
    This is the application architecture decision that Microsoft has made deliberately. It's not a bug or oversight.
    Microsoft has the Windows Store app version of PDF viewer called "Reader".  It may be possible for Microsoft to add the in-browser PDF viewing support using Reader (just like Google Chrome does) in a future release of the Windows Store app version of IE.  But it did not happen in the newer version of the operating systems: Windows 8.1 and Windows RT 8.1.
    If you have any feature requests/suggestions/questions regarding the Windows Store app version of IE, please visit the Microsoft forum instead.
    http://answers.microsoft.com/en-us/ie

  • Views not available in Discoverer Plus

    Hi Gurus,
    I have created some views using Oracle 10 g Disco Admin v 9.0.4 and I am able to access them from Disco Desktop v 9.0.4
    However, when I log in to Discoverer Plus, those views are not available. I am logging with the same user id that I am using for desktop. Some of the users who are on the previous version of Disco Desktop are facing the same problem. First I thought it might be a version mismatch issue, but now it is happening with Disco Plus too.
    Here is the Disco Plus version details:
    Oracle Application Server Discoverer 10g (9.0.4.00.00)
    Oracle Application Server Discoverer Plus 10g (9.0.4.45.02)
    Discoverer Model - 9.0.4.45.02
    Discoverer Server - 9.0.4.45.02
    End User Layer - 5.0.2.0.0.0
    End User Layer Library - 9.0.4.45.02
    Oracle9i Enterprise Edition Release 9.2.0.6.0 - 64bit Production
    Copyright © 1999, 2004, Oracle. All rights reserved.
    Thanks in advance.

    Hi Jagan,
    Thanks for your reply and I have just transported the Role after the views have been assigned to it.
    I'll update you once the Role is moved to Quality.
    Regards
    BN

  • Not able to read sql script file in ADF mobile

    hi,
    i am trying to create some DB tables in SQLLite DB (similar to the HR sample app where it creates bunch of DB objects using hr.sql file in .adf/META-INF)..
    but i am getting following error at runtime. i placed the file in .adf/META-INF directory in my application.
    "sqllite returned: error code=14, msg = cannot open file at source...."
    what am i missing here?
    please help.
    regards,
    ad

    This how I have done it.
    This is the start method from my Listener:
      public void start()
          String databaseName = "mydatabase";
          File dbFile = new File(AdfmfJavaUtilities.getDirectoryPathRoot(AdfmfJavaUtilities.ApplicationDirectory)+"/"+databaseName+".db");
          if(!dbFile.exists())
                try {
                    this.initializeDatabase(databaseName);
                } catch (Exception e) {
                    System.out.println(e.getMessage());
      }And this is a custom method also in the listener class
      private static void initializeDatabase(String databaseName) throws Exception
          List stmts = null;
          try {
              ClassLoader cl = Thread.currentThread().getContextClassLoader();
              InputStream is = cl.getResourceAsStream(".adf/META-INF/"+databaseName+".sql");
              if (is == null) {
                  // .sql script not found
              BufferedReader bReader = new BufferedReader(new InputStreamReader(is));
              stmts = new ArrayList();
              String strstmt = "";
              String ln = bReader.readLine();
              while (ln != null) {
                  if (ln.startsWith("REM") || ln.startsWith("COMMIT")) {
                      ln = bReader.readLine();
                      continue;
                  strstmt = strstmt + ln;
                  if (strstmt.endsWith(";")) {
                      System.out.println(strstmt);
                      stmts.add(strstmt);
                      strstmt = "";
                      ln = bReader.readLine();
                      continue;
                  ln = bReader.readLine();
              String Dir = AdfmfJavaUtilities.getDirectoryPathRoot(AdfmfJavaUtilities.ApplicationDirectory);
              String connStr = "jdbc:sqlite:" + Dir + "/"+databaseName+".db";
              Connection conn = null;
              conn = new SQLite.JDBCDataSource(connStr).getConnection();
              conn.setAutoCommit(false);
              for (int i = 0; i < stmts.size(); i++)
                  Statement pStmt = conn.createStatement();
                  pStmt.executeUpdate((String)stmts.get(i));
              conn.commit();
              conn.close();
          } catch (Exception ex)
              ex.printStackTrace();
          }My .sql scrip named "mydatabase.sql" located in the ADF META-INF folder.
    See this picture :
    http://upload.wiim.be/img/Screenshot%20at%20jan.%2019%2011-39-30.pngDon't forget the register your Listener class to the adfmf-application.xml file!
    http://upload.wiim.be/img/Screenshot%20at%20jan.%2019%2011-42-24.png

  • Not able to call sql script from shell program

    Hi Gurus,
    I am facing issue while calling sqlplus script from my shell program. Please find below my shell script. This program I've written and registered as for one of concurrent program
    in oracle applications.
    p_userid_passwd=$1
    p_appl_login=$2
    p_user_name=$3
    p_request_id=$4
    v_conc_request_id=${5}
    p_to_role=${6}
    p_from_role=${7}
    p_subject=${8}
    p_body=${9}
    p_dist_list=${10}
    v_request=${11}
    v_file_path_name=/u01/oraspt/REQUEST
    cd $APPLCSF/$APPLOUT
    echo "v_conc_request_id" $v_conc_request_id
    echo "p_to_role" $p_to_role
    echo "p_from_role" $p_from_role
    echo "p_subject" $p_subject
    echo "p_body" $p_body
    echo "p_dist_list" $p_dist_list
    echo "v_request" $v_request
    ls -l $v_request
    if [ $? -ne 0 ]
    then
       echo "No output request generated"
    else
       echo "Output request generated" 
    fi
    echo "connecting to ftp for placing out file to DB server"
    echo FTP to 99.60.17.11
    echo username: "oraspt"
    echo pw:        
    ftp -i -n 99.60.17.11 << EOF2
    user "oraspt" orakdk
    cd $v_file_path_name
    put $v_request
    bye
    EOF2
    output=`sqlplus -s /nolog <<EOT
    whenever sqlerror exit failure;
    connect  apps/apps
    set verify off;
    set serveroutput on size 120000;
           DECLARE
             l_errbuf      varchar2(300);
             l_retcode     varchar2(300);
           BEGIN      
            XXFND_SEND_MAIL.SEND_NOTIFICATIONS(  errbuf        => l_errbuf
                                               , retcode       => l_retcode
                                               , p_request_id  => $v_conc_request_id
                                               , p_to_role     => $p_to_role
                                               , p_from_role   => $p_from_role
                                               , p_subject     => $p_subject
                                               , p_body        => $p_body
                                               , p_dist_list   => $p_dist_list);
         EXCEPTION
            when others then
               dbms_output.put_line('Error encountered :'||SQLERRM);
         END;    
    EOT
    `
    echo "connecting to ftp for deleting output file"     
    echo FTP to 99.60.17.11
    echo username: "oraspt"
    echo pw:        
    ftp -i -n 99.60.17.11 << EOF2
    user "oraspt" orakdk
    cd $v_file_path_name
    delete $v_request
    bye
    EOF2
    echo "Deleted successfully"Output for script is as below
    v_conc_request_id 451906
    p_to_role DC.DKHOO
    p_from_role DC.DKHOO
    p_subject Receivable audit report10
    p_body Please find Audit Report Attachment.
    p_dist_list
    v_request o451906.out
    -rw-r--r-- 1 applspt dba 2368 Dec 28 15:06 o451906.out
    Output request generated
    connecting to ftp for placing out file to DB server
    FTP to 10.60.17.11
    username: oraspt
    pw:
    connecting to ftp for deleting output file
    FTP to 10.60.17.11
    username: oraspt
    pw:
    Deleted successfullyPlease let me know how to trigger pl/sql script.
    Thanks in advance for your help.
    Regards
    Nagendra
    Edited by: 838961 on Dec 27, 2011 11:25 PM

    Please find output as suggested, I've placed set -x in script.
    + p_userid_passwd=APPS/APPS
    + p_appl_login=1110
    + p_user_name=DC.DKHOO
    + p_request_id=451949
    + v_conc_request_id=451945
    + p_to_role=DC.DKHOO
    + p_from_role=DC.DKHOO
    + p_subject=Receivabless
    + p_body=report
    + p_dist_list=
    + v_request=o451945.out
    + v_file_path_name=/u01/oraspt/REQUEST
    + cd /u01/applspt/inst/apps/SPT_nfs-stg-app1/logs/appl/conc/out
    + echo v_conc_request_id 451945
    v_conc_request_id 451945
    + echo p_to_role DC.DKHOO
    p_to_role DC.DKHOO
    + echo p_from_role DC.DKHOO
    p_from_role DC.DKHOO
    + echo p_subject Receivabless
    p_subject Receivabless
    + echo p_body report
    p_body report
    + echo p_dist_list
    p_dist_list
    + echo v_request o451945.out
    v_request o451945.out
    + ls -l o451945.out
    -rw-r--r-- 1 applspt dba 2368 Dec 28 15:54 o451945.out
    + '[' 0 -ne 0 ']'
    + echo 'Output request generated'
    Output request generated
    + echo 'connecting to ftp for placing out file to DB server'
    connecting to ftp for placing out file to DB server
    + echo FTP to 10.60.17.11
    FTP to 10.60.17.11
    + echo username: oraspt
    username: oraspt
    + echo pw:
    pw:
    + ftp -i -n 10.60.17.11
    ++ sqlplus -s /nolog
    + output=Connected.
    + echo 'connecting to ftp for deleting output file'
    connecting to ftp for deleting output file
    + echo FTP to 10.60.17.11
    FTP to 10.60.17.11
    + echo username: oraspt
    username: oraspt
    + echo pw:
    pw:
    + ftp -i -n 10.60.17.11
    + echo 'Deleted successfully'
    Deleted successfully

  • Reader XI not available for Windows Vista. Why?

    I have just tried to install Reader XI, but I keep being directed to Reader X. Looking at the Technical Specs. Windows Vista is not listed. An over sight? What is going on?

    I have Reader XI on my Win 7 office computer.  I have Vista on my home computer and tried different links to get to the Reader XI download page, but I too kept getting redirected to the X download page.
    When I found the "previous versions" page http://get.adobe.com/reader/otherversions/ I tried inputing different OSs (XP, Vista and 7) and discovered XI is not available for Vista.  Obviously the auto-redirect is due to Adobe.com detecting my OS.
    I'm not overly concerned.  I mean, ver X works fine for what I need it for at home.  The only reason I came here (to the forum) was to find out 'why'.

  • PlayStation Store not available in my country. Why?

    Hello, create a new PSN account, but i can't select my counrty, because its doesn have in the list, that why i have to choose another country, and it is a reason, why i cant add funds in my wallet, what i have to do?

    The same story. PSN is not available in Armenia, so I cant neither select my country nor add funds. What the f***, sony?

  • Power view not working using remote sql

    Hi
    Our Sharepoint 2013 has all it's content databases installed on a sql server 2008 R2
    And our BI guys would like to use power view with the data on their SQL 2012 SP1.
    How should I proceed with the setup?
    At the moment I can't find any powerview integration feature to switch on, how should I do this?
    Do I need to install the Reporting Services Add-in for Sharepoint on the sharepoint servers?
    Anders

    PowerView requires SSRS in SharePoint integrated mode. Install SSRS on a SharePoint server in your farm and configure the SSRS Service Instance/Service Application, then try again.
    Trevor Seward
    Follow or contact me at...
    &nbsp&nbsp
    This post is my own opinion and does not necessarily reflect the opinion or view of Microsoft, its employees, or other MVPs.

  • How to view the result of any SQL script

    Hi
    I am working on Oracle 10 g Express Edition.I have an explicit cursor code ,a very basic one.I want to know how can i view result of the script.When i Save and run the script i get nothign on the window.
    I am pasting the script for the Reference.
    Code
    Declare
    CURSOR c_p IS
    select p_id from PRODUCTS;
    v_pid PRODUCTS.p_id%type;
    Begin
    OPEN c_p;
    Loop
    FETCH c_p into v_pid;
    Exit when c_p%NOTFOUND;
    Dbms_output.put_line(v_pid);
    End loop;
    CLOSE c_p;
    End;
    Prod_id Prod_category Prod_name Prod_price
    123456 Games Sony PS3 599.99
    234567 Games Sony PSP 249.99
    345678 Games Nintendo Wii 249.99
    456789 Games Microsoft Xbox 360 349.99
    567890 Computer Microsoft Vista 349.99

    Hi,
    Try like this:
    SQL> set serveroutput on
    SQL> DECLARE
      2  CURSOR c_p IS
      3  select first_name from EMP;
      4  v_name EMP.first_name%type;
      5  Begin
      6  OPEN c_p;
      7  Loop
      8  FETCH c_p into v_name;
      9  Exit when c_p%NOTFOUND;
    10  Dbms_output.put_line(v_name);
    11  End loop;
    12  CLOSE c_p;
    13  End;
    14
    15
    16  /
    Steven
    Neena
    Lex
    Alexander
    Bruce
    David
    Valli
    Diana
    Nancy
    Daniel
    John
    Ismael
    Jose Manuel
    Luis
    Den
    Alexander
    Shelli
    Sigal
    Guy
    Karen
    Matthew
    Adam
    Payam
    Shanta
    Kevin
    Julia
    Irene
    James
    Steven
    Laura
    Mozhe
    James
    TJ
    Jason
    Michael
    Ki
    Hazel
    Renske
    Stephen
    John
    Joshua
    Trenna
    Curtis
    Randall
    Peter
    John
    Karen
    Alberto
    Gerald
    Eleni
    Peter
    David
    Peter
    Christopher
    Nanette
    Oliver
    Janette
    Patrick
    Allan
    Lindsey
    Louise
    Sarath
    Clara
    Danielle
    Mattea
    David
    Sundar
    Amit
    Lisa
    Harrison
    Tayler
    William
    Elizabeth
    Sundita
    Ellen
    Alyssa
    Jonathon
    Jack
    Kimberely
    Charles
    Winston
    Jean
    Martha
    Girard
    Nandita
    Alexis
    Julia
    Anthony
    Kelly
    Jennifer
    Timothy
    Randall
    Sarah
    Britney
    Samuel
    Vance
    Alana
    Kevin
    Donald
    Douglas
    Jennifer
    Michael
    Pat
    Susan
    Hermann
    Shelley
    William
    PL/SQL procedure successfully completed.
    SQL>Cheers,

  • Query View not available as DataProvider in Report Designer

    Hi experts,
    I am unable to find any query views when I tried to insert DataProvider in Report Designer. All that is available in InfoAreas view is only queries.
    When I tried to restrict type to only Query View, they are only visible in History view and not others (e.g. Find and InfoAreas)
    Is this the same case with everyone and why is that so?
    Thanks!

    Anyone who had experienced this?

  • Print "Current View" not avail in Acro 9

    I am trying to print a selected area on the page.  In prior versions, I could zoom in on the area, click print and then choose "Current view" under print range.  In Acrobat 9, I don't have "Current View", but I do have "Selected Pages".
    Is there a way to print the current view short of extracting the page, cropping it then printing it?
    The online help page at http://help.adobe.com/en_US/Acrobat/9.0/Standard/WS58a04a822e3e50102bd615109794195ff-7bde. w.html says it should be there, but it is not.

    Bernd,
    Just closing the "Pages" navigation panel does not do it.  What I figured out was that if a page is preselected in the "Pages" navigation panel, then I get "Selected Pages" in the print range. I get that even with the navigation panel closed.
    In order to get "Current View", I have to click off of the page in the navigation panel so that no page is preselected. Now I can print what is shown in the graphics window.
    Thanks for your help.
    Kirk

  • Design view not available with php pages

    I am using Dreamweaver CS 3, If I have a page with an file extension of .php I cannot view the page in design view. If I want to use design view I have to give it an extension of .htm, do the work then rename the file with a .php extension. Does anyone know what the problem is?

    Go to Edit > Preferences (or Dreamweaver > Preferences on a Mac), and select the File Types/Editors category from the list on the left. Make sure that .php is not among the list of files to open in code view.

  • DW CS4 - Design/Live view not available with PHP

    I am working with PHP documents but both Live View and Design View are grey and unavailable with PHP documants open. I am using MAMP and have set up local info and testing server in the site set up dialog several times myself and with the help of some web search with no difference. Any thoughts on what may be some things to check would be greatly appreciated.

    Hoooo Leeeee Moe Leeee...
    QUOTE"
    Have you changed your preferences to open PHP pages in Code view?
    In the File Types/Editors category of Preferences, if you add .php to the list of file name extensions in "Open in code view", it disables Design view and Live View for that type of file.
    I can not believe I searched for over 30 minutes to find out that adding .php to this field; disables one of the ONLY reasons I purchased CS5.
    Just for giggles, why would it be designed like this? "Open in code View" = a prefrence to what screen type you see, not, "I want to disable CS5 to pre CS2 version"...
    Well, just my two cents.  Now that I know, I will never do that again... So, Next question.  Is there a way to make Dreamweaver by default open in code view, without setting the tempting box to do it for you?
    Thanks ahead of time. By the way, I am greatful that someone has the answers! and I am glad that person is you sir = Enter the Adobe Expert.

  • Customer consignment stock view not available at Ship-to party level

    We have moved our stock to customer consignment stock using order type KB (Consignment fill-up). When we view stock situation using MB58 (Consignment at customer) the stock shows up under customer sold-to. However, we would like to see how much consignment stock do we have under each ship-to location. Is there any view or report in the system which shows consignment stock at each ship-to level?
    We have tried the following:
    1) We thought of making ship-to party equal to sold-to party thus using the same output (MB58) but we have several ship-to's (sometimes 50) per sold-to which will make sales analysis and pricing maintenance difficult (as our pricing is based on sold-to).
    2) We looked at table MSKU (Special Stocks with Customer) and in it stock is stored at the sold-to level and MB58 pulls out stock from this table only. We thought of using user exit to move ship-to number in MSKU table at the time of stock movement but then we will have to change ATP logic (user exit again) also for consignment issue orders and we would like to avoid all that in case there is a simpler solution.
    This seems to be a requirement which lot of customers would have, Are we missing something obvious. Please help.
    Regards
    Sandeep

    Thanks Buddi,
    Partner function SB works the way we wanted it to.
    Regards

  • Data Warehouse - Synchronization Performance view not available/working

    Hi!
    How can I populate this view. I have no Performance counters to choose from. see attached picture. Come to think of it, I have a lot of empty views and reports - why is that?
    Best regards
    Rune Haugen

    Hi,
    The performance collection rules are disabled by default. You just need to turn them on.
    For more information, please review the link below:
    Dell Management Packs in System Center Operations Manager 2007 R2
    http://serverfault.com/questions/150251/dell-management-packs-in-system-center-operations-manager-2007-r2
    We
    are trying to better understand customer views on social support experience, so your participation in this
    interview project would be greatly appreciated if you have time.
    Thanks for helping make community forums a great place.

Maybe you are looking for

  • Officejet Pro 8500A (A910) - garbled printing

    Hi, This problem has been going on now on and off for approximately 12 months.  I've a small office with a 4 computers connected to the printer wirelessly.  When printing large files, the printer can't seem to handle it and instead prints out numerou

  • Problem with PDF vie from coldfusiom

    Hi, I am using the following code to display pdf files which I have in a seperate folder. <cfoutput> <select id="airportid" name="AirportDropDown" onChange="foo(this);" style="font:8pt monospace; font-weight:500;"> <option value="" selected>         

  • Despite checking 'save and quit' before exit, I lose all tabs upon re-launch.

    This kind of thing keeps me from making Firefox my default browser. This never happens with Chrome.

  • Error when export DART file

    Hi, i m workin in project to use the DART for extract tax data and Documentum to store theses extractions and I have a problem when i export file to documentum 0) i m configuring the oac0 transction the content repository with the : basic Path : /usr

  • Put iPod Touch icons into folders and organized all my apps. iTunes keeps erasing them.

    Hi Everyone    New iPod touch owner. I arranged my icons into folders for all my apps. But everytime I connect to iTunes it erases all my folders. And moves all my icons around. Anyway to tell iTunes or the iPod to not keep erasing all my folders and