Create Database Oracle Database (1)

Embed Size (px)

Citation preview

  • 8/13/2019 Create Database Oracle Database (1)

    1/18

  • 8/13/2019 Create Database Oracle Database (1)

    2/18

    ORACLE 10G [LAB2 : CREATING ORACLE DATABASE]

    Sithiphone PHANDALA Page 2

    1.Lab objectiveYou 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

    ORCLdatabase, as well as a database template and the database creation scripts. Locate the

    scripts in the /home/oracle/Labsdirectory (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 ORCLdatabase creation. Use the General Purposedatabase template.

    a) In the DBCA, click Nexton the Welcome page.

  • 8/13/2019 Create Database Oracle Database (1)

    3/18

    ORACLE 10G [LAB2 : CREATING ORACLE DATABASE]

    Sithiphone PHANDALA Page 3

    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.

  • 8/13/2019 Create Database Oracle Database (1)

    4/18

    ORACLE 10G [LAB2 : CREATING ORACLE DATABASE]

    Sithiphone PHANDALA Page 4

    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 onephysical storage device; but yes, if you can put each group on a different physical storagedevice.

    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 HRsample 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 characterset.

    e) Click Closeto close the Template Details window.

  • 8/13/2019 Create Database Oracle Database (1)

    5/18

    ORACLE 10G [LAB2 : CREATING ORACLE DATABASE]

    Sithiphone PHANDALA Page 5

    f) Click Next.

  • 8/13/2019 Create Database Oracle Database (1)

    6/18

    ORACLE 10G [LAB2 : CREATING ORACLE DATABASE]

    Sithiphone PHANDALA Page 6

    4.Create the ORCLdatabase, as well as the ORCLtemplate andthe database generation scripts.

    a) On the Database Identification page, enter orcl.oracle.comas Global DatabaseName. 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.

  • 8/13/2019 Create Database Oracle Database (1)

    7/18

  • 8/13/2019 Create Database Oracle Database (1)

    8/18

    ORACLE 10G [LAB2 : CREATING ORACLE DATABASE]

    Sithiphone PHANDALA Page 8

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

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

  • 8/13/2019 Create Database Oracle Database (1)

    9/18

    ORACLE 10G [LAB2 : CREATING ORACLE DATABASE]

    Sithiphone PHANDALA Page 9

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

  • 8/13/2019 Create Database Oracle Database (1)

    10/18

    ORACLE 10G [LAB2 : CREATING ORACLE DATABASE]

    Sithiphone PHANDALA Page 10

    i) On the Memory tabbed page of the Initialization Parameters page, select Customandthen select Automaticfor the Shared Memory Managementsetting.

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

  • 8/13/2019 Create Database Oracle Database (1)

    11/18

    ORACLE 10G [LAB2 : CREATING ORACLE DATABASE]

    Sithiphone PHANDALA Page 11

    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, clickNext.

  • 8/13/2019 Create Database Oracle Database (1)

    12/18

    ORACLE 10G [LAB2 : CREATING ORACLE DATABASE]

    Sithiphone PHANDALA Page 12

    m)On the Creation Options page, select Create Databaseand Save as a DatabaseTemplate

    n) Optionally, select all creation options and enter orclas Namefor the databasetemplate, ORCL Database templateas Description, and

    /u01/app/oracle/admin/orcl/scriptsas Destination Directory. Then,click Finish.

  • 8/13/2019 Create Database Oracle Database (1)

    13/18

    ORACLE 10G [LAB2 : CREATING ORACLE DATABASE]

    Sithiphone PHANDALA Page 13

    o) The Confirmation page appears. Review options and parameters, such as SampleSchemas (true), db_block_size (8KB), sga_target (270MB),

    undo_management (AUTO), Database Character Set (AL32UTF8),and then click OK.

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

  • 8/13/2019 Create Database Oracle Database (1)

    14/18

    ORACLE 10G [LAB2 : CREATING ORACLE DATABASE]

    Sithiphone PHANDALA Page 14

    q) The DBCA displays the progress of the various installation steps. When the databaseitself 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 ofthe following practice sessions.

  • 8/13/2019 Create Database Oracle Database (1)

    15/18

    ORACLE 10G [LAB2 : CREATING ORACLE DATABASE]

    Sithiphone PHANDALA Page 15

    r) Click the Password Managementbutton.

    s) Scroll down the Password Management page until you see the HRUser Name.

    t) Deselect Lock Account?and enter hras New Password and Confirm Password. Then,

    click OK.

  • 8/13/2019 Create Database Oracle Database (1)

    16/18

  • 8/13/2019 Create Database Oracle Database (1)

    17/18

    ORACLE 10G [LAB2 : CREATING ORACLE DATABASE]

    Sithiphone PHANDALA Page 17

    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)

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

    #

    # 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::## 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

  • 8/13/2019 Create Database Oracle Database (1)

    18/18

    ORACLE 10G [LAB2 : CREATING ORACLE DATABASE]

    Sithiphone PHANDALA Page 18

    w) Modify ~/.bash_profile for oracle user

    [oracle@exp001 oracle]$ cd[oracle@exp001 oracle]$ emacs .bash_profile

    Modify (or create if not exists) as fol lows using text editor

    # .bash_profile# Get the aliases and functionsif [ -f ~/.bashrc ]; then. ~/.bashrcfi# Oracle environmentexport ORACLE_BASE=/u01/app/oracleexport ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1export ORACLE_SID=orclPATH=$ORACLE_HOME/bin:$PATHexport LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATH# User specific environment and startup programsPATH=$PATH:$HOME/binexport PATHunset USERNAME