Explain plan privileges
Hi,
in order to use the explain plan feature inside the worksheet (sqldev 2.1, 15 Dec 09), sqldev requires the SELECT_CATALOG_ROLE and the SELECT ANY DICTIONARY privileges.
Why?
1. Even with only the classic CONNECT and RESOURCE roles granted, I can execute "explain plan for ..." and "select * from table(dbms_xplan.display);" and get the xplan.
2. Don't you see the problems in persuading those hard core DBAs, that developers need xplan - and yes, they can read them???
1. seems one of those bugs... there are more areas that need such privileges. DEV?
2. was requested at the Exchange, but sadly rejected. You can request it again, but seen the scarce support on votes, it would just be rejected again.
Regards,
K.
Similar Messages
-
What are the privileges required for explain plan in Oracle 11g database
I am facing the problem in doing a explain plan for a view in Oracle 11g database. When I select from the view like this:
select * from zonewisearpu
It does a select on the view but when I give explain plan like
explain plan for
select * from zonewisearpu
I get the error like insufficient privileges.
Please let me know if things are getting missed out as I guess system level privileges are required to execute this.
I hope, my question is clear.
It’s a humble request to revert urgently if possible as I need to complete a task and do not know the way out.
Regards975148 wrote:
Thanks for your reply. I have found out that an explain plan is possible on the user's own objects and is not possible on the granted objects from a different schema. For eg, if I do a explain plan on a view querying on tables from a different view, it would not allow the explain plan to proceed. This could mean that explain plan needs different privileges than just a select.
Requesting for a revert to this.
Here is a simple test case that I have perfomed
SQL> create user test1 identified by test1;
User created.
SQL> create user test2 identified by test1;
User created.
SQL> grant connect, resource to test1,test2;
Grant succeeded.
SQL> create table test1.tab1 as select * from v$session;
Table created.
SQL> connect test2/test1
Conencted.
SQL> show user
USER is "TEST2"
SQL>
SQL> explain plan for
2 select sid,serial#,status,username from test1.tab1 where username<> '';
Explained.
SQL>
So, as can be seen I am able to do a explain plan from user test2 for tables belong to user test1.
As far as privileges are concerned, following is the list
SQL> select * from dba_role_privs where grantee in ('TEST1','TEST2') order by 1;
GRANTEE GRANTED_ROLE ADM DEF
TEST1 CONNECT NO YES
TEST1 RESOURCE NO YES
TEST2 CONNECT NO YES
TEST2 RESOURCE NO YES
SQL>
SQL> select grantee,owner,table_name,privilege from dba_tab_privs where grantee in ('TEST1','TEST2') order by 1;
GRANTEE OWNER TABLE_NAME PRIVILEGE
TEST2 TEST1 TAB1 SELECT
SQL>
SQL> select * from dba_sys_privs where grantee in ('TEST1','TEST2') order by 1;
GRANTEE PRIVILEGE ADM
TEST1 UNLIMITED TABLESPACE NO
TEST2 UNLIMITED TABLESPACE NO
SQL> -
ERROR: insufficient privileges while using EXPLAIN PLAN command
Hi,
I have a table named TEST and i ran following command on this table.
SQL> EXPLAIN PLAN FOR
2 SELECT NAME FROM TEST;
SELECT NAME FROM TEST
ERROR at line 2:
ORA-01031: insufficient privileges
So which privilege do i need to give for using EXPLAIN PLAN command.
Thank.http://download-east.oracle.com/docs/cd/B19306_01/server.102/b14211/ex_plan.htm#i19260
SQL> @C:\oracle\product\10.2.0\db_1\RDBMS\ADMIN\utlxplan.sql
Table created.
SQL> select table_name from user_tables where table_name='PLAN_TABLE';
TABLE_NAME
PLAN_TABLE
You might consider checking dba_tables to check the owner in your case and may be you don't privilege on that table. -
What privileges or role is required for user to acces the explain plan?
Hi mates,
Can anyone pls tell me what privileges or roles(grants) are requred for a user to access the explain plan in oORACLE 8i 8174..
I think the select any dictionary is not valid for explain plan accessibility in 8i.
Cheers.I already had that... Just that a user (not a dba) requires access to the explain plan and I dont want to grant him a dba role.
Are you aware of any other grant I can give to the user? -
ORA-01039: insufficient privileges... on EXPLAIN PLAN but OK when run
I get
ORA-01039: insufficient privileges on underlying objects of the viewwhen I use EXPLAIN PLAN but if I actually run the SQL it is fine!
SQL> explain plan for select * from ifsinfo.gscdb_xref;
explain plan for select * from ifsinfo.gscdb_xref
ERROR at line 1:
ORA-01039: insufficient privileges on underlying objects of the view
SQL>select * from ifsinfo.gscdb_xref;
GSCDB_COMPANY COMPANY VARCHAR2
GSCDB_COMPANY NAME VARCHAR2
GSCDB_COMPANY ADDRESS1 VARCHAR2
GSCDB_COMPANY ADDRESS2 VARCHAR2
GSCDB_COMPANY ZIP_CODE VARCHAR2
GSCDB_COMPANY CITY VARCHAR2
GSCDB_COMPANY COUNTY VARCHAR2
GSCDB_COMPANY STATE VARCHAR2
GSCDB_COMPANY COUNTRY_DB VARCHAR2
GSCDB_COMPANY GSCDB_LAST_UPDATE VARCHAR2
GSCDB_CUSTOMER CUSTOMER_ID VARCHAR2
GSCDB_CUSTOMER NAME VARCHAR2
GSCDB_CUSTOMER ADDRESS_ID VARCHAR2
:...in which case (providing the SQLs in question are SELECT statements) you may be better off with DBMS_SQL.PARSE rather than explain plan.
-
What privileges needed for producing explain plan for other user's object ?
Hi there,
What privileges needed for producing explain plan for other user's object (tables) ?
Cheers
SoheilExperiment: (public plan table exists)
create user bob identified by bob;
grant create session to bob;
connect bob/bob
start sample_plan
If will error off on the table being read in the plan
connect dba_or_privileged_user
grant select on the referenced_table(s) to bob;
connect bob/bob
start sample_plan
It will now work providing a public plan table exists or you give bob create table and create a bob.plan_table
I ran the experiment on Oracle version 9.2.0.6 running on AIX 5.3. Select privilege on all referenced tables in the explained SQL must exist
HTH -- Mark D Powell -- -
Ora-01039 - Insuffficient priviliges - Tuning using Explain Plan
In a TEST instance, i am trying (as the APPS user) on a 9.2.0.5 DB (11.5.10.2) trying to run an explain plan on a query but keep getting the 'ora-01039 - Insuffficient privileges on underlying objects of view' error message.
I have granted 'select any dictionary' to both the APPS and APPLSYS users - but this does not seem to enable the explain plan to work.
Could someone please shed some light on this?
TksYou seem to be doin an Explain Plan on a query against a custom view against non-Apps objects.
Explain Plan needs to be able to "see" the underlying tables (in that other schema).
See :
SQL> create view his_cntry_vw as select * from my_cntry;
View created.
SQL> grant select on his_cntry_vw to abc;
Grant succeeded.
SQL> connect abc/abc
Connected.
SQL> create synonym his_cntry_vw for otheruser.his_cntry_vw;
Synonym created.
SQL> select * from his_cntry_vw;
GRP_I CNTRY
ABC Z9
XYZ UK
SQL> explain plan for select * from his_cntry_vw;
explain plan for select * from his_cntry_vw
ERROR at line 1:
ORA-01039: insufficient privileges on underlying objects of the view
SQL> REM THIS IS THE FIX :
SQL> connect otheruser/otheruser
Connected.
SQL> grant select on my_cntry to abc;
Grant succeeded.
SQL> connect abc/abc
Connected.
SQL> explain plan for select * from his_cntry_vw;
Explained.
SQL>Hemant K Chitale
http://hemantoracledba.blogspot.com -
Hi,
While executing the query i am getting the following error,
SQL> explain plan for
2 select * from user_objects;
select * from user_objects
ERROR at line 2:
ORA-01039: insufficient privileges on underlying objects of the view
But same query works in other schema. Is there any privilege has to be granted.Hi,
The user_objects view references some objects owned by SYS. It looks like you do not have enough object or system privileges on these objects. -
Explain plan for timesten and Oracle
we have a base table in our Oracle 10g database. We created a DSN for this in timesten 7.0 database and are able to connect. Now we have created 3 materialized views in timesten on top of the Oracle Base Table. How can we get the explain plan in timesten to find out when the table is being called by a custom java application, the materialized views are being used or not ? Please advice
Hi Can you help me in this regards,
i am getting the following error. Can you tell me how can i get rid of them?
Command> call ttcachestart();
15001: User lacks privilege ADMIN -
Verbose EXPLAIN PLAN output when asking for explain plan on simple SQL
Hello. In a nutshell I have two issues: first, inability to execute EXPLAIN PLAN via SET AUTOTRACE ON EXPLAIN, and second, extremely verbose output when I log on as SYSDBA to circumvent the first issue.
So, issue number one:
I am trying to get an EXPLAIN PLAN via SET AUTOTRACE ON EXPLAIN for a simple SQL query:
1 select decode(rownum,1,'JAN', 2,'FEB',3,'MAR',4,'APR',5,'MAY',6,'JUN',7,'JUL',8,'AUG',9,'SEP',10,'OCT',11,'NOV',12,'DEC')
2* from all_objects where rownum<13
HR@XE> /
DEC
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
NOV
DEC
12 rows selected.
HR@XE> set autotrace on explain
HR@XE> /
DEC
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
NOV
DEC
12 rows selected.
Execution Plan
ERROR:
ORA-01039: insufficient privileges on underlying objects of the viewSo, first question, why am I getting this error? ALL_OBJECTS should be available to everybody, no?
So to circumvent this I log on as sysdba and get the second issue: the following extremely verbose output
HR@XE> connect / as sysdba
Connected.
SYS@XE> select decode(rownum,1,'JAN', 2,'FEB',3,'MAR',4,'APR',5,'MAY',6,'JUN',7,'JUL',8,'AUG',9,'SEP',10,'OCT',11,'NOV',12,'DEC')
2 from all_objects where rownum<13;
DEC
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
NOV
DEC
12 rows selected.
SYS@XE> set autotrace on explain
SYS@XE> /
DEC
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
NOV
DEC
12 rows selected.
Execution Plan
Plan hash value: 1291336664
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | 12 | 3240 | 5 (20)| 00:00:01 |
|* 1 | COUNT STOPKEY | | | | | |
|* 2 | FILTER | | | | | |
|* 3 | HASH JOIN | | 32 | 8640 | 5 (20)| 00:00:01 |
| 4 | INDEX FULL SCAN | I_USER2 | 49 | 1078 | 1 (0)| 00:00:01 |
|* 5 | HASH JOIN | | 32 | 5248 | 4 (25)| 00:00:01 |
| 6 | INDEX FULL SCAN | I_USER2 | 49 | 196 | 1 (0)| 00:00:01 |
|* 7 | TABLE ACCESS FULL | OBJ$ | 33 | 2640 | 2 (0)| 00:00:01 |
|* 8 | TABLE ACCESS BY INDEX ROWID | IND$ | 1 | 8 | 2 (0)| 00:00:01 |
|* 9 | INDEX UNIQUE SCAN | I_IND1 | 1 | | 1 (0)| 00:00:01 |
|* 10 | HASH JOIN | | 1 | 24 | 3 (34)| 00:00:01 |
|* 11 | INDEX RANGE SCAN | I_OBJAUTH1 | 1 | 11 | 2 (0)| 00:00:01 |
| 12 | FIXED TABLE FULL | X$KZSRO | 100 | 1300 | 0 (0)| 00:00:01 |
|* 13 | FIXED TABLE FULL | X$KZSPR | 1 | 26 | 0 (0)| 00:00:01 |
|* 14 | FIXED TABLE FULL | X$KZSPR | 1 | 26 | 0 (0)| 00:00:01 |
| 15 | NESTED LOOPS | | | | | |
| 16 | NESTED LOOPS | | 1 | 73 | 6 (0)| 00:00:01 |
| 17 | NESTED LOOPS | | 1 | 63 | 4 (0)| 00:00:01 |
| 18 | NESTED LOOPS | | 1 | 52 | 3 (0)| 00:00:01 |
| 19 | MERGE JOIN CARTESIAN | | 1 | 48 | 2 (0)| 00:00:01 |
|* 20 | INDEX RANGE SCAN | I_OBJ5 | 1 | 35 | 2 (0)| 00:00:01 |
| 21 | BUFFER SORT | | 100 | 1300 | 0 (0)| 00:00:01 |
| 22 | FIXED TABLE FULL | X$KZSRO | 100 | 1300 | 0 (0)| 00:00:01 |
|* 23 | INDEX RANGE SCAN | I_USER2 | 1 | 4 | 1 (0)| 00:00:01 |
|* 24 | INDEX RANGE SCAN | I_OBJAUTH1 | 1 | 11 | 1 (0)| 00:00:01 |
|* 25 | INDEX RANGE SCAN | I_DEPENDENCY1 | 4 | | 1 (0)| 00:00:01 |
|* 26 | TABLE ACCESS BY INDEX ROWID | DEPENDENCY$ | 1 | 10 | 2 (0)| 00:00:01 |
|* 27 | FIXED TABLE FULL | X$KZSPR | 1 | 26 | 0 (0)| 00:00:01 |
|* 28 | HASH JOIN | | 1 | 24 | 3 (34)| 00:00:01 |
|* 29 | INDEX RANGE SCAN | I_OBJAUTH1 | 1 | 11 | 2 (0)| 00:00:01 |
| 30 | FIXED TABLE FULL | X$KZSRO | 100 | 1300 | 0 (0)| 00:00:01 |
|* 31 | FIXED TABLE FULL | X$KZSPR | 1 | 26 | 0 (0)| 00:00:01 |
| 32 | NESTED LOOPS | | 2 | 48 | 2 (0)| 00:00:01 |
|* 33 | INDEX RANGE SCAN | I_OBJAUTH1 | 1 | 11 | 2 (0)| 00:00:01 |
|* 34 | FIXED TABLE FULL | X$KZSRO | 2 | 26 | 0 (0)| 00:00:01 |
| 35 | NESTED LOOPS | | 1 | 38 | 2 (0)| 00:00:01 |
| 36 | NESTED LOOPS | | 1 | 25 | 2 (0)| 00:00:01 |
|* 37 | TABLE ACCESS BY INDEX ROWID | TRIGGER$ | 1 | 14 | 1 (0)| 00:00:01 |
|* 38 | INDEX UNIQUE SCAN | I_TRIGGER2 | 1 | | 0 (0)| 00:00:01 |
|* 39 | INDEX RANGE SCAN | I_OBJAUTH1 | 1 | 11 | 1 (0)| 00:00:01 |
|* 40 | FIXED TABLE FULL | X$KZSRO | 1 | 13 | 0 (0)| 00:00:01 |
|* 41 | FIXED TABLE FULL | X$KZSPR | 1 | 26 | 0 (0)| 00:00:01 |
| 42 | NESTED LOOPS | | | | | |
| 43 | NESTED LOOPS | | 1 | 73 | 6 (0)| 00:00:01 |
| 44 | NESTED LOOPS | | 1 | 63 | 4 (0)| 00:00:01 |
| 45 | NESTED LOOPS | | 1 | 52 | 3 (0)| 00:00:01 |
| 46 | MERGE JOIN CARTESIAN | | 1 | 48 | 2 (0)| 00:00:01 |
|* 47 | INDEX RANGE SCAN | I_OBJ5 | 1 | 35 | 2 (0)| 00:00:01 |
| 48 | BUFFER SORT | | 100 | 1300 | 0 (0)| 00:00:01 |
| 49 | FIXED TABLE FULL | X$KZSRO | 100 | 1300 | 0 (0)| 00:00:01 |
|* 50 | INDEX RANGE SCAN | I_USER2 | 1 | 4 | 1 (0)| 00:00:01 |
|* 51 | INDEX RANGE SCAN | I_OBJAUTH1 | 1 | 11 | 1 (0)| 00:00:01 |
|* 52 | INDEX RANGE SCAN | I_DEPENDENCY1 | 4 | | 1 (0)| 00:00:01 |
|* 53 | TABLE ACCESS BY INDEX ROWID | DEPENDENCY$ | 1 | 10 | 2 (0)| 00:00:01 |
|* 54 | FIXED TABLE FULL | X$KZSPR | 1 | 26 | 0 (0)| 00:00:01 |
|* 55 | FIXED TABLE FULL | X$KZSPR | 1 | 26 | 0 (0)| 00:00:01 |
|* 56 | FIXED TABLE FULL | X$KZSPR | 1 | 26 | 0 (0)| 00:00:01 |
| 57 | NESTED LOOPS | | 2 | 68 | 2 (0)| 00:00:01 |
| 58 | NESTED LOOPS | | 1 | 21 | 2 (0)| 00:00:01 |
| 59 | TABLE ACCESS BY INDEX ROWID | TABPART$ | 1 | 10 | 1 (0)| 00:00:01 |
|* 60 | INDEX UNIQUE SCAN | I_TABPART_OBJ$ | 1 | | 0 (0)| 00:00:01 |
|* 61 | INDEX RANGE SCAN | I_OBJAUTH1 | 1 | 11 | 1 (0)| 00:00:01 |
|* 62 | FIXED TABLE FULL | X$KZSRO | 2 | 26 | 0 (0)| 00:00:01 |
|* 63 | FIXED TABLE FULL | X$KZSPR | 1 | 26 | 0 (0)| 00:00:01 |
|* 64 | FIXED TABLE FULL | X$KZSPR | 1 | 26 | 0 (0)| 00:00:01 |
|* 65 | FIXED TABLE FULL | X$KZSPR | 1 | 26 | 0 (0)| 00:00:01 |
|* 66 | FIXED TABLE FULL | X$KZSPR | 1 | 26 | 0 (0)| 00:00:01 |
|* 67 | FIXED TABLE FULL | X$KZSPR | 1 | 26 | 0 (0)| 00:00:01 |
|* 68 | FIXED TABLE FULL | X$KZSPR | 1 | 26 | 0 (0)| 00:00:01 |
|* 69 | FIXED TABLE FULL | X$KZSPR | 1 | 26 | 0 (0)| 00:00:01 |
|* 70 | FIXED TABLE FULL | X$KZSPR | 1 | 26 | 0 (0)| 00:00:01 |
|* 71 | FIXED TABLE FULL | X$KZSPR | 1 | 26 | 0 (0)| 00:00:01 |
|* 72 | FIXED TABLE FULL | X$KZSPR | 1 | 26 | 0 (0)| 00:00:01 |
|* 73 | FIXED TABLE FULL | X$KZSPR | 1 | 26 | 0 (0)| 00:00:01 |
|* 74 | FIXED TABLE FULL | X$KZSPR | 1 | 26 | 0 (0)| 00:00:01 |
| 75 | VIEW | | 1 | 13 | 2 (0)| 00:00:01 |
| 76 | FAST DUAL | | 1 | | 2 (0)| 00:00:01 |
|* 77 | FIXED TABLE FULL | X$KZSPR | 1 | 26 | 0 (0)| 00:00:01 |
|* 78 | FIXED TABLE FULL | X$KZSPR | 1 | 26 | 0 (0)| 00:00:01 |
|* 79 | FIXED TABLE FULL | X$KZSPR | 1 | 26 | 0 (0)| 00:00:01 |
|* 80 | FIXED TABLE FULL | X$KZSPR | 1 | 26 | 0 (0)| 00:00:01 |
|* 81 | FIXED TABLE FULL | X$KZSPR | 1 | 26 | 0 (0)| 00:00:01 |
|* 82 | FIXED TABLE FULL | X$KZSPR | 1 | 26 | 0 (0)| 00:00:01 |
| 83 | NESTED LOOPS | | 2 | 42 | 2 (0)| 00:00:01 |
|* 84 | INDEX RANGE SCAN | I_OBJAUTH1 | 1 | 8 | 2 (0)| 00:00:01 |
|* 85 | FIXED TABLE FULL | X$KZSRO | 2 | 26 | 0 (0)| 00:00:01 |
|* 86 | FIXED TABLE FULL | X$KZSPR | 1 | 26 | 0 (0)| 00:00:01 |
| 87 | NESTED LOOPS | | 2 | 42 | 2 (0)| 00:00:01 |
|* 88 | INDEX RANGE SCAN | I_OBJAUTH1 | 1 | 8 | 2 (0)| 00:00:01 |
|* 89 | FIXED TABLE FULL | X$KZSRO | 2 | 26 | 0 (0)| 00:00:01 |
|* 90 | FIXED TABLE FULL | X$KZSPR | 1 | 26 | 0 (0)| 00:00:01 |
| 91 | VIEW | | 1 | 16 | 1 (0)| 00:00:01 |
| 92 | SORT GROUP BY | | 1 | 86 | 1 (0)| 00:00:01 |
| 93 | NESTED LOOPS | | 1 | 86 | 1 (0)| 00:00:01 |
| 94 | MERGE JOIN CARTESIAN | | 1 | 78 | 0 (0)| 00:00:01 |
| 95 | NESTED LOOPS | | 1 | 65 | 0 (0)| 00:00:01 |
|* 96 | INDEX UNIQUE SCAN | I_OLAP_CUBES$ | 1 | 13 | 0 (0)| 00:00:01 |
|* 97 | TABLE ACCESS BY INDEX ROWID| OLAP_DIMENSIONALITY$ | 1 | 52 | 0 (0)| 00:00:01 |
|* 98 | INDEX RANGE SCAN | I_OLAP_DIMENSIONALITY$ | 1 | | 0 (0)| 00:00:01 |
| 99 | BUFFER SORT | | 1 | 13 | 0 (0)| 00:00:01 |
| 100 | INDEX FULL SCAN | I_OLAP_CUBE_DIMENSIONS$ | 1 | 13 | 0 (0)| 00:00:01 |
|*101 | INDEX RANGE SCAN | I_OBJ1 | 1 | 8 | 1 (0)| 00:00:01 |
| 102 | NESTED LOOPS | | 1 | 30 | 2 (0)| 00:00:01 |
|*103 | INDEX SKIP SCAN | I_USER2 | 1 | 20 | 1 (0)| 00:00:01 |
|*104 | INDEX RANGE SCAN | I_OBJ4 | 1 | 10 | 1 (0)| 00:00:01 |
Predicate Information (identified by operation id):
1 - filter(ROWNUM<13)
2 - filter(("O"."TYPE#"<>1 AND "O"."TYPE#"<>10 OR "O"."TYPE#"=1 AND (SELECT 1 FROM "SYS"."IND$"
"I" WHERE "I"."OBJ#"=:B1 AND ("I"."TYPE#"=1 OR "I"."TYPE#"=2 OR "I"."TYPE#"=3 OR "I"."TYPE#"=4 OR
"I"."TYPE#"=6 OR "I"."TYPE#"=7 OR "I"."TYPE#"=9))=1) AND (("O"."SPARE3"=USERENV('SCHEMAID') OR
"O"."SPARE3"=1) OR "O"."TYPE#"=13 AND ( EXISTS (SELECT 0 FROM "SYS"."OBJAUTH$" "OA",SYS."X$KZSRO"
"X$KZSRO" WHERE "OA"."GRANTEE#"="KZSROROL" AND "OA"."OBJ#"=:B2 AND ("OA"."PRIVILEGE#"=12 OR
"OA"."PRIVILEGE#"=26)) OR EXISTS (SELECT 0 FROM SYS."X$KZSPR" "X$KZSPR" WHERE
"INST_ID"=USERENV('INSTANCE') AND ((-"KZSPRPRV")=(-184) OR (-"KZSPRPRV")=(-181) OR
(-"KZSPRPRV")=(-241)))) OR ("O"."TYPE#"=1 OR "O"."TYPE#"=2 OR "O"."TYPE#"=3 OR "O"."TYPE#"=4 OR
"O"."TYPE#"=5 OR "O"."TYPE#"=19 OR "O"."TYPE#"=20 OR "O"."TYPE#"=34 OR "O"."TYPE#"=35) AND EXISTS
(SELECT 0 FROM SYS."X$KZSPR" "X$KZSPR" WHERE "INST_ID"=USERENV('INSTANCE') AND ((-"KZSPRPRV")=(-45)
OR (-"KZSPRPRV")=(-47) OR (-"KZSPRPRV")=(-48) OR (-"KZSPRPRV")=(-49) OR (-"KZSPRPRV")=(-50))) OR
"O"."TYPE#"=11 AND ( EXISTS (SELECT 0 FROM "SYS"."OBJAUTH$" "OA","SYS"."DEPENDENCY$"
"DEP",SYS."USER$" "U",SYS."OBJ$" "O",SYS."X$KZSRO" "X$KZSRO" WHERE "O"."NAME"=:B3 AND
"O"."SPARE3"=:B4 AND "O"."TYPE#"=9 AND "O"."TYPE#"<>88 AND "O"."OWNER#"="U"."USER#" AND
"DEP"."D_OBJ#"=:B5 AND "DEP"."P_OBJ#"="O"."OBJ#" AND "OA"."OBJ#"="O"."OBJ#" AND "OA"."PRIVILEGE#"=26
AND "OA"."GRANTEE#"="KZSROROL") OR EXISTS (SELECT 0 FROM SYS."X$KZSPR" "X$KZSPR" WHERE
((-"KZSPRPRV")=(-141) OR (-"KZSPRPRV")=(-241)) AND "INST_ID"=USERENV('INSTANCE'))) OR ("O"."TYPE#"=7
OR "O"."TYPE#"=8 OR "O"."TYPE#"=9 OR "O"."TYPE#"=28 OR "O"."TYPE#"=29 OR "O"."TYPE#"=30 OR
"O"."TYPE#"=56) AND ( EXISTS (SELECT 0 FROM "SYS"."OBJAUTH$" "OA",SYS."X$KZSRO" "X$KZSRO" WHERE
"OA"."GRANTEE#"="KZSROROL" AND "OA"."OBJ#"=:B6 AND ("OA"."PRIVILEGE#"=12 OR "OA"."PRIVILEGE#"=26)) OR
EXISTS (SELECT 0 FROM SYS."X$KZSPR" "X$KZSPR" WHERE "INST_ID"=USERENV('INSTANCE') AND
((-"KZSPRPRV")=(-144) OR (-"KZSPRPRV")=(-141) OR (-"KZSPRPRV")=(-241)))) OR "O"."TYPE#"<>14 AND
"O"."TYPE#"<>28 AND "O"."TYPE#"<>29 AND "O"."TYPE#"<>30 AND "O"."TYPE#"<>56 AND "O"."TYPE#"<>93 AND
"O"."TYPE#"<>7 AND "O"."TYPE#"<>8 AND "O"."TYPE#"<>9 AND "O"."TYPE#"<>11 AND "O"."TYPE#"<>12 AND
"O"."TYPE#"<>13 AND EXISTS (SELECT 0 FROM "SYS"."OBJAUTH$" "OBJAUTH$",SYS."X$KZSRO" "X$KZSRO" WHERE
"GRANTEE#"="KZSROROL" AND "OBJ#"=:B7 AND ("PRIVILEGE#"=3 OR "PRIVILEGE#"=6 OR "PRIVILEGE#"=7 OR
"PRIVILEGE#"=9 OR "PRIVILEGE#"=10 OR "PRIVILEGE#"=11 OR "PRIVILEGE#"=12 OR "PRIVILEGE#"=16 OR
"PRIVILEGE#"=17 OR "PRIVILEGE#"=18)) OR "O"."TYPE#"=12 AND ( EXISTS (SELECT 0 FROM "SYS"."OBJAUTH$"
"OA","SYS"."TRIGGER$" "T",SYS."X$KZSRO" "X$KZSRO" WHERE "OA"."GRANTEE#"="KZSROROL" AND "T"."OBJ#"=:B8
AND BITAND("T"."PROPERTY",24)=0 AND "OA"."OBJ#"="T"."BASEOBJECT" AND "OA"."PRIVILEGE#"=26) OR EXISTS
(SELECT 0 FROM SYS."X$KZSPR" "X$KZSPR" WHERE ((-"KZSPRPRV")=(-152) OR (-"KZSPRPRV")=(-241)) AND
"INST_ID"=USERENV('INSTANCE'))) OR "O"."TYPE#"=14 AND ( EXISTS (SELECT 0 FROM "SYS"."OBJAUTH$"
"OA","SYS"."DEPENDENCY$" "DEP",SYS."USER$" "U",SYS."OBJ$" "O",SYS."X$KZSRO" "X$KZSRO" WHERE
"O"."NAME"=:B9 AND "O"."SPARE3"=:B10 AND "O"."TYPE#"=13 AND "O"."TYPE#"<>88 AND
"O"."OWNER#"="U"."USER#" AND "DEP"."D_OBJ#"=:B11 AND "DEP"."P_OBJ#"="O"."OBJ#" AND
"OA"."OBJ#"="O"."OBJ#" AND "OA"."PRIVILEGE#"=26 AND "OA"."GRANTEE#"="KZSROROL") OR EXISTS (SELECT 0
FROM SYS."X$KZSPR" "X$KZSPR" WHERE ((-"KZSPRPRV")=(-181) OR (-"KZSPRPRV")=(-241)) AND
"INST_ID"=USERENV('INSTANCE'))) OR ("O"."TYPE#"=66 OR "O"."TYPE#"=100) AND EXISTS (SELECT 0 FROM
SYS."X$KZSPR" "X$KZSPR" WHERE (-"KZSPRPRV")=(-265) AND "INST_ID"=USERENV('INSTANCE')) OR
("O"."TYPE#"=67 OR "O"."TYPE#"=79) AND EXISTS (SELECT 0 FROM SYS."X$KZSPR" "X$KZSPR" WHERE
((-"KZSPRPRV")=(-265) OR (-"KZSPRPRV")=(-266)) AND "INST_ID"=USERENV('INSTANCE')) OR "O"."TYPE#"=19
AND EXISTS (SELECT 0 FROM SYS."TABPART$" "TABPART$","SYS"."OBJAUTH$" "OBJAUTH$",SYS."X$KZSRO"
"X$KZSRO" WHERE "GRANTEE#"="KZSROROL" AND "BO#"="OBJ#" A)
3 - access("O"."OWNER#"="U"."USER#")
5 - access("O"."SPARE3"="U"."USER#")
7 - filter("O"."NAME"<>'_NEXT_OBJECT' AND "O"."NAME"<>'_default_auditing_options_' AND
BITAND("O"."FLAGS",128)=0 AND "O"."LINKNAME" IS NULL)
8 - filter("I"."TYPE#"=1 OR "I"."TYPE#"=2 OR "I"."TYPE#"=3 OR "I"."TYPE#"=4 OR "I"."TYPE#"=6 OR
"I"."TYPE#"=7 OR "I"."TYPE#"=9)
9 - access("I"."OBJ#"=:B1)
10 - access("OA"."GRANTEE#"="KZSROROL")
11 - access("OA"."OBJ#"=:B1)
filter("OA"."PRIVILEGE#"=12 OR "OA"."PRIVILEGE#"=26)
13 - filter("INST_ID"=USERENV('INSTANCE') AND ((-"KZSPRPRV")=(-184) OR (-"KZSPRPRV")=(-181) OR
(-"KZSPRPRV")=(-241)))
14 - filter("INST_ID"=USERENV('INSTANCE') AND ((-"KZSPRPRV")=(-45) OR (-"KZSPRPRV")=(-47) OR
(-"KZSPRPRV")=(-48) OR (-"KZSPRPRV")=(-49) OR (-"KZSPRPRV")=(-50)))
20 - access("O"."SPARE3"=:B1 AND "O"."NAME"=:B2 AND "O"."TYPE#"=9)
filter("O"."TYPE#"=9 AND "O"."TYPE#"<>88)
23 - access("O"."OWNER#"="U"."USER#")
24 - access("OA"."OBJ#"="O"."OBJ#" AND "OA"."GRANTEE#"="KZSROROL" AND "OA"."PRIVILEGE#"=26)
filter("OA"."PRIVILEGE#"=26 AND "OA"."GRANTEE#"="KZSROROL")
25 - access("DEP"."D_OBJ#"=:B1)
26 - filter("DEP"."P_OBJ#"="O"."OBJ#")
27 - filter(((-"KZSPRPRV")=(-141) OR (-"KZSPRPRV")=(-241)) AND "INST_ID"=USERENV('INSTANCE'))
28 - access("OA"."GRANTEE#"="KZSROROL")
29 - access("OA"."OBJ#"=:B1)
filter("OA"."PRIVILEGE#"=12 OR "OA"."PRIVILEGE#"=26)
31 - filter("INST_ID"=USERENV('INSTANCE') AND ((-"KZSPRPRV")=(-144) OR (-"KZSPRPRV")=(-141) OR
(-"KZSPRPRV")=(-241)))
33 - access("OBJ#"=:B1)
filter("PRIVILEGE#"=3 OR "PRIVILEGE#"=6 OR "PRIVILEGE#"=7 OR "PRIVILEGE#"=9 OR "PRIVILEGE#"=10
OR "PRIVILEGE#"=11 OR "PRIVILEGE#"=12 OR "PRIVILEGE#"=16 OR "PRIVILEGE#"=17 OR "PRIVILEGE#"=18)
34 - filter("GRANTEE#"="KZSROROL")
37 - filter(BITAND("T"."PROPERTY",24)=0)
38 - access("T"."OBJ#"=:B1)
39 - access("OA"."OBJ#"="T"."BASEOBJECT" AND "OA"."PRIVILEGE#"=26)
filter("OA"."PRIVILEGE#"=26)
40 - filter("OA"."GRANTEE#"="KZSROROL")
41 - filter(((-"KZSPRPRV")=(-152) OR (-"KZSPRPRV")=(-241)) AND "INST_ID"=USERENV('INSTANCE'))
47 - access("O"."SPARE3"=:B1 AND "O"."NAME"=:B2 AND "O"."TYPE#"=13)
filter("O"."TYPE#"=13 AND "O"."TYPE#"<>88)
50 - access("O"."OWNER#"="U"."USER#")
51 - access("OA"."OBJ#"="O"."OBJ#" AND "OA"."GRANTEE#"="KZSROROL" AND "OA"."PRIVILEGE#"=26)
filter("OA"."PRIVILEGE#"=26 AND "OA"."GRANTEE#"="KZSROROL")
52 - access("DEP"."D_OBJ#"=:B1)
53 - filter("DEP"."P_OBJ#"="O"."OBJ#")
54 - filter(((-"KZSPRPRV")=(-181) OR (-"KZSPRPRV")=(-241)) AND "INST_ID"=USERENV('INSTANCE'))
55 - filter((-"KZSPRPRV")=(-265) AND "INST_ID"=USERENV('INSTANCE'))
56 - filter(((-"KZSPRPRV")=(-265) OR (-"KZSPRPRV")=(-266)) AND "INST_ID"=USERENV('INSTANCE'))
60 - access("OBJ#"=:B1)
61 - access("BO#"="OBJ#" AND "PRIVILEGE#"=9)
filter("PRIVILEGE#"=9)
62 - filter("GRANTEE#"="KZSROROL")
63 - filter("INST_ID"=USERENV('INSTANCE') AND ((-"KZSPRPRV")=(-189) OR (-"KZSPRPRV")=(-190) OR
(-"KZSPRPRV")=(-191) OR (-"KZSPRPRV")=(-192)))
64 - filter((-"KZSPRPRV")=(-109) AND "INST_ID"=USERENV('INSTANCE'))
65 - filter(((-"KZSPRPRV")=(-177) OR (-"KZSPRPRV")=(-178)) AND "INST_ID"=USERENV('INSTANCE'))
66 - filter("INST_ID"=USERENV('INSTANCE') AND ((-"KZSPRPRV")=(-45) OR (-"KZSPRPRV")=(-47) OR
(-"KZSPRPRV")=(-48) OR (-"KZSPRPRV")=(-49) OR (-"KZSPRPRV")=(-50)))
67 - filter("INST_ID"=USERENV('INSTANCE') AND ((-"KZSPRPRV")=(-205) OR (-"KZSPRPRV")=(-206) OR
(-"KZSPRPRV")=(-207) OR (-"KZSPRPRV")=(-208)))
68 - filter("INST_ID"=USERENV('INSTANCE') AND ((-"KZSPRPRV")=(-200) OR (-"KZSPRPRV")=(-201) OR
(-"KZSPRPRV")=(-202) OR (-"KZSPRPRV")=(-203) OR (-"KZSPRPRV")=(-204)))
69 - filter(((-"KZSPRPRV")=(-222) OR (-"KZSPRPRV")=(-223)) AND "INST_ID"=USERENV('INSTANCE'))
70 - filter((-"KZSPRPRV")=12 AND "INST_ID"=USERENV('INSTANCE'))
71 - filter("INST_ID"=USERENV('INSTANCE') AND ((-"KZSPRPRV")=(-251) OR (-"KZSPRPRV")=(-252) OR
(-"KZSPRPRV")=(-253) OR (-"KZSPRPRV")=(-254)))
72 - filter("INST_ID"=USERENV('INSTANCE') AND ((-"KZSPRPRV")=(-258) OR (-"KZSPRPRV")=(-259) OR
(-"KZSPRPRV")=(-260) OR (-"KZSPRPRV")=(-261)))
73 - filter("INST_ID"=USERENV('INSTANCE') AND ((-"KZSPRPRV")=(-246) OR (-"KZSPRPRV")=(-247) OR
(-"KZSPRPRV")=(-248) OR (-"KZSPRPRV")=(-249)))
74 - filter(((-"KZSPRPRV")=(-268) OR (-"KZSPRPRV")=(-267)) AND "INST_ID"=USERENV('INSTANCE'))
77 - filter(((-"KZSPRPRV")=(-277) OR (-"KZSPRPRV")=(-278)) AND "INST_ID"=USERENV('INSTANCE'))
78 - filter("INST_ID"=USERENV('INSTANCE') AND ((-"KZSPRPRV")=(-292) OR (-"KZSPRPRV")=(-293) OR
(-"KZSPRPRV")=(-294)))
79 - filter("INST_ID"=USERENV('INSTANCE') AND ((-"KZSPRPRV")=(-282) OR (-"KZSPRPRV")=(-283) OR
(-"KZSPRPRV")=(-284) OR (-"KZSPRPRV")=(-285)))
80 - filter("INST_ID"=USERENV('INSTANCE') AND ((-"KZSPRPRV")=(-302) OR (-"KZSPRPRV")=(-303) OR
(-"KZSPRPRV")=(-304) OR (-"KZSPRPRV")=(-305) OR (-"KZSPRPRV")=(-306) OR (-"KZSPRPRV")=(-307)))
81 - filter("INST_ID"=USERENV('INSTANCE') AND ((-"KZSPRPRV")=(-315) OR (-"KZSPRPRV")=(-316) OR
(-"KZSPRPRV")=(-317) OR (-"KZSPRPRV")=(-318)))
82 - filter("INST_ID"=USERENV('INSTANCE') AND ((-"KZSPRPRV")=(-320) OR (-"KZSPRPRV")=(-321) OR
(-"KZSPRPRV")=(-322)))
84 - access("OBJ#"=:B1)
85 - filter("GRANTEE#"="KZSROROL")
86 - filter("INST_ID"=USERENV('INSTANCE') AND ((-"KZSPRPRV")=(-309) OR (-"KZSPRPRV")=(-310) OR
(-"KZSPRPRV")=(-311) OR (-"KZSPRPRV")=(-312) OR (-"KZSPRPRV")=(-313)))
88 - access("OBJ#"=:B1)
89 - filter("GRANTEE#"="KZSROROL")
90 - filter("INST_ID"=USERENV('INSTANCE') AND ((-"KZSPRPRV")=(-302) OR (-"KZSPRPRV")=(-303) OR
(-"KZSPRPRV")=(-304) OR (-"KZSPRPRV")=(-305) OR (-"KZSPRPRV")=(-306) OR (-"KZSPRPRV")=(-307)))
96 - access("C"."OBJ#"=:B1)
97 - filter("DIML"."DIMENSION_TYPE"=11)
98 - access("DIML"."DIMENSIONED_OBJECT_ID"=:B1 AND "DIML"."DIMENSIONED_OBJECT_TYPE"=1)
101 - access("DIML"."DIMENSION_ID"="DO"."OBJ#")
filter("DO"."OBJ#"="DIM"."OBJ#")
103 - access("U2"."TYPE#"=2 AND "U2"."SPARE2"=TO_NUMBER(SYS_CONTEXT('userenv','current_edition_id')))
filter("U2"."TYPE#"=2 AND "U2"."SPARE2"=TO_NUMBER(SYS_CONTEXT('userenv','current_edition_id')))
104 - access("O2"."DATAOBJ#"=:B1 AND "O2"."TYPE#"=88 AND "O2"."OWNER#"="U2"."USER#")
SYS@XE>Many thanks in advance.
JasonWelcome to the forum!
Whenever you post please provide your 4 digit Oracle Version (result of SELECT * FROM V$VERSION).
>
So, first question, why am I getting this error? ALL_OBJECTS should be available to everybody, no?
>
Your user probably does have access to ALL_OBJECTS. But you need to have dba privileges to access views base objects.
The "ORA-01039: insufficient privileges on underlying objects of the view" message is telling you that the user does not have privileges to access the BASE OBJECTS that used to build the view. Access to those base objects is necessary to generate the plan you are trying to see.
So to circumvent this I log on as sysdba and get the second issue: the following extremely verbose output
>
And that is because sysdba DOES have access to the base objects of the view. You asked for a plan and you got it. That verbose output IS the plan and all of those oddly named tables are being accessed to satisfy your query so are included in the plan.
Do your query using DUAL or the SCOTT.EMP table and you won't get the error. -
Not able to execute the explain plan in development.
Hi In TOAD when try to click "Explain plan current statement." icon, I getting the below error message. ORA-00604: error occurred at recursive SQL level 1 ORA-01950: no privileges on table space 'DEFAULT_DATA' can anybody give some idea to solve this issue?
Is this a new user? You could be running out of quota.
Ask your DBA to user on that tablespace.
Alter user <username> quota unlimited on DEFAULT_DATA;
OR
Title
When I do an Explain Plan, I get the error: ORA-00604: error occurred at recursive SQL level 1 OR
Description I get the error below when I run / execute an Explain Plan.ORA-00604: error occurred at recursive SQL level 1 ORA-01536: space quota exceeded for tablespace ‘USERS’ (not same but similar)
Resolution Ensure the Plan Table your Toad is using exists, valid, and can use enough space in the tablespace or give unlimited tablespace rights. Setting Toad to use the PLAN_TABLE from SYS schema via View menu | Toad Options | Oracle | General | Explain Plan can resolve the issue as well. -
How to enable Explain plan in TOAD
Hi,
I am using toad version 8.6.1.Whenever i login as my userid and run a sql stmnt i am trying to get explain plan from toad explain plan button.But it's not showing anything some times it says insuffcient privileges.I created synonym called plan_table which is based on actual plan_table.But no luck.Can you pls help me how to enable explain plan in toad
Thanks
AnandAnand,
in earlier versions of Toad you could use the notoad.sql or toadprep.sql to create the required tables.
In your version it is probably already has been replaced by menu option Tools->Server Side Object Wizard.
Toad does not use the plan_table - it creates it's own set of tables including the table for the explain plan.
Mike -
Hi,
in sqldevloper 3.1.07 some users (system or those with DBA role) can generate an explain plan but not all users.
Is there any option or privilege to grant ?
Thank you.F6 : in SQL Developer runs an AutoTrace,and actually runs the SQL and also displays timings and the explain plan.
F10. : explain plan
Read
http://www.thatjeffsmith.com/archive/2012/02/quick-tip-comparing-explain-plans-with-sql-developer/ -
Explain plan left the building
Hello guys, i have interesting problem, at least it seemed to me like that.
I am on 10.2.0.4.0 and for every statement i do explain plan i get the same plan ???.
Propably very known issue to some, but i didn't exeperienced that till now, so if somene have some advice, please share.
E.g.
SQL> explain plan for select user from dual;
Explained.
SQL> select * from table(dbms_xplan.display);
Plan hash value: 3995103059
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time | Inst |
| 0 | SELECT STATEMENT REMOTE | | 1 | 96 | 97591 (5)| 00:05:07 | |
| 1 | SORT ORDER BY | | 1 | 96 | 97591 (5)| 00:05:07 | |
|* 2 | TABLE ACCESS BY INDEX ROWID| CCONTACT_ALL | 1 | 54 | 3 (0)| 00:00:01 | VIPBS~ |
| 3 | NESTED LOOPS | | 1 | 96 | 97590 (5)| 00:05:07 | |
|* 4 | TABLE ACCESS FULL | CUSTOMER_ALL | 1 | 42 | 97587 (5)| 00:05:07 | VIPBS~ |
|* 5 | INDEX RANGE SCAN | PKCCONTACT_ALL | 1 | | 2 (0)| 00:00:01 | VIPBS~ |
Predicate Information (identified by operation id):
2 - filter("A1"."CCCONTRACT"='X')
4 - filter((TO_NUMBER("A2"."CSCOMPTAXNO")=3007943362918 OR
TO_NUMBER("A2"."PASSPORTNO")=0109965330447) AND (TO_NUMBER("A2"."CSLEVEL")=10 OR
TO_NUMBER("A2"."CSLEVEL")=20 AND "A2"."TMCODE"<>59 AND "A2"."TMCODE"<>42 AND "A2"."TMCODE"<>61
AND "A2"."TMCODE"<>11 AND "A2"."TMCODE"<>19) AND "A2"."CSTYPE"='a' AND "A2"."PAYMNTRESP"='X')
5 - access("A1"."CUSTOMER_ID"="A2"."CUSTOMER_ID")
filter("A1"."CUSTOMER_ID"<>0)
Note
- 'PLAN_TABLE' is old version
- fully remote statement
28 rows selected....so, it looks like i am doing all that just with select user from dual .... : ) ... ok
SQL> explain plan for
2 SELECT param_value
3 FROM ncis.cis_case_script_vars
4 WHERE case_id = 296645706 AND seq = 1 AND param_name = 'OHOPNAMT';
Explained.
SQL> select * from table(dbms_xplan.display);
Plan hash value: 3995103059
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time | Inst |
| 0 | SELECT STATEMENT REMOTE | | 1 | 96 | 97591 (5)| 00:05:07 | |
| 1 | SORT ORDER BY | | 1 | 96 | 97591 (5)| 00:05:07 | |
|* 2 | TABLE ACCESS BY INDEX ROWID| CCONTACT_ALL | 1 | 54 | 3 (0)| 00:00:01 | VIPBS~ |
| 3 | NESTED LOOPS | | 1 | 96 | 97590 (5)| 00:05:07 | |
|* 4 | TABLE ACCESS FULL | CUSTOMER_ALL | 1 | 42 | 97587 (5)| 00:05:07 | VIPBS~ |
|* 5 | INDEX RANGE SCAN | PKCCONTACT_ALL | 1 | | 2 (0)| 00:00:01 | VIPBS~ |
Predicate Information (identified by operation id):
2 - filter("A1"."CCCONTRACT"='X')
4 - filter((TO_NUMBER("A2"."CSCOMPTAXNO")=3007943362918 OR
TO_NUMBER("A2"."PASSPORTNO")=0109965330447) AND (TO_NUMBER("A2"."CSLEVEL")=10 OR
TO_NUMBER("A2"."CSLEVEL")=20 AND "A2"."TMCODE"<>59 AND "A2"."TMCODE"<>42 AND "A2"."TMCODE"<>61
AND "A2"."TMCODE"<>11 AND "A2"."TMCODE"<>19) AND "A2"."CSTYPE"='a' AND "A2"."PAYMNTRESP"='X')
5 - access("A1"."CUSTOMER_ID"="A2"."CUSTOMER_ID")
filter("A1"."CUSTOMER_ID"<>0)
Note
- 'PLAN_TABLE' is old version
- fully remote statement
28 rows selected.
SQL>..same plan for different sql...
..and now, i am trying to explain plan for several easy sqls but look...
SQL> explain plan for select * from all_objects where rownum < 2;
explain plan for select * from all_objects where rownum < 2
ERROR at line 1:
ORA-01039: insufficient privileges on underlying objects of the view
SQL> explain plan for select * from user_tables ;
explain plan for select * from user_tables
ERROR at line 1:
ORA-01039: insufficient privileges on underlying objects of the view
SQL> desc all_objects
Name Null? Type
OWNER NOT NULL VARCHAR2(30)
OBJECT_NAME NOT NULL VARCHAR2(30)
SUBOBJECT_NAME VARCHAR2(30)
OBJECT_ID NOT NULL NUMBER
DATA_OBJECT_ID NUMBER
OBJECT_TYPE VARCHAR2(19)
CREATED NOT NULL DATE
LAST_DDL_TIME NOT NULL DATE
TIMESTAMP VARCHAR2(19)
STATUS VARCHAR2(7)
TEMPORARY VARCHAR2(1)
GENERATED VARCHAR2(1)
SECONDARY VARCHAR2(1)...i can't figure this out... maybe i have to flush 'explain plan' ? it's ok if it sounds funny,im off with ideas..
then i tried to explain this sql:
SQL> explain plan for
2 SELECT param_value
3 FROM ncis.cis_case_script_vars
4 WHERE case_id = 296645706 AND seq = 1 AND param_name = 'OHOPNAMT';
Explained.
SQL> select * from table(dbms_xplan.display);
Plan hash value: 3995103059
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time | Inst |
| 0 | SELECT STATEMENT REMOTE | | 1 | 96 | 97591 (5)| 00:05:07 | |
| 1 | SORT ORDER BY | | 1 | 96 | 97591 (5)| 00:05:07 | |
|* 2 | TABLE ACCESS BY INDEX ROWID| CCONTACT_ALL | 1 | 54 | 3 (0)| 00:00:01 | VIPBS~ |
| 3 | NESTED LOOPS | | 1 | 96 | 97590 (5)| 00:05:07 | |
|* 4 | TABLE ACCESS FULL | CUSTOMER_ALL | 1 | 42 | 97587 (5)| 00:05:07 | VIPBS~ |
|* 5 | INDEX RANGE SCAN | PKCCONTACT_ALL | 1 | | 2 (0)| 00:00:01 | VIPBS~ |
Predicate Information (identified by operation id):
2 - filter("A1"."CCCONTRACT"='X')
4 - filter((TO_NUMBER("A2"."CSCOMPTAXNO")=3007943362918 OR
TO_NUMBER("A2"."PASSPORTNO")=0109965330447) AND (TO_NUMBER("A2"."CSLEVEL")=10 OR
TO_NUMBER("A2"."CSLEVEL")=20 AND "A2"."TMCODE"<>59 AND "A2"."TMCODE"<>42 AND "A2"."TMCODE"<>61
AND "A2"."TMCODE"<>11 AND "A2"."TMCODE"<>19) AND "A2"."CSTYPE"='a' AND "A2"."PAYMNTRESP"='X')
5 - access("A1"."CUSTOMER_ID"="A2"."CUSTOMER_ID")
filter("A1"."CUSTOMER_ID"<>0)
Note
- 'PLAN_TABLE' is old version
- fully remote statement
28 rows selected.
SQL>..and got the same plan again....
anyone with suggestons, anyone encountered this behaviour ?Vili Dialis wrote:
Is there some way to force usage of one of them explicitly, how can i know which one is currently used ?
So what happend here ?
I am using what plan table of the above, and why that table generates always the same plan ?
*/To bypass the problem (probably), and to see how it happened (possibly) see http://jonathanlewis.wordpress.com/2010/01/25/old-plan_table/
Not sure why you keep getting the same plan, but dbms_xplan does a 'select where plan_id = (select max(plan_id) ..) so perhaps the plan_table(s) you keep using have an artificially high plan_id which is always getting selected. (You could try doing: delete from plan_table ; commit; )
Regards
Jonathan Lewis
http://jonathanlewis.wordpress.com
http://www.jlcomp.demon.co.uk
A general reminder about "Forum Etiquette / Reward Points": http://forums.oracle.com/forums/ann.jspa?annID=718
If you never mark your questions as answered people will eventually decide that it's not worth trying to answer you because they will never know whether or not their answer has been of any use, or whether you even bothered to read it.
It is also important to mark answers that you thought helpful - again it lets other people know that you appreciate their help, but it also acts as a pointer for other people when they are researching the same question, moreover it means that when you mark a bad or wrong answer as helpful someone may be prompted to tell you (and the rest of the forum) what's so bad or wrong about the answer you found helpful. -
ORA-01039 on attempt to perform EXPLAIN PLAN
Folks,
I'm running a query below on Ora10G and getting "ORA-01039: insufficient privileges on underlying objects of the view":
EXPLAIN PLAN INTO DBO.plan_table FOR SELECT last_analyzed FROM all_tables WHERE table_name='MyTable'
I'm running under a user TST account and I did "grant all privileges to TST" to make sure I did not forget any privileges. This did not help. I also tried to explicitly "grant insert on plan_table to TST" and "grant select on all_users to TST" but that did not help either. What am I doing wrong?
Thanks,
Vladimir.To perform such execution plans on data dictionnary, you need to have the DBA role or have the "SELECT ANY DICTIONARY" privilege (if your O7_DICTIONARY_ACCESSIBILITY parameter is at the default value of FALSE. Otherwise, "SELECT ANY TABLE" should be enough). I don't haver 10G installed, but that should hold true, according to what I found on http://download-east.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_9013.htm#i2155015.
Daniel
Maybe you are looking for
-
Error when trying to execute ODI Interface
Hello, I receive the following error when I try to execute an ODI interface. The interface contains two models trying to load a .csv file into an Oracle table. The models seem to be working and I can right click on the source file and "View Data". I
-
Database connection dialog no longer available
I want to add a connection to the connections in SQL Developer. However I cannot as I cannot access the database connection dialog. I tried in different ways : - plus sign above the connections - editing an existing connection - menu option : editing
-
Since the latest FF automatic update - any jpg I send to myself I cannot save as a jpg. This is so frustrating. I use my camera phone to take shots of our library activities and then to make newsletters, website updates etc. Just started this week. T
-
JSF Component Tag Localization
In resource file if I have "." (dot) in between the key name then how to change the code below, For eg, Search.Value = Search Now Working Code: <jsfc:loadBundle basename="res.Resource" var="resource" /> <jsfc:view> <jsfh:command_button id="btnSearc
-
I replaced the hard disk with WD black cavier 1TB in my 2007-early iMac. Since I have installed SL, almost every applications have crashed, including iwork, adobe photoshop, not alone safari, especially when saving or opening files. What's even more