zoukankan      html  css  js  c++  java
  • Oracle 修改表空间物理路径

    1、修改表空间为offline
    
    alter tablespace users offline;
    
    2、拷贝表空间文件
    
    cp /oracle/app/oradata/HXDB/users01.dbf /oradata/HXDB/datafile/users01.dbf
    
    3、修改表空间指向地址
    
    alter database rename file '/oracle/app/oradata/HXDB/users01.dbf' to '/oradata/HXDB/datafile/users01.dbf';
    
    4、删除表空间物理文件
    
    rm /oracle/app/oradata/HXDB/users01.dbf
    
    5、修改表空间为online
    
    alter tablespace users online;
    --删除空的表空间,但是不包含物理文件
    drop tablespace tablespace_name;
    --删除非空表空间,但是不包含物理文件
    drop tablespace tablespace_name including contents;
    --删除空表空间,包含物理文件
    drop tablespace tablespace_name including datafiles;
    --删除非空表空间,包含物理文件
    drop tablespace tablespace_name including contents and datafiles;
    --如果其他表空间中的表有外键等约束关联到了本表空间中的表的字段,就要加上CASCADE CONSTRAINTS
    drop tablespace tablespace_name including contents and datafiles CASCADE CONSTRAINTS;
  • 相关阅读:
    2017沈阳站 Tree
    P2146 [NOI2015]软件包管理器
    hdu3307 欧拉函数
    poj 3126 Prime Path bfs
    CSL的字符串
    P1045 麦森数
    洛谷 P1338 末日的传说
    树链剖分
    SQL[Err] ORA-00933: SQL command not properly ended
    Postman 快速入门之脚本
  • 原文地址:https://www.cnblogs.com/vinsonLu/p/12331959.html
Copyright © 2011-2022 走看看