Access to the views dba procedure

Hi all
Using Oracle 10.2.0.5 on 64-bit RedHat, I meet a strange thing while trying to do a procedure: I can access dba_tablespace from sqlplus, but I can't leave a procedure...

This one works very well: Select tablespace_name dba_tablespaces;

But it gives me the error:
CREATE OR REPLACE PROCEDURE show_ts IS
BEGIN
FOR rec IN (SELECT FROM dba_tablespaces) *.
LOOP
NULL;
END LOOP;
END show_ts;

* 4/14 PL/SQL: statement ignored SQL *.
* 4/28 PL/SQL: ORA-00942: table or view does not exist *.

My user has DBA privileges and session_privs, I see those:
SELECT ANY DICTIONARY
SELECT ANY TABLE

dba_tablespaces seems to be part of the SYS schema, but change my request from dba_tablespaces to sys.dba_tablespaces gives me the same error...
I also have the same error with dba_users, but again, this works very well the procedure...

Does anyone know why?
Thank you!

Hello

PL/SQL disables roles. In order to access a table inside PL/SQL code you need to grant SELECT directly on the table.

Best regards
Nikolai

Tags: Database

Similar Questions

  • Windows asks for a password when you try to access to the "view work group computers."

    We are on a network.  Main computer, that we can access through the receptionist connect you and access shared files on this computer.  Computer from the receptionist, windows asks for a password when you try to access to the "view work group computers."  We tried to use its password.  However, the shared files are still not accessible.

    Hello

    1. what happens when you enter the password?

    2. how many computers are connected to this working group?

    Refer to this link and check: You cannot access shared files and folders or browse computers in the workgroup with Windows XP

    http://support.Microsoft.com/kb/318030

    I hope this helps!

  • with the accession of cloud creative as well as all my photos online, can I allow others access to the view my photos?

    with the accession of cloud creative as well as all my photos online, can I allow others access to the view my photos?

    Please check the latter:

    Store and share content with Adobe Creative active Cloud | Tutorials Adobe Creative Cloud

    Adobe Lightroom for FAQ mobile

    Adobe Creative Cloud desktop application: Questions and answers

    In the case still pending, please contact support for this: Support from Adobe

    Concerning

    Stéphane

  • Restrict access from the view of external endpoint

    Hello world

    I got an interesting question to come today: is it possible to restrict access to the view of physical endpoint?  This client does not support BYOD somehow and provided instead of thin laptops HP for their users access to the view since then at home, via a security gateway.  I know that you can disable the web interface from view completely, but they seek to block connections to nothing but these thin laptops.  Thank you!

    Here's a more recent document - https://www.vmware.com/files/pdf/VMware-View-KioskMode-WP-EN.pdf

  • Access to the view of the Oracle Applications via Dblink

    Hi gurus,

    Here's my problem:

    I installed on my local machine to apex and I created dblink to my applications remote oracle DB. Now, if I try to access all the views in the db to oracle applications, iam not getting data from the org context is not set.

    I tried to set the org context using below:

    exec dbms_application_info.set_client_info@appsdblink ('100');

    but still iam not received all data. I hope that there should be a way to do it.

    Thank you
    Sirot

    SK:

    What return the test script?
    You will need to run the context give code as a process before header or have the query of the report be returned by a pl/sql function in which you can set the context.

    CITY

  • Access to the viewer generator of

    How can I access the viewer constructor? I created an application multi-folio using my business account. I got the last generator of DPS app on my Mac and I don't have an option "Viewer bulder. Any ideas?

    Looks like you are looking to former instructions. "Viewer Builder" was changed to "DPS App Builder" a few years ago. DPS App Builder to create applications.

  • Need to get the result of joing the views dba

    Hello

    need to get the result of the fileds below in a database

    TABLE_NAME NOM_PARTITION NOM_TABLESPACE PARTITION_TYPE (RANGE?) PARTITION_RANGE_CONDITION SPACE_OCCUPIED_AS_OF_DATE (IN GB)

    can I know what are the points of view that I can use and application

    apprecaited for assistance

    Thank you

    Published by: user12266475 on November 2, 2011 11:33

    LONG data type is NOT friendly SQL.
    Consider the following:

    SQL> @long
    SQL> drop table test;
    
    Table dropped.
    
    SQL> create table test (id LONG);
    
    Table created.
    
    SQL> insert into test values(q'[RANGE     TO_DATE(' 2009-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')]');
    
    1 row created.
    
    SQL> set serveroutput on
    SQL> DECLARE
      2  long_var LONG;
      3  var_var  VARCHAR2(2000);
      4  BEGIN
      5       dbms_output.enable(10000);
      6       SELECT id INTO long_var FROM test ;
      7       var_var := substr(long_var,19,19);
      8       dbms_output.put_line(var_var);
      9  END;
     10  /
    2009-01-01 00:00:00
    
    PL/SQL procedure successfully completed.
    
  • How to grant security access to the views of the apps

    Hi hussein.


    What is the sql for grants of Security command, to be able to select the contents of a view in Oracle Applications 11i and R12?
    I have a vision of APPS. RA_CUSTOMER_LINES_TRX_V but I there is no selected line.


    Thank you very much


    Mrs. Mina

    Please see these documents.

    Note: 209185.1 - how to set the context of Applications (FND_GLOBAL. APPS_INITIALIZE)
    Note: 420787,1 - Oracle Applications multiple agencies of the custom Code access control
    Note: 462383.1 - queries SQL and the Architecture Multi-Org version 12
    Note: 165042,1 - FAQ - several organizations architecture (Multi-Org)

    Thank you
    Hussein

  • Can't access Conversation view under the view menu. With the help of 38.0a1 every day. Any ideas?

    I can access the Conversation view under the view menu in TB version final candidate 31.4.0. But he don't see under daily 38.0a1 of 64-bit version on different computers. Any help appreciated.

    THX

    Ok. Do not take into account. Apparently the conversation view is an Extension to tuberculosis, only not part of the base product. Hope that I would not lose too much of your time. Live and learn.

    Thank you
    Doug

  • View-> DBA is not showing the control panel connections s/n

    I am running SQL Developer Version 4.0.3.16

    If I click on the view-> s/n
    The DBA group is not displayed.

    Is this a bug or I do something wrong?

    Just found my answer.

    I clicked on window-> Windows reset to factory settings

    I then clicked on display-> s/n, and the DBA group

  • Access the views Where the access to the underlying data, through a role

    I have a user (say User1) who granted select access to motherlode via a role table

    User1 has a bunch of useful views created I want User2 to have access to the. User2 should have access only to these points of view, not to the underlying table.

    User1 can grant access to his point of view because it has no direct access granted to motherlode tables.

    I managed, based on a technique that I have for the most part, but do not entirely understand, give User2 access to data through a function. The solution is below.

    My general question is: y at - it an easier way (other than the grant direct access to the motherlode User1 tables)?

    My question is: the definition is possible shorter somehow. I know I can automate the production of the code for some of the statements using metadata, but, for example, is it possible to base the declaration of type (t_p5) on the existing view? (I have about 15 views I need to provide access)

    Solution is, where v_p5 is the original view:

    User 1:

    CREATE or replace type t_p5 as an object

    (< columns and data types of v_p5 >

    )  ;

    CREATE or REPLACE TYPE t_p5_tab AS TABLE OF THE t_p5;

    FUNCTION to CREATE or REPLACE f_provide_p5 RETURN t_p5_tab

    PIPELINED IS

    l_cur SYS_REFCURSOR;

    l_rec v_p5% rowtype;

    BEGIN

    L_cur OPEN FOR ' SELECT * FROM v_p5';

    LOOP

    EXTRACTION l_cur

    IN l_rec;

    EXIT WHEN l_cur % NOTFOUND;

    GUIDELINE (t_p5 (area = > l_rec.region))

    , district_name = > l_rec.district_name

    , current_month = > l_rec.current_month

    , p_current = > l_rec.p_current

    , previous_month = > l_rec.previous_month

    , p_prev = > l_rec.p_prev

    , diffp = > l_rec.diffp

    , diff_perc = > l_rec.diff_perc

    , previous_year = > l_rec.previous_year

    , p_year = > l_rec.p_year

    , diffy = > l_rec.diffy

    , perc_diffy = > l_rec.perc_diffy

    ));

    END LOOP;

    RETURN;

    EXCEPTION

    WHILE OTHERS THEN

    raise_application_error (-20000, SQLERRM |) Chr (10) | l_sql);

    END;

    And user2:

    VIEW to CREATE or REPLACE v_p5 AS

    SELECT * FROM TABLE (User1.f_provide_p5);

    I can then do a select * from v_p5 in User2 and return the view data.

    Thank you.

    Hello

    Don't bother with the pipeline and PL/SQL functions.  Everything will be easier, more effective and more reliable if you use only views.

    Privileges through roles do not create a view on a table in another schema.

    If user1 can create a view on motherlode.table_x, then user1 should have direct privileges already (or user1 must have a privilege of system as SELECT ANY TABLE).

    User1 needs the same privileges WITH GRANT OPTION in order to grant privileges on his point of view to User2.  To do this, have motherlode grant privileges to user1, like this:

    GRANT SELECT ON table_x to User1 WITH GRANT OPTION;

    GRANT SELECT ON table_y to User1 WITH GRANT OPTION;

    Repeat for each table that user1 uses in the views.

    Then user1 will be able to grant privileges on views to User2 like this:

    GRANT SELECT ON my_view_01 TO user2.

    This will NOT allow user2 directly see the motherlode.table_x.  User1 will have the power to give privileges to User2, but simply grant privileges on the view does not give User2 these privileges.

    If you don't want User1 to have this power, then create the views in the motherlode scheme, or create a new schema only for the putpose to own these views.

  • 'Performance' is missing for the node after activate it "View &gt; DBA.

    Version 4.0.1.14

    Build HAND-14, 48

    Open the DBA ' View > DBA ', expand the connection of interest, you try expand the node of the 'Performance '. But the 'Performance' node is missing.

    Someone knows why? This option should be available in this version.

    Thank you
    Eugen

    Hi Eugen,

    Node of the view of the DBA Performance developed for me against a 11.2.0.1 4.0.1 database with just the Pack Tuning license check box selected.  This could be one of those situations where...

    1. the database to which you are connecting is a version prior to 10 g R1, when Tuning Pack became available.

    2. you may hit a bug caused by not using is not a recent version of Java JDK 7, for example jdk1.7.0_51 or higher.

    3. your preferences of user for the 4.0.1 has been corrupted somehow.

    So if (1) is not the reason, check and upgrade the JDK if necessary, then consider creating newly migrated, or the new default, user settings.   Just...

    1. exit SQL Developer, delete/rename system4.0.1.14.48, restart SQL Developer (possibly without the migration of user settings).

    2 download and install the 4.0.2 patch now available.  Start SQL Developer (possibly without the migration of user settings).

    Hope this helps,

    Gary

    SQL development team

  • difference between the view and the procedure

    Hi Master,

    Today I received a request from my senior technical leader... !!

    Q > what is the difference between the view and the procedure?

    I got response like this...

    A view represents the logic of one or more tables/views. It won't take no place in db... It is a virtual table, query will only store in db... useful

    for safety... If the main table has obtained changes... automatically discovers also change... etc.

    Proecudure is a db object will be performs a perticular action... It may or may not return values. ?

    But somehow, he isn't happy... He expects more... .very close view of diff. b & w and procedure.

    Please explain it to me...!

    Concerning

    AR

    874273 wrote:

    Hi Blu,

    Thanks for your replies...! But we think if notice and procedure will be the same no matter what point of view? Both are the same? If Design view... We can create a stored procedure?

    How a view and procedure may do the same thing?  They are two different things with different objectives.  You use the correct one depending on what you want to achieve; they are not interchangeable.

    And another question...!

    (Q) how you will store Japan, characters of China in a database table? will there be a new feature in Oracle 11 g?

    (A) I use dbms_lob package? Japan/China characters are multi byte characters... so we can use the nclob data type?

    is this correct... ?

    No, it not there no novelty in Oracle 11 g for the storage of Japanese or Chinese characters, because there is already a feature for their storage in previous versions as well.  It is determined by the parameters characterset and nationality that you use when you create the database.

    Why would you choose to store them in a LOB using DBMS_LOB?  Yes, they have multibyte characters, but if you have configured your database for the correct character sets, for example using UTF - 8, then you can store the characters in VARCHAR2, like any other language.  The only difference is that the storage of 4000 bytes limit still applies, so you maybe isn't able to store 4000 multibyte characters in a varchar2 column 4000 single-byte, it can be as little as 1000 characters if they are all characters in 4 bytes.  (Note: 12 c limit in SQL can be increased up to 32,767 characters, to harmonize it with variable varchar2 PL)

  • Procedure to display the view number and execution time


    Hi all

    I'm creating a procedure to display the name of the view and its County and runtime to get this number if we adopt the view name in the procedure. so far, I have created the script below but it does not give any number. Please suggest me an idea to achieve this. I use Oracle Database 11 g Enterprise Edition Release 11.2.0.3.0 - 64 bit Production.

    CREATE OR REPLACE PROCEDURE VIEW_TIME_SP ( P_VIEW_NAME IN VARCHAR2 )
    IS
      V_START_DATE TIMESTAMP;
      V_END_DATE  TIMESTAMP;
      V_ROW_COUNT NUMBER;
      V_SQL       VARCHAR2(1000);
      V_LOG       VARCHAR2(1000);
      V_EXECUTION_TIME INTERVAL DAY TO SECOND;
      V_VIEW_NAME  VARCHAR2(40);
    
    BEGIN
    V_VIEW_NAME := P_VIEW_NAME;
    EXECUTE IMMEDIATE 'ALTER SESSION SET NLS_DATE_FORMAT = ''dd-Mon-yyyy hh24:mi:ss''';
         
    V_START_DATE := CURRENT_TIMESTAMP;
    V_ROW_COUNT := 0;
    V_SQL := 'SELECT COUNT(*) INTO' || V_ROW_COUNT || ' FROM '  || V_VIEW_NAME;
    EXECUTE IMMEDIATE V_SQL;
    V_END_DATE := CURRENT_TIMESTAMP;
    V_EXECUTION_TIME := V_END_DATE - V_START_DATE;
    V_LOG := V_VIEW_NAME || ' returns ' || V_ROW_COUNT || ' and completed in ' || V_EXECUTION_TIME;
    DBMS_OUTPUT.PUT_LINE (V_LOG);
    EXCEPTION
      WHEN OTHERS THEN
       DBMS_OUTPUT.PUT_LINE ('process failed:' || SQLCODE || ': ' || SQLERRM);
    END VIEW_TIME_SP;
    

    Appreciate your help.

    Thank you

    Hello

    MSB says:

    Hi all

    I'm creating a procedure to display the name of the view and its County and runtime to get this number if we adopt the view name in the procedure. so far, I have created the script below but it does not give any number. Please suggest me an idea to achieve this. I use Oracle Database 11 g Enterprise Edition Release 11.2.0.3.0 - 64 bit Production.

    1. CREATE OR REPLACE PROCEDURE VIEW_TIME_SP (P_VIEW_NAME IN VARCHAR2)
    2. IS
    3. V_START_DATE TIMESTAMP;
    4. V_END_DATE TIMESTAMP;
    5. NUMBER OF V_ROW_COUNT;
    6. V_SQL VARCHAR2 (1000);
    7. V_LOG VARCHAR2 (1000);
    8. V_EXECUTION_TIME INTERVAL DAY TO SECOND.
    9. V_VIEW_NAME VARCHAR2 (40);
    10. BEGIN
    11. V_VIEW_NAME: = P_VIEW_NAME;
    12. EXECUTE IMMEDIATE 'ALTER SESSION SET NLS_DATE_FORMAT = "dd-Mon-yyyy hh24:mi:ss" ';
    13. V_START_DATE: = CURRENT_TIMESTAMP;
    14. V_ROW_COUNT: = 0;
    15. V_SQL: = ' SELECT COUNT (*) IN "| V_ROW_COUNT | 'FROM ' | V_VIEW_NAME;
    16. IMMEDIATELY RUN V_SQL;
    17. V_END_DATE: = CURRENT_TIMESTAMP;
    18. V_EXECUTION_TIME: = V_END_DATE - V_START_DATE;
    19. V_LOG: = V_VIEW_NAME | 'returns "| V_ROW_COUNT | "and completed in | V_EXECUTION_TIME;
    20. DBMS_OUTPUT. PUT_LINE (V_LOG);
    21. EXCEPTION
    22. WHILE OTHERS THEN
    23. DBMS_OUTPUT. Put_line (' process failed:' |) SQLCODE. ': ' || SQLERRM);
    24. END VIEW_TIME_SP;

    Appreciate your help.

    Thank you

    Whenever you write dynamic SQL code, during the debugging phase, display the dynamic string before running it.  For example

    V_SQL: = ' SELECT COUNT (*) IN "| V_ROW_COUNT | 'FROM ' | V_VIEW_NAME;
    dbms_output.put_line (v_sql |) '= v_sql in view_time_sp");
    IMMEDIATELY RUN V_SQL;

    You will see that v_sql is something like:

    SELECT COUNT (*) VIEW_X INTO0'

    You do not want the value of v_row_count; you want the name v_row_count, and he didn't need to be part of the dynamic statement.  Try this:

    V_SQL: = ' SELECT COUNT (*) FROM "| V_VIEW_NAME;
    dbms_output.put_line (v_sql |) '= v_sql in view_time_sp");
    EXECUTE IMMEDIATE V_SQL IN v_row_count;

  • Copy the views and the procedure...

    Hello

    How to copy views and procedures of a schema into another schema with subsidies.

    Thank you

    How many views and functions are available in your database?

    If you want to copy only views & functions and also limited, then you can go to the metadata of objects and run... but I prefer you to use the entire schema views.

    You can use export & import schema objects or sqlfile option.

Maybe you are looking for

  • Tecra S3 (PTS30E-01K014FR) - where can I find the SATA drivers?

    Hello My friend's father just bought a Toshiba Tecra S3 PTS30E-01k014fr with XP pro installed work but I'm admin password to use the computer. So I want to reinstall Windows xp but the drive is not detected by the installation of XP. Where can I find

  • Intel Wifi Link 1000 bgn short range

    Hello, I have RMA had my Ideapad Y560 2 times and still have a problem, they stated that the Wifi has been tested and fully functional. Here's my problem. I can ONLY get connected wireless to my router/modem when I'm in the same room as the router. O

  • processing in Kannada on macpro

    I want to do word processing in Kannada on mac pro. How to do? Please explain.

  • Windows Live ID sign-in assistant has stopped working

    I had downloaded windows live ID sign in assistant and no longer had to type the user name and password for each hotmail account and outlook. All of a sudden, I have to type in all that every time I go to an account. I lost all the icons I just click

  • frame restoration date windows visited

    I can't set a restore date that precedes the current date. There is no option to reset the date. It automatically selects the current date.Is there a way to get around this?