0% found this document useful (0 votes)
21 views

Distributed Database

Uploaded by

Usama Qazi
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views

Distributed Database

Uploaded by

Usama Qazi
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 62

PRESENTATION GROUP

Names Roll no#


Muhammad Imran 2600

Muhammad Shahzaib 2519

Hunzah Naz 2503

Qurat-ul-Ain 2620

Hafiza Shumaila Noor 2521

Faran Khurshid 2590


MUHAMMAD
IMRAN

Roll NO=2600
Database
• A database is a collection of information that is organized
so that it can easily be access, manage, and update.
• Facebook . . .
Distributed computing system

• Is a collection of Processing elements which are


inter-connecting by a network & Co-ordinate to
perform a specific task.
Distributed computing system

P1 NETWORK P3

P2
Distributed Database

DDB is a collection of logical related DB.


Distributed over a Network.
Multi files of DB.
It is fast.
MOblink
Centralised Database

• A single central database accessed by


multiple users.
• only one DB file. DB

+ Easier to organise, edit.


- Can be slower because of high usage.
DDBMS
• It is a System to Manage a DB .
• Making this DB distribution Transparent.
User View System View
This Section Contains The Following Topics

DDBMS

• Homogenous Distributed Database System.

• Heterogeneous Distributed Database System.

Homogenous Heterogeneous
Homogenous Distributed Database Systems

In this type of database have same software.


Much easier to use , design and manage.
It appears to user as a single system.
Difficult for most organizations to force a homogeneous
environment.
Same software
Heterogeneous Distributed Database System

• In this type of database , Different DB run different DBMS software .


• Difficult to mange and design.
• Huge data can be stored in one .
• Translations required to allow for:
o Different hardware.
o Different DBMS products.
SQL ORACLE
Muhammad Shahzaib

2519
Database Tuning
 Database tuning is a group of activities used to optimize the
performance of a database
 Activity of making a database application run faster:
– Faster means higher throughput (or response
time)
Probable Causes
 Large Tables

 Poor Database Design.

 Bad coding.

 Database Upgrade Issues.

 Moves to New Operating System


Why Performance Tuning
 Performance is key to success of an application.

AIM:-
• Get best system throughput with available/minimum
resources.
Why Performance Tuning
• Avoid unnecessary investment in additional
hardware/development effort.
• Better system throughput
-implies better productivity.
• Better productivity
-implies better service.
Tuning Strategy
Who?

Application designer

Application developer

Database
administrator

System administrator

Network
administrator
Tuning Strategy

Why?

Have clear idea of achievements fro tuning.


Tuning Stages

Business rules
Business Design Implementation Management
procedure

Database
system and
Business Application Application Network
executive Designer Developer administrat
or
Where Should We Do The Tuning.

• Database Design: poor system performance usually results from a


poor database.
• Memory Tuning: By properly size your database buffers.
• Disk I/O Tuning: Database files needs to be properly sized.
• Tune The Operating System : Monitor and tune Operating System CPU,
I/O and memory utilization.
I/O Database Tuning Memory
Tuning Tuning

OS
Tuning
Hunzah Naz

2503
What is Database Tuning?
• Database tuning is a group of activities used to optimize the
performance of a database.
• Goal Of Database Tuning?
 To maximize use of system resources
 To perform task as efficiently
 To work rapidly as possible
Why and when should one tune?
• Slow Physical I/O
-caused by poorly-configured disks
-caused by unnecessary physical I/O
-caused by poorly-tuned SQL.
• Excessive CPU usage
-It means that there is little idle CPU on the system
-caused by an inadequately-sized system,
-caused by untuned SQLstatements
-caused inefficient application programs.
• Latch Contention
Rarely is latch contention tunable by reconfiguring the instance. Rather, latch contention usually is resolved through application
changes.
Causes for low Performance
• Bad Connection Management
• Bad Use of Cursors and the Shared Pool
• Bad SQL
• Use of Nonstandard Initialization Parameters
• Getting Database I/O Wrong
• Redo Log Setup Problems
• Long Full Table Scans
• High Amounts of Recursive (SYS) SQL
Where should we do the tuning?
• Database Design
Poor system performance usually results from a poor
database design.
One should generally normalize to the 3NF.
Selective denormalization can provide valuable
performance improvements..
Application Tuning:

