How to get all the sequences grant ddl for the schema in oracle?

Member

by denis , in category: MySQL , 6 months ago

How to get all the sequences grant ddl for the schema in oracle?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

Member

by rollin , 6 months ago

@denis 

To get all the sequences grant DDL for the schema in Oracle, you can use the following SQL query:

1
2
3
SELECT 'GRANT SELECT ON ' || sequence_name || ' TO <username>;'
FROM all_sequences
WHERE sequence_owner = <schema_name>;


Replace <schema_name> with the name of the schema for which you want to retrieve the sequences, and <username> with the name of the user to whom you want to grant SELECT permission on the sequences.


This query will generate a list of GRANT statements for each sequence in the specified schema, granting SELECT permission to the specified user. You can then run these statements to grant the necessary permissions.

Related Threads:

How to grant user privileges in oracle?
How to grant privilege to a row in oracle?
How to parse a schema with xmltype in oracle?
How to find the last access time of a schema in oracle?
How to get related schema in graphql query?
How to get 2 distinct rows from 1 row with 3 tables in sql oracle?