Sie sind auf Seite 1von 18

ORACLE 10G Author: Date:

[LAB2 : CREATING ORACLE DATABASE]

Sithiphone PHANDALA 03/07/2012

Contents
1. 2. 3. Lab objective ....................................................................................................................................... 2 Start the Database Configuration Assistant (DBCA). ................................................................... 2 Begin the ORCL database creation. Use the General Purpose database template. .................... 2

4. Create the ORCL database, as well as the ORCL template and the database generation scripts. .......................................................................................................................................................... 6

Sithiphone PHANDALA

Page 1

ORACLE 10G

[LAB2 : CREATING ORACLE DATABASE]

1. Lab objective
You are about to begin creating your first Oracle database. You anticipate that several similar databases will be needed in the near future. Therefore, you decide to create your ORCL database, as well as a database template and the database creation scripts. Locate the scripts in the /home/oracle/Labs directory (which is the directory that you use most often throughout this course). Note: Completing the database creation is critical for all following practice sessions.

2. Start the Database Configuration Assistant (DBCA).


(1) Open terminal (2) Start dbca tool => [oracle@localhost ~]$ dbca

3. Begin the ORCL database creation. Use the General Purpose database template.
a) In the DBCA, click Next on the Welcome page.

Sithiphone PHANDALA

Page 2

ORACLE 10G

[LAB2 : CREATING ORACLE DATABASE]

b) On the Operations page, select Create a Database, and then click Next.

c) On the Database Templates page, select General Purpose, and then click Show Details.

Sithiphone PHANDALA

Page 3

ORACLE 10G

[LAB2 : CREATING ORACLE DATABASE]

d) Review the templates details and answer the following questions. Question 1: How many control files are created? Answer: 3 Question 2: Would it maximize database availability to multiplex them? Answer: Yes. (This will be done in a later practice.) Question 3: How many redo log groups are created? Answer: 3 Question 4: Would it maximize database availability to mirror them? It depends: no, not in class, because there are already three groups and you have only one physical storage device; but yes, if you can put each group on a different physical storage device. Question 5: What is the database block size (db_block_size)? Answer: 8 KB Question 6: What is the value of Sample Schemas? Answer: Sample Schemas is set to False. Note: You will change this setting later in this practice to create the HR sample schema. Question 7: What is the template default for the Database Character Set? Answer: WE8ISO8859P1 Note: You will change this setting later in this practice to use a Unicode database character set.
e) Click Close to close the Template Details window.

Sithiphone PHANDALA

Page 4

ORACLE 10G

[LAB2 : CREATING ORACLE DATABASE]

f) Click Next.

Sithiphone PHANDALA

Page 5

ORACLE 10G

[LAB2 : CREATING ORACLE DATABASE]

4. Create the ORCL database, as well as the ORCL template and the database generation scripts.
a) On the Database Identification page, enter orcl.oracle.com as Global Database Name. The SID defaults to the database name orcl. Click Next.

b) On the Management Options page, ensure that the following items are selected: - Configure the Database with Enterprise Manager - Use Database Control for Database Management c) Click Next.

Sithiphone PHANDALA

Page 6

ORACLE 10G

[LAB2 : CREATING ORACLE DATABASE]

d) On the Database Credentials page, select Use the Same Password for All Accounts and enter oracle as Password and Confirm Password. Then, click Next.

e) On the Storage Options page, select File System, and then click Next.

Sithiphone PHANDALA

Page 7

ORACLE 10G

[LAB2 : CREATING ORACLE DATABASE]

f) On the Database File Locations page, select Use Oracle-Managed Files. Accept the default Database Area, and then click Next.

g) On the Recovery Configuration page, select Specify Flash Recovery Area, and then click Next.

Sithiphone PHANDALA

Page 8

ORACLE 10G

[LAB2 : CREATING ORACLE DATABASE]

h) On the Database Content page, select Sample Schemas, and then click Next.

Sithiphone PHANDALA

Page 9

ORACLE 10G

[LAB2 : CREATING ORACLE DATABASE]

