cannot rename datafile!
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 10 of 10

Thread: cannot rename datafile!

  1. #1
    Join Date
    Jan 2001
    Posts
    4

    Exclamation

    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

  2. #2
    Join Date
    Feb 2000
    Location
    Washington DC
    Posts
    1,843
    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..










  3. #3
    Join Date
    Jan 2001
    Posts
    4
    version 8.1.6.2 I already figured out how to copy the file
    the problem that I am having is in renaming the file in oracle.

  4. #4
    Join Date
    Oct 2000
    Location
    Dallas:TX:USA
    Posts
    407
    You may try using a GUI tool like OEM's Storage Manager to rename it.

    - Rajeev

  5. #5
    Join Date
    Nov 2000
    Location
    greenwich.ct.us
    Posts
    9,092
    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;
    /

    (Watch single quotes)

    [Edited by marist89 on 01-22-2001 at 05:28 PM]
    Jeff Hunter
    marist89@yahoo.com
    http://marist89.blogspot.com/
    Get Firefox!
    "I pledge to stop eating sharks fin soup and will not do so under any circumstances."

  6. #6
    Join Date
    Feb 2000
    Location
    Washington DC
    Posts
    1,843
    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........

  7. #7
    Join Date
    Jan 2001
    Posts
    4
    Thanks everyone I figured out how to do it. So obvious
    that I'm almost ashamed to give the answer :)

    All I did was to but a blank at the end of the .dbf ' file
    in the alter rename statement. LOL

  8. #8
    Join Date
    Nov 2000
    Location
    greenwich.ct.us
    Posts
    9,092
    [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...
    Jeff Hunter
    marist89@yahoo.com
    http://marist89.blogspot.com/
    Get Firefox!
    "I pledge to stop eating sharks fin soup and will not do so under any circumstances."

  9. #9
    Join Date
    Feb 2000
    Location
    Washington DC
    Posts
    1,843
    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...

    [Edited by sreddy on 01-22-2001 at 05:52 PM]

  10. #10
    Join Date
    Mar 2000
    Location
    CA
    Posts
    317
    It happened to me long back. And what I did was, I opened the file in OEM and then renamed it in GUI. Easy !!

    Thanks
    Kishore Kumar

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width