orale tablespace&datafile oracle表空间
在前面学习Oracle数据库基础架构时,已经了解了Oracle的存储结构,逻辑上,Oracle的数据存放在tablespaces中,物理上存放在datafiles中。一个tablespace只能属于一个数据库(一个数据库可包括多个tablespace),包括了1个或多个数据文件。Tablespace可进一步分为segments、extents和blocks。一个datafile只属于一个数据库的一个tablespace。
Tablespace的分类有2种,一种分为SYSTEM tablespace和Non-SYSTEM tablespace。
SYSTEM tablespace是随数据库的创建而创建的,包含了数据字典和SYSTEM undo segment;Non-SYSTEM tablespace包括了分配给用户的空间便于数据库的空间管理。
另一种分为permanent、undo、temporary三种tablespace。一般不加特别说明时所创建的permanent tablespace,保存永久性对象;undo tablespace用于保存undo segments以便于回滚操作,而不能包含其他对象;temporary tablespace是用于进行排序操作,能够被多个用户共享,不能包含永久性对象.
Temporary tablespace中有一个default temporary tablespace,指定了一个全局的默认临时表空间,如果没有这个表空间,默认情况下,是使用SYSTEM tablespace来存储临时数据的,显然,这是不好的,默认临时表空间只有一个,可以从表database_properties中查看default temp tablespace,在新的default temp tablespace被创建之前,是不能被dropped的。
和tablespace以及datafile相关的数据字典有:dba_tablespaces、v$tablespace、dba_data_files、v$datafile、dba_temp_files、v$tempfile。
1、创建表空间
创建表空间的完整命令:
Create [undo] tablespace <ts_name>
datafile <file_spec1> [,<file_spec2>]
mininum extent <m> k|m
blocksize <n> [k]
logging clause
force logging
default storage_clause
online | offline
permanent | temporary
extent_manager_clause
segment_manager_clause
1)、undo指定系统将创建一个回滚表空间
2)、tablespace指定表空间名称
3)、datafile指定数据文件的路径、名称、大小及自增长状况:具体形如'E:\oracle\product\10.2.0\oradata\orcl\TEST.DBF' size 50M autoextend on next 10M maxsize 500M,也可以指定on为off,就没有后面的递增和最大尺寸了,也可以在maxsize后面指定最大尺寸unlimited说明表空间无限大。
4)、mininum extent <m> k|m指出在表空间的extent的最小值,这个参数可
相关文档:
SVRMGR> select * from dba_jobs;
初始化相关参数job_queue_processes
alter system set job_queue_processes=39 scope=spfile;//最大值不能超过1000 ;job_queue_interval = 10 //调度作业刷新频率秒为单位
DBA_JOBS describes all jobs in the database.
USER_JOBS describes all jobs owned by the c ......
Oracle中的decode用法
Decode(条件,值1,显示值1,值2,显示值2,…… 值n,显示值n)
应用举例:
select t.res_id,
t.res_size || '(kb)' as res_size,
decode(t.res_type,1,'模板区','0','文档区') res_type,
......
1、查看ORACLE最大游标数
C:\Documents and Settings\Administrator>sqlplus "sys/admin@test151 as sysdba" (sys以dba登录test151服务)
SQL*Plus: Release 9.2.0.1.0 - Production on 星期四 11月 5 09:08:04 2009
Copyright (c) 1982, 2002, Oracle Corporation. All rights ......
何为LOB?
lob为oracle数据库的一个大对象数据类型,可以存储超过4000bytes的字符串,二进制数据,OS文件等大对象信息.最大可存储的容量根oracle的版本和oracle 块大小有关.
有那几种可供选择的LOB类型?
目前ORACLE提供了CLOB,NCLOB,BLOB,BFILE共四种LOB类型,CLOB,NLOB为大字符串类型,NLOB为多语言集字符类型,类似于NV ......