重命名数据文件
方法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/user01.dbf' ;
restore datafile 4;
switch datafile 4;
recover datafile 4;
sql 'alter tablespace users online';
}
report schema;