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

Member

by denis , in category: MySQL , 2 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 , 2 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.