oracle的逻辑结构和物理结构
1、数据库的逻辑结构和物理结构:
Oracle logically divides the database into a smaller units to manage ,store,and retreive
data efficently.
Tablespace\Blocks\Extents\segment\
有四种segment:
data segment、Index segment、Temporay segment、Rollback Segment
temporary segment:
Are created when Oracle needs a temporary work area,such as for sorting,during a query,
to complete execution of a SQL statement.These segments are freed when the execution completes.
Rollback segment:Used to store undo information.When you roll back the changes madde to the
database,the information in the rollback segment is used to undo the changes.
The physical daabase structure consists of three types of physcial files
data files
control files
redo log files
The control file contains the database name and timestamp of database creation as well as the name and location of every data file and redo log file.
相关文档:
1.查询用户(数据)表空间
SELECT UPPER(F.TABLESPACE_NAME) "表空间名",
D.TOT_GROOTTE_MB "表空间大小(M)",
D.TOT_GROOTTE_MB - F.TOTAL_BYTES "已使用空间(M)",
TO_CHAR(ROUND((D.TOT_GROOTTE_ ......
1、查找表的所有索引(包括索引名,类型,构成列):
select t.*,i.index_type from user_ind_columns t,user_indexes i where t.index_name = i.index_name and t.table_name = i.table_name and t.table_name = 要查询的表
2、查找表的主键(包括名称,构成列):
select cu.* from user_cons_columns cu, user_constr ......
Oracle数据库的数据块DB_BLOCK_SIZE大小确定数据库的最小数据块的大小,在创建表空间时可以如果不想使用默认的数据块大小,可以通过设置自己的数据块大小。
具体实例如下:
create tablespace test_16k
bloc ......
在系统时间基础上延迟5秒
sysdate+(5/24/60/60)
在系统时间基础上延迟5分钟
sysdate+5/24/60
在系统时间基础上延迟5小时
sysdate+5/24
在系统时间基础上延迟5天
sysdate+5
在系统时间基础上延迟5月
add_months(sysdate,-5)
在系统时间基础上延迟5年
add_months ......