by Jim Hannan (@HoBHannan)

DBCA2

In my previous post I discussed tools to automate deployments for virtualized Oracle workloads. I outlined some of the current industry methods and their tools. In this blog post I will take a deeper look at one of those tools, Oracle’s DBCA (Database Configuration Assistant). I cannot advocate for DBCA being the perfect solution for every company, but I think majority of IT teams will find it very well suited for their deployments. Before jumping into DBCA, we should first quickly revisit the table from the last blog post. The table below outlines the opportunities for automation. Each step has various methods available to it. In this blog we are targeting the final step, automated deployment of the Oracle database after the virtual machine and software has been deployed.

Table 1 - Oracle Automated Deployment and Tools

Steps

Tool(s)

Create a virtual machine

[1] Standard – Create VM through vSphere client of APIs (this step involves the process of allocating memory, CPU and storage)

Boot virtual machine

[1] Boot off media

[2] Network boot and receive boot image from network server

[3] Deploy virtual machine from template (template contains base OS with no additional software)

Automated OS install

[1] Linux kickstart

[2] Spacewalk

[3] VMware template with base image

Scripts for customization

[1] OS scripts to further customize the guest OS. Often includes network settings and deployment of organization scripts for managing Oracle.

Oracle software install

[1] Oracle Universal Install with a response file

[2] Zip of Oracle home with CPU patch already applied. Requires the creation of an Oracle inventory

Oracle Database

[1] Use Oracle DBCA command line

[2] Deploy Oracle database from zip files.

Most DBAs are familiar with DBCA and the GUI wizard. Probably less familiar is DBCA's ability to run silently from the command line. The command line options really lend themselves to automation. You can create a database template or a catalog of templates. In the following example I have created the template SAND-forblog.dbc. This is stored with the other default templates. After creating and selecting the configuration you can than override the setting by using DBCA command line options. An example of overriding a parameter is changing the character set or datafile location. From the command line you can type “dbca –help” to get a full list of options. I have listed some of the key options in the table below. Remember this command line options can override settings defined in the template, very flexible.
Creating the database:

[oracle@oel63-64-11g Desktop]$ dbca -silent -createDatabase -templateName SAND-forblog.dbc -gdbname FORBLOG -sid FORBLOG -responseFile NO_VALUE -sysPassword oracle -systemPassword oracle -storageType ASM -asmSysPassword oracle -diskGroupName DATA

Output of the database creation:

Copying database files

1% complete

3% complete

35% complete

Creating and starting Oracle instance

37% complete

42% complete

47% complete

52% complete

53% complete

56% complete

58% complete

Registering database with Oracle Restart

64% complete

Completing Database Creation

68% complete

71% complete

75% complete

85% complete

96% complete

100% complete

Look at the log file "/opt/oracle/cfgtoollogs/dbca/FORBLOG/FORBLOG.log" for further details.

You can delete a database with the command:

[oracle@oel63-64-11g Desktop]$ dbca -silent -deleteDatabase -sourceDB FORBLOG -sysDBAUserName sys -sysDBAPassword oracle

And output of the delete command:

Output

Connecting to database

4% complete

9% complete

14% complete

19% complete

23% complete

28% complete

47% complete

Updating network configuration files

48% complete

52% complete

Deleting instance and datafiles

76% complete

100% complete

Look at the log file "/opt/oracle/cfgtoollogs/dbca/DEV2.log" for further details.

I thought it would be worth mentioning that customers that have successfully implemented automation typically have matured their processes first by building standards. This reminds me of software development. First, build the flow chart (standard process), and then look for automation opportunities.

If you have any questions about DBCA automation or previous topics I can be reached on twitter @HoBHannan.

Add comment


Security code
Refresh