--创建用户名为dimon 密码为123456的用户
--指定关键字cascade,可删除用户所有的对象,然后再删除用户。下面的例子用来删除用户与其对象:
--给用户dimon赋予connect和resource角色的权限
drop role hgg;
--删除一个表中全部数据时,一定要使用truncate,
--因为用drop table,delete * from 表名时,tablespace表空间该表的占用空间并未释放,
--反复几次drop,delete操作后,该tablespace上百兆的空间就被耗光了。
--如果要删除该表,可先truncate,再drop。
truncate table table_name;
--查询所有用户的表和视图
select TABLE_NAME from all_tables where owner = 'DIMON';
--生成UUID
select sys_guid() from dual;
create user dimon identified by 123456;
drop user dimon;
--指定关键字cascade,可删除用户所有的对象,然后再删除用户。下面的例子用来删除用户与其对象:
drop user dimon cascade;
--给用户dimon赋予connect和resource角色的权限
grant connect,resource to dimon;
grant select on v_$session to dimon;
grant select on v_$sesstat to dimon;
grant select on v_$statname to dimon;
revoke connect, resource from dimon;
create role hgg;
grant select on class to hgg;
drop role hgg;
--删除一个表中全部数据时,一定要使用truncate,
--因为用drop table,delete * from 表名时,tablespace表空间该表的占用空间并未释放,
--反复几次drop,delete操作后,该tablespace上百兆的空间就被耗光了。
--如果要删除该表,可先truncate,再drop。
truncate table table_name;
--查询所有用户的表和视图
select * from all_tab_comments;
select * from user_tab_comments;
select * from all_col_comments;
select * from user_col_comments;
select TABLE_NAME from all_tables where owner = 'DIMON';
--生成UUID
select sys_guid() from dual;