Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sequence Permission in Oracle

How can I check a permission granted for particular sequence and assign permission to particular sequence from SQL*Plus. Thank you

like image 437
Jack Avatar asked Aug 23 '11 18:08

Jack


People also ask

How do I give a sequence access in Oracle?

GRANT CREATE ANY SEQUENCE, ALTER ANY SEQUENCE, DROP ANY SEQUENCE, SELECT ANY SEQUENCE TO my_user; The owner of a sequence has full privileges on the sequence. Another user can be given access to the sequence by granting the SELECT object privilege.

Which privileges can be granted on a sequence?

The following privileges are valid for sequences: SELECT: Execute functions CURRVAL and NEXTVAL on the specified sequences. ALTER: Modify a sequence's DDL with ALTER SEQUENCE. DROP: Drop this sequence with DROP SEQUENCE .

What is sequence used for in Oracle?

Use the CREATE SEQUENCE statement to create a sequence, which is a database object from which multiple users may generate unique integers. You can use sequences to automatically generate primary key values.

What is sequence in Oracle with example?

An Oracle Sequence is a database object, just like a table or view, that represents a sequence of integers that can be used by any table or view in the global database namespace. A Sequence's values can be accessed using the NEXTVAL, and CURRVAL pseudo-columns. A Sequence can be ascending or descending.


2 Answers

To grant a permission:

grant select on schema_name.sequence_name to user_or_role_name; 

To check which permissions have been granted

select * from all_tab_privs where TABLE_NAME = 'sequence_name' 
like image 107
beny23 Avatar answered Oct 18 '22 21:10

beny23


Just another bit. in some case i found no result on all_tab_privs! i found it indeed on dba_tab_privs. I think so that this last table is better to check for any grant available on an object (in case of impact analysis). The statement becomes:

    select * from dba_tab_privs where table_name = 'sequence_name'; 
like image 23
OPMendeavor Avatar answered Oct 18 '22 20:10

OPMendeavor