Post date: 22-May-2009 19:32:20
select file_id, file_name, length(file_name) from dba_data_files where file_name like '%E2E01%' and file_id in (85,128) order by file_name
FILE_ID FILE_NAME LENGTH(FILE_NAME)
---------- ---------------------------------------------------------------------- -----------------
85 /u01/app/oracle/oradata/rdb/D_E2E01_10.dbf 42
128 /u01/app/oracle/oradata/rdb/D_E2E01_10.dbf 46
As you can see the above file names are same but the length is different. It was not possible on SQL level to
solve the problem using conventional following approach :
1. Offline Datafile (As we cannot use the name we have to use the ID)
alter database datafile 128 offline;
2. Rename datafile
alter database rename file 128 to '/busdata/re2e/eur0/_lgi/oracle/data1/D_E2E01_24.dbf';
This would fail as instead of ID it requires name.
Following approach was used to solve the problem with 5 Seconds outage for segments in that datafile.
rman target /
RMAN> run{
backup as copy datafile 128 format '/u01/app/oracle/oradata/rdb/D_E2E01_10.dbf';
sql 'alter database datafile 128 offline'
}
RMAN> swith datafile 128 to copy;
RMAN> run{
recover datafile 128;
sql 'alter database datafile 128 online';
}
The above apporach can also be quite a good solution for following in relation to RAC Databases
1. Move database from one diskgroup to another diskgroup.
2. Change the redundancy of diskgroup.