Thursday, 4 July 2013

Oracle: Grant/Revoke Privileges example

You can grant users various privileges to tables. These privileges can be any combination of select, insert, update, delete, references, alter, and index

To view the grant permission of all tables:

select *from user_tab_privs;

Grant permission:

grant select, insert on sales to test with grant option;

here.,
tiara-Grantor
sales-table name
test-Grantee

Revoke Permission:

revoke all on sales from test;

Login in as "test" user:

To view the grantor tables:

select *from tiara.sales;

Insert values in grantor tables:

insert into tiara.sales values(41411,'Ganesh','Chennai','Tamilnadu',444);

No comments:

Data Sharing

  1. Create Share CREATE SHARE my_share; 2. Grant privileges to share GRANT USAGE ON DATABASE my_db TO SHARE my_share; GRANT USAGE ...