Creating
a Database with DBCA.
Database Configuration Assistant (DBCA) is the
preferred way to create a database, because it is a more automated approach,
and your database is ready to use when DBCA completes.DBCA can be launched by
the Oracle Universal Installer (OUI), depending upon the type of install that
you select.you can also launch DBCA as a standalone tool at any time after
Oracle Database Installation.
You can run DBCA in interactive mode no non-interactive/silent mode. Interactive mode provides a graphical interface and
guided workflow for creating and configuring a database.Non-interactive/silent
mode enable you to script database creation.you can run DBCA in non-interactive/silent mode by specifying command-line arguments, a response file
or both.
Here
I’ll show two methods to create a database using DBCA.
1) Creating
a Database with interactive DBCA
2) Creating
a database with Non-interactive/Silent DBCA.
Creating
a Database with interactive DBCA.
Just go to your command prompt if on windows system
or Terminal if using Linux Machine. And here write DBCA and Hit enter. This
will open the DBCA utility for you.But I highly recommend you to run DBCA with Administrator
Privileges otherwise you get error or accesses denied.
] # xhost +
]# su – oracle
Now you must have DBCA windows open on your system
with a Welcome screen along with lots of text describing what you can do with
this utility.
There
are total 11 steps which you have to go thorough to create an Oracle Database.
Before starting let me be clear on one thing- your
DBCA Windows’s screen may look different or you may have some extra option than
mine. That depends upon the Oracle Database Software.so just don’t worry!
Step
1:
Here you can see all the operation which you can
perform with database configuration assistant DBCA.you can create a new
database or configure the existing database delete a database and managed
template if you have any.
As we are creating a new database thus we will
choose the first option “CREATE A
DATBASE.”
Step
2:
We have to choose the template of our database which
means that here we have to choose what kind of database we want to create
Here
we have 3 options:
1. First
one is general purpose of Transaction processing.you mush have come across this
kind of database.
2. The
2nd one is custom database. Pretty similar to their general purpose
one but it’s a bit more flexible. Here you can chose individual component of
the database which you want to use such as oracle extension for dot net, Oracle
OLAP, text, Lab security and enterprise manager repository etc.
3. The
third one is Data warehouse. Data warehouse is also a type of relation database
which is basically used for query and analysis rather than for transaction
processing.
Step
3:
Here in this step you have to provide the global
database name for your database. Global database name is the full name of your database.
This helps you in uniquely identifying you database. This is also an oracle
recommended format for global database name. But you can give whatever name you
want.
In the second fields you have to specify the SID
which stands for system Identifier.as you can see that by default it takes
database name from global database name field. SID also helps in uniquely
identifying the instance that runs the database.
Step
4:
Here in this step you will choose whether you want
to configure enterprise manager or not. Oracle enterprise manager is a web-based
management tool for individual database, and central management tools for
managing your entire Oracle environment.
Step 5: Database credentials.
Here you have to configure the security for all
these accounts. These are few administrative mandatory and by default configure
accounts.
Here you have 2 options either you can configure
separate password for each of them or you can assign same password to all of
them.
Step
6:
Here in this step you have to specify the type of
storage you would like you database to use.
In the storage type we have 2 options first is file
system and second is ASM automatic Storage Management. If you have configured
ASM then I recommend you to choose the same otherwise go for file system.
After choosing Storage type you have to specify the storage
location.
For
Storage location we have 3 options also.
1. First
one is USE DATABASE FILE LOCATION FROM TEMPLATE. By using this option you don’t
need to do anything instead DBCA will create an ORACLE HOME directory for you.
2. Second
one is USE COMMON LOCATION FOR ALL DATABASE FILE. Here you can choose your own
directory.DBCA will set the chose directory as you ORACLE HOME and then the
entire database files will get create at this location.
3. Last
and third one is USE ORACLE MANAGED FILES. This option instructs Oracle
Database to directly manage operating system files.it provides you with a
flexible way for multiplexing online redo log and control file. This is
recommended for security purposes.
Step 7: RECOVERY CONFIGURATION.
Must watch suggestion what archive log mode is and
how to enable it?
I highly recommend you to enable archive log and
with archive if becomes mandatory to set least one archive log destination thus
here you have to enable flashback recovery area.
Specify flash Recovery Area:- You can go for this
option in order to specify a backup and recovery area as well as its directory
location and size.
The flash recovery area size should at least be
twice the database size.
Enable archiving:- select this option to enable the archiving
of database online redo log files, which can be used to recover database.
Select this option is the same as enabling archive log mode in ORACLE
ENTERPRISE MANAGER DATABASE Control or running the database in ARCHIVE LOG MODE.
Step
8: DATABASE CONTENTS.
Here in this step tick the sample schema check box
if you want to install sample schema such as HR,SCOTT,OE and many more.
Step
9: INITIALIZATION PARAMETER.
In this step you can change the default
initialization parameter setting that include memory sizing, character set and
connection mode.
Step:
10 DATABASE STORAGE.
At this stage you are presented with a navigation
tree display that contains the storage structure of you database including
control file, data files, online redo log groups and so forth. Here you have
the option of making changes in case you are not satisfied with the storage structure
or parameters.
Step
11: CREATION OPTIONS.
This is the last step where you have to tell DBC
what you want to do? Either you want to create a database or save all these
setting as template for future use or you want to generate the database
creation script.
You can also perform these steps altogether.
Now hit finish
This will show you database creation summary. PRESS OK .
Create a Database with non-interactive/Silent Mode DBCA.
]# su – oracle
]$ dbca -silent -createDatabase –templateName General_Purpose.dbc -gdbname sales -sid sales
-responseFile NO_VALUE -characterSet AL32UTF8 -datafileDestination
/disk1/oradata/sales -memoryPercentage
30 -emConfiguration LOCAL
Enter SYS user password: sys
Enter SYSTEM user password:sys
Enter DBSNMP user password: sys
Enter SYSMAN user password:sys
Copying
database files
1% complete
3% complete
11% complete
18% complete
26% complete
37% complete
Creating and starting Oracle instance
40% complete
45% complete
50% complete
55% complete
56% complete
60% complete
62% complete
Completing Database Creation
66% complete
70% complete
73% complete
85% complete
96% complete
100% complete
Look at the log file "/oraeng/apps/oracle/product/110.2.0/cfgtoollogs/dbca/SALES/SALES.log" for further details.
1% complete
3% complete
11% complete
18% complete
26% complete
37% complete
Creating and starting Oracle instance
40% complete
45% complete
50% complete
55% complete
56% complete
60% complete
62% complete
Completing Database Creation
66% complete
70% complete
73% complete
85% complete
96% complete
100% complete
Look at the log file "/oraeng/apps/oracle/product/110.2.0/cfgtoollogs/dbca/SALES/SALES.log" for further details.
]$ export ORACLE_SID=sales
]$ sqlplus / as sysdba
SQL> select name from v$database;
SQL> select instance_name from v$instance;
SQL> select name from v$datafile;
SQL> select name from v$tablespace;
SQL> select username from dba_users;
That’s it guys. Hops you found this useful. Kindly please
share this post on you social media to help me reach more people.
Thanks &
Have a great day!
Hi
ReplyDeletenice blog
Hi Sir,
ReplyDeleteThank you very much for sharing valuable info.. one the BEST Blog I have seen....ALL the BEST