zoukankan      html  css  js  c++  java
  • oracle 修改表空间存储路径

    [root@yoon ~]# more /etc/oracle-release
    Oracle Linux Server release 5.7

    Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
    PL/SQL Release 11.2.0.3.0 - Production
    CORE 11.2.0.3.0 Production
    TNS for Linux: Version 11.2.0.3.0 - Production
    NLSRTL Version 11.2.0.3.0 - Production

    1.查看数据文件的存储路径:

    SQL> select name from v$datafile;

    NAME
    --------------------------------------------------------------------------------
    /u01/oracle/oradata/yoon/system01.dbf
    /u01/oracle/oradata/yoon/sysaux01.dbf
    /u01/oracle/oradata/yoon/undotbs01.dbf
    /u01/oracle/oradata/yoon/users01.dbf

    2.修改表空间为offline:

    SQL> alter tablespace users offline;

    Tablespace altered.

    3.拷贝数据文件

    [oracle@yoon yoon]$ cp users01.dbf /u01/oracle/oradata/yoondata/

    4.修改表空间存储路径

    SQL> alter tablespace users rename datafile '/u01/oracle/oradata/yoon/users01.dbf' to '/u01/oracle/oradata/yoondata/users01.dbf';

    Tablespace altered.

    5.修改表空间为online

    SQL> alter tablespace users online;

    Tablespace altered.

    6.重新查看数据文件路径

    SQL> select name from v$datafile;

    NAME
    --------------------------------------------------------------------------------
    /u01/oracle/oradata/yoon/system01.dbf
    /u01/oracle/oradata/yoon/sysaux01.dbf
    /u01/oracle/oradata/yoon/undotbs01.dbf
    /u01/oracle/oradata/yoondata/users01.dbf

  • 相关阅读:
    linux信号
    APM浅析
    Jackson高并发情况下,产生阻塞
    [转]slf4j 与log4j 日志管理
    2015-09-27 git学习
    MySQL学习笔记-锁相关话题
    MySQL学习笔记-MySQL数据库优化实践[转]
    MySQL学习笔记-事务相关话题
    几个关于网站架构和性能的问题(我在知乎上的问答)
    MySQL学习笔记-数据库文件
  • 原文地址:https://www.cnblogs.com/hankyoon/p/5174495.html
Copyright © 2011-2022 走看看