Thursday, April 03, 2014

Now I know why SYSTEM tablespace comes with dictionary extent manament in a vendor application

It seems the database uses raw devices, and created manually (not using dbca), when the option is not specified explicitly, by default the SYSTEM tablespace is created  as DICTIONARY managed.

It seems quite a few article list disadvantages of DICTIONARY extent management, but don't where it come from.

Below is my testing.

default setting for SYSTEM datafile



-bash-3.2$ cat cre_db.sql
STARTUP NOMOUNT
CREATE DATABASE "RAWDB1"
    MAXLOGFILES 16
    MAXLOGMEMBERS 3
    MAXDATAFILES 100
    MAXINSTANCES 8
    MAXLOGHISTORY 292
DATAFILE '/software/oracle/admin/RAWDB1/conf/RAWDB1_system_raw_1000m' size 900m reuse
sysaux datafile '/software/oracle/admin/RAWDB1/conf/RAWDB1_sysaux_raw_600m'size 560m  reuse
undo tablespace "UNDOTBS1" datafile '/software/oracle/admin/RAWDB1/conf/RAWDB1_undotbs1_raw_500m' size 480m reuse
default temporary tablespace temp tempfile '/software/oracle/admin/RAWDB1/conf/RAWDB1_temp_raw_250m' size 200m reuse
LOGFILE
  GROUP 1 ('/software/oracle/admin/RAWDB1/conf/RAWDB1_redo1_1_raw_120m')  SIZE 50M reuse ,
  GROUP 2 ('/software/oracle/admin/RAWDB1/conf/RAWDB1_redo1_2_raw_120m')  SIZE 50M reuse
user sys identified by "oracle123" user  system identified by "oracle123" ;
 
and
run the $ORACLE_HOME/rdbms/admin/catalog.sql and $ORACLE_HOME/rdbms/admin/catproc.sql.




17:00:32 SYS@RAWDB1> select tablespace_name , extent_management from dba_tablespaces;

TABLESPACE_NAME                EXTENT_MAN
------------------------------ ----------
SYSTEM                         DICTIONARY
UNDOTBS1                       LOCAL
SYSAUX                         LOCAL
TEMP                           LOCAL

4 rows selected.
 

Create non-dictionary extent management for SYSTEM tablespace


-bash-3.2$ cat cre_db_non_dict_system.sql
STARTUP NOMOUNT
CREATE DATABASE "RAWDB1"
    MAXLOGFILES 16
    MAXLOGMEMBERS 3
    MAXDATAFILES 100
    MAXINSTANCES 8
    MAXLOGHISTORY 292
DATAFILE '/software/oracle/admin/RAWDB1/conf/RAWDB1_system_raw_1000m' size 900m reuse extent management local
sysaux datafile '/software/oracle/admin/RAWDB1/conf/RAWDB1_sysaux_raw_600m'size 560m  reuse
undo tablespace "UNDOTBS1" datafile '/software/oracle/admin/RAWDB1/conf/RAWDB1_undotbs1_raw_500m' size 480m reuse
default temporary tablespace temp tempfile '/software/oracle/admin/RAWDB1/conf/RAWDB1_temp_raw_250m' size 200m reuse
LOGFILE
  GROUP 1 ('/software/oracle/admin/RAWDB1/conf/RAWDB1_redo1_1_raw_120m')  SIZE 50M reuse ,
  GROUP 2 ('/software/oracle/admin/RAWDB1/conf/RAWDB1_redo1_2_raw_120m')  SIZE 50M reuse
user sys identified by "oracle123" user  system identified by "oracle123" ;





17:24:40 SYS@RAWDB1> select tablespace_name,  extent_management from dba_tablespaces;

TABLESPACE_NAME                EXTENT_MAN
------------------------------ ----------
SYSTEM                         LOCAL
UNDOTBS1                       LOCAL
SYSAUX                         LOCAL
TEMP                           LOCAL
 

delete file from raw partition

It seems  I was wrong to search above key words from Google.  In the end, I found no simple command to destroy the raw partition.

Maybe some storage related command may work, like dd, format. But I won't bother it.

For command "drop database", in fact it drops nothing to me . below demo is performed with Oracle database 10.2.0.5 running on linux 32bit platform.



16:20:44 SYS@RAWDB1> drop database ;

Database dropped.

Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Elapsed: 00:00:06.17
16:35:11 @> exit
-bash-3.2$ ps -fu oracle
UID        PID  PPID  C STIME TTY          TIME CMD
oracle    5807 26909  0 Mar25 ?        00:02:53 /software/oracle/product/10.2.0/jdk/bin/java -server -Xmx256M -XX:MaxPermSize=96m -XX:M
oracle    5949     1  0 Mar25 ?        00:00:00 /software/oracle/product/10.2.0/bin/tnslsnr LISTENER -inherit
oracle   22956 22952  0 14:58 ?        00:00:00 sshd: oracle@pts/0
oracle   22965 22956  0 14:58 pts/0    00:00:00 -bash
oracle   23029 23025  0 15:00 ?        00:00:00 sshd: oracle@pts/1
oracle   23040 23029  0 15:00 pts/1    00:00:00 -bash
oracle   24230 22965  0 16:35 pts/0    00:00:00 ps -fu oracle
oracle   26909     1  0 Mar25 ?        00:00:02 /software/oracle/product/10.2.0/perl/bin/perl /software/oracle/product/10.2.0/bin/emwd.
oracle   29695 26909  0 Mar25 ?        00:06:00 /software/oracle/product/10.2.0/bin/emagent
-bash-3.2$ sqlplus / as sysdba

SQL*Plus: Release 10.2.0.5.0 - Production on Thu Apr 3 16:35:21 2014

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

Connected to an idle instance.

16:35:21 SYS@RAWDB1> startup
ORACLE instance started.

Total System Global Area  901775360 bytes
Fixed Size                  2100424 bytes
Variable Size             226493240 bytes
Database Buffers          666894336 bytes
Redo Buffers                6287360 bytes
Database mounted.
Database opened.