zoukankan      html  css  js  c++  java
  • 转:1.2 Oracle表空间的操作

    1.创建表空间 

    1. SQL> create tablespace testspace   
    2. datafile 'd:/OracleTest/test001.dbf' size 10m autoextend on next 5m maxsize unlimited   
    3. extent management local ;   



    2.给表空间添加数据文件 

    1. SQL> alter tablespace testspace add datafile 'd:/OracleTest/test002.dbf' size 5m   
    2. autoextend on next 3m maxsize 50m;   



    3.删除表空间中的数据文件 

    1. SQL> alter tablespace testspace drop datafile 'd:/OracleTest/test002.dbf';   



    4.修改表空间文件的数据文件大小 

     
    1. SQL> alter database datafile 'd:/OracleTest/test001.dbf' resize 10m;  



    5.修改表空间数据文件的自动增长属性 

     
    1. SQL> alter database datafile 'd:/OracleTest/test001.dbf' autoextend off;   



    6.修改表空间的读写属性 

     
    1. SQL> alter tablespace testspace read only;(只读)   
    2.   
    3. SQL> alter tablespace testspace read write;(读写)   



    7.设置表空间脱/联机 

     
    1. SQL> alter tablespace testspace offline;   
    2.   
    3. SQL> alter tablespace testspace online;   



    8.转移物理文件路径的操作 

     
    1. (1)设置表空间脱机 alter tablespac testspace offline;   
    2.   
    3. (2)物理转移表空间文件;即把你的表空间物理文件转移到你想移动的路径   
    4.   
    5. (3)逻辑转移:alter tablespace testspace rename datafile 'd:/OracleTest/test001.dbf' to 'e:/test001.dbf';   
    6.   
    7. (4)设置表空间联机 alter tablespace testspace online;   



    9.删除表空间 

     
    1. (1)不删文件 drop tablespace testspace;   
    2.   
    3. (2)删除文件 drop tablespace testspace including contents and datafiles;   



    10.物理文件被非法删除时,怎样启动数据库 

    Java代码 
    1. (1)关闭数据库服务 shutdown   
    2.   
    3. (2)alter database datafile 'd:/test001.dbf' offline drop;   
    4.   
    5. (3)alter database open;   
    6.   
    7. (4)开启数据库服务 startup;   



    11、查看表空间名 


     
    1. Select distinct Tablespace_Name from tabs;  
    2. select tablespace_name from user_tablespaces;  
  • 相关阅读:
    iOS使用自签名证书实现HTTPS请求
    DB操作-用批处理执行Sql语句
    SSL通信-忽略证书认证错误
    oracle 19c awr 丢失 i/o信息
    this.$route.query刷新后类型改变
    wx.navigateTo在app.js中偶发性失效
    微信小程序new Date()转换日期格式时iphonex为NaN
    下载cnpm成功,cnpm -v却不识别
    element-ui的表单验证如何清除校验提示语
    5. 最长回文子串(动态规划算法)
  • 原文地址:https://www.cnblogs.com/pengkun/p/2433667.html
Copyright © 2011-2022 走看看