Friday, October 31, 2008

How does one create a new database? (For Starter DBA's / Juniors)

How does one create a new database? (For Starter DBA's / Juniors)

The purpose of this post to educate Starter DBA's / Junior DBA's as to how easy it is to create a database :)

One can create and modify Oracle databases using the Oracle "dbca" (Database Configuration Assistant) utility. The dbca utility is located in the $ORACLE_HOME/bin directory. The Oracle Universal Installer (oui) normally starts it after installing the database server software to create the starter database.

One can also create databases manually using scripts. This option, however, is falling out of fashion as it is quite involved and error prone. Look at this example for creating and Oracle 9i or higer database:

CONNECT SYS AS SYSDBA

ALTER SYSTEM SET DB_CREATE_FILE_DEST='/u01/oradata/';

ALTER SYSTEM SET DB_CREATE_ONLINE_LOG_DEST_1='/u02/oradata/';

ALTER SYSTEM SET DB_CREATE_ONLINE_LOG_DEST_2='/u03/oradata/';

CREATE DATABASE;

No comments: