查询用户
查看数据库里面所有用户,前提是你是有dba权限的帐号,如sys,system:
select * from dba_users;
查看你能管理的所有用户:
select * from all_users;
查看当前用户信息:
select * from user_users;
查询用户所对应的表空间:
select username,default_tablespace from dba_users;
为用户指定表空间:
alter user 用户名 default tablespace 表空间名字 ;
为用户指定临时表空间:
alter user 用户名 temporary tablespace 表空间名字;
删除用户:
drop user 用户名称 cascade;
删除表空间:
drop tablespace 表空间名字 including contents and datafiles cascade constraint;
查找工作空间的路径:
select * from dba_data_files;
Oracle 查看表空间的大小及使用情况sql语句
查询表空间的名称及大小(原样复制,不要改)
SELECT t.tablespace_name, round(SUM(bytes / (1024 * 1024)), 0) ts_size
FROM dba_tablespaces t, dba_data_files d
WHERE t.tablespace_name = d.tablespace_name
GROUP BY t.tablespace_name;
查看表空间物理文件的名称及大小(原样复制,不要改)
SELECT tablespace_name,file_id,file_name,
round(bytes / (1024 * 1024), 0) total_space
FROM dba_data_files ORDER BY tablespace_name;
本文详细介绍Oracle数据库中用户管理的SQL语句,包括查询所有用户、查看用户信息、指定和修改用户表空间、删除用户及表空间等操作。同时,提供查看表空间大小和使用情况的方法。

被折叠的 条评论
为什么被折叠?



