Cannot select from view even if she appears in ALL_VIEWS

Oracle documentation says that all_views "describes the views available to the user:

http://download.Oracle.com/docs/CD/B19306_01/server.102/b14237/statviews_2117.htm

DBA_OBJECTS appears in the ALL_VIEWS, but I get an error "table or view does not exist" when I try to choose in this one.

Any thoughts on why this is happening?
SQL> SELECT COUNT(1)
  FROM all_views
  WHERE owner = 'SYS'
  AND view_name = 'DBA_OBJECTS'

  COUNT(1)
----------
         1
1 row selected.
SQL> SELECT *
  FROM sys.dba_objects
SELECT *
  FROM sys.dba_objects
           *
Error at line 2
ORA-00942: table or view does not exist

Having the privilege of system "SELECT ANY TABLE" will let you see DBA_OBJECTS on ALL_VIEWS but does not let you choose in this one. You need explicit grant DBA_OBJECTS or DBA role to choose from in this one.

Check your session privileges:

SQL> select * from session_privs order by 1;

PRIVILEGE
----------------------------------------
CREATE CLUSTER
CREATE INDEXTYPE
CREATE OPERATOR
CREATE PROCEDURE
CREATE SEQUENCE
CREATE SESSION
CREATE TABLE
CREATE TRIGGER
CREATE TYPE
SELECT ANY TABLE
UNLIMITED TABLESPACE

11 rows selected.

SQL> SELECT COUNT(1)
  FROM all_views
  WHERE owner = 'SYS'
  AND view_name = 'DBA_OBJECTS';

  COUNT(1)
----------
         1

SQL> select * from sys.dba_objects;
select * from sys.dba_objects
                  *
ERROR at line 1:
ORA-00942: table or view does not exist

Published by: birlenbach Chase on January 5, 2010 11:07
Added example

Tags: Database

