Oracle表空间的管理——查看用户的表空间
1、熟悉与表空间相关的数据字典
(1)、数据字典:数据库提供的表,用于查询数据库信息。
<1>、相关的数据字典:dba_tablespaces
user_tablespaces
例1:select tablespace_name from dba_tablespaces;
注:system表空间:用于存放系统用户表、视图、存储过程等信息,也叫系统表空间。
sysaux表空间:example表空间的辅助表空间,也叫索引表空间
undoibs1表空间:用于存放撤销信息的表空间,也叫回退表空间或回滚表空间
temp表空间:属于临时一个的表空间
users表空间:用于存放数据库用户创建的数据库对象,与system表空间作用差不多,只是system表空间偏重于存放系统信息
example表空间:用于存放安装Oracle 11G示例的表空间,也叫工具表空间
例1:select tablespace_name from user_tablespaces;
2、查看系统用户的表空间
<1>、dba_users:针对于管理员的数据字典,用于查看数据库所有用户的用户信息
<2>、user_users:针对普通用户的数据字典,查看当前连接的用户的信息
例:查看system用户的表空间信息:
select default_tablespace,temporary_tablespace from dba_users where username = 'system';
3、设置用户默认或临时的表空间
<1>:语法格式:alter user username default | temporary tablespace tablespace_name;
例:alter user user01 default tablespace test1_tablespace temporary tablespace temptest1_tablespace;