Home >Database >Mysql Tutorial >手工创建数据库及删除数据库示例
首先是应对ORACLE_SID,DB_NAME,存放数据文件、REDO日志、控制文件等的目录进行规划。 如我的实验中:ORACLE_SID=bys3,DB_NAME为bys3,数据文件、REDO日志、控制文件均存放在/u01/oradata/bys3/ 实验如下: 环境:OEL5.7,ORACLE 11.2.0.4,VBOX虚拟机--建库前OR
首先是应对ORACLE_SID,DB_NAME,存放数据文件、REDO日志、控制文件等的目录进行规划。数据库相应的控制文件,日志文件,数据文件会自动删除,spfile也会删除(归档日志不会删除). 从以下官方文档的内容可以证实:Dropping a database involves
removing its datafiles, redo log files, control files, and initialization parameter files. The DROP DATABASE statement deletes all control files and all other database files listed in the control file.
The DROP DATABASE
statement has no effect on archived log files, nor does it have any effect on copies or backups of the database. It is best to use RMAN to delete such files. If the database is on raw disks,
the actual raw disk special files are not deleted.
[oracle@bys3 ~]$ cat alert_bys3.log
Thu Nov 14 14:17:19 2013
Starting ORACLE instance (normal)
************************ Large Pages Information *******************
Per process system memlock (soft) limit = 3418 MB
Total Shared Global Region in Large Pages = 0 KB (0%)
Large Pages used by this instance: 0 (0 KB)
Large Pages unused system wide = 0 (0 KB)
Large Pages configured system wide = 0 (0 KB)
Large Page size = 2048 KB
RECOMMENDATION:
Total System Global Area size is 146 MB. For optimal performance,
prior to the next instance restart:
1. Increase the number of unused large pages by
at least 73 (page size 2048 KB, total size 146 MB) system wide to
get 100% of the System Global Area allocated with large pages
********************************************************************
LICENSE_MAX_SESSION = 0
LICENSE_SESSIONS_WARNING = 0
Initial number of CPU is 1
Shared memory segment for instance monitoring created
CELL communication is configured to use 0 interface(s):
CELL IP affinity details:
NUMA status: non-NUMA system
cellaffinity.ora status: N/A
CELL communication will use 1 IP group(s):
Grp 0:
Picked latch-free SCN scheme 2
Using LOG_ARCHIVE_DEST_1 parameter default value as /u01/app/oracle/product/11.2.0/dbhome_1/dbs/arch
Autotune of undo retention is turned on.
IMODE=BR
ILAT =22
LICENSE_MAX_USERS = 0
SYS auditing is disabled
Starting up:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options.
ORACLE_HOME = /u01/app/oracle/product/11.2.0/dbhome_1
System name: Linux
Node name: bys3.bys.com
Release: 2.6.32-200.13.1.el5uek
Version: #1 SMP Wed Jul 27 20:21:26 EDT 2011
Machine: i686
Using parameter settings in server-side spfile /u01/app/oracle/product/11.2.0/dbhome_1/dbs/spfilebys3.ora
System parameters with non-default values: ----和前面设置的初始化参数文件中参数对应
control_files = "/u01/oradata/bys3/control01.ctl"
control_files = "/u01/oradata/bys3/control02.ctl"
db_name = "bys3"
Thu Nov 14 14:17:21 2013
PMON started with pid=2, OS id=4389
Thu Nov 14 14:17:21 2013
PSP0 started with pid=3, OS id=4393
Thu Nov 14 14:17:23 2013
VKTM started with pid=4, OS id=4397 at elevated priority
VKTM running at (1)millisec precision with DBRM quantum (100)ms
Thu Nov 14 14:17:23 2013
GEN0 started with pid=5, OS id=4403
Thu Nov 14 14:17:23 2013
DIAG started with pid=6, OS id=4407
Thu Nov 14 14:17:23 2013
DBRM started with pid=7, OS id=4411
Thu Nov 14 14:17:23 2013
DIA0 started with pid=8, OS id=4415
Thu Nov 14 14:17:23 2013
MMAN started with pid=9, OS id=4419
Thu Nov 14 14:17:24 2013
DBW0 started with pid=10, OS id=4423
Thu Nov 14 14:17:24 2013
LGWR started with pid=11, OS id=4427
Thu Nov 14 14:17:24 2013
CKPT started with pid=12, OS id=4431
Thu Nov 14 14:17:24 2013
SMON started with pid=13, OS id=4435
Thu Nov 14 14:17:24 2013
RECO started with pid=14, OS id=4439
Thu Nov 14 14:17:24 2013
MMON started with pid=15, OS id=4443
ORACLE_BASE not set in environment. It is recommended
that ORACLE_BASE be set in the environment
Thu Nov 14 14:17:25 2013
MMNL started with pid=16, OS id=4447
Thu Nov 14 14:23:19 2013
create database bys3
user sys identified by *user system identified by * logfile group 1('/u01/oradata/bys3/redo01.log') size 50m,
group 2('/u01/oradata/bys3/redo02.log') size 50m,
group 3('/u01/oradata/bys3/redo03.log') size 50m
maxlogfiles 20
maxlogmembers 5
maxloghistory 200
maxdatafiles 100
character set AL32UTF8
national character set AL16UTF16
extent management local
datafile '/u01/oradata/bys3/system01.dbf' size 500m reuse
sysaux datafile '/u01/oradata/bys3/sysaux01.dbf' size 325m reuse
default temporary tablespace temp
tempfile '/u01/oradata/bys3/temp01.dbf' size 20m reuse
undo tablespace undotbs1
datafile '/u01/oradata/bys3/undotbs01.dbf' size 200m reuse
Database mounted in Exclusive Mode
Lost write protection disabled
Thu Nov 14 14:23:38 2013
Successful mount of redo thread 1, with mount id 3358374039
Thu Nov 14 14:23:38 2013
Database SCN compatibility initialized to 1
Assigning activation ID 3358374039 (0xc82cb897)
Thread 1 opened at log sequence 1
Current log# 1 seq# 1 mem# 0: /u01/oradata/bys3/redo01.log
Successful open of redo thread 1
MTTR advisory is disabled because FAST_START_MTTR_TARGET is not set
Thu Nov 14 14:23:38 2013
SMON: enabling cache recovery
processing ?/rdbms/admin/dcore.bsq
create tablespace SYSTEM datafile '/u01/oradata/bys3/system01.dbf' size 500m reuse
EXTENT MANAGEMENT LOCAL online
Thu Nov 14 14:24:23 2013
Completed: create tablespace SYSTEM datafile '/u01/oradata/bys3/system01.dbf' size 500m reuse
EXTENT MANAGEMENT LOCAL online
create rollback segment SYSTEM tablespace SYSTEM
storage (initial 50K next 50K)
UNDO_SEG_CRT: Could not find usn tail
Completed: create rollback segment SYSTEM tablespace SYSTEM
storage (initial 50K next 50K)
Undo initialization finished serial:0 start:12514064 end:12514074 diff:10 (0 seconds)
processing ?/rdbms/admin/dsqlddl.bsq
processing ?/rdbms/admin/dmanage.bsq
CREATE TABLESPACE sysaux DATAFILE '/u01/oradata/bys3/sysaux01.dbf' size 325m reuse
EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO ONLINE
Thu Nov 14 14:24:54 2013
Completed: CREATE TABLESPACE sysaux DATAFILE '/u01/oradata/bys3/sysaux01.dbf' size 325m reuse
EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO ONLINE
processing ?/rdbms/admin/dplsql.bsq
processing ?/rdbms/admin/dtxnspc.bsq
CREATE UNDO TABLESPACE UNDOTBS1 DATAFILE '/u01/oradata/bys3/undotbs01.dbf' size 200m reuse
Thu Nov 14 14:25:12 2013
[4450] Successfully onlined Undo Tablespace 2.
Completed: CREATE UNDO TABLESPACE UNDOTBS1 DATAFILE '/u01/oradata/bys3/undotbs01.dbf' size 200m reuse
CREATE TEMPORARY TABLESPACE TEMP TEMPFILE '/u01/oradata/bys3/temp01.dbf' size 20m reuse
Completed: CREATE TEMPORARY TABLESPACE TEMP TEMPFILE '/u01/oradata/bys3/temp01.dbf' size 20m reuse
ALTER DATABASE DEFAULT TEMPORARY TABLESPACE TEMP
Completed: ALTER DATABASE DEFAULT TEMPORARY TABLESPACE TEMP
ALTER DATABASE DEFAULT TABLESPACE SYSTEM
Completed: ALTER DATABASE DEFAULT TABLESPACE SYSTEM
processing ?/rdbms/admin/dfmap.bsq
processing ?/rdbms/admin/denv.bsq
processing ?/rdbms/admin/drac.bsq
processing ?/rdbms/admin/dsec.bsq
processing ?/rdbms/admin/doptim.bsq
processing ?/rdbms/admin/dobj.bsq
processing ?/rdbms/admin/djava.bsq
processing ?/rdbms/admin/dpart.bsq
processing ?/rdbms/admin/drep.bsq
processing ?/rdbms/admin/daw.bsq
processing ?/rdbms/admin/dsummgt.bsq
processing ?/rdbms/admin/dtools.bsq
processing ?/rdbms/admin/dexttab.bsq
processing ?/rdbms/admin/ddm.bsq
processing ?/rdbms/admin/dlmnr.bsq
processing ?/rdbms/admin/ddst.bsq
Thu Nov 14 14:25:21 2013
SMON: enabling tx recovery
Starting background process SMCO
Thu Nov 14 14:25:22 2013
SMCO started with pid=18, OS id=4476
Thu Nov 14 14:25:24 2013
replication_dependency_tracking turned off (no async multimaster replication found)
Starting background process QMNC
Thu Nov 14 14:25:25 2013
QMNC started with pid=19, OS id=4480
Completed: create database bys3
user sys identified by *user system identified by * logfile group 1('/u01/oradata/bys3/redo01.log') size 50m,
group 2('/u01/oradata/bys3/redo02.log') size 50m,
group 3('/u01/oradata/bys3/redo03.log') size 50m
maxlogfiles 20
maxlogmembers 5
maxloghistory 200
maxdatafiles 100
character set AL32UTF8
national character set AL16UTF16
extent management local
datafile '/u01/oradata/bys3/system01.dbf' size 500m reuse
sysaux datafile '/u01/oradata/bys3/sysaux01.dbf' size 325m reuse
default temporary tablespace temp
tempfile '/u01/oradata/bys3/temp01.dbf' size 20m reuse
undo tablespace undotbs1
datafile '/u01/oradata/bys3/undotbs01.dbf' size 200m reuse
Thu Nov 14 14:25:57 2013
create tablespace users datafile '/u01/oradata/bys3/sysaux01.dbf' size 50m
ORA-1537 signalled during: create tablespace users datafile '/u01/oradata/bys3/sysaux01.dbf' size 50m...
Thu Nov 14 14:26:25 2013
create tablespace users datafile '/u01/oradata/bys3/user01.dbf' size 50m
Completed: create tablespace users datafile '/u01/oradata/bys3/user01.dbf' size 50m
Thu Nov 14 14:30:31 2013
Thread 1 advanced to log sequence 2 (LGWR switch)
Current log# 2 seq# 2 mem# 0: /u01/oradata/bys3/redo02.log
Thu Nov 14 14:31:16 2013
Thread 1 advanced to log sequence 3 (LGWR switch)
Current log# 3 seq# 3 mem# 0: /u01/oradata/bys3/redo03.log
Thu Nov 14 14:33:22 2013
Thread 1 advanced to log sequence 4 (LGWR switch)
Current log# 1 seq# 4 mem# 0: /u01/oradata/bys3/redo01.log
Thu Nov 14 14:33:52 2013
Thread 1 advanced to log sequence 5 (LGWR switch)
Current log# 2 seq# 5 mem# 0: /u01/oradata/bys3/redo02.log
Thu Nov 14 14:34:11 2013
Create Relation IPS_PACKAGE_UNPACK_HISTORY
Thu Nov 14 14:34:28 2013
Thread 1 advanced to log sequence 6 (LGWR switch)
Current log# 3 seq# 6 mem# 0: /u01/oradata/bys3/redo03.log
Thu Nov 14 14:34:43 2013
Thread 1 advanced to log sequence 7 (LGWR switch)
Current log# 1 seq# 7 mem# 0: /u01/oradata/bys3/redo01.log
Thu Nov 14 14:35:04 2013
Thread 1 advanced to log sequence 8 (LGWR switch)
Current log# 2 seq# 8 mem# 0: /u01/oradata/bys3/redo02.log
Thu Nov 14 14:36:16 2013
Thread 1 advanced to log sequence 9 (LGWR switch)
Current log# 3 seq# 9 mem# 0: /u01/oradata/bys3/redo03.log
Thu Nov 14 14:37:43 2013
Thread 1 advanced to log sequence 10 (LGWR switch)
Current log# 1 seq# 10 mem# 0: /u01/oradata/bys3/redo01.log
Thu Nov 14 14:38:55 2013
Thread 1 advanced to log sequence 11 (LGWR switch)
Current log# 2 seq# 11 mem# 0: /u01/oradata/bys3/redo02.log
Thu Nov 14 14:40:10 2013
Thread 1 advanced to log sequence 12 (LGWR switch)
Current log# 3 seq# 12 mem# 0: /u01/oradata/bys3/redo03.log
Thu Nov 14 14:40:34 2013
Thread 1 advanced to log sequence 13 (LGWR switch)
Current log# 1 seq# 13 mem# 0: /u01/oradata/bys3/redo01.log
Thu Nov 14 14:40:46 2013
Starting background process CJQ0
Thu Nov 14 14:40:46 2013
CJQ0 started with pid=32, OS id=4598
Thu Nov 14 14:41:31 2013
Thread 1 advanced to log sequence 14 (LGWR switch)
Current log# 2 seq# 14 mem# 0: /u01/oradata/bys3/redo02.log
Thu Nov 14 14:41:40 2013
SERVER COMPONENT id=CATPROC: timestamp=2013-11-14 14:41:40
Thu Nov 14 15:06:30 2013
Spfile /u01/app/oracle/product/11.2.0/dbhome_1/dbs/spfilebys3.ora is in old pre-11 format and compatible >= 11.0.0; converting to new H.A.R.D. compliant format.