-- 生成sql禁用所有约束
SELECT 'ALTER TABLE ' || table_name || ' disable CONSTRAINT ' || constraint_name || ';' FROM user_constraints where CONSTRAINT_TYPE = 'R';
-- 生成sql把已经禁止的约束打开
SELECT 'ALTER TABLE ' || table_name || ' enable CONSTRAINT ' || constraint_name || ';' FROM user_constraints where CONSTRAINT_TYPE = 'R';
-- 生成sql删除所有约束
SELECT 'ALTER TABLE ' || table_name || ' drop CONSTRAINT ' || constraint_name || ';' FROM user_constraints;
-- 生成sql删除所有对象
select 'drop ' || object_type ||' '||object_name||';' as sqlstatment from user_objects order by sqlstatment;
-- 查看当前用户权限
select * from session_privs;
-- 查看当前用户角色
select * from session_roles;
-- 查看当前用户角色
select * from session_roles;
网友评论