oracle 管理表空间和数据文件

来源:互联网 发布:韦东山linux咋样 编辑:程序博客网 时间:2024/06/06 12:44

以下内容摘自oracle 11g 权威指南

 




tablespace(表空间)---》segment(段)---》extent(盘区)---》block(块)



一、表空间和数据文件的关系

在oracle系统中,表空间与数据文件是一对不能分开的概念,创建表空间时必须创建数据文件,增加数据文件时必须制定表空间。

1、查询表空间及其包含的数据文件

select tablespace_name,file_name,bytes from dba_data_files order by tablespace_name;

 

2、oracle默认表空间列表

example --如果安装时候选择实例方案,则此表空间是各样例账号的对象
sysaux--system表空间的辅助空间。一些选件的对象都存放在此表空间内以减少system表空间的负荷

system--存储数据字典、包括表、视图、存储过程的定义等

temp--存数sql语句处理的表和索引的信息

undotbs1--存储撤销信息的表空间

users--处处数据库用户创建的数据库对象

 

2.1 查询system 表空间存放的对象及其拥有者

select distinct segment_type,owner,tablespace_name from dba_sgements where tablespace_name='SYSTEM'  order by owner,segment_type

(注意在SQL PLUS查询时候,tablespace_name 需要大写,因为表中存储的是大写)

 

 2.2 查询sysaux表空间存放的用户对象数

select owner,count(*) from dba_sgements where tablespace_name='SYSAUX'   group by owner




 


sgement /ˈsɛɡmənt/  段


 

 

0 0