m odule 2 d atabase i nstallation and c onfiguration section 3: database design 1 itec 450 fall 2012
TRANSCRIPT
ITEC
45
0
1
MODULE 2 DATABASE INSTALLATION AND CONFIGURATIONSection 3: Database Design
Fall 2
01
2
2
ITEC
45
0
PHASE OF DATABASE DESIGN
Fall 2
01
2
3
ITEC
45
0
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 2
01
2
4
ITEC
45
0
PHASE 2: CONCEPTUAL DB DESIGN
DBMS-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 2
01
2
5
ITEC
45
0
ENTITY RELATIONSHIP MODEL
Steps 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 2
01
2
6
ITEC
45
0
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 2
01
2
7
ITEC
45
0
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 2
01
2
8
ITEC
45
0
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 2
01
2
9
ITEC
45
0
CHARACTERISTICS OF RELATIONAL MODEL
Fall 2
01
2
10
ITEC
45
0
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 2
01
2
11
ITEC
45
0
PHYSICAL DESIGN PROCESS
Fall 2
01
2
Attribute data types
Physical record descriptions (doesn’t always match logical design)
File organizations
Indexes and database architectures
Query optimization
Leads to
DecisionsNormalized relations
Volume estimates
Attribute definitions
Response time expectations
Data security needs
Backup/recovery needs
Integrity expectations
DBMS technology used
Inputs
12
ITEC
45
0
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 2
01
2
13
ITEC
45
0
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 2
01
2
ITEC
45
0
14
MODULE 2 DATABASE INSTALLATION AND CONFIGURATIONSection 4: Oracle Database Creation
Fall 2
01
2
15
ITEC
45
0
ASSIGNMENT 3-1-1: DO NOT CREATE A STARTER DATABASE DURING INSTALLATION
Fall 2
01
2
16
ITEC
45
0
ENTERPRISE EDITION
Fall 2
01
2
17
ITEC
45
0
SUMMARY OF INSTALLATION
Fall 2
01
2
18
ITEC
45
0
CREATING DATABASE
Fall 2
01
2
19
ITEC
45
0
CREATING DATABASEFa
ll 20
12
20
ITEC
45
0
CREATING DATABASEFa
ll 20
12
21
ITEC
45
0
DBCA CREATION DEMO
Fall 2
01
2
22
ITEC
45
0
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 2
01
2
23
ITEC
45
0
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 2
01
2
24
ITEC
45
0OPERATING 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 2
01
2
25
ITEC
45
0
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 2
01
2
26
ITEC
45
0
INITIALIZATION PARAMETERSFa
ll 20
12
27
ITEC
45
0
INITIALIZATION PARAMETERSFa
ll 20
12
28
ITEC
45
0
INITIALIZATION PARAMETERSFa
ll 20
12
29
ITEC
45
0
CREATING DATABASEFa
ll 20
12
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
45
0
DBCA – CHOOSE TEMPLATE
Fall 2
01
2
31
ITEC
45
0DBCA – NAME DATABASE
NOTE: FILL GLOBAL DATABASE NAME ONLY, SID WILL BE FILLED AUTOMATICALLY. YOU WILL USE A DIFFERENT SID FOR YOUR ASSIGNMENT. Fa
ll 20
12
32
ITEC
45
0
DBCA – DBA PASSWORDSNOTE: HERE IS SYS AND SYSTEM PASSWORD DEFINED.
Fall 2
01
2
33
ITEC
45
0
DBCA – ADD SAMPLE SCHEMAS
Fall 2
01
2
34
ITEC
45
0
DBCA – STORAGE NOTE: HERE IS THE PLACE TO DELETE REDO LOG GROUP 3
Fall 2
01
2
35
ITEC
45
0
DBCA – CREATE DATABASE
Fall 2
01
2
36
ITEC
45
0
DBCA – DATABASE CREATED
Fall 2
01
2
37
ITEC
45
0
PHYSICAL DATABASE STRUCTURE
Initialization 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 2
01
2
38
ITEC
45
0
STARTING 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
/nolog
3. Connect as SYS with SYSDBACONNECT SYS/<password>@trial01 AS SYSDBA
4. Type SHUTDOWN IMMEDIATE and press EnterDatabase closed.Database dismounted.ORACLE instance shut down.
There are four options for SHUTDOWN: NORMAL, TRANSACTIONAL, IMMEDIATE, ABORT
Fall 2
01
2
39
ITEC
45
0
STARTING 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 2
01
2
40
ITEC
45
0
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 2
01
2