Granting SELECT on dictionary views ... (?)
Hi there,
please try to find out, what I am doing wrong below:
1. I connect as sys:
connect sys as sysdba
2. Create a role. Just to point out the problem, it will have just CREATE SESSION, CREATE PROCEDURE
create role tr not identified;
grant create session to tr;
grant create procedure to tr;
3. Now the problem: I want the role (users with that role) to have SELECT privilege, just on one dict-view, that is v$session:
My first attempt is denied:
grant select on v$session to tr;
grant select on v$session to tr
FEHLER in Zeile 1:
ORA-02030: can only select from fixed tables/views
Now this in itself is wierd. I read v$-objects are synonyms to v_$-objects. Is that right? What is the problem here? See, what happens next...
4. grant select on v_$session to tr;
That works!
5. create user tu identified by tu;
grant tr to tu;
That works!
6. Now connect as tu/tu
sql*plus Test: select count(*) from v$session;
COUNT(*)
46
works!
7. Now: create a simple stored function to perform the same as my query:
create or replace function testf
return number
is
res number;
begin
select count(*) into res from v$session;
return res;
end;
This is refused with ORA-00942: Table or view does not exist !!!
Simple query on v$session works, but its usage inside a stored function is not allowed??? Please explain!!!
Pointing out to the explanation in the documentation (just one link) would suffice. I just have not found an explanation for this behaviour!
Many thanks in advance!
Xenofon
Ok, It seems this GRANT, even though it is an object privilege it is handled like of those privileges, which can be granted only directly to a user and not to a role;
But on the other hand, the reaction is not the system:
When you try to grant UNLIMITED tablespace to a role you get a definitive error message: ORA-01931.
You don't get this error when granting SELECT on V_$SESSION to a role...
It's getting more and more wierd...
(Does anyone know a complete list of privs which can only be granted directly to a user? I thought it's only UNLIMITED TABLESPACE)
Similar Messages
-
Granting select on X$ views?
Hi,
Is it possible to select from X$ views from users other than sys? Is it not possible to grant privileges on these structures/views?
Cheers,
WarrenWhat you would need to do: create a view on the X$ view and grant select on the view. See Steve Adams' create_xviews.sql script for an example.
-
ORA-01720 while trying to grant select on a view
Hi Friends,
Iam getting the following error while trying to grant select privilege for the view to SchemaB, i have the view in schemaA.
I have used the tables from both the schema for creating the view and iam getting the error on showing a particular table
ORA-01720: grant option does not exist for 'schemaB.Product'.
I have looked into so many forums but i couldn't find the answer for my question.
I must have to create the view in the Schema A only(strictly), as i seen in some forums stated that while creating the view in the other schema and granting the select privilege will solve the problem.But it was an exception to me ...
Tell me something how can i proceed in this .....grant select on t1 to seconduser with admin optionNo. WITH ADMIN OPTION applies to system privileges only. Object privileges need the WITH GRANT OPTION ...
SQL> grant select on joe_soap.some_table to apc with admin option
2 /
grant select on joe_soap.some_table to apc with admin option
ERROR at line 1:
ORA-00993: missing GRANT keyword
SQL> grant select any table to apc with admin option
2 /
Grant succeeded.
SQL> grant select on joe_soap.some_table to apc with grant option
2 /
Grant succeeded.
SQL> Cheers, APC -
If DBMS_LOB is include in a view I can't grant select on the view
I have a view which includes a column that uses DBMS_LOB.SUBSTR( MyLob, 4000, 1 )....
The view works for the owner. When I attempt to grant select on it I get
grant select on MyView
ERROR at line 1:
ORA-01720: grant option does not exist for 'SYS.DBMS_LOB'What am I missing here... Is there a conceptual flaw in my reasoning or is there a permission problem with including a LOB in a view ?
When the view is in my account, everything is fine. I try to grant select on an object I own and I get...
ORA-01720: grant option does not exist for 'SYS.DBMS_LOB'
It seems to underline that the implementation of LOBS is somewhat different than other data types. If I store the LOB inline, I probably would be OK if the data is less than 4000, but I would not use a LOB in that case. -
Oracle 11g -select on dictionary view hangs
Hi Experts,
I have issued the below query and it's hanging for a long time.
SQL> select * from gv$session where rownum<=1;
Could you please someone shed light on this issue?
Regards,
Richard
Edited by: user12075620 on May 16, 2011 8:44 PMDuplicated and even triplicated post, probably Jive issue.
To be continued over there :
http://forums.oracle.com/forums/message.jspa?messageID=9594103#9594103
Nicolas. -
hi ,
I want to privelege only Grant SELECT ALL tables,views....
I have written A procedure.....given below....
CREATE OR REPLACE PROCEDURE GRANT_SELECT_ALL_PROC
IS
l_obj VARCHAR2(60);
l_obj_type VARCHAR2(60);
CURSOR Cur_Obj IS
SELECT OBJECT_NAME,OBJECT_TYPE
FROM USER_OBJECTS
WHERE USER ='OWNER';
BEGIN
For i in Cur_Obj Loop
l_obj := i.OBJECT_NAME;
l_obj_type := i.OBJECT_TYPE;
IF l_obj_type IN ('TABLE','VIEW')
THEN
EXECUTE IMMEDIATE 'GRANT SELECT ON' || l_obj ||'TO TEMP’;
ELSIF l_obj_type IN('FUNCTION','PROCEDURE','PACKAGE') THEN
EXECUTE IMMEDIATE 'GRANT EXECUTE ON'|| l_obj ||'TO TEMP’;
END IF;
END LOOP;
END GRANT_SELECT_ALL_PROC;
procedure is working fine.....
OWNER there are some table and views......
But After creation of User name TEMp....
When I m giving GRANT SELECT to TEMP(by procedure)..... ALL tables and views of OWNER....
when I coonecte to TEMP...
Not getting table,view List...
not even data of table or Views.....
can anybdy help me.......advance thanx ...
sanjayhi ,
I want to privelege only Grant SELECT ALL
tables,views....
have written A procedure.....given below....
CREATE OR REPLACE PROCEDURE GRANT_SELECT_ALL_PROC
IS
l_obj VARCHAR2(60);
l_obj_type VARCHAR2(60);
CURSOR Cur_Obj IS
SELECT OBJECT_NAME,OBJECT_TYPE
FROM USER_OBJECTS
WHERE USER ='OWNER';
BEGIN
For i in Cur_Obj Loop
l_obj := i.OBJECT_NAME;
l_obj_type := i.OBJECT_TYPE;
IF l_obj_type IN ('TABLE','VIEW')
THEN
EXECUTE IMMEDIATE 'GRANT SELECT ON' || l_obj ||'TO
TEMP’;
ELSIF l_obj_type IN('FUNCTION','PROCEDURE','PACKAGE')
THEN
EXECUTE IMMEDIATE 'GRANT EXECUTE ON'|| l_obj ||'TO
TEMP’;
END IF;
END LOOP;
END GRANT_SELECT_ALL_PROC;
procedure is working fine.....
OWNER there are some table and views......
But After creation of User name TEMp....
When I m giving GRANT SELECT to TEMP(by
procedure)..... ALL tables and views of OWNER....
when I coonecte to TEMP...
Not getting table,view List...
not even data of table or Views.....
can anybdy help me.......advance thanx ...
sanjayQuery SELECT * FROM USER_TAB_PRIVS_MADE from the user from which you are executing the procedure
and Query SELECT * FROM USER_TAB_PRIVS_RECD from the TEMP user. -
Hi,
on 11g I have the follwing error . What is wrong with syntaxe :
SQL> GRANT SELECT ON ANY DICTIONARY TO myuser;
GRANT SELECT ON ANY DICTIONARY TO myuser
GRANT SELECT ON ANY DICTIONARY TO myuser
ORA-00903: *Thanks.user522961 wrote:
Hi,
how to verify if user is granted :
select on dictionary
Do some research by yourself too, it's been a long time you are here!
SQL> grant select any dictionary to scott;
Grant succeeded.
SQL>
*Session2*
[oracle@edmtr2p0-orcl SPA]$ sqlplus scott/tiger
SQL*Plus: Release 11.2.0.1.0 Production on Wed Jan 16 19:22:45 2013
Copyright (c) 1982, 2009, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> select * from session_privs;
PRIVILEGE
CREATE SESSION
CREATE TABLE
CREATE CLUSTER
CREATE SEQUENCE
CREATE PROCEDURE
CREATE TRIGGER
CREATE TYPE
CREATE OPERATOR
CREATE INDEXTYPE
SELECT ANY DICTIONARY
10 rows selected.
SQL> sho user
USER is "SCOTT"
SQL> Aman.... -
Can not select from data dictionary view from a procedure
Hi,
I wonder, which privilege is missing here:
my schema has this roles and privs:
GRANT CONNECT, RESOURCE TO cb ;
GRANT CREATE SESSION TO cb ;
GRANT SELECT_CATALOG_ROLE TO cb ;
GRANT CREATE SYNONYM TO CB;
GRANT CREATE VIEW TO CB;
I create a procedure:
create or replace procedure dd_test as
begin
dbms_output.enable(2000000);
for r in (select table_name from sys.dba_tab_partitions where owner = 'CB') loop
dbms_output.put_line(r.table_name);
end loop;
end;
sho err
4/38 PL/SQL: ORA-00942: table or view does not exist
When I run the core statement form sql prompt, it works !
so what privilege is missing here ???
thanks for any hint, Lao DeHi,
thanks for that reply, after doing that I can not select this DD-view from sql-prompt anymore (which I don't wonder ;-). Can you tell me, what idea you had behind that test ?
I found another instance, where the procedure works and I will compare those privileges, but it's hard to sort out that complex structure of nested roles and sys_privs.
How ever, I will update here, when I found the missing privilege.
regards LaoDe -
Granting SELECT to user on VIEW with FULL OUTER JOIN fails?
I have a quandary.
Using Oracle 9i, I have created a simple view. When I perform a count on it, rows are returned.
However, when I grant SELECT access to another user, they can't see the VIEW. The VIEW has a FULL OUTER JOIN operation in it.
When I do the same thing using a regular join, it works.
Any ideas why, please?
SQL> conn ifsinfo/******@DB
Connected.
SQL> ed
Wrote file afiedt.buf
1 create view mctest3 as
2 select
3 vc.idcus ,
4 ci.customer_id
5 from
6 ifsapp.vmo_company vc
7 full outer join
8 ifsapp.customer_info ci
9 on
10* vc.custno = ci.customer_id
SQL> /
View created.
SQL> select count(*) from mctest3;
COUNT(*)
73994
SQL> GRANT SELECT ON MCTEST3 TO IFSAPP WITH GRANT OPTION;
Grant succeeded.
SQL> CONN IFSAPP/******@DB
Connected.
SQL> select count(*) from IFSINFO.MCTEST3;
select count(*) from IFSINFO.MCTEST3
ERROR at line 1:
ORA-00942: table or view does not existbut with regular join:
SQL> conn ifsinfo/******@DB
Connected.
SQL> create view mctest4 as
2 select
3 vc.idcus ,
4 ci.customer_id
5 from
6 ifsapp.vmo_company vc, ifsapp.customer_info ci
7 where vc.custno = ci.customer_id;
View created.
SQL> select count(*) from mctest4;
COUNT(*)
44269
SQL> GRANT SELECT ON MCTEST4 TO IFSAPP WITH GRANT OPTION;
Grant succeeded.
SQL> conn ifsapp/******@DB
Connected.
SQL> select count(*) from IFSINFO.MCTEST4;
COUNT(*)
44269Hi,
>>SQL> conn ifsinfo/******@DB
Connected.
SQL> ed
Wrote file afiedt.buf
1 create view mctest3 as
2 select
3 vc.idcus ,
4 ci.customer_id
5 from
6 ifsapp.vmo_company vc
7 full outer join
8 ifsapp.customer_info ci
9 on
10* vc.custno = ci.customer_id
SQL> /
According to Note:244315.1, it is not possible to make a FULL OUTER JOIN on views owned by another user at the 9i version of Oracle. As above, do not use FULL OUTER JOIN on views owned by another user. Try to use outer join operator (+), and/or UNIONS instead.
Cheers -
Granting only select command on view to another db user
Hi Expers,
i have table in xxx schema
desc dept
deptnumber number,
name varchar2(10)
i created view as
create view inser as select * dept;
view created.
using this view i can inserting values into dept table also.
i need to give only select access to yyyy user/schema......
can any tell me how to create role for the above scenario....
Thanks.....SQL> show user
USER is "DCA"
SQL> create table test123(c1 number);
Table created.
SQL> grant select on test123 to etlaudit;
Grant succeeded.
SQL> conn
Enter user-name: etlaudit@xxxxxxx
Enter password:
Connected.
SQL> select * from dca.test123;
no rows selected
SQL> insert into dca.test123 values(1);
insert into dca.test123 values(1)
ERROR at line 1:
ORA-01031: insufficient privilegesIn the same way you can grant privileges to view also. -
Grant select on all of views to public
How to grant select on all of views to public? Thanks in advance.
782150 wrote:
How to grant select on all of views to public? Thanks in advance.
spool doit.sql
select 'grant select on '||
owner ||
'.' ||
view_name ||
' to public;'
from dba_views;
spool offexecute doit.sql
That's how it's done. Whether or not it's wise is a different question. -
After posting something here a few days back about the myriad views needing to be digested for the Fund.I Exam, I have just gleaned this lot from the Couchman book. No doubt some of the pros out there may well correct me, but this is simple what I have collected from the book, in the last 3 hours. Cheers.
Dictionary Views
Data Dictionary
Which users are in the database password file:
V$PWFILE_USERS
Where values set in the init.ora file can be viewed – all parameters:
V$PARAMETER
Script used to create the objects that comprise the data dictionary:
catalog.sql
To grant a special role to users so they can look at DBA views:
SELECT_CATALOG_ROLE
Information about all database objects in the database:
DBA_OBJECTS
Information about all tables in the database:
DBA_TABLES
Information about all indexes in the database:
DBA_INDEXES
Information about all views (including dictionary views) in the database:
DBA_VIEWS
Information about all sequences in the database:
DBA_SEQUENCES
Information about all users in the database:
DBA_USERS
Information about all constraints in the database:
DBA_CONSTRAINTS
Information about all table columns that have constraints on them:
DBA_CONS_COLUMNS
Information about all columns that have indexes on them in the database:
DBA_IND_COLUMNS
Information about all columns in all the tables in the database:
DBA_TAB_COLUMNS
Information about all the roles in the database:
DBA_ROLES
Information about all object privileges in the database:
DBA_TAB_PRIVS
Information about all system privileges granted to all users in the database:
DBA_SYS_PRIVS
Displays all PL/SQL source code in the database:
DBA_SOURCE
Information about all triggers in the database:
DBA_TRIGGERS
Information about object privileges granted to roles
ROLE_TAB_PRIVS
Information about system privileges granted to roles
ROLE_SYS_PRIVS
Information about roles granted to roles
ROLE_ROLE_PRIVS
Information about all tablespaces in the database:
DBA_TABLESPACES
Information about all profiles in the database:
DBA_PROFILES
For all parameters?
V$PARAMETER
General information about the database mounted to your instance:
V$DATABASE
Most information about the performance of the database is kept here:
V$SYSSTAT
Most information about the performance for individual user sessions is stored here:
V$SESSION , V$SESSTAT
Information about online redo logs (2)
V$LOG, V$LOGFILE
Information about datafiles
V$DATAFILE
Basic information about control files, and the two columns it has:
V$CONTROLFILE. STATUS / NAME
An object you can query to obtain a listing of all data dictionary objects (4)
CATALOG, CAT, DICTIONARY, DICT.
When the control file was created, Sequence Number, most recent SCN:
V$DATABASE
Information stored in different sections of the control file, Sequence Number:
V$CONTROLFILE_RECORD_SECTION
To see the names and locations of all control files in the db? (2)
V$PARAMETER. V$CONTROLFILE
Tablespace and Datafiles
Temporary Segments:
Name, tablespace location, and owner of temporary segments:
DBA_SEGMENTS
Size of temporary tablespaces, current number of extents allocated to sort segments, and sort segment high-water mark information. Space usage allocation for temporary segments:
V$SORT_SEGMENT
Types of sorts that are happening currently on the database
V$SORT_USAGE
To see the username corresponding with the session:
V$SESSION
Information about every datafile in the database associated with a temporary tablespace:
DBA_TEMP_FILES
Similar to DBA_TEMP_FILES, this performance view gives Information about every datafile in the database associated with a temporary tablespace:
V$TEMPFILE
Storage Structures
A summary view, contains all types of segments and their storage parameters, space utilization settings:
DBA_SEGMENTS
Tablespace quotas assigned to users:
DBA_TS_QUOTAS
Segment name, type, owner, total bytes of extent, name of tablespace storing the extent:
DBA_EXTENTS
The location and amount of free space by tablespace name:
DBA_FREE_SPACE
The location of free space in the tablespace that has been coalesced:
DBA_FREE_SPACE_COALESCED
Information about datafiles for every tablespace
DBA_DATAFILES
Performance view for information for datafiles for every tablespace
V$DATAFILE
To see the total amount of space allocated to a table?
DBA_EXTENTS
Table creation timestamp, information about the object ID:
DBA_OBJECTS
High water mark, all storage settings for a table, and statistics collected as part of the analyze (for row migration) operation on that table
DBA_TABLES
Information about every column in every table:
DBA_TAB_COLUMNS
To determine how many columns are marked unused for later removal?
DBA_UNUSED_COL_TABS
To find the number of deleted index entries ?
INDEX_STATS
To determine the columns on a table that have been indexed:
DBA_ID_COLUMNS
The dynamic view to show whether the index is being used in a meaningful way?
V$OBJECT_USAGE
To see whether a constraint exists on a particular column?
DBA_CONS_COLUMNS
To see the constraints associated with a particular table:
DBA_CONSTRAINTS
To find the username, ID number, (encrypted) password, default and temporary tablespace information, user profile of a user, password expiry date:
DBA_USERS
To all objects, which objects belong to which users, how many objects a user has created?
DBA_OBJECTS
Resource-usage parameters for a particular profile:
DBA_PROFILES
Identifies all resources in the database and their corresponding cost:
RESOURCE_COST
Identifies system resource limits for individual users:
USER_RESOURCE_LIMITS
Shows all system privileges:
DBA_SYS_PRIVS
Show all object privileges:
DBA_TAB_PRIVS
Shows all privileges in this session available to you as the current user:
SESSION_PRIVS
Views for audits currently taking place are created by this script:
cataudit.sql
a list of audit entries generated by the exists option of the audit command:
DBA_AUDIT_EXISTS
A list of audit entries generated for object audits:
DBA_AUDIT_OBJECT
A list of audit entries generated by session connects and disconnects:
DBA_AUDIT_SESSION
A list of audit entries generated by statement options of the audit command:
DBA_AUDIT_STATEMENT
A list of all entries in the AUD$ table collected by the audit command:
DBA_AUDIT_TRAIL
To determine the roles available in the database, the names of all the roles on the database and if a password is required to use each role:
DBA_ROLES
Names of all users and the roles granted to them:
DBA_ROLE_PRIVS
All the roles and the roles that are granted to them:
ROLE_ROLE_PRIVS
Which system privileges have been granted to a role:
DBA_SYS_PRIVS
All the system privileges granted only to roles:
ROLE_SYS_PRIVS
All the object privileges granted only to roles:
ROLE_TAB_PRIVS
All the roles available in the current session:
SESSION_ROLES
Which object privilege has been granted to a role:
DBA_TAB_PRIVS
To display the value of the NLS_CHARACTERSET parameter:
NLS_DATABASE_PARAMETERS
DAYou can also find a lot of stuff by doing:
SELECT *
FROM dictionary; -
Linking two fields in a dictionary view to the same field
My DBA asked me if I knew how to do this without resorting to ABAP code, and I said I'd ask you guys over here.
A customer wants a view on several tables. Vendor name from LFA1 is one of the
columns in the view.
He has two other columns in the view which can hold two different vendor numbers at the same time.
He wants the view to automatically bring in the names from LFA1 from both of them.
My DBA knows how to do this directly in DB2, of course, but can it be done in native SAP dictionary ???
Reason he's asking is because he suspects the customer wants to use the view directly in SQLQuery, where there's no chance for an ABAP code intercept.
Or is there? Are there ABAP exits in dictionary views? Or in SQLQueries?Hi
We can straight away write a select statement to a database view similar to a TABLE in ABAP
see the sample views VIAUFKS and VIAUF_AFVC
and see the select statement below for this view
CLEAR: i_ord.
REFRESH: i_ord.
SELECT aufnr " PM Order No
equnr " Equipment Number
tplnr " Functional Location
auart " Order Type
aedat " Order Date
swerk " Maintenance Plant
werks " Plant
ktext " Order Text
kokrs " Controlling Area
objnr " Object Id
kostl " Cost Center
INTO TABLE i_ord
FROM viaufks
WHERE aufnr IN s_aufnr AND
equnr IN s_equnr AND
tplnr IN s_tplnr AND
swerk IN s_swerk AND
aedat IN s_date AND
auart IN s_auart.
Reward points for useful Answers
Regards
Anji -
Error while selecting from a view ORA-01031: Insufficient privileges
As DBA I have granted select privileges on a view to a user, but whenever I login as that user and try to select from the view I get the message 'ORA-01031'. When I run the query in the view as the user I do not have problem and can see the results. This view joins tables from more than one schema and does a distinct on the resultset. I am new to Oracle and would appreciate any help I can get.
ThanksBack on this problem when I created another user with select permission on the same view and a default role that has reference on all the objects on the other schemas, I end up with the same error message. Although this time the schema owner of the view has select privileges on all the tables from other schemas referenced in the view.
Thanks -
Help me granting privilege on a view (!)
I have two schema A & B.In schema A I have table T_tb.Now I want to create view T_vw (select * from T_tb) on T_tb in schema B and I want some of my users having role R make a select on this view.
I tried this way..
CONN SYS
GRANT SELECT ON A.T_tb TO B;
CREATE OR REPLACE VIEW B.T_vw AS SELECT * FROM A.T_tb;
GRANT SELECT ON B.T_vw TO B WITH GRANT OPTION;
GRANT SELECT ON B.T_vw TO R;
GRANT R TO user1;
after that when I try to access view T_vw loged in as user1 I get..
ERROR at line 1:
ORA-01031: insufficient privileges
I apreciate any help towards resolving this issue.
Bye,
ADHopefully this will help you.....
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options
SQL> create user a identified by a;
User created.
SQL> create user b identified by b;
User created.
SQL> grant connect,resource to a;
Grant succeeded.
SQL> grant connect,resource to b;
Grant succeeded.
SQL> conn a@inftmark
Enter password: *
Connected.
SQL> create table test (roll number(3));
Table created.
SQL> grant select on test to b;
Grant succeeded.
SQL> conn b@inftmark
Enter password: *
Connected.
SQL> select * from a.test;
no rows selected
SQL> create view test_view as select * from a.test;
create view test_view as select * from a.test
ERROR at line 1:
ORA-01031: insufficient privileges
SQL> conn sys@inftmark as sysdba
Enter password: ******
Connected.
SQL> grant create view to b;
Grant succeeded.
SQL> conn b@inftmark
Enter password: *
Connected.
SQL> create view test_view as select * from a.test;
View created.
SQL>
Maybe you are looking for
-
dear friends i have created two radio buttons 1- material 2- sales document and below that ther is a list box..when i click on radio buton one itshould show sattement regarding material and when i click on sales document it should show statement reg
-
Can I only use the itunes ID for the music and my other id for my computer and Iphone
Can I just use one Itunes id for Match and another Id for my apps on my phone and my Mac?
-
Version Control for OSB Proxy/Business Services ?
Dear all I've used the browser-based osb console to expose a legacy web-service as follows : 1. Create a Session 2. Create a BusinessService based on the legacy web-service WSDL 3. Create a ProxyService based on the BusinessService WSDL 4. Activate t
-
Unmounted internal HD when running Snow Leopard.
Hi guys! So I am studying in Milano Italy, Graphic Design. Yesterday in school I was working like normal. Suddenly the warning sign of a unmounted disk came up. The only problem was that I didnt have any connected USB or drives. I pressed ok. Then th
-
I work at a coin design maker and our old files seem to be corrupted. I could use some help figuring this out. Patrick