城市獵人

          在一網(wǎng)情深的日子里,誰能說得清是苦是甜,只知道確定了就義無反顧
          posts - 1, comments - 7, trackbacks - 0, articles - 89

          3.1 表空間

          Posted on 2008-07-11 23:18 sailor 閱讀(243) 評論(0)  編輯  收藏 所屬分類: oracle
          1、創(chuàng)建表空間
          1create tablespace student
          2datafile 'D:\oracle\product\oradata\mydata\student01.dbf' size 10m
          3autoextend on
          4next 10m
          5maxsize 100m;

          2、修改表空間大小

               1).增加數(shù)據(jù)文件
             
          1alter tablespace student
          2add datafile 'D:\oracle\product\oradata\mydata\student02.dbf' size 10m;

               2).修改數(shù)據(jù)文件

          1alter database datafile 'D:\oracle\product\oradata\mydata\student02.dbf' resize 20m;

              3).增加表空間或數(shù)據(jù)文件時,使用autoextend on.

          3、重新命名表空間

          1Alter tablespace student rename to newTablespaceName;

          4、只讀表空間

          1Alter tablspace student read only;

          1Alter tablespace student read write;

          5、表空間脫機

          1Alter tablespace student offline normal;

          1Alter tablespace student online;

          6、建立臨時表空間

          1Create temporary tablespace tempDemo
          2tempfile 'D:\oracle\product\oradata\mydata\temp01.dbf' size 10m;

          7、刪除表空間

          1drop tablespace tempDemo;

          1Drop tablespace tempDemo including contents;

          8、刪除表空間數(shù)據(jù)文件

          1alter tablespace testspace student datafile 'd:/oracle/product/oradata/student02.dbf'

          9、轉(zhuǎn)移物理文件

          1(1)設(shè)置表空間脫機 alter tablespac testspace offline;    
          2  
          3(2)物理轉(zhuǎn)移表空間文件;即把你的表空間物理文件轉(zhuǎn)移到你想移動的路徑    
          4  
          5(3)邏輯轉(zhuǎn)移:alter tablespace testspace rename datafile 'd:/OracleTest/test001.dbf' to 'e:/test001.dbf';    
          6  
          7(4)設(shè)置表空間聯(lián)機 alter tablespace testspace online;  

          10、物理文件被非法刪除時,怎樣啟動數(shù)據(jù)庫

          1(1)關(guān)閉數(shù)據(jù)庫服務(wù) shutdown    
          2  
          3(2)alter database datafile 'd:/test001.dbf' offline drop;    
          4  
          5(3)alter database open;    
          6  
          7(4)開啟數(shù)據(jù)庫服務(wù) startup;

          11、查看表空間的數(shù)據(jù)字典
                  USER_TABLESPACE;
                  DBA_DATA_FILES;
                  DBA_FREE_SPACE;
                  
          主站蜘蛛池模板: 伊吾县| 屏山县| 樟树市| 会昌县| 肇州县| 正镶白旗| 卢氏县| 改则县| 麻栗坡县| 阳高县| 塔河县| 林口县| 北川| 荃湾区| 广汉市| 句容市| 余姚市| 太白县| 米林县| 上犹县| 黑山县| 称多县| 东兴市| 柳河县| 墨竹工卡县| 资阳市| 鸡泽县| 太康县| 额敏县| 木兰县| 安义县| 九龙坡区| 泽普县| 运城市| 山阴县| 上饶市| 东明县| 阳江市| 社旗县| 温州市| 天台县|