工作中经常会用到一个用户对另外一个用户下表的操作,遇到批量的授权或回收权限可以用如下语句执行就可以了,一般是授予 select\update\delete\insert 也可以用 grant all 表示所有 对存储过程的授权为 grant execute on 过程 to 用户 如果加 with grant option 当前被授权的用户则可以再授予给其他用户 以下是示例,实际工作中根据情况进行修改即可 --批量授予与收回 --授予 查询 插入 权限 declare cursor cur_a
Copy the sample code below into a file named kill_drop_user.sql.Open SQL*Plus and connect as user SYS to your databaseSQL> CONNECT sys/[email protected] AS SYSDBACreate a user called TEST with password TESTSQL> GRANT connect, resource TO test IDENTI
create or replace procedure drop_all as cursor cur_obj is select uo.OBJECT_NAME, uo.OBJECT_TYPE from user_objects uo where uo.OBJECT_NAME not in ('DROP_ALL') and uo.OBJECT_TYPE not in ('LOB'); /* cursor cur_tablespace is select ut.TABLESPACE_NAME fro
-- 大概 这个样子,如果没有 FK 的话,一下子就都删掉了. begin for x in (select table_name from user_tables) loop execute immediate 'delete ' || x.table_name ; end loop ; end ;