zoukankan      html  css  js  c++  java
  • Oracle表空间基本操作

    普通表空间:

    1》  创建表空间:

      Create tablespace tablespace_name

      Datafile ‘E:oracle ablespace_datafile.dbf’ size 20M

      Autoextend on

      Next 5M

      Maxsize 50M;

    2》  添加数据文件:

      Alter tablespace tablespace_name

      Add datafile ‘E:oracle ablespace_new_add_datafile.dbf’

      Size 20M

      Autoextnend off;

    3》  更改数据文件大小:

      Alter database datafile ‘E:oracle ablespace_datafile.dbf’

      Resize 50M

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

      Alter database datafile ‘E:oracle ablespace_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:oracleold ablespace_datafile.dbf’

        to ‘E:oracle ew ablespace_datafile.dbf’

    11》   删除表空间:

      Drop tablespace tablespace_name

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

    临时表空间:  

    1》  创建临时表空间:

      Create temporary tablespace tablespace_name

      Tempfile ‘E:oracle emptablespace_datafile.dbf’

      Size 5M

      Autoextend on

      Next 3M

      Maxsize 10M

    2》  添加数据文件:

      Alter tablespace tablespace_name

      Add tempfile ‘E:oracle emptablespace_new_add_datafile.dbf’

      Size 5M;

    3》  更改数据文件大小:

    4》  更改临时文件状态:

      Alter database tempfile ‘E:oracle emptablespace_datafile.dbf’ offline

    5》  创建临时表空间组:

      Create temporary tablespace temptablespace_name

      Tempfile ‘E:oracle emptablespace_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  

  • 相关阅读:
    intel 蓝牙驱动安装时报错
    H310C,B365,M.2 NVME SSD,USB3.0,安装 WIN7 64 位
    C# .NET 判断输入的字符串是否只包含数字和英文字母
    squid http,https, 代理,默认端口3128
    C# .net mvc web api 返回 json 内容,过滤值为null的属性
    centos7安装python-3.5
    systemctl命令完全指南
    Centos7中systemctl命令详解
    Python if 和 for 的多种写法
    CentOS 7.0,启用iptables防火墙
  • 原文地址:https://www.cnblogs.com/kaibing/p/7853349.html
Copyright © 2011-2022 走看看