0% found this document useful (0 votes)
184 views

Steps For Creating Manual Database

The document outlines the steps to create an Oracle database named testdb: 1) Set the ORACLE environment variables and create an initialization parameter file 2) Create the database directories and files 3) Start up the database using the parameter file or create it using SQL commands, which define the database name and users, tablespaces, datafiles, and other configuration details.

Uploaded by

Ravi Dingari
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
184 views

Steps For Creating Manual Database

The document outlines the steps to create an Oracle database named testdb: 1) Set the ORACLE environment variables and create an initialization parameter file 2) Create the database directories and files 3) Start up the database using the parameter file or create it using SQL commands, which define the database name and users, tablespaces, datafiles, and other configuration details.

Uploaded by

Ravi Dingari
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

1) Su - -oracle

2) Create environment
$ export ORACLE_HOME=/u02/app/oracle/product/11.2.0/dbhome_1(software Location)
$ export ORACLE_BASE=/u02/app/oracle (Default base location)
$ export ORACLE_SID=<testdb>
3) Parameter file location
$ cd /u02/app/oracle/product/11.2.0/dbhome_1/dbs
(in dbs location we create pfile)

$vi inittestdb.ora
Press <i>key on keyboard and past
db_name = testdb
shared_pool_size = 65M
control_files=(/u02/app/oracle/testdb/ctl1.ctl,/u02/app/oracle/testdb/ctl2.ctl)
background_dump_dest= /u02/app/oracle/testdb/bdump
user_dump_dest=/u02/app/oracle/testdb/udump
core_dump_dest= /u02/app/oracle/testdb/cdump
undo_tablespace = undotbs
undo_retention = 900
undo_management = AUTO

[ esc &
:wq]

4) Create folders (test db and oradata)
Go to location /u02/app/oracle
$ mkdir testdb
$ cd testdb
$ mkdir oradata

5) To connect sql
Go to /u02/app/oracle/product/11.2.0/dbhome_1/bin
./sqlplus

/ as sysdba

6) SQL>startup nomount pfile='/u02/app/oracle/product/11.2.0/dbhome_1/dbs/inittestdb.ora'
7) Copy and past then database will be created (or)
in $ prompt
$ vi testdb.sql
Press <i> key and past
CREATE DATABASE testdb
USER SYS IDENTIFIED BY welcome
USER SYSTEM IDENTIFIED BY welcome
LOGFILE GROUP 1 ('/u02/app/oracle/testdb/oradata/redo01.log') SIZE 100M,
GROUP 2 ('/u02/app/oracle/testdb/oradata/redo02.log') SIZE 100M,
GROUP 3 ('/u02/app/oracle/testdb/oradata/redo03.log') SIZE 100M
MAXLOGFILES 5
MAXLOGMEMBERS 5
MAXLOGHISTORY 1
MAXDATAFILES 100
CHARACTER SET US7ASCII
NATIONAL CHARACTER SET AL16UTF16
EXTENT MANAGEMENT LOCAL
DATAFILE '/u02/app/oracle/testdb/oradata/system01.dbf' SIZE 325M REUSE
SYSAUX DATAFILE '/u02/app/oracle/testdb/oradata/sysaux01.dbf' SIZE 325M REUSE
DEFAULT TABLESPACE users
DATAFILE '/u02/app/oracle/testdb/oradata/users01.dbf'
SIZE 500M REUSE AUTOEXTEND ON MAXSIZE UNLIMITED
DEFAULT TEMPORARY TABLESPACE tempts1
TEMPFILE '/u02/app/oracle/testdb/oradata/temp01.dbf'
SIZE 20M REUSE
UNDO TABLESPACE undotbs
DATAFILE '/u02/app/oracle/testdb/oradata/undotbs01.dbf'
SIZE 200M REUSE AUTOEXTEND ON MAXSIZE UNLIMITED;
<esc> key and
enter <:wq>

or in this way
SQL>
CREATE DATABASE testdb
USER SYS IDENTIFIED BY welcome
USER SYSTEM IDENTIFIED BY welcome
LOGFILE GROUP 1 ('/u02/app/oracle/testdb/oradata/redo01.log') SIZE 100M,
GROUP 2 ('/u02/app/oracle/testdb/oradata/redo02.log') SIZE 100M,
GROUP 3 ('/u02/app/oracle/testdb/oradata/redo03.log') SIZE 100M
MAXLOGFILES 5
MAXLOGMEMBERS 5
MAXLOGHISTORY 1
MAXDATAFILES 100
CHARACTER SET US7ASCII
NATIONAL CHARACTER SET AL16UTF16
EXTENT MANAGEMENT LOCAL
DATAFILE '/u02/app/oracle/testdb/oradata/system01.dbf' SIZE 325M REUSE
SYSAUX DATAFILE '/u02/app/oracle/testdb/oradata/sysaux01.dbf' SIZE 325M REUSE
DEFAULT TABLESPACE users
DATAFILE '/u02/app/oracle/testdb/oradata/users01.dbf'
SIZE 500M REUSE AUTOEXTEND ON MAXSIZE UNLIMITED
DEFAULT TEMPORARY TABLESPACE tempts1
TEMPFILE '/u02/app/oracle/testdb/oradata/temp01.dbf'
SIZE 20M REUSE
UNDO TABLESPACE undotbs
DATAFILE '/u02/app/oracle/testdb/oradata/undotbs01.dbf'
SIZE 200M REUSE AUTOEXTEND ON MAXSIZE UNLIMITED;

Post steps
sql>@$ORACLE_HOME/rdbms/admin/catalog.sql
sql>@$ORACLE_HOME/rdbms/admin/catproc.sql
sql>@$ORACLE_HOME/sqlplus/admin/pupbld.sql

You might also like