ITPub博客

首页 > Linux操作系统 > Linux操作系统 > 修改数据库文件名字和路径

修改数据库文件名字和路径

原创 Linux操作系统 作者:yhj20041128001 时间:2013-01-05 00:27:22 0 删除 编辑

1.普通数据文件

alter database datafile '/u02/fmsprd/fmsprddatasystem01.dbf' offline;

mv fmsprddatasysaux01.dbf   sysaux01.dbf

alter database rename file '/u02/fmsprd/fmsprddatasysaux01.dbf' to '/u02/fmsprd/fmsprddata/sysaux01.dbf';
recover datafile '/u02/fmsprd/fmsprddata/sysaux01.dbf';

alter database datafile '/u02/fmsprd/fmsprddata/sysaux01.dbf' online;

需要归档模式,因为需要对数据文件进行恢复。

2.undo  tablespace

create undo tablespace undotbs2 datafile '/u02/fmsprd/fmsprddata/undotbs02.dbf'size 100M autoextend off;

alter system set undo_tablespace='UNDOTBS2' scope=both ;

alter tablespace undotbs1 offline normal;

drop tablespace undotbs1 including contents and datafiles ;

shutdown immediate;

startup;


3 temporary tablespace

create temporary   tablespace pstemp  TEMPFILE '/u02/fmsprd/fmsprddata/pstemp01.dbf 'size 200M;

alter database default temporary tablespace pstemp;

drop tablespace temp including  contents and  datafiles  ;

4.移动system表空间下的数据文件。

 shutdown immediate;

 startup mount;

 mv fmsprddatasystem01.dbf  system01.dbf

alter database rename file '/u02/fmsprd/fmsprddatasystem01.dbf' to '/u02/fmsprd/fmsprddata/system01.dbf';
alter database open;

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/23757700/viewspace-752101/ ,如需转载,请注明出处,否则将追究法律责任。

上一篇: 坏块---ORA_1258
请登录后发表评论 登录
全部评论

注册时间:2010-09-17

  • 博文量
    174
  • 访问量
    390267