A-A+
删除数据库
下边是命令行删除数据库的过程
注意:在删除数据库之前,数据库首先要处于restrict模式下。
以下为具体的删除过程:
[oracle@ocm1 ~]$ /u01/app/oracle/product/10.2.0/db_1/bin/sqlplus "/as sysdba"
SQL*Plus: Release 10.2.0.1.0 - Production on Mon May 5 06:05:31 2014
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
SQL> select file_name from dba_data_files;
FILE_NAME
--------------------------------------------------------------------------------
/u01/app/oracle/yallonking/system01.dbf
/u01/app/oracle/yallonking/undotbs01.dbf
/u01/app/oracle/yallonking/sysaux01.dbf
SQL> show parameter dump
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
background_core_dump string partial
background_dump_dest string /u01/app/oracle/yallonking/bdu
mp
core_dump_dest string /u01/app/oracle/yallonking/cdu
mp
max_dump_file_size string 10240
shadow_core_dump string partial
user_dump_dest string /u01/app/oracle/yallonking/udu
mp
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount restrict;
ORACLE instance started.
Total System Global Area 314572800 bytes
Fixed Size 1219184 bytes
Variable Size 96470416 bytes
Database Buffers 213909504 bytes
Redo Buffers 2973696 bytes
Database mounted.
SQL> drop database;
Database dropped.
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
SQL>
下边是删除过程中alert中的记录,可以发现该命令会将数据文件,redo,controlfile,tempfile从OS上物理的删除,其实,一并删除的还有spfile.
alert如下:
Mon May 5 06:08:18 2014 Starting ORACLE instance (restrict) Cannot determine all dependent dynamic libraries for /proc/self/exe Unable to find dynamic library libocr10.so in search paths RPATH = /ade/aime1_build2101/oracle/has/lib/:/ade/aime1_build2101/oracle/lib/:/ade/aime1_build2101/oracle/has/lib/: LD_LIBRARY_PATH is not set! The default library directories are /lib and /usr/lib Unable to find dynamic library libocrb10.so in search paths Unable to find dynamic library libocrutl10.so in search paths Unable to find dynamic library libocrutl10.so in search paths LICENSE_MAX_SESSION = 0 LICENSE_SESSIONS_WARNING = 0 Picked latch-free SCN scheme 2 Using LOG_ARCHIVE_DEST_1 parameter default value as /u01/app/oracle/product/10.2.0/db_1/dbs/arch Autotune of undo retention is turned on. IMODE=BR ILAT =18 LICENSE_MAX_USERS = 0 SYS auditing is disabled ksdpec: called for event 13740 prior to event group initialization Starting up ORACLE RDBMS Version: 10.2.0.1.0. System parameters with non-default values: processes = 150 sga_max_size = 314572800 __shared_pool_size = 88080384 __large_pool_size = 4194304 __java_pool_size = 4194304 __streams_pool_size = 0 sga_target = 314572800 control_files = /u01/app/oracle/yallonking/control1, /u01/app/oracle/yallonking/control2 __db_cache_size = 213909504 log_checkpoint_interval = 10000 db_files = 180 db_file_multiblock_read_count= 8 undo_management = AUTO undo_tablespace = undotbs global_names = TRUE parallel_max_servers = 5 background_dump_dest = /u01/app/oracle/yallonking/bdump user_dump_dest = /u01/app/oracle/yallonking/udump max_dump_file_size = 10240 core_dump_dest = /u01/app/oracle/yallonking/cdump db_name = test PMON started with pid=2, OS id=25669 PSP0 started with pid=3, OS id=25671 MMAN started with pid=4, OS id=25673 DBW0 started with pid=5, OS id=25675 LGWR started with pid=6, OS id=25677 SMON started with pid=8, OS id=25681 CKPT started with pid=7, OS id=25679 RECO started with pid=9, OS id=25683 MMON started with pid=10, OS id=25685 MMNL started with pid=11, OS id=25687 Mon May 5 06:08:18 2014 ALTER DATABASE MOUNT Mon May 5 06:08:22 2014 Setting recovery target incarnation to 1 Mon May 5 06:08:22 2014 Successful mount of redo thread 1, with mount id 2144881106 Mon May 5 06:08:22 2014 Database mounted in Exclusive Mode Completed: ALTER DATABASE MOUNT Mon May 5 06:08:28 2014 drop database Deleted file /u01/app/oracle/yallonking/system01.dbf Deleted file /u01/app/oracle/yallonking/undotbs01.dbf Deleted file /u01/app/oracle/yallonking/sysaux01.dbf Deleted file /u01/app/oracle/yallonking/redo01.log Deleted file /u01/app/oracle/yallonking/redo02.log Deleted file /u01/app/oracle/yallonking/redo03.log Deleted file /u01/app/oracle/yallonking/temp01.dbf Instance terminated by USER, pid = 25689 Mon May 5 06:08:33 2014 Deleted file /u01/app/oracle/yallonking/control1 Deleted file /u01/app/oracle/yallonking/control2 Completed: drop database Mon May 5 06:08:33 2014 Shutting down instance (abort) License high water mark = 1