Creating and Managing a Database with DBCA

Create and Manage a Database Using DBCA


DBCA also enables you to modify a database configuration, delete a database, and more. You can perform the following DBCA tasks:


    Starting DBCA
    Creating a Database Using DBCA
    Changing the Configuration of a Database Using DBCA
    Deleting a Database Using DBCA
    Managing Templates with DBCA
    Using DBCA to Manage PDBs




Starting DBCA:


1. Log on to your computer as a member of the administrative group that is
authorized to install Oracle Database software and to create and run the database.

2. To start DBCA on UNIX or Linux, or at the command-line prompt on the
Windows operating system, enter the following command:
dbca

The dbca utility is typically located in the ORACLE_HOME/bin directory.


3. Click Next to bypass the Welcome window.


Creating a Database Using DBCA


1. Start DBCA

2. In the Operations window, select Create a Database and click Next to start the guided workflow for creating a database.

Step#2: Database Templates


Use DBCA to create a database from templates supplied by Oracle or from templates that you create.


Step#3: Database Identification


In the Global Database Name field, enter the database name in the form database_name.domain_name.

In the SID field, enter the system identifier. The SID defaults to the database name and uniquely identifies the instance that runs the database.


Step#4: Management Options


Use this window to set up your database so it can be managed.


Step#5: Database Credentials


In this window, specify the passwords for the administrative accounts such as SYS and SYSTEM.

Step#6: Database File Locations


In this window, specify the type of storage you would like your database to use. Like - 



    Use Database File Locations from Template
    Use Common Location for All Database Files
    Use Oracle Managed Files

Step#7: Recovery Configuration

It is important to configure the database so you can recover your data if a system failure occurs.

Online redo log files contain a record of changes that were made to data files.
Online redo log files are stored in online redo log groups.
You must have at least two online redo log groups for your database.
After the online redo log files in a group have filled up, the log writer process (LGWR) switches the writing of redo records to a new online redo log group.

Oracle Database can automatically save the inactive group of online redo log files to one or more offline destinations, known collectively as the archived redo log (also called the archive log). The process of turning online redo log files into archived redo log files is called archiving.

Archiving can be performed only if the database is running in ARCHIVELOG mode.

A group of online redo log files cannot be reused by the log writer (LGWR) process until the group is archived. If the database is running in NOARCHIVELOG mode, then when a group becomes inactive after the LGWR process switches to a new group, the inactive group is available for immediate reuse by the LGWR process.

The NOARCHIVELOG mode protects a database from instance failure but not from media failure. Only the most recent changes made to the database, which are stored in the online redo log files, are available for instance recovery. To restore a database operating in NOARCHIVELOG mode, you can use only entire database backups taken while the database is closed. Therefore, if you operate a database in NOARCHIVELOG mode, then back up the entire database at regular, frequent intervals.

Advantages of ARCHIVELOG Mode:

                     A database backup, with online and archived redo log files, guarantees that you can recover all committed transactions if the operating system or hardware fails.

                    You can recover the database using a backup that was taken while the database was open and being used, if you have a copy of the archived log files that were written while the database was being backed up.

                    You can perform online tablespace backups, and use these backups to restore a tablespace following media failure.

                   You can keep a standby database current with its original database by continuously applying the original archived redo log files to the standby database.

Before you can archive the online redo log files, you must determine the destination to
which you want to archive.

Oracle recommends that the archive log be stored in a fast recovery area because it can simplify backup and recovery operations for your database.

A fast recovery area is a location in which Oracle Database can store and manage files related to backup and recovery. It is distinct from the database area, which is a location for the current database files (data files, control files, and online redo log files).

When creating your database, you can select the following options:

Storage Type: Specify the type of storage you would like your database to use for recovery-related files.

Specify Fast Recovery Area: Select this option to specify a backup and recovery area and its directory location and size. You can use variables to identify standard locations.

Enable Archiving: Select this option to enable the archiving of database online redo log files, which can be used to recover a database. Oracle recommends you select Enable Archiving. Selecting this option provides better protection for your database for software or hardware failure.

Step#8: Database Content

When you create your database, you can load it with data using either of the following methods:
Sample Schemas
Custom Scripts

