I made a really stupid mistake and now I can't figure out how to fix it.
I created a datafile wiith a space after the .dbf
alter tablespace data_01
add datafile
'/u02/oradata/ads02/df_ads02_data_01_3.dbf ' size 1024M;
Now there is some sort of special charecter at the end of .dbf
I copied the file to another file
cp df_ads02_data_01_3* df_test.dbf
That worked
Then when I tried the alter I get the fillowing error
I also tried it with a wildcard at the here also ie df_ads02_data_01_3%
1 alter tablespace data_01
2 rename datafile '/u02/oradata/ads02/df_ads02_data_01_3.dbf'
3* to '/u02/oradata/ads02/df_test.dbf'
SQL> /
alter tablespace data_01
*
ERROR at line 1:
ORA-01525: error in renaming data files
ORA-01522: file '/u02/oradata/ads02/df_ads02_data_01_3.dbf' to be renamed does
not exist
What version we are talking about. If its 7.x version time stamp should be same for the file you copied. You have to use 'cp -p' option to preseve the timestamp.
I think did you try saving the old file some where and renaming it using mv command ?
Just trying to give you the alternatives/possibilities..
You could write a pl/sql loop and fetch the data into a variable and then execute immediate (something like...):
declare
myFn varchar2(2000);
mySql varchar2(2000);
begin
select file_name into myFn from dba_data_files
where file_name like '%RBS%';
mySql := 'alter database rename file ''' || myFn || ''' to ''/new/file/name''';
dbms_output.put_line(mySql);
execute immediate mySql;
end;
/
[QUOTE][i]Originally posted by sreddy [/i]
[B]Jeff,
Is it that big deal with spaces, if at all happens. Good lesson before I hit that. I will keep an eye next time I play........ [/B][/QUOTE]
Silly me, I figured that Joni already tried that. I was assuming that the character was a control character or an unprintable character...
I think my prev. posting is void. Thats what I thought and assumed, Joni might have not done the mistake of not adding the space at the end of .dbf in the rename datafile syntax. But, Joni Right and My assumption was wrong.
** Happens Sometimes ** If it doen't work the way it suppose to be...it will worse...
Bookmarks