Вы находитесь на странице: 1из 31

Module 1

Database design
Position the server technologies
• There is a family of products that makes up the Oracle
server technologies:
• The Oracle database (repository of data)
• The Oracle Web Logic Server (application server)
• The Oracle Enterprise Manager (Administration and monitoring tool)
• Various application development tools and languages (SQL, PL/SQL, Java,C)
Oracle database instance
• An Oracle database instance structure:
• SGA (System Global Area)
• Maintaining internal data structures that are accessed by many processes and threads
concurrently
• Caching data blocks read from disk
• Buffering redo data before writing it to the online redo log files
• Storing SQL execution plans
• Background process
• DBWn, LGWR, CKPT, Others
User or application connection to Oracle instance
Database instance configuration
Oracle WebLogic Server
• The Oracle WebLogic Server is a platform for
developing, deploying, and managing web
applications
• An application server replaces the client-side
software traditionally installed on end-user
terminals; it runs applications centrally, presenting
them to users in windows displayed locally in web
browsers. The applications make use of data stored
in one or more database servers.
• Oracle WebLogic Server is a JEE-compliant
application server
Oracle Enterprise Manager
• Oracle Enterprise Manager is Oracle’s on-premises management
platform, providing a single pane of glass for managing all of a
customer's Oracle deployments, whether in their data centers or in
the Oracle Cloud.
• Database Express (Available when you install Oracle Database 12c)
• Cloud Control (Licensed product, manage and monitor multiple oracle
instances)
• Fusion Middleware Control (monitoring, managing, and configuring Oracle
Fusion Middleware Components)
Oracle Fusion Middleware
Portfolio of leading,
standards-based, and
customer-proven software
products that spans a range
of tools and services from
Java EE and developer
tools, through integration
services, business
intelligence, collaboration,
and content management
Development tools
• The Oracle server technologies include various facilities for
developing applications, some existing within the database, others
external to it.
• SQL
• PL/SQL
• Java
Oracle cloud services
• Oracle Cloud provides three types of services:
• Software as a Service (SaaS)
• Platform as a Service (PaaS)
• Infrastructure as a Service (IaaS)
RDBMS
• Oracle Database 12c:
• Relational model and object relational model
• User-defined data types and objects
• Fully compatible with relational database
• Supports multimedia and large objects
• High-quality database server features
Modeling a database
Entity Relationship Modeling Conventions
Relational model
• Dr. E. F. Codd proposed the
relational model for database
systems in 1970.
• The relational model consists of
the following:
• Collection of objects or relations
• Set of operators to act on the relations
• Data integrity for accuracy and
consistency
Relationships in the model
• The relationships between the entities can be one of the following:
• 1:N One-to-many
• N:1 Many-to-one
• 1:1 One-to-one
• M:N Many-to-many
Database normalization
• Database normalization refers to modeling data using multiple
entities with relationships between them, which may reduce or
entirely eliminate data redundancy
• First Normal Form (1NF)
• Second Normal Form (2NF)
• Third Normal Form (3NF)
First Normal Form (1NF)
• Rule 1: Single Valued Attributes
• Each column of your table should be single valued which means they should
not contain multiple values
• Rule 2: Attribute Domain should not change
• In each column the values stored must be of the same kind or type.
• Rule 3: Unique name for Attributes/Columns
• Each column in a table should have a unique name
• Rule 4: Order doesn't matters
• The order in which you store the data in your table doesn't matter.
First Normal Form (1NF) Example
before

after
Second Normal Form (2NF)
• It should be in the First Normal form.
• And, it should not have Partial Dependency
• Partial Dependency exists, when for a composite primary key, any attribute in
the table depends only on a part of the primary key and not on the complete
primary key.
• To remove Partial dependency, we can divide the table, remove the attribute
which is causing partial dependency, and move it to some other table where it
fits in well.
Second Normal Form (2NF) Example
Before

After
Third Normal Form (3NF)
• It should be in the Second Normal form.
• And it should not have Transitive Dependency.
• Transitive dependency - When a non-primary attribute depends on other
non-primary attributes rather than depending upon the primary attributes or
primary key.
• Advantages of removing transitive dependency
• Amount of data duplication is reduced.
• Data integrity achieved.
Third Normal Form (3NF) Example
Third Normal Form (3NF) Example
Oracle SQL Developer Data Modeler
• Oracle SQL Developer Data Modeler is a free graphical tool that
enhances productivity and simplifies data modeling tasks
• Users can create, browse and edit, logical, relational, physical, multi-
dimensional, and data type models
• The Data Modeler provides forward and reverse engineering capabilities and
supports collaborative development through integrated source code control
• The Data Modeler can be used in both traditional and in Cloud environments.
• Download using:
• https://www.oracle.com/database/technologies/appdev/datamodeler.html
Relational Database Terminology
1. Single row (tuple)
2. Column or attribute
3. Column that is not a key
4. Column as a foreign key
5. A field (intersection of a
row and column)
6. Null value
SQL Commands
• The Data Manipulation Language (DML) commands:
• SELECT, INSERT, UPDATE, DELETE, MERGE
• Data Definition Language (DDL)
• CREATE, ALTER, DROP, RENAME, TRUNCATE, COMMENT
• Data Control Language (DCL)
• GRANT, REVOKE
• Transaction Control
• COMMIT, ROLLBACK, SAVEPOINT
Client tools
•There are two development environments for this course:
• The primary tool is Oracle SQL Developer.
• SQL*Plus command-line interface can also be used.
Oracle Schema
• A schema is a collection of logical
structures of data, or schema objects
• A schema is owned by a database user and
has the same name as that user
• Each user owns a single schema
• Schema objects can be created and
manipulated with SQL
• Example of schema objects: tables, views,
sequences, indexes, database triggers,
stored functions, procedures, packages
HR Schema
ORACLE live sql
• https://livesql.oracle.com/apex/f?p=590:1000:109837462813498:::::
Practice 1
• Access to the course environment
• Startup Oracle database 12c
• Using sql*plus
• Using Oracle SQL Developer
• Use HR Schema

Вам также может понравиться