SELECT * FROM DBA_ROLE_PRIVS;
SELECT * FROM ROLE_SYS_PRIVS
-- revoke all
select 'REVOKE ' || GRANTED_ROLE || ' FROM ' || GRANTEE || ';' from dba_role_privs where grantee='SCHEMA';
select 'REVOKE ' || PRIVILEGE || ' FROM ' || GRANTEE || ';' from dba_sys_privs where grantee='SCHEMA';
GRANT CREATE TRIGGER TO SCHEMA;
GRANT CREATE JOB TO SCHEMA;
GRANT CREATE PROCEDURE TO SCHEMA;
GRANT CREATE TABLE TO SCHEMA;
GRANT CREATE CREDENTIAL TO SCHEMA;
GRANT CREATE SEQUENCE TO SCHEMA;
GRANT CREATE SYNONYM TO SCHEMA;
GRANT DEBUG ANY PROCEDURE TO SCHEMA;
GRANT CREATE VIEW TO SCHEMA;
GRANT DEBUG CONNECT SESSION TO SCHEMA;
GRANT ALTER SESSION TO SCHEMA;
GRANT CREATE SESSION TO SCHEMA;
--collation
SELECT name,value$ FROM sys.props$ where name = 'NLS_NCHAR_CHARACTERSET' or name = 'NLS_CHARACTERSET' or name = 'NLS_RDBMS_VERSION';
SELECT df.tablespace_name TABLESPACE, df.total_space TOTAL_SPACE,
fs.free_space FREE_SPACE, df.total_space_mb TOTAL_SPACE_MB,
(df.total_space_mb - fs.free_space_mb) USED_SPACE_MB,
fs.free_space_mb FREE_SPACE_MB,
ROUND(100 * (fs.free_space / df.total_space),2) PCT_FREE
FROM (SELECT tablespace_name, SUM(bytes) TOTAL_SPACE,
ROUND(SUM(bytes) / 1048576) TOTAL_SPACE_MB
FROM dba_data_files
GROUP BY tablespace_name) df,
(SELECT tablespace_name, SUM(bytes) FREE_SPACE,
ROUND(SUM(bytes) / 1048576) FREE_SPACE_MB
FROM dba_free_space
GROUP BY tablespace_name) fs
WHERE df.tablespace_name = fs.tablespace_name(+)
ORDER BY fs.tablespace_name;