zoukankan      html  css  js  c++  java
  • CHIL-ORACLE-创建表空间

    表空间概念
      最大的逻辑单位

    表空间作用
      方便存储管理
      提高I/O性能
      备份和恢复

    表空间分类
      永久性、临时性、撤销表空间

    默认表空间
      system sysaux users undo(撤销) temp(临时)

    1
    .创建表空间语法 create tablespace kiki --创建名叫kiki的表空间 datafile 'D:oraclekiki.dbf'--kiki表空间包含的数据文件位置'D:oraclekiki.dbf size 3000M --空间大小为3000兆 autoextend on --可自动扩张(这个指当3000M用完时) next 128M maxsize unlimited --自动扩展时按128M扩展,最大size没有限制 minimum extent 128K --最小范围数是128K logging --产生log,意指进行DML操作(如:delete,update等时,产生redo log记录这些改变以便于恢复) default storage( --预设存储参数如下 initial 128K --初始分配 128k next 128K --下一次 128k minextents 1 --最小范围 1 maxextents 4096 --最大范围 4096 pctincrease 0 --pct增长 0 ) online --在线 permanent --永久(表空间分为永久和临时两种类型) extent management dictionary; --字典管理模式(表空间分为两种管理模式,字典与本地) 2.查询表空间 select tablespase_name, fid_id, block, bytes, blocks from dba_data_files; 3.查询数据文件名称,大小和路径 select tablespase_name, fid_id, bytes, file_name from dba_data_files; 4.修改表空间文件大小 alter database datafile '需要增加的数据文件路径' resize 800M; 5.删除表空间 drop tablespce 空间名 including contents and datafiles; 6.创建表空间(create tablespaces) create tablespace table_name datafile 'c:oracleoradatafile1.dbf' size 100M minimum extent 550k [logging/nologging] default storage (initial 500k next 500k maxextents 500 pctinccease 0) [online/offline] [permanent/temporary] [extent_management_clause] 7.创建本地管理的表空间( locally managed tabalespace ) create tablespace user_data datafile 'c:oracleoradatauser_data001.dbf' size 500M extent management local uniform size 10M; 8. 创建临时表空间(temporary tablespace) create temporary tablespace temp tempfile 'c:oracleoradata emppp01.dbf' size 500M extent management local uniform size 10M; 9.改变表空间的存储参数(change the storage setting) alter tablespace app_data minimum extent 2M; or alter tablespace app_date default storage( initial 2M next 2M maxextents 999); 10.使表空间离线或连线(taking tablespace offline or online) alter tablespace app_data offline; or alter tablespace app_data online; 11.设置表空间为只读、可写模式(read_only tablespace) alter tablespace app_data read only | write; 12.删除表空间(droping tablespace) drop tablespace app_data including contents; 13.允许数据文件自动扩张(enableing automatic extension of data files) alter tablespace app_data add datafile 'c:oracleoradataapp_data01.dbf' size 200M autoextend on next 10M maxsize 500M; 14.手动改变数据文件大小(change the size fo data files manually) alter database datafile 'c:oracleoradataapp_data.dbf' resize 200M; 15.改变表空间中的数据文件(mocing data files:alter tablespace) alter tablespace app_data rename datafile 'c:oracleoradataapp_data.dbf' to 'c:oracleapp_data.dbf'; 16.修改数据库中的数据文件(moving data files:alter databasealter database rename file 'c:oracleoradataapp_data.dbf' to 'c:oracleapp_data.dbf';
  • 相关阅读:
    API入门系列之三 那迷惑人的Windows字符和字符指针类型 转载
    laravel中关联模型查询选择性的字段
    【实习】微软PM实习生面经
    【C++学习】String类的基本用法
    sql server cast 和 convert函数使用
    JS,Jquery获取,dropdownlist,checkbox 下拉列表框的值
    Buffer
    SQL Server 2012新增的内置函数尝试
    SQL Server2012新特性WITH RESULT SETS
    ros(8)自定义service数据
  • 原文地址:https://www.cnblogs.com/ChineseIntelligentLanguage/p/6513212.html
Copyright © 2011-2022 走看看