0% found this document useful (0 votes)
21 views3 pages

DB Creation

DB creation

Uploaded by

chandu518cse
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views3 pages

DB Creation

DB creation

Uploaded by

chandu518cse
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

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/redo01.log’) SIZE 50M,
GROUP 2 (‘/u01/test/redo02.log’) SIZE 50M,
GROUP 3 (‘/u01/test/redo03.log’) SIZE 50M
MAXLOGFILES 5
MAXLOGMEMBERS 5
MAXLOGHISTORY 50
MAXDATAFILES 100
MAXINSTANCES 1
DATAFILE ‘/u01/test/system01.dbf’ SIZE 100M autoextend on
SYSAUX DATAFILE ‘/u01/test/sysaux01.dbf’ SIZE 100M autoextend
on
DEFAULT TABLESPACE users datafile ‘/u01/test/users01.dbf’ size
100m autoextend on
DEFAULT TEMPORARY TABLESPACE temp
TEMPFILE ‘/u01/test/temp01.dbf’ SIZE 50m
UNDO TABLESPACE undotbs1
DATAFILE ‘/u01/test/undotbs01.dbf’
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 19.0.0.0.0 – Production on Wed May 15


00:21:51 2019
Version 19.2.0.0.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/catalog.sql;

SQL> @$ORACLE_HOME/rdbms/admin/catproc.sql;

SQL> @$ORACLE_HOME/sqlplus/admin/pupbld.sql

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 19.0.0.0.0 – Production
Version 19.2.0.0.0

You might also like