Click Help for more information.

Step#9: Initialization Parameters

This option enable you to change the default initialization parameter settings.

Categories are:
                       Memory
                       Sizing
                       Character Sets
                       Connection Mode

To display a list of all the database initialization parameters click on "All Initialization Parameters" button.

Memory:

Use this window to set the initialization parameters that control how the database manages its memory.

Typical
AMM - Automatic Memory Manageement

Custom
ASMM - Automatic Shared Memory Management
MSMM - Manual Shared Memory Management

Sizing:

Specify the smallest block size and the maximum number of operating system user processes that can simultaneously connect to the database.

Block Size
Use this list to select the block size, or accept the default, 8 kilobytes (KB).

Processes
Specify the maximum number of processes that can simultaneously connect to the database. Enter a number or accept the default value of 150.

Character Sets:

Use this tab to define the character sets used by your database.
Use the Default
Use Unicode (AL32UTF8)
Choose from the list of character sets
National Character Set
Default Language
Default Territory - for date and time.

Connection Mode:
Use this window to select the database mode. You can run the database in either

Dedicated Server Mode - a dedicated server process for each user process.
Shared Server Mode - This mode allows several client connections to share a database-allocated pool of resources.

Step#10: Database Storage

In this window, a navigation tree displays the storage structure of your database (control files, data files, online redo log groups, and so forth). If you are not satisfied with the storage structure or parameters, then you can make changes.
Note that if you selected a pre-configured template for a database, then you cannot add or remove control files, data files, or undo segments.

Step#11: Creation Options

In this window, select any of the following options for creating the database:

Create Database - Select this option to create your database now.
Save as a Database Template - Select this option to save the database definition as a template to use at a later time.
Generate Database Creation Scripts - Select this option to generate a SQL database creation script that you can run at a later time.

click Finish.

Review the Create Database Summary information, then click OK to proceed.



Changing the Configuration of Database Using DBCA



You can use DBCA to change the configuration of an existing database. For example, you can:

Register the database with Grid Control
Configure Database Control alert notification via e-mail
Enable daily disk backups to the recovery area
Change default security settings
Change server mode from dedicated to shared, or the reverse
Add database options that were not previously configured (for example, Oracle Label Security or Oracle OLAP)


To change the configuration of a database using DBCA:



1. Start DBCA
2. Select Configure Database Options and click Next.
3. Follow the instructions in the DBCA.



Deleting a Database Using DBCA


You can also use DBCA to delete a database. When DBCA deletes a database, it shuts down the database instance and then deletes all database files.

To delete a database using DBCA:

1. Start DBCA.
2. Select Delete a Database and click Next.
3. Select the database to delete and click Finish.

To see in details : Deleting a Database Using DBCA


Managing Templates with DBCA:


DBCA templates are XML files that contain information required to create a database. Templates are used in DBCA to create new databases and duplicate existing databases. The information in templates includes database options, initialization parameters, and storage attributes (for data files, tablespaces, control files, and online redo log files).

Templates are stored in the following directory:

ORACLE_HOME/assistants/dbca/templates

Advantages:

Time saving:
If you use a template, then you do not have to define the database.

Easy duplication:
By creating a template containing your database settings, you can easily create a duplicate database without specifying parameters twice.

Easy editing:
You can quickly change database options from the template settings.

Easy sharing:
Templates can be copied from one computer to another.

Types of Templates:

Seed templates:

Contains both the structure and the physical data files of an existing database, referred to as the seed database.

Nonseed templates:

Used to create a new database. It contains the characteristics of the database to be created. Nonseed templates are more flexible than their seed counterparts.

DBCA Templates Provided by Oracle

Data warehouse
General Purpose or Transaction processing
Custom database

To create templates:

1.Start DBCA
2.In the Operations window, select Manage Templates and click Next.
3.In the Template Management window, select Create a database template and one of the following options, and click Next.

From an existing template
From an existing database (structure only)
From an existing database (structure as well as data)

To delete a template:

1.Start DBCA
2.In the Operations window, select Manage Templates and click Next.
3.In the Template Management window, select Delete a database template and click Next.
4.Select the template to delete and click Finish.

No comments:

Post a Comment