oracle数据库文件移动方法
因业务需求,需要将Oracle数据库的部分文件转移到新的位置
需要操作步骤如下
1、停止所有Oracle数据库的连接和业务程序
2、将需要移动的文件表空间设置offline(需要system用户登陆)
alter tablespace [tablesspacename] offline;
3、移动文件到新位置
4、设置新数据文件路径(需要system用户登陆)
alter tablespace [tablesspacename] rename datafile '/data/oracle/oradata/orcl/datafile.dbf' to '/newpath/datafile.dbf';
5、设置表空间online
alter tablespace [tablesspacename] online;
完成!
附录:
查询表空间文件的路径
select tablespace_name,file_name,online_status from dba_data_files where tablespace_name='tablesspacename';
本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来自 AJian的小站!