Oracle表空间基本操作

普通表空间:

1》  创建表空间:

  Create tablespace tablespace_name

  Datafile ‘E:\oracle\tablespace_datafile.dbf’ size 20M

  Autoextend on

  Next 5M

  Maxsize 50M;

2》  添加数据文件:

  Alter tablespace tablespace_name

  Add datafile ‘E:\oracle\tablespace_new_add_datafile.dbf’

  Size 20M

  Autoextnend off;

3》  更改数据文件大小:

  Alter database datafile ‘E:\oracle\tablespace_datafile.dbf’

  Resize 50M

4》  更改表数据文件自增:

  Alter database datafile ‘E:\oracle\tablespace_new_add_datafile.dbf’

  Autoextend on

 

5》  查询所有表空间名字等 :user_tablespaces;

6》  查询默认表空间,临时表空间:user_users

7》  查询表空间空闲情况:dba_free_space

8》  查询数据文件:dba_data_files

9》  查询表空间状态:dba_tablespaces

10》 移动数据文件:

  ①   :alter tablespace tablespace_name offline

  ②   :物理硬盘上移动数据文件

  ③   :alter tablespace tablespace_name

    rename datafile ‘E:\oracle\old\tablespace_datafile.dbf’

    to ‘E:\oracle\new\tablespace_datafile.dbf’

11》   删除表空间:

  Drop tablespace tablespace_name

  Including contents and datafiles;(删除内容和文件)

 

 

临时表空间:  

1》  创建临时表空间:

  Create temporary tablespace tablespace_name

  Tempfile ‘E:\oracle\temptablespace_datafile.dbf’

  Size 5M

  Autoextend on

  Next 3M

  Maxsize 10M

2》  添加数据文件:

  Alter tablespace tablespace_name

  Add tempfile ‘E:\oracle\temptablespace_new_add_datafile.dbf’

  Size 5M;

3》  更改数据文件大小:

4》  更改临时文件状态:

  Alter database tempfile ‘E:\oracle\temptablespace_datafile.dbf’ offline

5》  创建临时表空间组:

  Create temporary tablespace temptablespace_name

  Tempfile ‘E:\oracle\temptablespace_datafile.dbf’

  Size 5M

  Tablespace group tablespace_group_name

6》  把临时表空间添加到表空间组:

  Alter tablespace temptablespace_name tablespace group tablespace_group_name

7》  删除表空间组 == 删除表空间组中的所有表空间

  Drop tablespace temptablespace_name including contents and datafiles  

转载于:https://www.cnblogs.com/kaibing/p/7853349.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值