zoukankan      html  css  js  c++  java
  • Oracle 数据文件管理

     

    1、手工改变数据文件的大小

    SQL>conn / as sysdba

    SQL>Createtablespace exampletb Datafile 'E: examp01.dbf' size 10M ;

    SQL>alter database datafile 'E:examp01.dbf' resize 20m;

    SQL>alter database datafile 'E:examp01.dbf' resize 9m;

    2、加入数据文件到表空间

    SQL> alter tablespace exampletb add datafile 'E: examp02.dbf' size 10M;

    3、从表空间中删除数据文件

    SQL> alter tablespace exampletb drop datafile 'E: examp02.dbf';

    4、将表空间设置为仅仅读模式和读写模式

    SQL>CREATETABLE scott.student (id NUMBER(5), name VARCHAR2(10)) TABLESPACE exampletb;

    SQL>insertinto scott.student(id,name) values(1, 'lucy');

    SQL> alter tablespace exampletb read only;

    SQL>insertinto scott.student(id,name) values(2, 'lily');

    SQL>select* from scott.student;

          SQL> alter tablespace exampletb read write。

    SQL>insertinto scott.student(id,name) values(2, 'lily');

    5、 将表空间设置为在线和离线

    SQL> alter tablespace exampletb offline;

    SQL>select* from scott.student;

    SQL> alter tablespace exampletb online;

    SQL>select* from scott.student;

    6、查询表空间和数据文件

    SQL>select * from v$tablespace;

    SQL>select * from dba_tablespaces;

    SQL>select * from v$datafile;

    SQL> select * from dba_data_files;


  • 相关阅读:
    C#的编码规范中文版(www.idesign.net Author: Juval Lowy)
    [经典推荐]事半功倍系列之javascript(二)
    [推荐]让SQL跑得更快
    SortedList 用法
    在C#中应用哈希表(Hashtable)
    SVN配置安装
    sql事务处理回滚及保留点transaction,ROLLBACK
    启用Service Broker
    BLOB
    WebServiceBinding属性
  • 原文地址:https://www.cnblogs.com/bhlsheji/p/5370970.html
Copyright © 2011-2022 走看看