Similar Questions

  • Allowing only SELECT * FROM view?

    Hello world

    I would like to give to someone in a different organization access to our installation of Oracle 10 so he can get a copy of certain data of a BI tool. Our Oracle database is shared between several applications and some business people with ALS criticism difficult. I understand that the audit can give a user a potential overload, but of course, it is best to avoid such problems in the first place.

    I want to assure you that the one who gets access to our database can issue SQLs that are not too demanding for the DB. For example, I want to do not what he is able to use it AS. It would be preferable that the single SQL it could issue is a SELECT *;

    Is there such a feature in Oracle itself? You know a commercial ODBC or JDBC Proxy that could filter SQLs 'bad '?

    Thanks in advance,
    Chris

    You can activate profiles and limit the cpu and I/o usage and it will be automatically expelled when he exceeds his quota.
    CREATE a PROFILE search documentation.

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

  • Cannot select the Dictionary view user USER_TAB_COMMENT?

    Hello.

    I have this weird problem in 11.2.0.3

    I cannot select the view of the USER_TAB_COMMENT of a user dictionary, but others can.
    If I try to describe it, I get ORA-00942 and ORA-04043 messages.

    Here is my attempt. I create a comment on a table, try desc or select the view from the dictionary. Then connect with SYS and select the comment in the view "dba" to check if the comment was created:
    SQL> conn RODOLFO
    Introduzca la contraseña:
    Conectado.
    SQL> show user
    USER es "RODOLFO"
    SQL> comment on table DOCUMENTILLOS is 'This is a comment';
    
    Comentario creado.
    
    SQL> select table_name, comments from user_tab_comments;
    select table_name, comments from user_tab_comments
                                     *
    ERROR en línea 1:
    ORA-00942: la tabla o vista no existe
    
    SQL> desc user_tab_comments;
    ERROR:
    ORA-04043: el objeto "SYS"."DBA_TAB_COMMENTS" no existe
    
    
    SQL> desc all_tab_comments;
    ERROR:
    ORA-04043: el objeto "SYS"."DBA_TAB_COMMENTS" no existe
    
    
    SQL> conn / as sysdba
    Conectado.
    SQL> show user
    USER es "SYS"
    SQL> select owner, table_name, comments from dba_tab_comments
      2  where owner = 'RODOLFO' and table_name = 'DOCUMENTILLOS'
      3  ;
    
    OWNER                          TABLE_NAME
    ------------------------------ ------------------------------
    COMMENTS
    --------------------------------------------------------------------------------
    RODOLFO                       DOCUMENTILLOS
    This is a comment
    
    
    SQL>
    Other users, I don't have this problem
    SQL> conn MANOLO
    Introduzca la contraseña:
    Conectado.
    SQL> show user
    USER es "MANOLO"
    SQL> comment on table DOCS is 'This is a comment';
    
    Comentario creado.
    
    SQL> select table_name, comments from user_tab_comments where table_name = 'DOCS';
    
    TABLE_NAME
    ------------------------------
    COMMENTS
    --------------------------------------------------------------------------------
    DOCS
    This is a comment
    Clues why this is happening?

    Kind regards.

    elvegaa_esp wrote:
    What do you think?

    OK, the question is in the place where he is not pointing?

    Edit:
    Oh, it looks that it points to dba_tab_comments. Since your original post:

    desc user_tab_comments;
    ERROR:
    ORA-04043: el objeto "SYS"."DBA_TAB_COMMENTS" no existe
    

    Who do not have the right of Rodolfo.

    Thus, final to get rid of him.

    And a good thing that you do not 'go to your DBA"as suggested. It was just to choose the wrong solution to an unknown problem.

    Concerning
    Peter

    Published by: Peter on March 11, 2013 08:49

  • Hi I can not see the App health or my pulse in the looks on my watch even if she is selected to appear on eyes on my phone?

    Hi I can not see the App health or my pulse in the looks on my watch even if she is selected to appear on eyes on my phone?

    Hello

    Slide your finger left or right on the screen.

    Also go to ibooks on the user guide iphone download Apple Watch is free.

    See you soon

    Brian

  • ORA-01445 error: cannot select ROWID from where sample, a join without a view

    Hi all

    I get an error when I created a VO based EO with standard Table (forced) jtf_notes_vl
    It gives me the error ORA-01445: cannot select ROWID from where sample, a join without key preserved table view

    the Table has the ROW_ID as Primery key


    Thanks in advance

    Hello

    Creation of an EO-based the rowid as primary key is usually the cause of this error as is not recommended to use the rowid as the primary key. Try to use jtf_note_id as the primary key.

    Furthermore, why are you using NAV it is seen for the creation of EO. If I remember correctly, there is a JTF_NOTES_B and JTF_NOTES_TL table that you can use.

    Thank you
    AJ

  • ORA-01445: cannot select ROWID, or sample, a view of join without key - preserved table form w/report and LOV

    I create a page "Form on a Table with Report" (APEX 5). Table I has 3 columns: cat_key, item_value, item_description. The cat_key is a foreign key in a table with columns cat_key, cat_value. I created the report and everything works fine.  The page of the report shows my domain cat_key in number, so I want it instead to display the cat_value. I change the field cat_key to a text based on LOV, select my LOV and now when I view the page of report I get the "'ORA-01445: cannot select ROWID from where sample, a join without key preserved table view ' error." The report uses the ROWID as a link to the edit page field.

    If I use the same tables and even shared LOV in a report page interactive, it works fine.

    What I am doing wrong?

    This is a limitation of the IR Apex will rewrite your query to a query that includes the lookup table and the columns. So now you have actually created a query on an inline view, which causes the error. You can see the query apex created when running in debug mode. APEX will join the table of choice with your primary table. For example from one of my IR:

    Select 'ID '...

    "MSL". "" HIS_COUNTRIES "=> my primary table

    ) ) b,

    (select rv_meaning d, rv_low_value r

    of msl_ref_codes_table

    where rv_domain = "JOHN".

    ) L1 = > query My LOV Lookup

    ...

    So, if possible, base your reports and forms on the real primary key, no rowid.

    You can also write the IR query with the search yourself:

    Select T1.rowid...

    of primary_table T1

    look_table L1

    ...

  • Why when I choose a photo in the library grid view it does not appear in the window to develop up to selected in the Filmstrip below?

    Why when I choose a photo in the library grid view it does not appear in the window to develop up to selected in the Filmstrip below?

    It was the strangest thing, but I think I solved the problem. Use the CC version 2015.1 on a Wacom tablet using Win 8.1 and inadvertently from the same batch of photos, I had downloaded twice and it was very confusing because it did not prevent the duplication of files, but the files where not really there. I didn't know whether to remove or delete the files with question marks for fear of destroying a link or something so merged files and now everything works as it should, once chosen in the library that the photo appears in develop mode.

  • IPhone 5 Bluetooth icon sometimes does not appear on the status bar even though she was on

    Hello

    My iPhone 5 is a little weird lately after installing a new copy of ios 9.2.1 and I set up like new. Bluetooth icon sometimes does not appear on the status bar even if she was turned on.

    Here is my screenshot

    The application of settings

    Thanks in advance.

    I think it's one of those things. 1 you are not connected to anything with blue tooth here for you aren't really "use it" 2. Its a software problem and maybe if you take it to the apple store that they would turn you off and back on to reset it or you say to wait for the next update, if you want to save gas or if you ride or walk save energy if you the person who has a power car electric you can write a quick review with the Apple and say hey guys do a new update , I really need a heres my problem.

  • SQLite Select * from table1 - cannot see last line

    Hello

    I did some testing with SQLite component on the Simulator and ran into a problem. When I try to retrieve the data from the database (storage works great... open the db to an observer and data file has been stored properly), I can't get the last line of the query. I have something in the sense of the following:

    try {
          Statement _statement = m_db.createStatement("SELECT * FROM TABLE1");
          _statement.prepare();
          _statement.execute();
          Cursor _cursor = _statement.getCursor();
          if (_cursor != null) {
    
            while (_cursor.next()){
                Row _row = (Row)_cursor.getRow();
                // Read row. For example:
                int idx1 = _row.getColumnIndex("id");
                int idx2 = _row.getColumnIndex("name");
    
                String _id           = _row.getString(idx1);
                String _name         = _row.getString(idx2);
            }
          }
          _statement.close();
          _cursor.close();
        } catch (Throwable e) {
          Dialog.alert("unable to get row data");
        }
    

    The first problem is that _cursor.next does not succeed, and the loop is not executed. If I change the code to force it to enter the loop (ie. cursor.first and run the .getPixel etc... in any case), I always get the LAST row, even when I use the position (1, 2, 3, 4... etc) function. It's pretty boring. I develop this 5.0 and testing with 9700 Simulator. Any ideas why I would see only the last row?

    Why the next file in the thropugh code above, I can't retrieve a row in the database?

    Note I tried dogin cursor.first ()... . Run the .GetPixel and the. next(), don't always gets me the line after line and the other always returns false. I do a select empty in the database, all lines should be there (checked the structure of data in another program... it is fine), no idea why it isn't here?

    Thanks in advance.

    Figured this out, the _statement.execute (); should not be there.

  • Until a few days ago I was able to print a PDF from Acrobat Reader ms in Windows 7.  Now I get "the document could not be printed."  The next panel says "there are no pages selected to print," even if all the pages have been selected.  Thoughts?

    Until a few days ago I was able to print a PDF from Acrobat Reader ms in Windows 7.  Now I get "the document could not be printed."  The next panel says "there are no pages selected to print," even if all the pages have been selected.  I've uninstalled Reader and reinstalled, but the problem remains.  I also tried to repair the installation and that doesn't work anymore.

    Thanks for the tip.  It turned out that kind Reader has been commissioning in protected mode.  I changed the setting and it prints now as before.

    Thank you

  • 4.0 ai2 - cannot select and copy the code from a package body when opened in read-only mode

    4.0 ai2 - cannot select and copy the code from a package body when opened in read-only mode

    He was connected/buggy. It is not fixed yet. But it will be.

  • v4.0 - in the form of ORA-01445: cannot select ROWID from where sample,.

    Hello
    I have created a form in table form in version 4.0.
    Selection is based on three tables that have primary keys, the keys are selected, and whenever I run the page I get the following error:-
    Failed to parse the SQL query:
    ORA-01445: cannot select ROWID, or sample, join without table views preserved key

    The query runs very well in the TOAD

    Any ideas?

    Thank you

    Mike
    ___________________________________________________________________________________
    Select
    CTR. PERF_RATING_LINE_ID,
    CTR. PERF_RATING_LINE_ID PERF_RATING_LINE_ID_DISPLAY,
    CTR. BUSINESS_UNIT,
    CTR. EMPLID,
    ''''|| CTR. REVIEW_YEAR REVIEW_YEAR,
    CTR. REVIEW_PERIOD,
    CTR. PERFORMANCE_SCORE,
    CTR. MODERATED_SCORE,
    CTR. HUMAN RESOURCES MANAGEMENT,
    PRL.COMMENTS,
    ACB. BU_DESC,
    ''''|| ACB. DEPTID DEPTID,
    ACB. DEPT_DESC,
    ACB. EMPLOYEE_NAME,
    ACB. GRADE,
    CTR. SCORE_APPROVED_BY,
    ACB. TEMP_PERM,
    ACB. GENDER,
    ACB. JOB_START_DATE,
    decode (DECODE (SUBSTR (ACB. FLAG, 1, 5), "S Job", substr (CPR. FLAG, instr (CPR. FLAG,'~ ', 1) + 2, 3));
    "HIR", "Committed", "XFR", "Transfer", "REH", "recall").
    Decode (SUBSTR (ACB. FLAG, 1, 30), "work starts the period ~ XFR ',' - ' | substr (CPR. FLAG, instr (CPR. FLAG,'~ ', 1, 2) + 2)) JOB_START_DETAILS,.
    ACB. APPOINTMENT_DATE,
    SUBSTR (CPR. JOB_END_DETAILS, INSTR (CPR. JOB_END_DETAILS,'~ ', 1, 2) + 2) JOB_END_DATE.
    SUBSTR (CPR. JOB_END_DETAILS, INSTR (CPR. JOB_END_DETAILS,'~ ', 1, 1) + 2, INSTR (CPR. JOB_END_DETAILS,'~ ', 1, 2) - INSTR (CPR. JOB_END_DETAILS,'~ ', 1, 1)-2) REASON,
    ACB. JOB_GROUP,
    ACB. JOB_GROUP_DESC,
    ACB. JOBCODE,
    ACB. JOBCODE_DESC JOB_DESC,
    ACB. JOB_FAMILY,
    ACB. JOB_FAMILY_DESC,
    ACB. PBR_ID,
    MD. MGR_DEPT_ID
    PERFORMANCE_BASE_REFRESH_V ACB,.
    PERFORMANCE_RATING_LINE PRL,
    Y00_OPR_MGR_DEPT MD
    WHERE (PRL. BUSINESS_UNIT = ACB. BUSINESS_UNIT
    AND PRL. EMPLID = ACB. EMPLID
    AND PRL. REVIEW_YEAR = ACB. REVIEW_YEAR
    AND PRL. REVIEW_PERIOD = ACB. REVIEW_PERIOD)
    AND MD. OPRID =: APP_USER
    AND INSTR (': ' |) MD. DEPTS_MANAGED |': ',' :'|| ACB. DEPTID |': ') > 0
    AND MD. MGR_DEPT_ID > 0
    AND CPR. ADMIN_CENTRE IN
    (select c.deptid AC
    of PSHR. PSOPRDEFN@PSHR. CSIR.CO. ZA,.
    PSHR.PS_SCRTY_TBL_DEPT@PSHR. CSIR.CO. ZA C
    where A.ROWSECCLASS = C.ROWSECCLASS
    AND C.DEPTID! = 'ZZZZ '.
    and a.oprid =: APP_USER)
    AND (: P2210_BUSINESS_UNIT IS NULL)
    OR PBR. BUSINESS_UNIT =: P2210_BUSINESS_UNIT)
    AND (: P2210_EMPLOYEE_NAME IS NULL)
    OR INSTR (UPPER (CPR. Employee_name), UPPER (:P2210_EMPLOYEE_NAME)) > 0)
    AND (: P2210_DEPARTMENT IS NULL)
    OR PBR. DEPTID =: P2210_DEPARTMENT)
    AND (: P2210_PERFORMANCE_RATING IS NULL)
    OR PBR. PERFORMANCE_SCORE =: P2210_PERFORMANCE_RATING)
    AND (: P2210_MODERATED_RATING IS NULL)
    OR PBR. MODERATED_SCORE =: P2210_MODERATED_RATING)
    AND (: P2210_GRADE IS NULL)
    OR PBR. CATEGORY =: P2210_GRADE)
    AND (: P2210_PERM_TEMP IS NULL)
    OR PBR. TEMP_PERM =: P2210_PERM_TEMP)
    AND SUBSTR (NVL (ACB. (JOB_END_DETAILS, "XXX"), 1, 3) NOT ("TER", "TOC")
    AND PRL. SCORE_APPROVED_BY IS NULL

    Mike,

    We also changed our Wizard to create only validations for columns that are selected to be updated (in the wizard on the page in a table). And in the case of the application wizard, we examine if the columns have been excluded on the edit page popup page, and they are set to read-only through the default user interface. If you should only get validations for the columns that are modifiable, view-only / save state or hidden. We include only display / save state and hidden, because in both cases, you have actual shape on your page elements, which could easily be manipulated through common web tools.

    Kind regards
    Marc

  • ORA-22992: cannot use LOB Locators selected from the remote tables...

    Oracle 10.2.1.0.4
    Solaris 10

    We try to access a table in another database via a db_link.

    The table we are trying to access has a LOB.

    We get the following error: ora-22992: cannot use LOB Locators selected from the remote tables.

    Is there a way to get around this? We need the data in the BLOB field.

    Thank you.

    See on metalink:

    ORA-22992 has a workaround solution in 10 gr 2
    DOC - ID: 436707.1

    Werner

  • I've upgraded to 2015 CC Photoshop today.  However, the quick selection tools and brush do not appear in a circular/round shape.  I tried to use the support key to enlarge to see if that brings the circle/round view form, but does not work.  All the I

    I've upgraded to 2015 CC Photoshop today.  However, the quick selection tools and brush do not appear in a circular/round shape.  I tried to use the support key to enlarge to see if it carries the form circle/round in sight, but it does not work.  All I get is a focus.  Can anyone help with this please.  Thank you.

    Remove the caps lock

  • Error ORA-01031 insufficient privilege when selecting a view

    OK, I think it's maybe a stupid question, but I can't understand it:

    The user John won the right to SELECT (directly, not by a database role) to the FRED.table1 schema.
    John user can issue select * from FRED.table1; and it works very well.

    User John then got the right to SELECT (directly, without going through a database role) to the schema
    MARK.view1;

    MARK.view1 selects only FRED.table1. No other table is in the View1.
    Schema MARK questionable views successfully. SELECT * FROM View1 returns results.
    I also checked the MARK scheme to ensure that she got the select on FRED.table1 directly that he has.

    Now, when you're logged in schema John, I try SELECT * to SCORE. VIEW1; and I get error ORA-01031 insufficient privileges.

    I don't know how to solve this. If John is granted SELECT a TABLE, it works of course but I don't want John to have this powerful private.

    As a reminder, SELECT these two brands a John. View1 and the table View1 selects from (FRED. (TABLE 1).
    John can select FRED. Table1: no problem but does not receive a privilege error even if John has SELECT on the BRAND. VIEW1.

    Any thoughts?

    Oh, Oracle 10.2.0.4 EA

    JSebastian wrote:
    OK, I think it's maybe a stupid question, but I can't understand it:

    The user John won the right to SELECT (directly, not by a database role) to the FRED.table1 schema.
    John user can issue select * from FRED.table1; and it works very well.

    User John then got the right to SELECT (directly, without going through a database role) to the schema
    MARK.view1;

    MARK.view1 selects only FRED.table1. No other table is in the View1.
    Schema MARK questionable views successfully. SELECT * FROM View1 returns results.
    I also checked the MARK scheme to ensure that she got the select on FRED.table1 directly that he has.

    Now, when you're logged in schema John, I try SELECT * to SCORE. VIEW1; and I get error ORA-01031 insufficient privileges.

    I don't know how to solve this. If John is granted SELECT a TABLE, it works of course but I don't want John to have this powerful private.

    As a reminder, SELECT these two brands a John. View1 and the table View1 selects from (FRED. (TABLE 1).
    John can select FRED. Table1: no problem but does not receive a privilege error even if John has SELECT on the BRAND. VIEW1.

    Any thoughts?

    Oh, Oracle 10.2.0.4 EA

    Are you sure that John was granted select on Mark.view1? In order for that to work, Mark would have had to select on the WITH GRANT OPTION Fred.table1... otherwise the grant to fail and then John would not be able to select the view because the grant was never issued successfully.

    Here is a basic test case (which I think is consistent with what you said) to make it work.

    drop user u1 cascade;
    drop user u2 cascade;
    drop user u3 cascade;
    
    create user u1 identified by u1;
    grant connect, resource to u1; 
    
    create user u2 identified by u2;
    grant connect, resource, create view to u2;
    
    create user u3 identified by u3;
    grant connect, resource to u3;
    
    connect u1/u1@orcl
    create table test1 (col1 number);
    grant select on test1 to u2 with grant option; --> this is the important part
    grant select on test1 to u3;
    
    connect u2/u2@orcl
    create view test2 as select * from u1.test1;
    grant select on test2 to u3;
    
    connect u3/u3@orcl
    select * from u2.test2;
    

Maybe you are looking for