Anda di halaman 1dari 12

03 - Creating an Oracle Database

By Muhammad Asghar Khan


Reference: OCA Oracle Database 11g - Admin I Exam Guide by John Watson

1/1

Agenda

Create a Database by Using the DBCA


Understanding the Instance, Database, and the Data Dictionary EXERCISE 3-1: Use the DBCA to Create a Database

Scripts and Other Files Created by the DBCA

http://asghars.blogspot.com

1/8

Create a Database by Using the DBCA

Understanding the Instance, Database, and the Data Dictionary

An Oracle server is an instance and a database The instance is memory structures and processes, in your RAM and on your CPU(s) and is defined by an instance parameter file The database is files on disk Creating an instance is nothing more than building the memory structures and starting the processes All parameters, either specified by the parameter file or implicit, have defaults, except for one: the parameter DB_NAME
http://asghars.blogspot.com

2/8

Create a Database by Using the DBCA


Creating a database is done by the instance The data dictionary describes all the logical and physical structures in the database, including all the segments that store user data The data dictionary itself is created by running a set of SQL scripts that exist in the ORACLE_HOME/rdbms/admin directory Invoke the dbca On the DBCA Welcome dialog box, click Next Select the Create A Database radio button, and click Next
http://asghars.blogspot.com

EXERCISE 3-1: Use the DBCA to Create a Database


1.

2.
3.

3/8

Create a Database by Using the DBCA


4.

5.

Select the Custom Database radio button, as this will present all possible options. Click Next In the Database Identification dialog box, enter a global database name, and a System Identifier (a SID), which will be used as the instance name

http://asghars.blogspot.com

4/8

Create a Database by Using the DBCA


6.

The Management Options dialog box has a check box for configuring the database with Enterprise Manager. Select this. Then there are radio buttons for either Grid Control or Database Control. The Grid Control radio button will be grayed out if the DBCA does not detect a Grid Control agent running on the machine. Select Database Control.

http://asghars.blogspot.com

5/8

Create a Database by Using the DBCA


7.

The Database Credentials dialog box prompts for passwords for four users in the database: SYS (who owns the data dictionary), SYSTEM (used for most DBA work), DBSNMP (used for external monitoring), and SYSMAN (used by Enterprise Manager). Select the radio button for Use The Same Password For All Accounts. Enter oracle as the password, twice, and click Next

http://asghars.blogspot.com

6/8

Create a Database by Using the DBCA


8.

Select Storage Types as File System, then select the Use Common Locations for All Database Files

9.

10.

In the Recovery Configuration dialog box, accept the default configuration for the flash recovery area and do not enable archiving. Click Next In the Database Content dialog box, deselect all options except Enterprise Manager Repository. The others are not needed for this database and will make the creation take much longer http://asghars.blogspot.com

7/8

Create a Database by Using the DBCA


11.

12.

13.

Click the Standard Database Components button, and deselect these as well. Dont worry about a warning that the XML DB is used by other components. Click Next The Initialization Parameters dialog box has four tabs. Leave everything on default, but look at all the tabs The Database Storage dialog box shows, via a navigation tree on the left, the files that will be created. Navigate around this, and see the names and sizes of the files
http://asghars.blogspot.com

8/8

Create a Database by Using the DBCA


14.

15.

In the Creation Options dialog box, select the check boxes for Create Database and Generate Database Creation Scripts. Note the path for the scripts; it will be ORACLE_BASE/admin/ocp11g/scripts. Click Finish When the DBCA completes, it will present the dialog box shown in the illustration that follows. Take note of all the information given, in particular the URL given for database control

http://asghars.blogspot.com

1/2

Scripts and Other Files Created by the DBCA

Scripts generated will be in the directory ORACLE_BASE/admin/DB_NAME/scripts The instance parameter file, named init.ora There are about 300 parameters, but the file generated by the DBCA sets only a few The Database Creation Shell Script is the file the DBCA executes to launch the database creation process The CreateDB.sql script consists of CREATE DATABASE Command The other SQL scripts called by ocp11g.sql to complete the database creation will depend on the options chosen when going through the DBCA
http://asghars.blogspot.com

2/2

Scripts and Other Files Created by the DBCA

CreateDBfiles.sql

It creates a small tablespace USERS It runs a set of scripts in the $ORACLE_HOME/rdbms/admin directory that construct views on the data dictionary and create many PL/SQL packages This runs the script to create the objects needed by Enterprise Manager Database Control

CreateDBCatalog.sql

emRepository.sql

postDBCreation.sql

This generates a server parameter file from the init.ora file, unlocks the DBSNMP and SYSMAN accounts used by EM, and runs the EM configuration Assistant (emca) to configure Database Control for the new database
http://asghars.blogspot.com

Anda mungkin juga menyukai