zoukankan      html  css  js  c++  java
  • 六分钟学会创建Oracle表空间的步骤

    经过长时间学习创建Oracle表空间,于是和大家分享一下,看完本文你肯定有不少收获,希望本文能教会你更多东西。

    1、先查询空闲空间

    1. select tablespace_name,file_id,block_id,bytes,blocks from dba_free_space; 

    2、增加Oracle表空间

    先查询数据文件名称、大小和路径的信息,语句如下:

    1. select tablespace_name,file_id,bytes,file_name from dba_data_files; 

    3、修改文件大小语句如下

    1. alter database datafile   
    2. '需要增加的数据文件路径,即上面查询出来的路径  
    3. 'resize 800M; 

    4、创建Oracle表空间

    1. create tablespace test  
    2. datafile '/home/app/oracle/oradata/oracle8i/test01.dbf' size 8M  
    3. autoextend on  
    4. next 5M  
    5. maxsize 10M;  
    6.  
    7. create tablespace sales  
    8. datafile '/home/app/oracle/oradata/oracle8i/sales01.dbf' size 800M  
    9. autoextend on  
    10. next 50M  
    11. maxsize unlimited  
    12. maxsize unlimited 是大小不受限制  
    13.  
    14. create tablespace sales  
    15. datafile '/home/app/oracle/oradata/oracle8i/sales01.dbf' size 800M  
    16. autoextend on  
    17. next 50M  
    18. maxsize 1000M  
    19. extent management local uniform;  
    20. unform表示区的大小相同,默认为1M  
    21.  
    22. create tablespace sales  
    23. datafile '/home/app/oracle/oradata/oracle8i/sales01.dbf' size 800M  
    24. autoextend on  
    25. next 50M  
    26. maxsize 1000M  
    27. extent management local uniform size 500K;  
    28. unform size 500K表示区的大小相同,为500K  
    29.  
    30. create tablespace sales  
    31. datafile '/home/app/oracle/oradata/oracle8i/sales01.dbf' size 800M  
    32. autoextend on  
    33. next 50M  
    34. maxsize 1000M  
    35. extent management local autoallocate;  
    36. autoallocate表示区的大小由随表的大小自动动态改变,大表使用大区小表使用小区  
    37.  
    38. create tablespace sales  
    39. datafile '/home/app/oracle/oradata/oracle8i/sales01.dbf' size 800M  
    40. autoextend on  
    41. next 50M  
    42. maxsize 1000M  
    43. temporary;  
    44. temporary创建字典管理临时表空间  
    45.  
    46. create temporary tablespace sales  
    47. tempfile '/home/app/oracle/oradata/oracle8i/sales01.dbf' size 800M  
    48. autoextend on  
    49. next 50M  
    50. maxsize 1000M  
    51. 创建本地管理临时表空间,如果是临时表空间,所有语句中的datafile都换为tempfile  
    52.  
    53. 8i系统默认创建字典管理临时表空间,要创建本地管理临时表空间要加temporary tablespace关键字  
    54. 创建本地管理临时表空间时,不得使用atuoallocate参数,系统默认创建uniform管理方式  
    55.  
    56. 为表空间增加数据文件:  
    57. alter tablespace sales add  
    58. datafile '/home/app/oracle/oradata/oracle8i/sales02.dbf' size 800M  
    59. autoextend on next 50M  
    60. maxsize 1000M; 

    创建本地管理临时Oracle表空间,如果是临时表空间,所有语句中的datafile都换为tempfile8i系统默认创建字典管理临时表空间,要创建本地管理临时表空间要加temporary tablespace关键字创建本地管理临时表空间时,不得使用atuoallocate参数,系统默认创建uniform管理方式

    为表空间增加数据文件:

    1. alter tablespace sales add  
    2. datafile '/home/app/oracle/oradata/oracle8i/sales02.dbf' size 800M  
    3. autoextend on next 50M  
    4. maxsize 1000M; 

    5、更改自动扩展属性:

    1. alter database datafile  
    2. '/home/app/oracle/oradata/oracle8i/sales01.dbf',  
    3. '/home/app/oracle/oradata/oracle8i/sales02.dbf'  
    4. '/home/app/oracle/oradata/oracle8i/sales01.dbf  
    5. autoextend off; 

    以上介绍创建Oracle表空间,在这里拿出来和大家分享一下,希望对大家有用。

  • 相关阅读:
    [经典SQL语句]根据父级ID查找所有子级ID,并将所有ID用逗号隔开返回
    小程序页面之间传值
    微信小程序样式wxss各种问题总结(不断更新)
    产品经理--用户体验设计
    linux(centos)下为php添加添加GD扩展
    discuzx3.2发帖流程
    linux(centos)下配置nginx配置文件nginx.conf显示语法高亮
    Mysql关于字段的操作(记录)
    Mysql为表字段添加索引(记录)
    laravel-admin报错: Driver [] is not supported.
  • 原文地址:https://www.cnblogs.com/zhwl/p/3747180.html
Copyright © 2011-2022 走看看