zoukankan      html  css  js  c++  java
  • 【练习】表空间操作

    1.创建表空间 

    1)test1:大小为50M,自动扩展最大不能超过2G,表空间本地管理,且segment space management manual。

    SQL> create tablespace test1 datafile '/u01/app/oracle/oradata/ORA11GR2/test101.dbf' size 50M
      2  autoextend on next 1M maxsize 2G
      3  extent management local uniform size 1M
      4  segment space management manual;
    
    Tablespace created.

    2)tool:大小为40M,本地管理,且扩展时按照统一大小1M扩展。

    SQL> create tablespace tool datafile '/u01/app/oracle/oradata/ORA11GR2/test102.dbf' size 40M
      2  extent management local uniform size 1M
      3  segment space management manual;
    
    Tablespace created.

    3)创建临时表空间tem11,temp12,大小均为50M,并且加到temp_grp组中,将这个组设置为数据库默认的临时表空间组。

    SQL> create temporary tablespace tem11
      2  tempfile '/u01/app/oracle/oradata/ORA11GR2/temp_01.dbf' size 50M
      3  tablespace group temp_grp;
    
    Tablespace created.
    
    SQL> create temporary tablespace tem12
      2  tempfile '/u01/app/oracle/oradata/ORA11GR2/temp_02.dbf' size 50M
      3  tablespace group temp_grp;
    
    Tablespace created.
    SQL> alter database default temporary tablespace temp_grp;
    
    Database altered.

    4)查看临时表空间。

    SQL> select property_value from database_properties where property_name = 'DEFAULT_TEMP_TABLESPACE';
    
    PROPERTY_VALUE
    --------------------------------------------------------------------------------
    TEMP_GRP

     5)创建小文件表空间(最多4G个块,每块8k,也就是最大32G)。

    SQL> create tablespace small_tbs1 datafile
      2  '/u01/app/oracle/oradata/ORA11GR2/tbs1.dbf' size 10M
      3  autoextend on maxsize 1G;
    
    Tablespace created.

    6)创建非标块的表空间(先建一个非标块的缓存)。

    SQL> alter system set db_16k_cache_size=16M;
    
    System altered.
    创建
    SQL> create tablespace tbs1 datafile
      2  '/u01/app/oracle/oradata/ORA11GR2/tbs1.dbf' size 10M
      3  blocksize 16k;
    
    Tablespace created.

    7)创建undo表空间(每次只能有一个undo表空间在使用)。

    SQL> create undo tablespace undo1 datafile '/u01/app/oracle/oradata/ORA11GR2/undo1.dbf' size 100M;
    
    Tablespace created.

    切换当前使用的临时表空间:

    SQL> alter system set undo_tablespace='undo1';
    
    System altered.

    8)删除表空间

    SQL> drop tablespace small_tbs1 including contents and datafiles;
    
    Tablespace dropped.
  • 相关阅读:
    bzoj3884: 上帝与集合的正确用法(数论)
    洛谷10月月赛R2·浴谷八连测R3题解
    bzoj5055: 膜法师(BIT)
    bzoj2213: [Poi2011]Difference(思维题)
    bzoj1016: [JSOI2008]最小生成树计数(kruskal+dfs)
    一模 (2) day2
    一模 (2) day1
    Prime Palindromes
    常州培训 day5 解题报告
    一模 (1) day2
  • 原文地址:https://www.cnblogs.com/tomatoes-/p/6040725.html
Copyright © 2011-2022 走看看