oracle rename datafile
方法1:文件系统
sql>alter tablespace users offline;
sql>host cp /u01/app/oracle/oradata/orcl/users01.dbf /u01/app/oracle/oradata/orcl/users_01.dbf
sql>alter database rename file '/u01/app/oracle/oradata/orcl/users01.dbf' to '/u01/app/oracle/oradata/orcl/users_01.dbf';
sql>alter tablespace users rename datafile '/u01/app/oracle/oradata/orcl/users01.dbf' to '/u01/app/oracle/oradata/orcl/users_01.dbf';
sql>alter tablespace users online;
方法2:(asm环境只能用此法)
rman>
report schema;
copy datafile '+DATA/orcl/datafile/user01.dbf' to '+DATA/orcl/datafile/user_01.dbf'
run{
sql 'alter tablespace users offline';
set newname for datafile 4 to '+DATA/orcl/datafile/user_01.dbf' ;
restore datafile 4;
switch datafile 4;
recover datafile 4;
sql 'alter tablespace users online';
}
report schema;
喜欢请赞赏一下啦^_^
微信赞赏
支付宝赞赏