CREATE USER READ_ONLY IDENTIFIED BY "password";
GRANT CREATE SESSION TO READ_ONLY;
SET HEADING OFF
SET PAGES 9999 LINES 400
SPOOL TABLE_GRANTS.sql
SELECT 'GRANT READ ON ' || OWNER || '.' || TABLE_NAME || ' TO READ_ONLY;'
FROM DBA_TABLES
WHERE OWNER IN ('PRESS')
ORDER BY 1;
SELECT 'CREATE SYNONYM RO_CAPEX.'||TABLE_NAME|| ' FOR ' || OWNER || '.' || TABLE_NAME || ';'
FROM DBA_TABLES
WHERE OWNER IN ('PRESS')
ORDER BY 1;
SPOOL OFF
@TABLE_GRANTS.sql
!rm TABLE_GRANTS.sql
No comments:
Post a Comment