Approximately 80% of all Oracle system performance


problems are resolved by coding optimal SQL.
Memory Tuning:

• By Properly size your database buffers (shared pool,


buffer cache, log buffer, etc)
 By looking at your wait events, buffer hit ratios, system
swapping and paging, etc.
Disk I/O Tuning:

Database files needs to be properly sized.


Also look for frequent disk sorts, full table scans, data
fragmentation, etc.
Eliminate Database Contention:

Study database locks, latches and wait events carefully


and eliminate where possible.
Tune the Operating System:

Monitor and tune operating system CPU, I/O and


memory utilization.
Qurat-ul-Ain

2620
What is Database?
• A database is an organized collection of data. It is collection of
schemas, table, queries, views and other objects.
Issues in Database Performance
• Performance in Read / write are hardware issues => throw money at it
• Performance of DB = ability of engine to locate data
• Factors affecting speed of retrieval
• Cache (sizing of objects)
• Access method (table scan / indexes…)
• Contention between processes
• Indirect processes (roll back, archiving…)
Reading data in Oracle
1 – determine how to access block where data is located
• read data dictionary stored in separate part of DB
• DD may be loaded up in cache (aka row cache) to limit I/O activity
2 - DD indicates preferred access method for block
• B tree index, partitioning, hash clusters etc…
3 - Search begins either in full scan or with index until data found
Designing DB for reading
• Supply methods for high precision access to data
• But some queries will defeat the strategies
• E.g. credit cards transactions – monthly report of scattered items
• No solution = take off-line
Changing data
• Oracle makes hard work of changes
• Rollback data (immediate)
• Log files (long term)
• Changed blocks read and updated in buffer
• Released to disk as buffer is cleared
• But rollback info generate most I/O operations
Indexing Problems
• Super-fast indexes need updating as data is changed => DB slows
down.
• DB physical structure degrades, so does index (e.g split blocks)
• Performance decreases over time
• Rebuild needed
Side effects
• Role of DBMS enforce data consistency
• A reading process may need an older version of the data
• Need to create a private version of the data
Solution
• To create an older version of data
• Must apply roll back
• find old roll back block (I/O)
• Roll back index (I/O)
• Find data (I/O)
• Roll back data
• Read old data
• Reverse all changes (multiple I/O)
• Significant I/O implications + buffer full of old stuff
Conclusions
• Writers and readers DO interfere with each other
• The mechanisms used by Oracle to bypass locking have
performance side effects
• Performance come with minimising I/O
• i.e. with good access techniques
• Precision of data location
• Physical proximity of related data
Hafiza Shumaila Noor

2521
SQL
The Structured Query Language
SQL
The ANSI standard language for the definition and
manipulation of relational database.
 SQL statements are used to perform task such as update data
on a database, or retrieve data from a database.
SQL data is case-sensitive, SQL commands are not.
 SQL is not a programming language, it is a Data Manipulation
language.
SQL

Some common relational database management system that


uses SQL are
Oracle, Microsoft SQL server, Access etc.
 The Standard SQL commands such as Select, Insert, Update,
Delete, Create and drop can be use to accomplish almost
everything that one need to do with a database.
SQL
Select
Update

Create
Standard commands Insert

Alter Delete Drop


Types of SQL

SQL

DDL DML
DDL

A data definition language or data description language (DDL)


is a syntax similar to a computer programming language for
defining data structures, especially database schemas.
 DDL statements create, modify and remove database objects
such as tables, indexes and users.
Commands DDL statements are create, Alter and Drop.
SQL

Create DDL Drop

Alter
DDL
CREATE:
Things to consider before you create your table are:
The type of data
the table name
what column will make up the primary key
the names of the columns
DDL

ALTER:
To add or drop columns on existing tables.
Drop:
Delete objects from the Database
Data Manipulation language

A data manipulating language is a family of syntax elements


similar to a computer language used for selecting, Inserting,
Deleting and updating data in a DB.
SQL
Select

Insert Delete
DML

Update
DML
INSERT:
To insert a row into a table, it is necessary to have a
value for each attribute, and order matters.
Update:
Updates existing data within a table.
SELECT
Retrieve data from the Database.
DML
DELETE:
Used to delete objects from the database.
Faran Khurshid

2590

You might also like