Create directory where we need to create a Database:
[oracle@ram ~]$ cd /u01
[oracle@ram ~]$ ls
app ARC_BKP
[oracle@ram ~]$ mkdir test
[oracle@ram ~]$ cd $ORACLE_HOME/dbs
[oracle@ram ~]$ orapwd file=orapwdtest password=manager
force=y format=12
[oracle@ram ~]$ cd /u01/test
[oracle@ram ~]$ vi dbcreate_script.sql
CREATE DATABASE test
USER SYS IDENTIFIED BY manager
USER SYSTEM IDENTIFIED BY manager
LOGFILE GROUP 1 (‘/u01/test/[Link]’) SIZE 50M,
GROUP 2 (‘/u01/test/[Link]’) SIZE 50M,
GROUP 3 (‘/u01/test/[Link]’) SIZE 50M
MAXLOGFILES 5
MAXLOGMEMBERS 5
MAXLOGHISTORY 50
MAXDATAFILES 100
MAXINSTANCES 1
DATAFILE ‘/u01/test/[Link]’ SIZE 100M autoextend on
SYSAUX DATAFILE ‘/u01/test/[Link]’ SIZE 100M autoextend
on
DEFAULT TABLESPACE users datafile ‘/u01/test/[Link]’ size
100m autoextend on
DEFAULT TEMPORARY TABLESPACE temp
TEMPFILE ‘/u01/test/[Link]’ SIZE 50m
UNDO TABLESPACE undotbs1
DATAFILE ‘/u01/test/[Link]’
SIZE 200M;
Bring up the Database in mount mode:
[oracle@ram test]$ export ORACLE_SID=test
[oracle@ram test]$ sqlplus / as sysdba
SQL*Plus: Release [Link].0 – Production on Wed May 15
[Link] 2019
Version [Link].0
Copyright (c) 1982, 2018, Oracle. All rights reserved.
Connected to an idle instance.
SQL> startup nomount
ORACLE instance started.
Total System Global Area 243268208 bytes
Fixed Size 8895088 bytes
Variable Size 180355072 bytes
Database Buffers 50331648 bytes
Redo Buffers 3686400 bytes
SQL> @dbcreate_script.sql;
Database created.
POST SCRIPTS:
SQL> @$ORACLE_HOME/rdbms/admin/[Link];
SQL> @$ORACLE_HOME/rdbms/admin/[Link];
SQL> @$ORACLE_HOME/sqlplus/admin/[Link]
SQL> select status from v$instance;
STATUS
……………….
OPEN
1 row selected.
DROP DATABASE:
SQL> startup force mount restrict;
ORACLE instance started.
Total System Global Area 243268208 bytes
Fixed Size 8895088 bytes
Variable Size 180355072 bytes
Database Buffers 50331648 bytes
Redo Buffers 3686400 bytes
Database mounted.
SQL> drop database;
Database dropped.
Disconnected from Oracle Database 19c Enterprise Edition
Release [Link].0 – Production
Version [Link].0