经过长时间学习创建Oracle表空间,于是和大家分享一下,看完本文你肯定有不少收获,希望本文能教会你更多东西。
1、先查询空闲空间
select tablespace_name,file_id,block_id,bytes,blocks from dba_free_space;
2、增加Oracle表空间
先查询数据文件名称、大小和路径的信息,语句如下:
select tablespace_name,file_id,bytes,file_name from dba_data_files;
3、修改文件大小语句如下
alter database datafile
'需要增加的数据文件路径,即上面查询出来的路径
'resize 800M;
4、创建Oracle表空间
create tablespace test
datafile '/home/app/oracle/oradata/oracle8i/test01.dbf' size 8M
autoextend on
next 5M
maxsize 10M;
create tablespace sales
datafile '/home/app/oracle/oradata/oracle8i/sales01.dbf' size 800M
autoextend on
next 50M
maxsize unlimited
maxsize unlimited 是大小不受限制
create tablespace sales
datafile '/home/app/oracle/oradata/oracle8i/sales01.dbf' size 800M
autoextend on
next 50M
maxsize 1000M
extent management local uniform;
unform表示区的大小相同,默认为1M
create tablespace sales
datafile '/home/app/oracle/oradata/oracle8i/sales01.dbf' size 800M
autoextend on
next 50M
maxsize 1000M
extent management local uniform size 500K;
unform size 500K表示区的大小相同,为500K
create tablespace sales
datafile '/home/app/oracle/oradata/oracle8i/sales01.dbf' size 800M
autoextend on
next 50M
maxsize 1000M
extent management local autoallocate;
autoallocate表示区的大小由随表的大小自动动态改变,大表使用大区小表使用小区
create tablespace sales
datafile '/home/app/oracle/oradata/oracle8i/sales01.dbf' size 800M
autoextend on
next 50M
maxsize 1000M
temporary;
temporary创建字典管理临时表空间
create temporary tablespace sales
tempfile '/home/app/oracle/oradata/oracle8i/sales01.dbf' size 800M
autoextend on
next 50M
maxsize 1000M
创建本地管理临时表空间,如果是临时表空间,所有语句中的datafile都换为tempfile
8i系统默认创建字典管理临时表空间,要创建本地管理临时表空间要加temporary tablespace关键字
创建本地管理临时表空间时,不得使用atuoallocate参数,系统默认创建uniform管理方式
为表空间增加数据文件:
alter tablespace sales add
datafile '/home/app/oracle/oradata/oracle8i/sales02.dbf' size 800M
autoextend on next 50M
maxsize 1000M;
创 建本地管理临时Oracle表空间,如果是临时表空间,所有语句中的datafile都换为tempfile8i系统默认创建字典管理临时表空间,要创建 本地管理临时表空间要加temporary tablespace关键字创建本地管理临时表空间时,不得使用atuoallocate参数,系统默认创建uniform管理方式
为表空间增加数据文件:
alter tablespace sales add
datafile '/home/app/oracle/oradata/oracle8i/sales02.dbf' size 800M
autoextend on next 50M
maxsize 1000M;
5、更改自动扩展属性:
alter database datafile
'/home/app/oracle/oradata/oracle8i/sales01.dbf',
'/home/app/oracle/oradata/oracle8i/sales02.dbf'
'/home/app/oracle/oradata/oracle8i/sales01.dbf
autoextend off;
6、删除表空间:
drop tablespace xxx including contents and datafiles
分享到:
相关推荐
CREATE TABLESPACE命令详解 CREATE TABLESPACE命令详解
Mysql innodb tablespace 表空间实践
rlv方式增加oracle tablespace datafile
Oracle_create_tablespace语法详解.docx
1tablespace.sql
本文详细介绍和阐述了 Oracle 用户(user)和表空间(tablespace)的概念和使用方法等内容,并对用户和表空间使用过程中的注意事项、关键知识点等进行了重点标注和详尽解析,以便于读者进行深入学习和理解。...
create temporary tablespace user_temp tempfile 'D:\oracle\oradata\Oracle9i\user_temp.dbf' size 50m autoextend on next 50m maxsize 20480m extent management local; /*第2步:创建数据表空间...
get_tablespace_usage.sh
select a.tablespace_name tablespace_name ,nvl(ceil((1 - b.free / a.total) * 100), 100) usage_of_tablespace% ,nvl(b.free, 0) left_space(M) ,c.extent_management Extent_management from (select tables
ERP管理系统资料:SAP专业教材资料T_Tablespace_Ext.doc
将设置目标用户的默认表空间为导入的目的表空间,在默认表空间上授予QUOTA UNLLIMITED,回收改用户的UNLIMITED TABLESPACE权限: 看一个简单的例子: SQL> CREATE TABLESPACE TESTEXP DATAFILE '/data/oradata/...
Oracle_tablespace_(表空间)的创建、删除、修改、扩展及检查等
CREATE TABLESPACECREATE TABLESPACECREATE TABLESPACECREATE TABLESPACECREATE TABLESPACE
oracle tablespace usage
-- Create the user create user BOS identified by "" default tablespace SYSTEM temporary tablespace TEMP profile DEFAULT password expire; -- Grant/Revoke role privileges grant connect to BOS; grant ...
WHERE A.TABLESPACE_NAME=B.TABLESPACE_NAME AND A.TABLESPACE_NAME=C.TABLESPACE_NAME; 7、查看数据库库对象 select owner, object_type, status, count(*) count# from all_objects group by owner, object_...
NULL 博文链接:https://j2ee2009.iteye.com/blog/1005083