Sunday, 1 September 2019

Create database in oracle

How to create database in oracle :

To create database in oracle, first of all, binaries should have been installed. Here our binaries are present at /u02/app/oracle/product/12201 location.

Steps to create database in oracle are below:-


Step 1 : Go to /u02/app/oracle/product/12201/bin directory.

]$ ./dbca 

Then Create a database.


create database in oracle

Step 2: Click Advance configuration.



select advance configurations to create well tuned database

Step 3: Select the Database type as a Single instance database.



Select single instance database if not using Oracle RAC.


Step 4: Give the Global Database name as well as SID.

Here in Single Instance Database we usually keep both names as same, whereas in RAC both are different. Also, SID is the database name that you see in cat /etc/oratab.

Set Global database name and SID

Step 5: Now, you have to select Storage for your database. 

So before creating a database in oracle you have to do grid installation (ASM) where the actual data is stored. Here I have already installed ASM. So I have selected ASM as my storage type and the Create file destination is +DATA ( It is Diskgroup where actual data is present, also basic Notation for data in ASM that we basically use is +DATA and for Archives we use +FLASH/FRA).



Select ASM as storage and Data Diskgroup for actual data storage

Step 6: Select Size and Destination of Fash Recovery area.

As Discussed above Fast recovery area is place where we store archives of the database. Also, select the size of the fast recovery area as per your database size and retention (For how many days you want to keep your archives in the database). For longer retention use recovery catalog and save archive or backup data on tapes, as tape storage is much cheaper.


Select flash as Fast recovery area


Step 7: Listener Configuration

The default port for Listener is 1521. Here we just selected that. Now the question arises what is the listener? As we know user's with the help of the Application server connect the database. The listener's work is to make a connection of application users with the database. Once the connection is established, now if the listener goes down connection still remains.

If single database select Default LISTENER

Step 8: Memory Configurations

Now select the size of SGA and PGA, as per your application configurations.


Set size of SGA and PGA

Step 9: Process Configuration

How many users concurrently can make connections with database ( That depends on the type of application for which you are making the database). Also, whether you are using dedicated server mode or Shared server mode will decide how many processes you gonna require.

Set number of processes as per requirement

Step 10: Character set

Just select the language of the database. You can see these values in (v$nls_parameters).

Character set

Step 11: Connection Mode

Select as per your application design and configuration. Also, remember one thing the most resource-consuming task for the database is to make as well as remove connections. So to improve the performance of the database if so many connections are coming and leaving, it is a big overhead. So use dedicated mode if database is not going to be used by too many users concurrently.

Select Dedicated connection mode

Step 12: Sample schemas 

Just uncheck this, as we don't require this to create database in oracle.

Uncheck Sample schemas

Step 13: OEM configuration

This can be done in the future if required.

Will Do OEM Configuration in future

Step 14: Set sys user password.


set sys password

Step 15: Create database


Select create database


Step 16: Set all initialization parameters.

One major thing to remember is if you do not have a license for the control management pack. Then replace TUNING+DIAGNOSTIC to NONE in the initialization parameters.


Set Initialization parameter control management pack to none

Step 17: Custom storage Location and management.

In this Set Minimum datafiles to 512. As this is not dynamic parameters so in the future if you have to change this you have to bounce the database. Better to increase this now, while creating database.


Increase Datafiles number to 512

Step 18: Redo Log Group size

Redo log group size should be tuned because if its size is small then database has to do too many log switches, which might increase overhead on I/O due to too many write operations. So tuned/determine the redo log group size as per the size of the database and how fastly users are updating, writing into the database.

Set redo log group size

Step 19: Click next 


Click on next make sure you have selected create database

Step 20: Recheck all configurations you have done till now.


Recheck all initialization parameters

Step 21: Finish

You have successfully created database in oracle.


Successfully created database click close


Once installed set environment variable and you can use the vanilla database. 

Thanks and Enjoy Learning!!


No comments:

Post a Comment

Temp tablespace usage in oracle

Script to monitor temp tablespace usage in oracle Create a folder mkdir -p /u01/app/oracle/script/chk_tmp_usage copy below scripts ...