i) On the Memory tabbed page of the Initialization Parameters page, select Custom and then select Automatic for the Shared Memory Management setting.

j)

On the Initialization Parameters Character Sets tabbed page, select Use Unicode (AL32UTF8).

Sithiphone PHANDALA

Page 10

ORACLE 10G

[LAB2 : CREATING ORACLE DATABASE]

k) Review the Sizing and Connection Mode tabbed pages, but do not change any values. Then, click Next.

l) On the Database Storage page, review your file names and locations. Then, click Next.

Sithiphone PHANDALA

Page 11

ORACLE 10G

[LAB2 : CREATING ORACLE DATABASE]

m) On the Creation Options page, select Create Database and Save as a Database Template n) Optionally, select all creation options and enter orcl as Name for the database template, ORCL Database template as Description, and /u01/app/oracle/admin/orcl/scripts as Destination Directory. Then, click Finish.

Sithiphone PHANDALA

Page 12

ORACLE 10G

[LAB2 : CREATING ORACLE DATABASE]

o) The Confirmation page appears. Review options and parameters, such as Sample Schemas (true), db_block_size (8KB), sga_target (270MB), undo_management (AUTO), Database Character Set (AL32UTF8), and then click OK.

p) Click OK to acknowledge that the template has been created. Then, acknowledge the generation of the database scripts (if you selected those options).

Sithiphone PHANDALA

Page 13

ORACLE 10G

[LAB2 : CREATING ORACLE DATABASE]

q) The DBCA displays the progress of the various installation steps. When the database itself has been created, the DBCA displays essential information about the database. Make note of this information. The Database Control URL will be used in several of the following practice sessions.

Sithiphone PHANDALA

Page 14

ORACLE 10G

[LAB2 : CREATING ORACLE DATABASE]

r) Click the Password Management button.

s) Scroll down the Password Management page until you see the HR User Name. t) Deselect Lock Account? and enter hr as New Password and Confirm Password. Then, click OK.
Sithiphone PHANDALA Page 15

ORACLE 10G

[LAB2 : CREATING ORACLE DATABASE]

u) Click Exit to close the DBCA.

You completed your task to create a database and (optionally) a database template and database generation scripts.

Sithiphone PHANDALA

Page 16

ORACLE 10G

[LAB2 : CREATING ORACLE DATABASE]

v) [root@exp001 init.d]# cd /etc [root@exp001 init.d]# emacs oratab modify /etc/oratab to specify the database name to activate (give Y to the corresponding line)
# # This file is used by ORACLE utilities. It is created by root.sh # and updated by the Database Configuration Assistant when creating # a database. # A colon, ':', is used as the field terminator. A new line terminates # the entry. Lines beginning with a pound sign, '#', are comments. # # Entries are of the form: # $ORACLE_SID:$ORACLE_HOME:<N|Y>: # # The first and second fields are the system identifier and home # directory of the database respectively. The third filed indicates # to the dbstart utility that the database should , "Y", or should not, # "N", be brought up at system boot time. # # Multiple entries with the same $ORACLE_SID are not allowed. # # orcl:/u01/app/oracle/product/10.2.0/db_1:Y

Note: The directory name db_1 may be different according to the environment.

Sithiphone PHANDALA

Page 17

ORACLE 10G

[LAB2 : CREATING ORACLE DATABASE]

w) Modify ~/.bash_profile for oracle user

[oracle@exp001 oracle]$ cd [oracle@exp001 oracle]$ emacs .bash_profile Modify (or create if not exists) as follows using text editor

# .bash_profile # Get the aliases and functions if [ -f ~/.bashrc ]; then . ~/.bashrc fi # Oracle environment export ORACLE_BASE=/u01/app/oracle export ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1 export ORACLE_SID=orcl PATH=$ORACLE_HOME/bin:$PATH export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATH # User specific environment and startup programs PATH=$PATH:$HOME/bin export PATH unset USERNAME

Sithiphone PHANDALA

Page 18

Das könnte Ihnen auch gefallen