DBAsupport.com Forums - Powered by vBulletin
Page 1 of 2 12 LastLast
Results 1 to 10 of 18

Thread: how to delete a DATABASE from command prompt ?

  1. #1
    Join Date
    Oct 2002
    Posts
    284

    how to delete a DATABASE from command prompt ?

    Hello all..

    I need to delete a Database (8.1.7) from command prompt...My X-server is not working for some reason....

    How do we delete/drop the database from command line ?

    thanks
    Ron

  2. #2
    Join Date
    Jun 2000
    Location
    Madrid, Spain
    Posts
    7,447
    hmm I suggest you to read concepts guide, there is no such delete/drop database command

  3. #3
    Join Date
    May 2002
    Posts
    2,645
    Assuming all your datafiles are in /opt2/oradata/baddb -

    as the owner of the files (oracle, oracle8, oracle9, whatever), do
    rm /opt2/oradata/baddb/*

    That will remove all files in the baddb directory.

    If you are deleting the database (not re-using "baddb" anymore) -
    rm -r /opt2/oradata/baddb

    That will not only remove the files under the baddb directory, but will also remove the baddb directory.

    Don't forget the control files (if you left them in $ORACLE_HOME/dbs).

    Check system processes for anything to do with baddb -
    ps -ef | grep baddb

    Kill any remaining processes with
    kill -9 (the process id you got from the ps command)

    But, it sounds like you may be playing with fire by the nature of the question.
    Last edited by stecal; 01-15-2003 at 04:24 PM.

  4. #4
    Join Date
    Mar 2002
    Location
    Mesa, Arizona
    Posts
    1,204
    1. Note the datafiles that make up this database

    select name from v$datafile

    2. Note the Control files

    select name from v$controlfile

    3. Shutdown the database and listener

    4. Remove the files noted above

    5. Remove this SID entry from
    /etc/oratab

    6. Remove this SID entry from
    $ORACLE_HOME/network/admin/listener.ora
    and
    $ORACLE_HOME/network/admin/tnsnames.ora

    7. Change your $ORACLE_SID env var

    8. If you want to remove the oracle software, let us know... That's got tentacles.

    9. Put your head between your legs and kiss your butt goodbye!
    Last edited by KenEwald; 01-15-2003 at 04:30 PM.
    "I do not fear computers. I fear the lack of them." Isaac Asimov
    Oracle Scirpts DBA's need

  5. #5
    Join Date
    May 2002
    Posts
    2,645
    Well, since we're diving in to this -

    select member from v$logfile;
    delete those as well

    delete the init.ora file

    delete the LK file in $ORACLE_HOME/dbs

  6. #6
    Join Date
    Mar 2002
    Location
    Mesa, Arizona
    Posts
    1,204
    Oh, and don't forget redo logs and archived log files.

    select member from v$logfile

    select value from v$parameter where name = 'log_archive_dest'
    "I do not fear computers. I fear the lack of them." Isaac Asimov
    Oracle Scirpts DBA's need

  7. #7
    Join Date
    May 2002
    Posts
    2,645
    And don't forget files located in bdump, cdump, udump, admin, etc.

  8. #8
    Join Date
    May 2002
    Posts
    2,645
    And trace files & alert log(s).

  9. #9
    Join Date
    Dec 2000
    Location
    Ljubljana, Slovenia
    Posts
    4,439
    Originally posted by stecal
    And trace files & alert log(s).
    ... have allready been deleted in your previous message (bdump, udump, ....).
    Jurij Modic
    ASCII a stupid question, get a stupid ANSI
    24 hours in a day .... 24 beer in a case .... coincidence?

  10. #10
    Join Date
    May 2002
    Posts
    2,645
    eess probably true

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