Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
set echo off
rem
rem This script generates a list of tables in one Oracle user that you want
rem another user have privileges over them.
rem
rem The output grantprivs.sql goes TO your current working directory, the
rem output will create all grants for cross-user privileges
rem
set linesize 160
set pagesize 0
set echo off
set feedback off
set verify off
accept grantee prompt 'Enter grantee: '
spool grantprivs.sql
select 'spool grantprivs.log' from dual;
rem *******************************
rem *** Grants for current user ***
rem *******************************
select 'GRANT SELECT, INSERT, UPDATE, DELETE ON ' || table_name || ' TO &grantee;'
from user_tables;
select 'spool off' from dual;
spool off
set heading on
set feedback on
set verify on
prompt
prompt When you are ready to actually grant these privileges,
prompt issue the SQL*Plus command "@grantprivs"
prompt
SQL> @grants
Enter grantee: yada
spool grantprivs.log
GRANT SELECT, INSERT, UPDATE, DELETE ON A TO yada;
GRANT SELECT, INSERT, UPDATE, DELETE ON ACCOUNT TO yada;
GRANT SELECT, INSERT, UPDATE, DELETE ON ADDRESS TO yada;
...
GRANT SELECT, INSERT, UPDATE, DELETE ON X_TABLE TO yada;
GRANT SELECT, INSERT, UPDATE, DELETE ON YADA2 TO yada;
GRANT SELECT, INSERT, UPDATE, DELETE ON YOURTABLE TO yada;
spool off
When you are ready to actually grant these privileges,
issue the SQL*Plus command "@grantprivs"
SQL>
SQL> create role yada;
Role created.
SQL> @grantprivs
Grant succeeded.
Grant succeeded.
GRANT SELECT, INSERT, UPDATE, DELETE ON ADDRESS TO yada
*
ERROR at line 1:
ORA-30657: operation not supported on external organized table
...
Grant succeeded.
Grant succeeded.
Grant succeeded.
SQL> grant yada to dhunt;
Grant succeeded.