Grant Select
I'm logged in as user A which is non-DBA, I have a table, and I want to allow access to it by user B, so I use grant all. I log out and log in as user B, and I go to my list of tables and the table from user A is not there. A simple select * from in the command line comes up ORA-00942 table or view does not exist This was done all through the web admin app except for the select *. any help?
I'm logged in as user A which is non-DBA, I have a
table, and I want to allow access to it by user B, so
I use grant all. I log out and log in as user B, and
I go to my list of tables and the table from user A
is not there. A simple select * from in the command
line comes up ORA-00942 table or view does not exist
This was done all through the web admin app except
for the select *. any help?as user A, grant select to user B directly:
grant select on a.MY_TABLE to B;that should enable user B to view the table with the schema prefix (you'll need to specify a.MY_TABLE, not just MY_TABLE).
If B needs to create views or use the table in a stored procedure, then simple select grant is not enough, you need to grant B to propagate that privilege to its users.
grant select on a.MY_TABLE to B with grant option;
Similar Messages
-
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 -
Grant select privilege to specific columns on a table to user in Oracle 9i
Can anyone tell me how to grant select privilege to a user for specific columns in a table?
I have tried the following statement
GRANT SELECT (EMP_ID) ON EMP TO USER1
But it's not working and I am getting this error "Missing ON Keyword".
Please anyone tell me how to grant select privilege for specific columns.
Edited by: 899045 on Nov 24, 2011 7:03 AM899045 wrote:
Can anyone tell me how to grant select privilege to a user for specific columns in a table?
I have tried the following statement
GRANT SELECT (EMP_ID) ON EMP TO USER1
But it's not working and I am getting this error "Missing ON Keyword".
Please anyone tell me how to grant select privilege for specific columns.
Edited by: 899045 on Nov 24, 2011 7:03 AMFrom the 9.2 SQL Reference manual, found at tahiti.oracle.com (http://docs.oracle.com/cd/B10501_01/server.920/a96540/statements_912a.htm#2062456)
*"You can specify columns only when granting the INSERT, REFERENCES, or UPDATE privilege. "* -
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 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!
XenofonOk, 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) -
IN A SCHEMA TEST1 THERE ARE 200 PLUS TABLES AND VIEWS.NOW I WANT TO GRANT SELECT ON TABLES AND VIEWS TO TEST2 USER.HOW CAN I GRANT SELECT ON THOSE TABLES AND VIEWS IN BULK INSTED OF GRANTING INDIVIDUALLY.
Any idea?
Thankx...
Sorry for suing cap.letters....That works providing the grantee doesn't want to be able to build stored procedures or (more likely) views on the granted tables...
SQL> conn u1/u1
Connected.
SQL> create role select_u1
2 /
Role created.
SQL> grant select on t1 to select_u1
2 /
Grant succeeded.
SQL> grant select_u1 to u3
2 /
Grant succeeded.
SQL> conn u3/u3
Connected.
SQL> select * from u1.t1
2 /
COL1
1
SQL> create view my_view as
2 select * from u1.t1
3 /
select * from u1.t1
ERROR at line 2:
ORA-01031: insufficient privileges
SQL> As it happens, we know from the OP's other thread that they want a read only user, so perhaps the role will suffice. But they still need to grant selects on 200 objects to the role, so the automation will still come in handy :)
Cheers, APC -
How to GRANT SELECT on all the tables in 1 go?
Hi
I have many tables (close to 200) in my Schema. I want to grant SELECT ON ALL TABLES to another user. How do I achieve this in one go?
Thanking you in advance,
...Although Justin has given a wonderful answer. You might also review the following threads;
Grant select on a schema
Re: Grant select on a schema
grant select on
grant select on
grant select on tables
Re: grant select on tables
Adith -
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. -
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. -
Grant select role with filter ?
hi,
is it possible to Grant select with filter to a role, for example,
user should select where ename='smith'I guess you may want something similar to VPD
-
As user "A" I want to grant select permissions to all my tables to user "B". Is there a way to do this in 1 command, or do I need to specify 1 table at a time.
for x in (select table_name from user_tables)
loop
begin
execute immediate 'grant select on '||x.table_name||' to b';
end;
end loop;
/ -
Granting select, insert to an user
Hello,
i have a user, 'roger', with dba privileges. i created a view(named 'vw_absente'), and then a user, 'user1', to which i granted connect, resource, and then select, insert on vw_absente. but when i log off, and i log in with that user, i wanna select * from vw_absence, but i got that 'Table or view does not exist'.
However, i wanna in Forms, if that user logs on, when creating a new data block, to show only the tables and views the current user has privileges to. in my case i don't see any table or view when i log in with the 'user1' user.
What i did wrong?
so i wanna that user to update only some columns from a table (that's why i created the view and granted the select and insert privileges on that view, to 'user1' user).
Please help me
ThanksThe public synonym doesn't belong to your schema. You only see the objects which belongs to your schema. You didn't see the dual table in the selection as the public synonym doesn't belong to your schema. There's a public synonym for the dual table. The synonym belongs to the public schema. You can access the dual table via sys.dual or simply use the public synonym dual for sys.dual as there's a synonym which belongs to the public schma where your user belongs to...
just a test:
SQL> conn sys/oracle as sysdba
Connected.
SQL> create user testsyn identified by testsyn;
User created.
SQL> create table test (id number);
Table created.
SQL> grant all on test to public;
Grant succeeded.
SQL> create public synonym test for sys.test;
Synonym created.
SQL> grant connect, resource to testsyn;
Grant succeeded.
SQL> conn testsyn/testsyn
Connected.
SQL> select * from user_objects where object_name = 'TEST';
no rows selected
SQL> select * from test;
no rows selectedI can select on test altough in my schema there's no test object...
Also look at the dual table (user testsyn):
SQL> select * from dual;
D
X
SQL> select * from user_objects where object_name = 'DUAL';
no rows selected
SQL> select * from all_synonyms where synonym_name = 'DUAL';
OWNER SYNONYM_NAME TABLE_OWNER TABLE_NAME DB_LINK
PUBLIC DUAL SYS DUALand the next:
SQL> conn sys/oracle as sysdba
Connected.
SQL> insert into test(id) values (1);
1 row created.
SQL> insert into test(id) values (2);
1 row created.
SQL> insert into test(id) values (3);
1 row created.
SQL> commit;
Commit complete.
SQL> select * from test;
ID
1
2
3
SQL> grant create table to testsyn;
Grant succeeded.
SQL> conn testsyn/testsyn
Connected.
SQL> select * from test;
ID
1
2
3
SQL> create table test (id number);
Table created.
SQL> select * from test;
no rows selectedThe first, I insert into the table, and as it is granted to the public schema the user testsyn can see te records in the test table where public test synonym points to. then, I created a test table in the testsyn schema, and as there is a more specific test table this one is used...
and one last sample:
SQL> conn sys/oracle as sysdba
Connected.
SQL> create user testsyn2 identified by testsyn2;
User created.
SQL> grant connect, resource to testsyn2;
Grant succeeded.
SQL> conn testsyn2/testsyn2
Connected.
SQL> select * from test;
ID
1
2
3
SQL> conn sys/oracle as sysdba
Connected.
SQL> create synonym testsyn2.test for testsyn.test;
Synonym created.
SQL> conn testsyn/testsyn
Connected.
SQL> grant select on test to testsyn2;
Grant succeeded.
SQL> conn testsyn2/testsyn2
Connected.
SQL> select * from test;
no rows selected
SQL> So, quick answer to your question: you only see objects in your own schema, that's why you didn't see your object although you created a public synonym ;).
regards -
I want to grant select privileges on all tables and views belonging to database xyz to the user abc.
What's the best way to do that?
Message was edited by: Diarmuid - 11/07/07
user580522I beg to differ. Of course OP can try to 'GRANT SELECT ANY TABLE'. It's just a matter of his own privileges if he succeeds or not.
To OP: Reading about GRANT might help:
http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_9013.htm#i2077938
Note this part from the docs:
To grant a system privilege, you must either have been granted the system privilege with the ADMIN OPTION or have been granted the GRANT ANY PRIVILEGE system privilege. -
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.
-
Grant select on v$session
To all
if i want some user to select v$session only
i connect system and grant select on v$session to user
but then ora-01031 insufficient privilege (cause owner is public)
i can do to grant ?Login as sys and exec the grant statement.
Regards,
http://askyogesh.com
Maybe you are looking for
-
Curious Problem with NYTimes App. Can You help?
I downloaded the NYTimes app (a newspaper reader) but I can't get it to sync any content (the newspaper articles). Called Apple, they said it's the app. Wrote to the NYTimes they said it was my ipod touch. So I bought a new ipod touch and right out o
-
ESS Claim Advance Approval screen showing incomplete list of requests.
Hi Friends, In ESS Claim Advance Approval screen we are facing this issue. When approver opens the screen for approving the request. The list of requests appear but its not the complete list. There are also 2 sucess messages that get displayed. 112 r
-
How to refresh a view on click of a link in UI5
Hi, I have created an SAPUI5 application with 1 view (main.view.js) in Eclipse. I have a link in the view along with some input fields and buttons, on click of the link, I need to refresh view (main.view.js) . Can some one please help me on this? Re
-
Report Customization Form Question
How do you display the report customization before the report is rendered?
-
Wireless connectivity problems using IOS 6.0.2?
After installing IOS 6.0.2 on my iPhone 5 I can no longer connect to known wireless sites. I've been through troubleshooting with both Apple and my ISP and no luck. I'm thinking there's wireless connectivity problems with this latest update (my iPa