DBAsupport.com Forums - Powered by vBulletin
Results 1 to 8 of 8

Thread: alter database error

  1. #1
    Join Date
    Apr 2001
    Location
    santa clara
    Posts
    41
    HI

    I want to name the datafiles such has system.dbf, temp.dbf, etc to another location different from the original location that was specified during database creation.

    What is the correct way to achieve this ?

    I tried this query:

    SVRMGR> alter database rename file '/export2/oradata/816/oradata/qasol2/tools01.
    2> dbf' to
    3> '/export2/oradata/816/oradata/qasol2/system01.dbf'
    4> ;

    errors encounter:
    ORA-01511: error in renaming log/data files
    ORA-01121: cannot rename database file 2 - file is in use or recovery
    ORA-01110: data file 2: '/export2/oradata/816/oradata/qasol2/tools01.dbf'

  2. #2
    Join Date
    Sep 2000
    Posts
    47
    My guess would be that you have the database open. Make sure you do a shutdown, then "startup mount". After the rename is complete, you can then do a "alter database open".

    Tim

  3. #3
    Join Date
    Oct 2000
    Location
    Cambridge, MA (Boston)
    Posts
    144
    what steps did you take before the attempted rename? in 8i you must
    1. take the affected tablespace offline.
    2. copy, move, or rename the file to the new name
    3. alter tablespace xxx rename datafile 'old' to 'new';
    4. alter the tablespace back online

    i can't remember what the procedure is for other versions, but starting the database in mount and using ALTER DATABASE RENAME FILE will work for all versions of 7.3.x and 8.x. oh, if you are renaming system, you MUST use the latter method (mount & ALTER DATABASE).

    d.

    [Edited by DBAtrix on 04-13-2001 at 04:28 PM]

  4. #4
    Join Date
    Apr 2001
    Location
    santa clara
    Posts
    41

    How to take tablespace offline

    Could you show me the command to take tablespace offline ?

    Thanks

  5. #5
    Join Date
    Oct 2000
    Location
    Cambridge, MA (Boston)
    Posts
    144
    ALTER TABLESPACE xxxx OFFLINE;

    don't you have an index in your docs, man?

    d.

  6. #6
    Join Date
    Apr 2001
    Location
    santa clara
    Posts
    41
    DBAtrix: kekeke...which docs are you using ? please advise. I am a newbie to oracle....Thanks

  7. #7
    Join Date
    Oct 2000
    Location
    Saskatoon, SK, Canada
    Posts
    3,925
    Check this site for more details on how to take a tablespace offline/backup/recover.

    http://technet.oracle.com/doc/oracle...a76993/toc.htm


    Good luck,
    Sam
    Thanx
    Sam



    Life is a journey, not a destination!


  8. #8
    Join Date
    Oct 2000
    Location
    Cambridge, MA (Boston)
    Posts
    144
    hoctro, track down the cd entitles "On-Line Generic Documentation" (oracle 8i) that should have come with the software. these will use a browser to read the docs. you can also download from MetaLink (get an account if you don't have one--your company *does* have a support contract, right?) in .pdf format. i find .pdf nicer to use, but that is solely personal preference.

    there are also a number of good technical books out there (and many discussions in this forum regarding such). I'm not very impressed with the Oracle Press Oracle8i DBA handbook (Loney & Theriault) but maybe because it was not Oracle 8i centric like i was expecting. i can't remember and the best use i found for it was to jack up my monitor a few inches. but go to a bookstore for an afternoon to peruse the books. i would highly recommend OraclePress Oracle Backup & Recovery (i have 7.3 edition by Velpuri).

    but for SQL reference, definately learn to read oracle's syntax ladder diagrams in their official documentation.
    oracle's DBA admin doc is also pretty good. both these docs will be on the cd or on metalink.
    d.

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