Post on 25-Feb-2016
description
ITEC 450
1
MODULE 2 DATABASE INSTALLATION AND CONFIGURATIONSection 3: Database Design
Fall 2012
2
ITEC 450
PHASE OF DATABASE DESIGNFall 2012
3
ITEC 450
DB DESIGN
Conceptual Database Design The process of constructing a model of the
information used in an enterprise, independent of all physical considerations
Logical Database Design The process of constructing a model of the
information used in an enterprise based on a specific data model, but independent of a particular DBMS and other physical considerations.
Physical Database Design The process of producing a description of the
implementation of the database on secondary storage; it describes the storage structures and access methods used to archieve efficient access to the data
Fall 2012
4
ITEC 450
PHASE 2: CONCEPTUAL DB DESIGNDBMS-independent high-level data model Conceptual schema design
Characteristics: expressiveness, simplicity and understandability, minimalism, diagrammatic representation, formality
Approaches: centralized vs. view integration Outcome: E-R schema
Transaction design (application ) Technique: identify input/out and functional behavior Categories: retrieval, update, and mixed
Fall 2012
5
ITEC 450
ENTITY RELATIONSHIP MODELSteps to create E-R model: Create entities Identify key attributes Relate each entity via relationships Add detailed attributes Define cardinality Verify all business operations
Fall 2012
6
ITEC 450
ENTITY RELATIONSHIP MODEL
Entity TypesAn object or concept that is identified by the enterprise as having an independent existence
AttributesA property of an entity or a relationship type
Relationship TypesA meaningful association among entity types
Fall 2012
7
ITEC 450
NORMALIZATION
Normalization A technique for producing a set of relations with desirable
properties, given the data requirements of an enterprise UNF is a table that contains one or more repeating groups
1NF is a relation in which the intersection of each row and column contains one and only one value
2NF is a relation that is in 1NF and every non-primary-key attribute is fully functionally dependent on the primary key.
3NF is a relation that is in 1NF, 2NF in which no non-primary-key attribute is transitively dependent on the primary key
BCNF is a relation in which every determinant is a candidate key
4NF is a relation that is in BCNF and contains no trivial multi-valued dependency
5NF is a relation that contains no join dependency
Fall 2012
8
ITEC 450
PHASE 4: LOGICAL DB DESIGN System-independent mapping
From DBMS-independent EER to relational models Tailoring the schemas to a specific DBMS
Define data types Create specific constraints
Result of this phase: DDL statements that specify the conceptual and external level schemas (not physical design parameters yet)
Fall 2012
9
ITEC 450CHARACTERISTICS OF RELATIONAL MODEL
Fall 2012
10
ITEC 450
PHASE 5: PHYSICAL DB DESIGN Choosing specific storage structures
Storage configuration File organization
Designing access paths Indexing, clustering, and hashing
Criteria Response time Space utilization Transaction throughput
Fall 2012
11
ITEC 450
PHYSICAL DESIGN PROCESSFall 2012
Attribute data typesPhysical record descriptions (doesn’t always match logical design)File organizationsIndexes and database architecturesQuery optimization
Leads to
DecisionsNormalized relationsVolume estimatesAttribute definitionsResponse time expectationsData security needsBackup/recovery needsIntegrity expectationsDBMS technology used
Inputs
12
ITEC 450
FILE ORGANIZATION PRINCIPLES Fast data retrieval High throughput for I/O Efficient use of storage space Protection from failures or data loss Accommodating growth
Fall 2012
13
ITEC 450
INDEXED FILE ORGANIZATIONS Index is a data structure used to
determine the location of rows in a file for quick retrieval
Indexing design: B-tree index – a keyed, treelike index structure Bitmap index – a separate string of zeros and ones
used for a column with a very small number of distinct values
Hash Index – a transformed key value using a hash algorithm
Fall 2012
ITEC 450
14
MODULE 2 DATABASE INSTALLATION AND CONFIGURATIONSection 4: Oracle Database Creation
Fall 2012
15
ITEC 450ASSIGNMENT 3-1-1: DO NOT CREATE A STARTER DATABASE DURING INSTALLATION
Fall 2012
16
ITEC 450
ENTERPRISE EDITIONFall 2012
17
ITEC 450
SUMMARY OF INSTALLATIONFall 2012
18
ITEC 450
CREATING DATABASEFall 2012
19
ITEC 450CREATING DATABASE
Fall 2012
20
ITEC 450CREATING DATABASE
Fall 2012
21
ITEC 450
DBCA CREATION DEMOFall 2012
22
ITEC 450
CHOOSING CONFIGURATION
Important configuration tasks: Choose a database type
Transactional, data warehouse, or hybrid How should the database be managed?
OEM Grid Control or OEM Database Control Decide on the DBA authentication method Select a storage mechanism
OS, ASM, or raw devices Decide on the file management method
Specified or set using OMF Set the initial parameters (init.ora)
Fall 2012
23
ITEC 450
DBA AUTHENTICATION METHODS
The DBA authentication method encompasses the method used to validate logon of users with the SYSDBA or SYSOPER role SYSDBA: ADMIN role and can CREATE DATABASE SYSOPER: has system privileges to start up, shut
down, and back up the database, and modify database components
Two authentication methods: OS authentication Password file authentication
Fall 2012
24
ITEC 450OPERATING SYSTEM (OS)
AUTHENTICATION
User logs without specifying user name/password
To set up OS authentication, follow these steps:1. Create OS user for the DBA2. Unix only: Create an OSDBA group3. Optional: Create an OSOPER group4. Set the initialization parameter
REMOTE_LOGIN_PASSWORDFILE to NONE5. Assign OS user to OSDBA or OSOPER group6. Create Oracle user in DB with same name
To log on to SQL*Plus using OS authentication:sqlplus /nologCONNECT /@ORACLASS AS SYSDBA
Fall 2012
25
ITEC 450
PASSWORD FILE AUTHENTICATION
Encrypted file contains user names and passwords
To set up password file authentication:Create a new password file (orapwd)
Windows: PWD<sid>.ORA, in ORACLE_HOME\database
Unix: orapw<sid>.ora, typically in ORACLE_HOME/dbs
1. REMOTE_LOGIN_PASSWORD FILE = EXCLUSIVE2. Log on to DB with SYSDBA privileges3. Create the new DBA user name if needed4. Grant SYSDBA or SYSOPER privilege to user
Fall 2012
26
ITEC 450
INITIALIZATION PARAMETERSFall 2012
27
ITEC 450
INITIALIZATION PARAMETERSFall 2012
28
ITEC 450
INITIALIZATION PARAMETERSFall 2012
29
ITEC 450
CREATING DATABASEFall 2012
To create a database you can use: Database Configuration Assistant (DBCA tool) CREATE DATABASE command
You can use the DBCA tool to generate scripts for creating a database manually You can use these scripts if you have multiple
consistent databases to create at different sites CREATE DATABASE gives you greater
flexibility but unnecessary complexity with settings You do need to be familiar with its syntax
30
ITEC 450
DBCA – CHOOSE TEMPLATEFall 2012
31
ITEC 450DBCA – NAME DATABASE
NOTE: FILL GLOBAL DATABASE NAME ONLY, SID WILL BE FILLED AUTOMATICALLY. YOU WILL USE A DIFFERENT SID FOR YOUR ASSIGNMENT. Fall 2012
32
ITEC 450
DBCA – DBA PASSWORDSNOTE: HERE IS SYS AND SYSTEM PASSWORD DEFINED. Fall 2012
33
ITEC 450
DBCA – ADD SAMPLE SCHEMASFall 2012
34
ITEC 450DBCA – STORAGE
NOTE: HERE IS THE PLACE TO DELETE REDO LOG GROUP 3
Fall 2012
35
ITEC 450
DBCA – CREATE DATABASEFall 2012
36
ITEC 450
DBCA – DATABASE CREATEDFall 2012
37
ITEC 450
PHYSICAL DATABASE STRUCTUREInitialization and Administration files under:
C:\app\Administrator\product\11.2.0\dbhome_1\admin\orcl450
Network files under: C:\app\Administrator\product\11.2.0\dbhome_1\
network\admin
Main types of files – data files, control files, redo log files.
Initialization files – init.ora, SPFILE Network files – tnsnames.ora, listener.ora Administration files – alert.log, trace files
Fall 2012
38
ITEC 450STARTING AND STOPPING THE
INSTANCE AND DATABASE To shut down a running database using
SQL*Plus:1. Start a Command Prompt window (or shell)2. Start up SQL*Plus without logging: sqlplus
/nolog3. Connect as SYS with SYSDBA
CONNECT SYS/<password>@trial01 AS SYSDBA4. Type SHUTDOWN IMMEDIATE and press Enter
Database closed.Database dismounted.ORACLE instance shut down.
There are four options for SHUTDOWN: NORMAL, TRANSACTIONAL, IMMEDIATE, ABORT
Fall 2012
39
ITEC 450STARTING AND STOPPING THE
INSTANCE AND DATABASE To start DB, change step 4 in previous slide:
STARTUP PFILE=ORACLE_BASE\admin\trial01\pfile\inittrial01.ora
PFILE parameter needed if you have not created the SPFILE
STARTUP options: NOMOUNT, MOUNT, OPEN, PFILE
Fall 2012
40
ITEC 450
THE ALERT LOG AND TRACE FILES
The alert log is essential because it will contain all the essential information for the smooth running of your database All critical errors will be written to the alert log
Trace files contain more detailed log and tracing information about general processing Trace files can be used to track down problems
not causing critical failures, generally using special tools E.g. , TKPROF
Note: Some of the slides are from Oracle 10g Database Administrator: Implementation and Administration by Gavin Powell and Carol McCullough-Dieter
Fall 2012