Results 1 to 6 of 6
  1. #1
    Join Date
    Dec 2003
    Location
    Buenos Aires, Argentina
    Posts
    86

    Unanswered: How to delete a datafile ORA8i

    Hello. I made a mistake adding a datafile to a TBSP. Do I have to put the datafile ofline and then delete it? Cause I tried delete it (from OMS) but I couldn't.
    Tanks in advance.
    Regards,

    Manf

  2. #2
    Join Date
    Jun 2004
    Location
    Liverpool, NY USA
    Posts
    2,509
    One a datafile is made part of a tablespace, you have only three options.

    1) Make it smaller using an alter.
    2) Move it to another drive where it will be out of the way.
    3) Export the tablespace. Drop the tablespace. Remake the tablespace using only the datafiles that you want. Reimport the export.

    You may NOT delete a datafile without rebuilding the tablespace.
    Bill
    You do not need a parachute to skydive. You only need a parachute to skydive twice.

  3. #3
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    Once a file gets added to a tablespace, it must remain forever in that tablespace for as long as the tablespace is part of the DB.
    The only way to be able to delete the file at the OS level is to first drop the tablespace from the DB.
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

  4. #4
    Join Date
    Dec 2003
    Location
    Buenos Aires, Argentina
    Posts
    86
    Ok. So can rename it?
    Thanks and regards.

    Manf

  5. #5
    Join Date
    Jun 2004
    Location
    Liverpool, NY USA
    Posts
    2,509
    Yes you can rename it, but why? What is it hurting? If you really want to rename it, then do the following.

    1) If the database is up, shut it down.
    2) MOVE the datafile to the new name using OS commands.
    3) Startup Mount the database
    4) Rename the file inside Oracle.
    ALTER DATABASE RENAME FILE '/FULL_PATH_OF_OLD_LOCATION/AND_DATAFILE_NAME.DBF' TO '/FULL_PATH_OF_NEW_LOCATION/AND_DATAFILE_NAME.DBF';
    5) ALTER DATABASE OPEN

    Your datafile has been renamed.
    Bill
    You do not need a parachute to skydive. You only need a parachute to skydive twice.

  6. #6
    Join Date
    Dec 2003
    Location
    Buenos Aires, Argentina
    Posts
    86
    Thanks guys for your comments.
    Regards,

    Manf

Posting Permissions

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