20 December 2006

DROP DATABASE Command In Oracle

Yesterday I have written about how to remove an oracle database. Thanks to Tonguc, he made me to investigate DROP DATABASE command with his comment. I drop a database via this command and check database configuration files. I see that when you drop the database with command, Oracle deletes datafiles from operating system. If you want to remove all items that related database you must do some work more. I have written what that work is yesterday.

oracle@aurora:/usr/users/oracle> sqlplus system/system as sysdba;
SQL*Plus: Release - Production on Tue Dec 19 22:35:37 2006

Copyright (c) 1982, 2005, Oracle.  All Rights Reserved.

Connected to an idle instance.
SQL> startup exclusive restrict mount;
ORACLE instance started.

Total System Global Area  167772160 bytes
Fixed Size                  2047344 bytes
Variable Size              79692432 bytes
Database Buffers           79691776 bytes
Redo Buffers                6340608 bytes
Database mounted.

SQL> drop database;
Database dropped.

Disconnected from Oracle Database 10g Enterprise Edition Release - Production
With the Partitioning, OLAP and Data Mining options
SQL> exit
oracle@aurora:/usr/users/oracle> ls /data06/app/oracle/oradata/
ashp01  pre
pre oracle@aurora:/usr/users/oracle> ls /data06/app/oracle/oradata/pre
pre oracle@aurora:/usr/users/oracle> ls /data06/app/oracle/admin/pre 
adump    bdump    cdump    dpdump   pfile    scripts  udump
oracle@aurora:/usr/users/oracle> more /etc/oratab
oracle@aurora:/usr/users/oracle> more /data06/app/oracle/product/10.2/network/admin/listener.ora
# Generated by Oracle configuration tools.
    (ADDRESS = (PROTOCOL = TCP)(HOST = aurora)(PORT = 1522))

    (SID_DESC =
      (GLOBAL_DBNAME = pre)
      (ORACLE_HOME = /data06/app/oracle/product/10.2)
      (SID_NAME = pre)

oracle@aurora:/usr/users/oracle> more /data06/app/oracle/product/10.2/network/admin/tnsnames.ora
# tnsnames.ora Network Configuration File: /data06/app/oracle/product/10.2/network/admin/tnsnames.ora

    (ADDRESS = (PROTOCOL = TCP)(HOST = aurora)(PORT = 1521))
      (SERVICE_NAME = pre)


No comments: