Monday, August 3, 2009

Dropping oracle10g Database

Deleting two databases (PROD/RMAN)

1. Deleting Target database using RMAN (PROD using RMAN)

Login as PROD user:

$ sqlplus /nolog

Sql> connect sys/pwd@connect_string as sysdba

Sql> startup mount exclusive

Sql> alter system enable restricted session

Sql> exit

Login as rman user

$ rman target sys/pwd@connect_string catalog rman/pwd@rman

RMAN> drop database including backup;

2. Deleting RMAN Database:

i. Connect to drop catalog

$ connect catalog rman/pwd@rman

RMAN> drop catalog;

RMAN> exit

ii. Check Datafile, Controlfile and Redo logs;

SQL> select name from v$datafile/ v$logfile / v$controlfile;

iii. Drop Database

SQL> startup mount exclusive restrict;
SQL> drop database;

3. Removing Oracle10g Software:

Login as software owner

Run /bin/runinstaller and uninstall oracle software

Restrictions and Usage Notes (FROM ORACLE DOCS)

  • This command can only be run from RMAN.
  • You must be connected to the target database from RMAN while the database is mounted in EXCLUSIVE mode with RESTRICTED SESSION enabled.
  • When using the "DROP DATABASE" command, RMAN drops the target database including the following files at the operating system level:
    • Datafiles
    • Online Redo Log Files
    • Controlfiles
    • SPFILE (if it exists)
  • When including the "INCLUDING BACKUPS" clause, RMAN will delete the files listed above as well as the following files at the operating system level:
    • Archive Redo Logs
    • Backup pieces generated by RMAN for the target database
  • When using the "DROP DATABASE" command with RMAN connected to a recovery catalog, RMAN will unregister the target database.
  • The "DROP DATABASE" command does not delete the following files:
    • init.ora (text version of the Oracle initialization file)
    • password file

No comments:

Post a Comment