It can't get much simpler than this



Ever wondered what the absolute bare minimum required is to get a database created?

This is about as 'bare bones' as you can get i think (ignoring multitenant that is). The example below should work for most versions........

The oracle software is installed but nothing at all is configured.

First up i set some variables (this could all be done on one line using the ; separator if you wanted to make this even shorter.....)


oracle@server:/oracle/home/oracle> export ORACLE_SID=MINI
oracle@server:/oracle/home/oracle> export ORACLE_HOME=/oracle/12.0.0.1
oracle@server:/oracle/home/oracle>  echo db_name='MINI' > $ORACLE_HOME/dbs/initMINI.ora
oracle@server:/oracle/home/oracle> export PATH=$ORACLE_HOME/bin:$PATH













So all we have is an init file with just one parameter set - nothing else - will this really work?

 Lets connect to sqplus and try and start it

oracle@server:/oracle/home/oracle> sqlplus / as sysdba

SQL*Plus: Release 12.1.0.1.0 Production on Sun Dec 22 21:01:43 2013

Copyright (c) 1982, 2013, Oracle.  All rights reserved.

Connected to an idle instance.

SQL> startup nomount
ORACLE instance started.

Total System Global Area  572100608 bytes
Fixed Size                  2290704 bytes
Variable Size             461376496 bytes
Database Buffers          100663296 bytes
Redo Buffers                7770112 bytes

SQL>

So far so good - it's allocated all the memory (using defaults) as well as all the trace file location etc (again with defaults).

 Now lets create the database using all defaults again - which believe it or not is just two words.....

SQL> create database;


Database created.


Done! (well apart from catalog/catproc etc) - prett amazing how little you have to type really.

So where did it put everything?

SQL> select name from v$controlfile;

NAME
--------------------------------------------------------------------------------
/oracle/12.0.0.1/dbs/cntrlMINI.dbf

SQL> select name from v$datafile;

NAME
--------------------------------------------------------------------------------
/oracle/12.0.0.1/dbs/dbs1MINI.dbf
/oracle/12.0.0.1/dbs/dbx1MINI.dbf
/oracle/12.0.0.1/dbs/dbu1MINI.dbf

SQL> select member from v$logfile;

MEMBER
--------------------------------------------------------------------------------
/oracle/12.0.0.1/dbs/log1MINI.dbf
/oracle/12.0.0.1/dbs/log2MINI.dbf


SQL> sho parameter diag

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
diagnostic_dest                      string      /oracle


None of this is where you'd want it of course - but this is an interesting technical exercise...

Now to tidy up ( and i bet you've never used this many options on a startup before!)

SQL> startup force mount restrict exclusive;
ORACLE instance started.

Total System Global Area  572100608 bytes
Fixed Size                  2290704 bytes
Variable Size             461376496 bytes
Database Buffers          100663296 bytes
Redo Buffers                7770112 bytes

Database mounted.

SQL> drop database;

Database dropped.

Disconnected from Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
SQL>


An interesting exercise i think you'll agree but all pretty pointless in the end....


Comments