You are on page 1of 51

Week13&14

System Performance ‫ﺃﺩﺍء ﺍﻟﻧﻅﺎﻡ‬

Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley


Outline
• The larger environment
• DBMS installation and configuration issues
• System monitoring

• ‫ﺍﻟﺑﻳﺋﺔ ﺑﺷﻛﻝ ﺍﻛﺑﺭ‬


• ‫ﺗﺭﻛﻳﺏ ﻧﻅﻡ ﺇﺩﺍﺭﺓ ﻗﻭﺍﻋﺩ ﺍﻟﺑﻳﺎﻧﺎﺕ ﻭﺍﻟﻘﺿﺎﻳﺎ ﺍﻟﺗﻛﻭﻳﻥ‬
• ‫ﻣﺭﺍﻗﺑﺔ ﺍﻟﻧﻅﺎﻡ‬

Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley


• A poorly performing system can degrade the performance
of all databases and applications deployed on that system.
• ‫ﻧﻅﺎﻡ ﺍﻷﺩﺍء ﺍﻟﺿﻌﻳﻑ ﻳﻣﻛﻥ ﺃﻥ ﺗﺗﺣﻠﻝ ﺃﺩﺍء ﺟﻣﻳﻊ ﻗﻭﺍﻋﺩ ﺍﻟﺑﻳﺎﻧﺎﺕ ﻭﺍﻟﺗﻁﺑﻳﻘﺎﺕ ﺍﻟﻣﻧﺗﺷﺭﺓ‬
.‫ﻋﻠﻰ ﻫﺫﺍ ﺍﻟﻧﻅﺎﻡ‬
• Therefore, a system problem can cause all databases and
applications to perform poorly,
• ‫ﻣﺷﻛﻠﺔ ﺍﻟﻧﻅﺎﻡ ﻳﻣﻛﻥ ﺃﻥ ﻳﺳﺑﺏ ﻛﻝ ﻗﻭﺍﻋﺩ ﺍﻟﺑﻳﺎﻧﺎﺕ ﻭﺍﻟﺗﻁﺑﻳﻘﺎﺕ ﻷﺩﺍء ﺿﻌﻳﻔﺎ‬
• just like a database problem can cause all applications
that access that database to perform poorly.
• ‫ﺗﻣﺎﻣﺎ ﻣﺛﻝ ﻣﺷﻛﻠﺔ ﻗﺎﻋﺩﺓ ﺑﻳﺎﻧﺎﺕ ﻳﻣﻛﻥ ﺃﻥ ﻳﺳﺑﺏ ﻛﻝ ﺍﻟﺗﻁﺑﻳﻘﺎﺕ ﺍﻟﺗﻲ ﻳﻣﻛﻧﻬﺎ ﺍﻟﻭﺻﻭﻝ‬
.‫ﺇﻟﻰ ﻗﺎﻋﺩﺓ ﺍﻟﺑﻳﺎﻧﺎﺕ ﻷﺩﺍء ﺿﻌﻳﻔﺎ‬

Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley


Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley
The Larger Environment ‫ﺍﻟﺑﻳﺋﺔ ﺃﻛﺑﺭ‬

• A DBMS operates within the context of a much larger environment that consists of other
software and hardware components.
• Each of these components must be installed, configured, and managed effectively for
the DBMS to function as required.

• The DBA needs to understand how the DBMS interacts


with the server hardware, the operating system, and any
other required software.
• ‫ﻳﺣﺗﺎﺝ ﻣﺳﺅﻭﻝ ﻗﺎﻋﺩﺓ ﺍﻟﺑﻳﺎﻧﺎﺕ ﻟﻔﻬﻡ ﻛﻳﻔﻳﺔ ﺗﻔﺎﻋﻝ ﻧﻅﺎﻡ ﺇﺩﺍﺭﺓ ﻗﺎﻋﺩﺓ ﺍﻟﺑﻳﺎﻧﺎﺕ ﻣﻊ ﺃﺟﻬﺯﺓ‬
.‫ ﻭﺃﻱ ﺑﺭﺍﻣﺞ ﺃﺧﺭﻯ ﺍﻟﻣﻁﻠﻭﺑﺔ‬،‫ ﻧﻅﺎﻡ ﺍﻟﺗﺷﻐﻳﻝ‬،‫ﺍﻟﺧﺎﺩﻡ‬
• Tuning and configuring these components and
connections properly can have a dramatic impact on
system performance.
• ‫ﻳﻣﻛﻥ ﺿﺑﻁ ﻭﺗﻛﻭﻳﻥ ﻫﺫﻩ ﺍﻟﻣﻛﻭﻧﺎﺕ ﻭﺍﻻﺗﺻﺎﻻﺕ ﺑﺷﻛﻝ ﺻﺣﻳﺢ ﻳﻛﻭﻥ ﻟﻬﺎ ﺗﺄﺛﻳﺭ ﻛﺑﻳﺭ‬
.‫ﻋﻠﻰ ﺃﺩﺍء ﺍﻟﻧﻅﺎﻡ‬

Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley


Interaction with the Operating System
‫ﺍﻟﺗﻔﺎﻋﻝ ﻣﻊ ﻧﻅﺎﻡ ﺍﻟﺗﺷﻐﻳﻝ‬
• When the operating system experiences a performance
problem, all of the software that runs on that operating
system may experience performance problems.
• ‫ ﻭﺟﻣﻳﻊ ﻣﻥ ﺍﻟﺑﺭﺍﻣﺞ ﺍﻟﺗﻲ ﻳﺗﻡ ﺗﺷﻐﻳﻠﻬﺎ ﻋﻠﻰ‬،‫ﻋﻧﺩﻣﺎ ﻳﻭﺍﺟﻪ ﻧﻅﺎﻡ ﺍﻟﺗﺷﻐﻳﻝ ﻣﺷﻛﻠﺔ ﺃﺩﺍء‬
.‫ﻧﻅﺎﻡ ﺍﻟﺗﺷﻐﻳﻝ ﻗﺩ ﺗﻭﺍﺟﻪ ﻣﺷﺎﻛﻝ ﻓﻲ ﺍﻷﺩﺍء‬
• To help ensure an optimal operating system for your
database applications, the DBA should ask the following
questions.
،‫ﻟﻠﻣﺳﺎﻋﺩﺓ ﻓﻲ ﺿﻣﺎﻥ ﻭﺟﻭﺩ ﻧﻅﺎﻡ ﺍﻟﺗﺷﻐﻳﻝ ﺍﻷﻣﺛﻝ ﻟﺗﻁﺑﻳﻘﺎﺕ ﻗﻭﺍﻋﺩ ﺍﻟﺑﻳﺎﻧﺎﺕ ﺍﻟﺧﺎﺻﺔ ﺑﻙ‬
.‫ﻳﺟﺏ ﺃﻥ ﻳﻁﻠﺏ ﻣﻥ ﻣﺳﺅﻭﻝ ﻗﺎﻋﺩﺓ ﺍﻟﺑﻳﺎﻧﺎﺕ ﻋﻠﻰ ﺍﻷﺳﺋﻠﺔ ﺍﻟﺗﺎﻟﻳﺔ‬

Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley


• Has a sufficient amount of memory been allocated for operating system
tasks?
• How were the database files allocated when the database was
implemented?
• Is the operating system at the version and release level recommended by
the DBMS vendor?
• ‫ﻟﺩﻳﻪ ﻛﻣﻳﺔ ﻛﺎﻓﻳﺔ ﻣﻥ ﺍﻟﺫﺍﻛﺭﺓ ﺗﻡ ﺗﺧﺻﻳﺹ ﻟﺗﺷﻐﻳﻝ ﻣﻬﺎﻡ ﺍﻟﻧﻅﺎﻡ؟‬

• ‫ﻛﻳﻑ ﺗﻡ ﻣﻠﻔﺎﺕ ﻗﺎﻋﺩﺓ ﺍﻟﺑﻳﺎﻧﺎﺕ ﺍﻟﻣﺧﺻﺻﺔ ﻋﻧﺩﻣﺎ ﺗﻡ ﺗﻁﺑﻳﻖ ﻗﺎﻋﺩﺓ ﺍﻟﺑﻳﺎﻧﺎﺕ؟‬



• ‫ﻫﻭ ﻧﻅﺎﻡ ﺍﻟﺗﺷﻐﻳﻝ ﻓﻲ ﻧﺳﺧﺔ ﻭﺇﻁﻼﻕ ﺍﻟﻣﺳﺗﻭﻯ ﺍﻟﻣﻭﺻﻰ ﺑﻪ ﻣﻥ ﻗﺑﻝ ﻧﻅﺎﻡ ﺇﺩﺍﺭﺓ ﻗﻭﺍﻋﺩ ﺍﻟﺑﻳﺎﻧﺎﺕ ﺑﺎﺋﻊ؟‬

Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley


Hardware Configuration
‫ﺗﻛﻭﻳﻥ ﺍﻷﺟﻬﺯﺓ‬
• The hardware must be installed and set up properly for the DBMS to
operate efficiently.
• ‫ﻳﺟﺏ ﺗﺛﺑﻳﺕ ﺍﻷﺟﻬﺯﺓ ﻭﺗﻌﻳﻳﻥ ﺑﺷﻛﻝ ﺻﺣﻳﺢ ﻟﻧﻅﻡ ﺇﺩﺍﺭﺓ ﻗﻭﺍﻋﺩ ﺍﻟﺑﻳﺎﻧﺎﺕ ﻟﺗﻌﻣﻝ ﺑﻛﻔﺎءﺓ‬
• Again, here are some questions the DBA should ask to assure an
optimal hardware environment for the database applications .
• ‫ﻭﻫﻧﺎ ﺑﻌﺽ ﺍﻷﺳﺋﻠﺔ ﻳﺟﺏ ﺃﻥ ﺗﻁﻠﺏ ﻣﻥ ﻣﺳﺅﻭﻝ ﻗﺎﻋﺩﺓ ﺍﻟﺑﻳﺎﻧﺎﺕ ﻟﺿﻣﺎﻥ ﺑﻳﺋﺔ ﺍﻷﺟﻬﺯﺓ ﺍﻷﻣﺛﻝ‬
‫ﻟﺗﻁﺑﻳﻘﺎﺕ ﻗﻭﺍﻋﺩ ﺍﻟﺑﻳﺎﻧﺎﺕ‬
• Is the computer hardware and capacity appropriate for the DBMS
environment?
• ‫ﻫﻭ ﺟﻬﺎﺯ ﻛﻣﺑﻳﻭﺗﺭ ﻭﻣﻧﺎﺳﺑﺔ ﺍﻟﻘﺩﺭﺍﺕ ﻣﻥ ﺃﺟﻝ ﺑﻳﺋﺔ ﻧﻅﺎﻡ ﺇﺩﺍﺭﺓ ﻗﺎﻋﺩﺓ ﺍﻟﺑﻳﺎﻧﺎﺕ؟‬

Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley


Hardware Configuration
‫ﺗﻛﻭﻳﻥ ﺍﻷﺟﻬﺯﺓ‬
• Has a sufficient amount of memory been installed for all of the
system software to be installed (Operating System, Database
management system,etc.)?
• ‫ ﻭﻧﻅﺎﻡ‬،‫ﻭﻗﺩ ﺗﻡ ﻋﻠﻰ ﻛﻣﻳﺔ ﻛﺎﻓﻳﺔ ﻣﻥ ﺍﻟﺫﺍﻛﺭﺓ ﺍﻟﻣﺛﺑﺗﺔ ﻟﺟﻣﻳﻊ ﺑﺭﺍﻣﺞ ﺍﻟﻧﻅﺎﻡ ﻟﻳﺗﻡ ﺗﺛﺑﻳﺗﻬﺎ )ﻧﻅﺎﻡ ﺍﻟﺗﺷﻐﻳﻝ‬
‫(؟‬.‫ ﺍﻟﺦ‬،‫ﺇﺩﺍﺭﺓ ﻗﻭﺍﻋﺩ ﺍﻟﺑﻳﺎﻧﺎﺕ‬
• Are all the network cables connected and functioning properly.
• .‫ﻫﻝ ﺟﻣﻳﻊ ﻛﺎﺑﻼﺕ ﺷﺑﻛﺔ ﺍﺗﺻﺎﻝ ﻭﻳﻌﻣﻝ ﺑﺷﻛﻝ ﺻﺣﻳﺢ‬

Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley


Components of the DBMS ‫ﻣﻛﻭﻧﺎﺕ ﻧﻅﻡ ﺇﺩﺍﺭﺓ ﻗﻭﺍﻋﺩ ﺍﻟﺑﻳﺎﻧﺎﺕ‬
• A DBMS is a very complex system requiring hundreds of
thousands of lines of computer code.
• A DBMS is so complex that multiple programs are required
to deliver the requisite data management functionality;
• each program interoperates with other programs to provide
a database management system.
• ‫ﻭﻧﻅﻡ ﺇﺩﺍﺭﺓ ﻗﻭﺍﻋﺩ ﺍﻟﺑﻳﺎﻧﺎﺕ ﻫﻭ ﻧﻅﺎﻡ ﻣﻌﻘﺩ ﻟﻠﻐﺎﻳﺔ ﺗﺗﻁﻠﺏ ﻣﺋﺎﺕ ﺍﻵﻻﻑ ﻣﻥ ﺍﻷﺳﻁﺭ ﻣﻥ‬
.‫ﺍﻟﺗﻌﻠﻳﻣﺎﺕ ﺍﻟﺑﺭﻣﺟﻳﺔ ﺍﻟﻛﻣﺑﻳﻭﺗﺭ‬
• ‫ﻭﻧﻅﻡ ﺇﺩﺍﺭﺓ ﻗﻭﺍﻋﺩ ﺍﻟﺑﻳﺎﻧﺎﺕ ﻣﻌﻘﺩ ﺑﺣﻳﺙ ﻳﻁﻠﺏ ﻣﻥ ﺑﺭﺍﻣﺞ ﻣﺗﻌﺩﺩﺓ ﻟﺗﻘﺩﻳﻡ ﻭﻅﻳﻔﺔ ﺇﺩﺍﺭﺓ‬
.‫ﺍﻟﺑﻳﺎﻧﺎﺕ ﺍﻟﻣﻁﻠﻭﺑﺔ‬

• .‫ﻳﻌﻣﻝ ﻛﻝ ﺑﺭﻧﺎﻣﺞ ﻣﻊ ﺍﻟﺑﺭﺍﻣﺞ ﺍﻷﺧﺭﻯ ﻟﺗﻭﻓﻳﺭ ﻧﻅﺎﻡ ﺇﺩﺍﺭﺓ ﻗﻭﺍﻋﺩ ﺍﻟﺑﻳﺎﻧﺎﺕ‬

Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley


• Each DBMS vendor breaks down DBMS functionality into different
components.
• The DBA must study the makeup of the DBMS and gain an understanding
of each component piece and how it integrates with the other components
of the DBMS.
• For a high-level overview of the architecture of the Oracle DBMS
• ‫ﻳﻘﻮﻡ ﻛﻞ ﻣﻮﺭﺩ ﻷﻧﻈﻤﺔ ﺇﺩﺍﺭﺓ ﻗﻮﺍﻋﺪ ﺍﻟﺒﻴﺎﻧﺎﺕ ﺑﺘﻘﺴﻴﻢ ﻭﻅﺎﺋﻒ ﻧﻈﺎﻡ ﺇﺩﺍﺭﺓ ﻗﻮﺍﻋﺪ ﺍﻟﺒﻴﺎﻧﺎﺕ ﺇﻟﻰ ﻣﻜﻮﻧﺎﺕ‬
.‫ﻣﺨﺘﻠﻔﺔ‬
• ‫ﻳﺠﺐ ﻋﻠﻰ ﻣﺴﺆﻭﻝ ﻗﺎﻋﺪﺓ ﺍﻟﺒﻴﺎﻧﺎﺕ ﺩﺭﺍﺳﺔ ﺗﺮﻛﻴﺒﺔ ﻧﻈﺎﻡ ﺇﺩﺍﺭﺓ ﻗﺎﻋﺪﺓ ﺍﻟﺒﻴﺎﻧﺎﺕ ﻭﺍﻛﺘﺴﺎﺏ ﻓﻬﻢ ﻟﻜﻞ ﺟﺰء‬
.‫ﻣﻜﻮﻥ ﻭﻛﻴﻔﻴﺔ ﺗﻜﺎﻣﻠﻪ ﻣﻊ ﺍﻟﻤﻜﻮﻧﺎﺕ ﺍﻷﺧﺮﻯ ﻟﻨﻈﺎﻡ ﺇﺩﺍﺭﺓ ﻗﺎﻋﺪﺓ ﺍﻟﺒﻴﺎﻧﺎﺕ‬
• ‫ﻟﻠﺤﺼﻮﻝ ﻋﻠﻰ ﻧﻈﺮﺓ ﻋﺎﻣﺔ ﺭﻓﻴﻌﺔ ﺍﻟﻤﺴﺘﻮﻯ ﻋﻠﻰ ﺑﻨﻴﺔ ﻧﻈﺎﻡ ﺇﺩﺍﺭﺓ ﻗﺎﻋﺪﺓ ﺑﻴﺎﻧﺎﺕ ﺃﻭﺭﺍﻛﻞ‬

Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley


The Oracle Database
‫ﻗﺎﻋﺩﺓ ﺑﻳﺎﻧﺎﺕ ﺃﻭﺭﺍﻛﻝ‬

• The Oracle Relational Database Management System


(RDBMS) is a database management system that
provides an open, comprehensive, integrated
approach to information management.
• ‫ﻧﻅﺎﻡ ﺇﺩﺍﺭﺓ ﻗﻭﺍﻋﺩ ﺍﻟﺑﻳﺎﻧﺎﺕ ﺍﻟﻌﻼﺋﻘﻳﺔ ﺃﻭﺭﺍﻛﻝ ﻫﻭ ﻧﻅﺎﻡ ﺇﺩﺍﺭﺓ ﻗﻭﺍﻋﺩ ﺍﻟﺑﻳﺎﻧﺎﺕ ﺍﻟﺗﻲ‬
.‫ﺗﻭﻓﺭ ﻧﻬﺟﺎ ﻣﻔﺗﻭﺡ ﻭﺷﺎﻣﻝ ﻭﻣﺗﻛﺎﻣﻝ ﻹﺩﺍﺭﺓ ﺍﻟﻣﻌﻠﻭﻣﺎﺕ‬

Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley


Oracle Database Architecture: Instance

Overview SMON PMON Others

SGA Shared pool

Library
Database cache
Redo log
buffer
buffer
cache Data dictionary
cache
PGA
Server
process DBWn CKPT LGWR ARCn

User Archived
process Control Online redo log files
Data files files log files
Database

Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley


Oracle Database Architecture
‫ﻗﺎﻋﺩﺓ ﺑﻳﺎﻧﺎﺕ ﺃﻭﺭﺍﻛﻝ ﺍﻟﻌﻣﺎﺭﺓ‬
– An Oracle Database consists of an instance and its
associated databases.
– An oracle instance is the combination all of the memory
structures and background processes that are allocated
when an oracle database is started.

.‫ﺗﺗﻛﻭﻥ ﻗﺎﻋﺩﺓ ﺑﻳﺎﻧﺎﺕ ﺃﻭﺭﺍﻛﻝ ﻣﺛﻳﻝ ﻭﻗﻭﺍﻋﺩ ﺍﻟﺑﻳﺎﻧﺎﺕ ﺍﻟﻣﺭﺗﺑﻁﺔ ﺑﻬﺎ‬

‫ﻣﺛﻳﻝ ﺃﻭﺭﺍﻛﻝ ﻫﻭ ﻣﺯﻳﺞ ﻣﻥ ﻛﻝ ﺍﻟﻬﻳﺎﻛﻝ ﺍﻟﺫﺍﻛﺭﺓ ﻭﺍﻟﻌﻣﻠﻳﺎﺕ ﺍﻟﺧﻠﻔﻳﺔ ﺍﻟﺗﻲ ﻳﺗﻡ ﺗﺧﺻﻳﺻﻬﺎ‬
.‫ﻋﻧﺩ ﺑﺩء ﻗﺎﻋﺩﺓ ﺑﻳﺎﻧﺎﺕ ﺃﻭﺭﺍﻛﻝ‬

Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley


Oracle Database Architecture
‫ﻗﺎﻋﺩﺓ ﺑﻳﺎﻧﺎﺕ ﺃﻭﺭﺍﻛﻝ ﺍﻟﻌﻣﺎﺭﺓ‬
– Every time an instance is started, a shared memory area called the
System Global Area (SGA) is allocated and the background processes
are started.
– ‫ ﻭﻫﻲ ﻣﻧﻁﻘﺔ ﺍﻟﺫﺍﻛﺭﺓ ﺍﻟﻣﺷﺗﺭﻛﺔ ﺗﺩﻋﻰ ﻳﺗﻡ ﺗﺧﺻﻳﺹ ﻣﻧﻁﻘﺔ ﺍﻟﻧﻅﺎﻡ ﺍﻟﻌﺎﻣﺔ ﻭﺑﺩﺃ‬،‫ﻛﻝ ﻣﺭﺓ ﻳﺗﻡ ﺗﺷﻐﻳﻝ ﻣﺛﻳﻝ‬
.‫ﺍﻟﻌﻣﻠﻳﺎﺕ ﺍﻟﺧﻠﻔﻳﺔ‬
– The database consists of both physical structures and logical structures.
– .‫ﺗﺗﻛﻭﻥ ﻗﺎﻋﺩﺓ ﺍﻟﺑﻳﺎﻧﺎﺕ ﻣﻥ ﻛﻝ ﻣﻥ ﺍﻟﻬﻳﺎﻛﻝ ﺍﻟﻣﺎﺩﻳﺔ ﻭﺍﻟﻬﻳﺎﻛﻝ ﺍﻟﻣﻧﻁﻘﻳﺔ‬
– Because the physical and logical structures are separate, the physical
storage of data can be managed without affecting access to logical
storage structures.

Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley


Connecting to the Database
‫ﺗﻭﺻﻳﻝ ﺇﻟﻰ ﻗﺎﻋﺩﺓ ﺍﻟﺑﻳﺎﻧﺎﺕ‬
– Connection: Communication pathway between a user
process and an instance
– ‫ ﺍﺗﺻﺎﻝ‬:‫ﻣﺳﺎﺭ ﺍﻻﺗﺻﺎﻻﺕ ﺑﻳﻥ ﻋﻣﻠﻳﺔ ﺍﻟﻣﺳﺗﺧﺩﻡ ﻭﻣﺛﻳﻝ‬
– Session: Specific connection of a user to an instance through
a user process
– ‫ ﺍﺗﺻﺎﻝ ﻣﺣﺩﺩﺓ ﻣﻥ ﻣﺳﺗﺧﺩﻡ ﺇﻟﻰ ﻣﺛﻳﻝ ﻣﻥ ﺧﻼﻝ ﻋﻣﻠﻳﺔ ﺍﻟﻣﺳﺗﻌﻣﻝ‬:‫ﺍﻟﺩﻭﺭﺓ‬

SQL> Select … User Session


USER

‫ﺻﻠﺔ‬Connection

Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley


• Connecting to the Database
• ‫ﺗﻮﺻﻴﻞ ﺇﻟﻰ ﻗﺎﻋﺪﺓ ﺍﻟﺒﻴﺎﻧﺎﺕ‬
• A connection is a communication pathway between a user
process and an Oracle Database instance.
• ‫ﺍﺗﺼﺎﻝ ﻟﻴﺸﻜﻞ ﺳﺒﻴﻼ ﺍﻟﺘﻮﺍﺻﻞ ﺑﻴﻦ ﻋﻤﻠﻴﺔ ﺍﻟﻤﺴﺘﺨﺪﻡ ﻭﻗﺎﻋﺪﺓ ﺑﻴﺎﻧﺎﺕ ﺃﻭﺭﺍﻛﻞ ﺳﺒﻴﻞ‬
.‫ﺍﻟﻤﺜﺎﻝ‬
• A session represents the state of a current user login to the
database instance.
• .‫ﻭﺗﻤﺜﻞ ﺟﻠﺴﺔ ﺍﻟﺪﻭﻟﺔ ﻟﺘﺴﺠﻴﻞ ﺩﺧﻮﻝ ﺍﻟﻤﺴﺘﺨﺪﻡ ﺍﻟﺤﺎﻟﻲ ﺇﻟﻰ ﻣﺜﻴﻞ ﻗﺎﻋﺪﺓ ﺍﻟﺒﻴﺎﻧﺎﺕ‬
• For example, when a user starts SQL*Plus, the user must
provide a valid username and password, and then a session is
established for that user.
• ‫ ﺛﻢ ﻳﺘﻢ‬،‫ﻟﺒﺪء ﺟﻠﺴﺔ ﻳﺠﺐ ﻋﻠﻰ ﺍﻟﻤﺴﺘﺨﺪﻡ ﺗﻮﻓﻴﺮ ﺍﺳﻢ ﻣﺴﺘﺨﺪﻡ ﺻﺎﻟﺢ ﻭﻛﻠﻤﺔ ﺍﻟﻤﺮﻭﺭ‬
.‫ﺗﺄﺳﻴﺲ ﺟﻠﺴﺔ ﻋﻤﻞ ﻟﻬﺬﺍ ﺍﻟﻤﺴﺘﺨﺪﻡ‬

Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley


• A session lasts from the time the user connects until the time the user
disconnects or exits the database application.
• ‫ﺗﺳﺗﻐﺭﻕ ﺟﻠﺳﺔ ﻣﻥ ﻣﺭﺓ ﻳﺗﺻﻝ ﺍﻟﻣﺳﺗﺧﺩﻡ ﺣﺗﻰ ﻭﻗﺕ ﻗﻁﻊ ﺍﺗﺻﺎﻝ ﺍﻟﻣﺳﺗﺧﺩﻡ ﺃﻭ ﻣﺧﺎﺭﺝ ﺗﻁﺑﻳﻖ ﻗﺎﻋﺩﺓ‬
.‫ﺍﻟﺑﻳﺎﻧﺎﺕ‬
• In the case of a dedicated connection, the session is serviced by a
permanent dedicated process.

• The session is serviced by an available server process selected from a


pool, either by the middle tier or by the Oracle shared server
architecture.
• Multiple sessions can be created and exist concurrently for a single
Oracle Database user using the same username.
• ‫ﺟﻠﺳﺎﺕ ﻣﺗﻌﺩﺩﺓ ﻳﻣﻛﻥ ﺇﻧﺷﺎء ﻭﺟﻭﺩ ﻟﻬﺎ ﻓﻲ ﻭﻗﺕ ﻭﺍﺣﺩ ﻻﺣﺩ ﺃﻭﺭﺍﻛﻝ ﺍﻟﻣﺳﺗﺧﺩﻡ ﻗﺎﻋﺩﺓ ﺍﻟﺑﻳﺎﻧﺎﺕ ﺑﺎﺳﺗﺧﺩﺍﻡ‬
.‫ﻧﻔﺱ ﺍﺳﻡ ﺍﻟﻣﺳﺗﺧﺩﻡ‬
• For example, a user with the username/password of HR/HR can
connect to the same Oracle Database instance several times.

Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley


Oracle Database Server Structures ‫ﺃﻭﺭﺍﻛﻝ ﺍﻟﻬﻳﺎﻛﻝ ﺧﺎﺩﻡ‬
‫ﻗﺎﻋﺩﺓ ﺍﻟﺑﻳﺎﻧﺎﺕ‬
‫ﻣﺛﻝ‬Instance
Memory structures SGA
‫ﻫﻳﺎﻛﻝ ﺍﻟﺫﺍﻛﺭﺓ‬ Shared pool
Database Library
buffer Redo log cache
User Server cache buffer
process process
Data dict.
‫ﺇﻋﺎﺩﺓ ﺗﺳﺟﻳﻝ؟ ﻋﺎﺯﻟﺔ ﻗﺎﻋﺩﺓ ﺍﻟﺑﻳﺎﻧﺎﺕ؟ ﻋﺎﺯﻟﺔ؟ ﻣﺧﺑﺄ‬
cache

Processes DBWn CKPT LGWR SMON PMON ARCn Others


‫ﺍﻟﻌﻣﻠﻳﺎﺕ‬

Database

Storage structures
‫ﻫﻳﺎﻛﻝ ﺍﻟﺗﺧﺯﻳﻥ‬

‫ﻣﻠﻔﺎﺕ ﺍﻟﺑﻳﺎﻧﺎﺕ‬ Online redo log files


Control files
Data files ‫ﻣﻠﻔﺎﺕ ﺍﻟﺳﺟﻝ ﺇﻋﺎﺩﺗﻪ ﻋﻠﻰ ﺍﻻﻧﺗﺭﻧﺕ‬
‫ﻣﻠﻔﺎﺕ ﺍﻟﺗﺣﻛﻡ‬

Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley


Database Structures ‫ﻫﻳﺎﻛﻝ ﻗﻭﺍﻋﺩ ﺍﻟﺑﻳﺎﻧﺎﺕ‬
• After starting an instance, the Oracle software associates the instance
with a specific database. This is called mounting the database.
• ‫ ﻭﻫﺫﺍ ﻣﺎ ﻳﺳﻣﻰ ﺗﺭﻛﻳﺏ ﻗﺎﻋﺩﺓ‬.‫ ﺑﺭﻧﺎﻣﺞ ﺃﻭﺭﺍﻛﻝ ﻋﻠﻰ ﺭﺑﻁ ﺍﻟﻣﺛﺎﻝ ﻣﻊ ﻗﺎﻋﺩﺓ ﺑﻳﺎﻧﺎﺕ ﻣﺣﺩﺩﺓ‬،‫ﺑﻌﺩ ﺑﺩء ﻣﺛﻳﻝ‬
.‫ﺍﻟﺑﻳﺎﻧﺎﺕ‬
• The database is then ready to be opened, which makes it accessible to
authorized users.
• .‫ ﻣﻣﺎ ﻳﺟﻌﻠﻪ ﻓﻲ ﻣﺗﻧﺎﻭﻝ ﺍﻟﻣﺳﺗﺧﺩﻣﻳﻥ ﺍﻟﻣﺻﺭﺡ ﻟﻬﻡ ﺫﻟﻙ ﺍﻟﺣﻳﻥ‬،‫ﻗﺎﻋﺩﺓ ﺑﻳﺎﻧﺎﺕ ﺟﺎﻫﺯﺓ ﻟﻳﺗﻡ ﻓﺗﺣﻪ‬
• Multiple instances can execute concurrently on the same computer,
each accessing its own physical database.
• ‫ ﻛﻝ ﺍﻟﻭﺻﻭﻝ ﺇﻟﻰ ﻗﺎﻋﺩﺓ ﺍﻟﺑﻳﺎﻧﺎﺕ ﺍﻟﻔﻌﻠﻳﺔ‬،‫ﻳﻣﻛﻥ ﻣﺛﻳﻼﺕ ﻣﺗﻌﺩﺩﺓ ﺑﺷﻛﻝ ﻣﺗﺯﺍﻣﻥ ﻋﻠﻰ ﺗﻧﻔﻳﺫ ﻧﻔﺱ ﺍﻟﻛﻣﺑﻳﻭﺗﺭ‬
.‫ﺍﻟﺧﺎﺻﺔ ﺑﻬﺎ‬
• An Oracle instance uses memory structures and processes to manage
and access the database.
• .‫ﻳﺳﺗﺧﺩﻡ ﻣﺛﻳﻝ ﺃﻭﺭﺍﻛﻝ ﺍﻟﻬﻳﺎﻛﻝ ﺍﻟﺫﺍﻛﺭﺓ ﻭﺍﻟﻌﻣﻠﻳﺎﺕ ﻹﺩﺍﺭﺓ ﻭﺍﻟﻭﺻﻭﻝ ﺇﻟﻰ ﻗﺎﻋﺩﺓ ﺍﻟﺑﻳﺎﻧﺎﺕ‬

Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley


• All memory structures exist in the main memory of the computers
that constitute the database server.
• ‫ﻭﺗﻭﺟﺩ ﺟﻣﻳﻊ ﺍﻟﻬﻳﺎﻛﻝ ﺍﻟﺫﺍﻛﺭﺓ ﻓﻲ ﺍﻟﺫﺍﻛﺭﺓ ﺍﻟﺭﺋﻳﺳﻳﺔ ﻣﻥ ﺃﺟﻬﺯﺓ ﺍﻟﻛﻣﺑﻳﻭﺗﺭ ﺍﻟﺗﻲ ﺗﺷﻛﻝ ﺧﺎﺩﻡ ﻗﺎﻋﺩﺓ‬
.‫ﺍﻟﺑﻳﺎﻧﺎﺕ‬
• Processes are jobs that work in the memory of these computers.
• .‫ﺍﻟﻌﻣﻠﻳﺎﺕ ﻫﻲ ﺍﻟﻭﻅﺎﺋﻑ ﺍﻟﺗﻲ ﺗﻌﻣﻝ ﻓﻲ ﺍﻟﺫﺍﻛﺭﺓ ﻣﻥ ﻫﺫﻩ ﺍﻟﺣﻭﺍﺳﻳﺏ‬
• A process is defined as a “thread of control” or a mechanism in an
operating system that can run a series of steps.

Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley


Oracle Database Storage Architecture ‫ﻗﺎﻋﺪﺓ ﺑﻴﺎﻧﺎﺕ ﺃﻭﺭﺍﻛﻞ ﺍﻟﺘﺨﺰﻳﻦ‬
‫ﺍﻟﻌﻤﺎﺭﺓ‬
• The files that constitute an Oracle database are organized into the
following:
• :‫ﻭﻳﺘﻢ ﺗﻨﻈﻴﻢ ﺍﻟﻤﻠﻔﺎﺕ ﺍﻟﺘﻲ ﺗﺸﻜﻞ ﻗﺎﻋﺪﺓ ﺑﻴﺎﻧﺎﺕ ﺃﻭﺭﺍﻛﻞ ﺇﻟﻰ ﻣﺎ ﻳﻠﻲ‬
• Data files : Contains all the database data.that is, physical
database structure information.
• ‫ ﻣﻌﻠﻮﻣﺎﺕ‬،‫ ﻭﻫﺬﺍ ﻫﻮ‬.‫ ﻳﺤﺘﻮﻱ ﻋﻠﻰ ﺟﻤﻴﻊ ﺍﻟﺒﻴﺎﻧﺎﺕ ﻗﺎﻋﺪﺓ ﺍﻟﺒﻴﺎﻧﺎﺕ‬:‫ﻣﻠﻔﺎﺕ ﺍﻟﺒﻴﺎﻧﺎﺕ‬
.‫ﺑﻨﻴﺔ ﻗﺎﻋﺪﺓ ﺍﻟﺒﻴﺎﻧﺎﺕ ﺍﻟﻔﻌﻠﻴﺔ‬
• Online redo log files: It records all changes made to the
database data. Moment to moment activity of database will be
recorded in redo log files. ‫ ﺇﻧﻪ ﻳﺴﺠﻞ‬:‫ﻣﻠﻔﺎﺕ ﺍﻟﺴﺠﻞ ﺇﻋﺎﺩﺗﻪ ﻋﻠﻰ ﺍﻻﻧﺘﺮﻧﺖ‬
‫ ﺳﻴﺘﻢ ﺗﺴﺠﻴﻠﻬﺎ ﺣﻈﺔ ﻟﺤﻈﺔ‬.‫ﺟﻤﻴﻊ ﺍﻟﺘﻐﻴﻴﺮﺍﺕ ﺍﻟﺘﻲ ﺃﺩﺧﻠﺖ ﻋﻠﻰ ﺑﻴﺎﻧﺎﺕ ﻗﺎﻋﺪﺓ ﺍﻟﺒﻴﺎﻧﺎﺕ‬
.‫ﺍﻟﻨﺸﺎﻁ ﻗﺎﻋﺪﺓ ﺍﻟﺒﻴﺎﻧﺎﺕ ﻓﻲ ﻣﻠﻔﺎﺕ ﺍﻟﺴﺠﻞ ﺇﻋﺎﺩﺓ‬
• Every database may have minimum 2 and maximum 255 redo
files. Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley
Database Storage Architecture
‫ﻗﺎﻋﺩﺓ ﺑﻳﺎﻧﺎﺕ ﺍﻟﺗﺧﺯﻳﻥ ﺍﻟﻌﻣﺎﺭﺓ‬

Control files Data files Online redo log files

Parameter file Backup files Archived redo log


files

Password file Alert log and trace files

Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley


• Control files : Controls the entire operations of the database .
Every database practically having one control file .
• ‫ ﻛﻞ ﻗﺎﻋﺪﺓ ﺍﻟﺒﻴﺎﻧﺎﺕ ﺫﺍﺕ‬.‫ ﻳﺘﺤﻜﻢ ﻓﻲ ﻋﻤﻠﻴﺎﺕ ﻛﺎﻣﻠﺔ ﻣﻦ ﻗﺎﻋﺪﺓ ﺍﻟﺒﻴﺎﻧﺎﺕ‬:‫ﻣﻠﻔﺎﺕ ﺍﻟﺘﺤﻜﻢ‬
.‫ﻋﻤﻠﻴﺎ ﻣﻠﻒ ﻋﻨﺼﺮ ﺗﺤﻜﻢ ﻭﺍﺣﺪ‬
• But we can create maximum 8 mirror copies of the same
control file. ‫ﻭﻟﻜﻦ ﻳﻤﻜﻨﻨﺎﺧﻠﻖ ﺃﻗﺼﻰ ﺛﻤﺎﻧﻲ ﻧﺴﺦ ﻁﺒﻖ ﺍﻷﺻﻞ ﻣﻦ ﻣﻠﻒ ﺍﻟﺘﺤﻜﻢ‬
.‫ﻧﻔﺴﻪ‬
• It contains information's like database name, names and
locations of redo log files and data files etc…
• ‫ ﻭﺃﺳﻤﺎء ﻭﻣﻮﺍﻗﻊ ﻣﻠﻔﺎﺕ‬،‫ﺃﻧﻪ ﻳﺤﺘﻮﻱ ﻋﻠﻰ ﻣﻌﻠﻮﻣﺎﺕ ﻓﻲ ﻣﺜﻞ ﺍﺳﻢ ﻗﺎﻋﺪﺓ ﺍﻟﺒﻴﺎﻧﺎﺕ‬
... ‫ﺍﻟﺴﺠﻞ ﺇﻋﺎﺩﺗﻪ ﻭﻣﻠﻔﺎﺕ ﺍﻟﺒﻴﺎﻧﺎﺕ ﺍﻟﺦ‬
• If control file is missing database is missing.
• .‫ﺇﺫﺍ ﻛﺎﻥ ﻣﻠﻑ ﺍﻟﺗﺣﻛﻡ ﻓﻲ ﻋﺩﺍﺩ ﺍﻟﻣﻔﻘﻭﺩﻳﻥ ﻗﺎﻋﺩﺓ ﺑﻳﺎﻧﺎﺕ ﻣﻔﻘﻭﺩ‬

Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley


• The following additional files are important to the successful running
of the database::‫ﻣﻠﻔﺎﺕ ﺇﺿﺎﻓﻳﺔ ﺍﻟﺗﺎﻟﻳﺔ ﻣﻬﻣﺔ ﻟﺗﺷﻐﻳﻝ ﺑﻧﺟﺎﺡ ﻣﻥ ﻗﺎﻋﺩﺓ ﺍﻟﺑﻳﺎﻧﺎﺕ‬
• Parameter file: Is used to define how the instance is configured
when it starts up
• ‫ ﻳﺳﺗﺧﺩﻡ ﻟﺗﺣﺩﻳﺩ ﻛﻳﻔﻳﺔ ﺗﻛﻭﻳﻥ ﺍﻟﻣﺛﺎﻝ ﻋﻧﺩﻣﺎ ﻳﺑﺩﺃ ﺍﻟﻌﻣﻝ‬:‫ﻣﻠﻑ ﺍﻟﻣﻌﻠﻣﺔ‬
• Password file: Allows the database administrators to connect
remotely to the database and perform administrative tasks
• ‫ ﻳﺳﻣﺢ ﻟﻠﻣﺳﺅﻭﻟﻳﻥ ﻗﺎﻋﺩﺓ ﺑﻳﺎﻧﺎﺕ ﻟﻼﺗﺻﺎﻝ ﻋﻥ ﺑﻌﺩ ﺇﻟﻰ ﻗﺎﻋﺩﺓ‬:‫ﻣﻠﻑ ﻛﻠﻣﺔ ﺍﻟﺳﺭ‬
‫ﺍﻟﺑﻳﺎﻧﺎﺕ ﻭﺃﺩﺍء ﺍﻟﻣﻬﺎﻡ ﺍﻹﺩﺍﺭﻳﺔ‬

Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley


• Backup files: Are used for database recovery. You typically restore a
backup file when a media failure or user error has damaged or deleted the
original file.
• ‫ ﻛﻨﺖ ﻋﺎﺩﺓ ﺍﺳﺘﻌﺎﺩﺓ ﻣﻠﻒ ﺍﻟﻨﺴﺨﺔ‬.‫ ﺗﺴﺘﺨﺪﻡ ﻻﺳﺘﺮﺩﺍﺩ ﻗﺎﻋﺪﺓ ﺍﻟﺒﻴﺎﻧﺎﺕ‬:‫ﻣﻠﻔﺎﺕ ﺍﻟﻨﺴﺦ ﺍﻻﺣﺘﻴﺎﻁﻲ‬
.‫ﺍﻻﺣﺘﻴﺎﻁﻴﺔ ﻋﻨﺪ ﺗﻠﻒﺧﻄﺄ ﻓﺸﻞ ﻭﺳﺎﺋﻞ ﺍﻹﻋﻼﻡ ﺃﻭ ﻣﺴﺘﺨﺪﻡ ﺃﻭ ﺣﺬﻑ ﺍﻟﻤﻠﻒ ﺍﻷﺻﻠﻲ‬
• Archived redo log files: Contain an ongoing history of the data changes
(redo) that are generated by the instance. Using these files and a backup
of the database, you can recover a lost data file. That is, archive logs
enable the recovery of restored data files.
• ‫ ﺗﺤﺘﻮﻱ ﻋﻠﻰ ﺍﻟﺘﺎﺭﻳﺦ ﺍﻟﻤﺘﻮﺍﺻﻞ ﻟﻠﺘﻐﻴﻴﺮﺍﺕ ﺍﻟﺒﻴﺎﻧﺎﺕ )ﺍﻹﻋﺎﺩﺓ( ﺍﻟﺘﻲ ﺗﻢ‬:‫ﺃﺭﺷﻔﺔ ﻣﻠﻔﺎﺕ ﺍﻟﺴﺠﻞ ﺍﻹﻋﺎﺩﺓ‬
‫ ﻳﻤﻜﻨﻚ ﺍﺳﺘﻌﺎﺩﺓ‬،‫ ﺑﺎﺳﺘﺨﺪﺍﻡ ﻫﺬﻩ ﺍﻟﻤﻠﻔﺎﺕ ﻭﻧﺴﺨﺔ ﺍﺣﺘﻴﺎﻁﻴﺔ ﻣﻦ ﻗﺎﻋﺪﺓ ﺍﻟﺒﻴﺎﻧﺎﺕ‬.‫ﺇﻧﺸﺎﺅﻫﺎ ﺑﻮﺍﺳﻄﺔ ﺍﻟﻤﺜﻴﻞ‬
.‫ ﻭﺳﺠﻼﺕ ﺃﺭﺷﻴﻒ ﺗﺘﻴﺢ ﺍﺳﺘﺮﺩﺍﺩ ﻣﻠﻔﺎﺕ ﺍﻟﺒﻴﺎﻧﺎﺕ ﺍﻟﻤﺴﺘﻌﺎﺩﺓ‬،‫ ﻭﻫﺬﺍ ﻫﻮ‬.‫ﻣﻠﻒ ﺍﻟﺒﻴﺎﻧﺎﺕ ﺍﻟﻤﻔﻘﻮﺩﺓ‬

Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley


Oracle Memory Architecture
Server Server Background
PGA PGA PGA
process 1 process 2 process

Data Dictionary SGA


Shared
cache
SQL area

Library Other
cache

Redo log Shared pool


buffer
Free
Database buffer I/O Buffer
memory
cache
Response Request
Java pool Streams queue queue
pool Large pool

Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley


Oracle Memory Structures ‫ﺃﻭﺭﺍﻛﻝ ﺍﻟﻬﻳﺎﻛﻝ ﺍﻟﺫﺍﻛﺭﺓ‬
• memory structures stores program code being run, data shared
among users, and private data areas for each connected user.
• ‫ ﻭﺍﻟﻣﻧﺎﻁﻖ ﺍﻟﺑﻳﺎﻧﺎﺕ‬،‫ ﺍﻟﺑﻳﺎﻧﺎﺕ ﺍﻟﻣﺷﺗﺭﻛﺔ ﺑﻳﻥ ﺍﻟﻣﺳﺗﺧﺩﻣﻳﻥ‬،‫ﻫﻳﺎﻛﻝ ﺍﻟﺫﺍﻛﺭﺓ ﻣﺧﺎﺯﻥ ﻛﻭﺩ ﺑﺭﻧﺎﻣﺞ ﺗﺩﺍﺭ‬
.‫ﺍﻟﺧﺎﺻﺔ ﻟﻛﻝ ﻣﺳﺗﺧﺩﻡ ﻣﺗﺻﻝ‬
• Two basic memory structures are associated with an instance:
• :‫ﻭﺗﺭﺗﺑﻁ ﻫﻳﻛﻠﻳﻥ ﺍﻟﺫﺍﻛﺭﺓ ﺍﻷﺳﺎﺳﻳﺔ ﻣﻊ ﻣﺛﻳﻝ‬
• The System Global Area (SGA) is a group of shared memory structures,
known as SGA components, that contain data and control information for one
Oracle Database instance.
• ‫ ﻭﺍﻟﻣﻌﺭﻭﻓﺔ ﺑﺎﺳﻡ ﻣﻛﻭﻧﺎﺕ ﻧﻅﺎﻡ ﺍﻟﻣﻧﺎﻁﻖ‬،‫ﺍﻟﻣﻧﻁﻘﺔ ﺍﻟﻌﺎﻟﻣﻳﺔ ﻟﻠﻧﻅﺎﻡ ﻫﻲ ﻣﺟﻣﻭﻋﺔ ﻣﻥ ﻫﻳﺎﻛﻝ ﺍﻟﺫﺍﻛﺭﺓ ﺍﻟﻣﺷﺗﺭﻛﺔ‬
.‫ ﺍﻟﺗﻲ ﺗﺣﺗﻭﻱ ﻋﻠﻰ ﺍﻟﺑﻳﺎﻧﺎﺕ ﻭﺍﻟﺗﺣﻛﻡ ﻓﻲ ﺍﻟﻣﻌﻠﻭﻣﺎﺕ ﻋﻥ ﻭﺍﺣﺩ ﻗﺎﻋﺩﺓ ﺑﻳﺎﻧﺎﺕ ﺃﻭﺭﺍﻛﻝ ﺍﻟﻣﺛﺎﻝ‬،‫ﺍﻟﻌﺎﻟﻣﻳﺔ‬
• The Program Global Areas (PGAs) are memory regions that contain data and
control information which is private to each server or background process.
• ‫ﺍﻟﻣﻧﺎﻁﻖ ﺍﻟﻌﺎﻟﻣﻳﺔ ﺑﺭﻧﺎﻣﺞ ﻫﻲ ﻣﻧﺎﻁﻖ ﺍﻟﺫﺍﻛﺭﺓ ﺍﻟﺗﻲ ﺗﺣﺗﻭﻱ ﻋﻠﻰ ﺍﻟﺑﻳﺎﻧﺎﺕ ﻭﺍﻟﺗﺣﻛﻡ ﻓﻲ ﺍﻟﻣﻌﻠﻭﻣﺎﺕ ﺍﻟﺗﻲ ﻫﻭ ﺧﺎﺹ ﻟﻛﻝ‬
.‫ﻋﻣﻠﻳﺔ ﺍﻟﺧﺎﺩﻡ ﺃﻭ ﺍﻟﺧﻠﻔﻳﺔ‬

Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley


• Oracle Memory Structures (continued)
• . The SGA includes the following data structures:
• ‫ﻭﺗﺿﻡ ﺍﻟﻣﻧﻁﻘﺔ ﺍﻟﻌﺎﻟﻣﻳﺔ ﻧﻅﺎﻡ ﺍﻟﻬﻳﺎﻛﻝ ﺍﻟﺑﻳﺎﻧﺎﺕ ﺍﻟﺗﺎﻟﻳﺔ‬
• Database buffer cache: Caches blocks of data retrieved from the
database
• Redo log buffer: Caches redo information (used for instance
recovery) until it can be written to the physical redo log files stored on
the disk
• Shared pool: Caches various constructs that can be shared among
users
• Large pool: Is an optional area that provides large memory allocations
for certain large processes, such as Oracle backup and recovery
operations, and I/O server processes
• Java pool: Is used for all session-specific Java code and data within
the Java Virtual Machine (JVM)
• Streams pool: Is used by Oracle Streams to store information required
by capture and apply When you start the instance by using Enterprise
Manager or SQL*Plus, the amount of memory allocated for the SGA is
displayed.

Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley


Process Architecture ‫ﺍﻟﻌﻣﺎﺭﺓ ﻋﻣﻠﻳﺔ‬
– User process: ‫ﻋﻤﻠﻴﺔ ﺍﻟﻤﺴﺘﺨﺪﻡ‬
• Is started when a database user or a batch process
connects to Oracle Database ‫ﻫﻞ ﺑﺪﺃﺕ ﻋﻤﻠﻴﺔ ﺍﻟﻤﺴﺘﺨﺪﻡ ﻋﻨﺪﻣﺎ‬
‫ﻳﻘﻮﻡ ﺍﻟﻤﺴﺘﺨﺪﻡ ﻗﺎﻋﺪﺓ ﺍﻟﺒﻴﺎﻧﺎﺕ ﺃﻭ ﻋﻤﻠﻴﺔ ﺩﻓﻌﺔ ﻳﺘﺼﻞ ﻗﺎﻋﺪﺓ ﺑﻴﺎﻧﺎﺕ ﺃﻭﺭﺍﻛﻞ‬
– Database processes ‫ﻋﻤﻠﻴﺎﺕ ﻗﺎﻋﺪﺓ ﺍﻟﺒﻴﺎﻧﺎﺕ‬
• Server process: Connects to the Oracle instance and is
started when a user establishes a session
• ‫ ﻳﻘﻮﻡ ﺑﺘﻮﺻﻴﻞ ﺇﻟﻰ ﻣﺜﻴﻞ ﺃﻭﺭﺍﻛﻞ ﻭﺑﺪﺃ ﻋﻨﺪﻣﺎ ﻳﻨﺸﺊ ﺍﻟﻤﺴﺘﺨﺪﻡ‬:‫ﻋﻤﻠﻴﺔ ﺍﻟﺨﺎﺩﻡ‬
‫ﺟﻠﺴﺔ‬
• Background processes: Are started when an Oracle
instance is started
• ‫ ﻫﻞ ﺑﺪﺃﺕ ﻋﻨﺪﻣﺎ ﻳﺘﻢ ﺗﺸﻐﻴﻞ ﻣﺜﻴﻞ ﺃﻭﺭﺍﻛﻞ‬:‫ﺍﻟﻌﻤﻠﻴﺎﺕ ﺍﻟﺨﻠﻔﻴﺔ‬

Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley


Process Architecture ‫ﺍﻟﻌﻣﺎﺭﺓ ﻋﻣﻠﻳﺔ‬
Instance

SGA

Shared pool
Library
cache
Database
Redo log
buffer
buffer
cache
PGA Data dictionary
cache

User Server
process process Background processes

DBWn CKPT LGWR SMON PMON ARCn Others

Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley


• The oracle database typically runs in two modes they are
• ‫ﻗﺎﻋﺪﺓ ﺑﻴﺎﻧﺎﺕ ﺃﻭﺭﺍﻛﻞ ﻳﻌﻤﻞ ﻋﺎﺩﺓ ﻓﻲ ﻭﺿﻌﻴﻦ ﻫﻢ‬
• 1-Dedicated server mode : With dedicated server, each user
process is served by a dedicated server process.
• ‫ ﻭﻳﺨﺪﻡ ﻛﻞ ﻋﻤﻠﻴﺔ ﺍﻟﻤﺴﺘﺨﺪﻡ ﻣﻦﺧﻼﻝ‬،‫ ﻣﻊﺧﺎﺩﻡ ﻣﺨﺼﺺ‬:‫ﻭﺿﻊﺧﺎﺩﻡ ﻣﺨﺼﺺ‬
.‫ﻋﻤﻠﻴﺔﺧﺎﺩﻡ ﻣﺨﺼﺺ‬
• 2-Shared or multithreaded mode(MTS):Here the same server
process services requests from multiple clients.
• ‫ ﻫﻨﺎ ﻧﻔﺲ ﻁﻠﺒﺎﺕ ﺍﻟﺨﺪﻣﺎﺕ ﻋﻤﻠﻴﺔ ﺍﻟﺨﺎﺩﻡ ﻣﻦ ﻋﺪﺓ‬:‫ﺍﻟﻤﺸﺘﺮﻛﺔ ﺃﻭ ﻭﺿﻊ ﻣﺆﺷﺮﺍﺕ‬
.‫ﻋﻤﻼء‬

Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley


Shared server process (continue..)
If any process goes idle is pulled in to the shared server
pool by the dispatcher process. The dispatcher process
knows the incoming user request and also the idle server
processes. So it allocates the user request to any of the
idle server process.

Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley


• Process Structures ‫ﻫﻴﺎﻛﻞ ﻋﻤﻠﻴﺔ‬
– Background Processes ‫ﺍﻟﻌﻤﻠﻴﺎﺕ ﺍﻟﺨﻠﻔﻴﺔ‬
– To maximize performance and accommodate many
users, a multiprocess Oracle Database system uses
some additional Oracle Database processes called
background processes.
– An Oracle Database instance can have many
background processes.
– ،‫ﻟﺘﺤﻘﻴﻖ ﺃﻗﺼﻰ ﻗﺪﺭ ﻣﻦ ﺍﻷﺩﺍء ﻭﺍﺳﺘﻴﻌﺎﺏ ﺍﻟﻌﺪﻳﺪ ﻣﻦ ﺍﻟﻤﺴﺘﺨﺪﻣﻴﻦ‬
‫ﻳﺴﺘﺨﺪﻡ ﻧﻈﺎﻡ ﻗﺎﻋﺪﺓ ﺍﻟﺒﻴﺎﻧﺎﺕ ﺃﻭﺭﺍﻛﻞ ﺑﻌﺾ ﻋﻤﻠﻴﺎﺕ ﻗﺎﻋﺪﺓ ﺑﻴﺎﻧﺎﺕ‬
.‫ﺃﻭﺭﺍﻛﻞ ﺇﺿﺎﻓﻴﺔ ﺗﺴﻤﻰ ﺍﻟﻌﻤﻠﻴﺎﺕ ﺍﻟﺨﻠﻔﻴﺔ‬
– ‫ﻗﺎﻋﺪﺓ ﺑﻴﺎﻧﺎﺕ ﺃﻭﺭﺍﻛﻞ ﺳﺒﻴﻞ ﺍﻟﻤﺜﺎﻝ ﻳﻤﻜﻦ ﺃﻥ ﻳﻜﻮﻥ ﻟﻬﺎ ﺍﻟﻌﺪﻳﺪ ﻣﻦ‬
.‫ﺍﻟﻌﻤﻠﻴﺎﺕ ﺍﻟﺨﻠﻔﻴﺔ‬
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley
• Process Structures (continued)
– Background Processes ‫ﺍﻟﻌﻣﻠﻳﺎﺕ ﺍﻟﺧﻠﻔﻳﺔ‬
– The background processes commonly seen are the following:
– :‫ﺍﻟﻌﻣﻠﻳﺎﺕ ﺍﻟﺧﻠﻔﻳﺔ ﺷﺎﺋﻊ ﻫﻲ ﺍﻟﺗﺎﻟﻳﺔ‬
• Database Writer process (DBWn)
• Log Writer process (LGWR)
• Checkpoint process (CKPT)
• System Monitor process (SMON)
• Process Monitor process (PMON)
• Recoverer process (RECO)
• Job Queue processes
• Archiver processes (ARCn)
• Queue Monitor processes (QMNn)

On many operating systems, background processes are created


automatically when an instance is started.
.‫ ﻳﺗﻡ ﺇﻧﺷﺎء ﺍﻟﻌﻣﻠﻳﺎﺕ ﺍﻟﺧﻠﻔﻳﺔ ﺗﻠﻘﺎﺋﻳﺎ ﻋﻧﺩ ﺑﺩء ﻣﺛﻳﻝ‬،‫ﻋﻠﻰ ﺍﻟﻌﺩﻳﺩ ﻣﻥ ﺃﻧﻅﻣﺔ ﺍﻟﺗﺷﻐﻳﻝ‬

Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley


Database Architecture:
Summary of Structural Components

– Memory structures:
• System Global Area (SGA): Database buffer cache, redo
buffer, and various pools
• Program Global Area (PGA)
– Process structures:
• User process and server process
• Background processes: SMON, PMON, DBWn, CKPT,
LGWR, ARCn, and so on
– Storage structures:
• Logical: Database, schema, tablespace, segment, extent,
and Oracle block
• Physical: data files, control files, and redo log files

Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley


Logical and Physical Database Structures
‫ﻫﻳﺎﻛﻝ ﻗﻭﺍﻋﺩ ﺍﻟﺑﻳﺎﻧﺎﺕ ﺍﻟﻣﻧﻁﻘﻳﺔ ﻭﺍﻟﻣﺎﺩﻳﺔ‬

‫ﻣﻨﻄﻘﻲ‬Logical ‫ﻣﺎﺩﻱ‬Physical

Database

Tablespace
Schema Data file
‫ﻣﺳﺎﺣﺔ ﺍﻟﻁﺎﻭﻟﺔ‬

Segment‫ﻗﻁﻌﺔ‬

Extent

Oracle data
OS block
block

Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley


Logical and Physical Database Structures ‫ﻫﻴﺎﻛﻞ ﻗﻮﺍﻋﺪ ﺍﻟﺒﻴﺎﻧﺎﺕ ﺍﻟﻤﻨﻄﻘﻴﺔ ﻭﺍﻟﻤﺎﺩﻳﺔﻫﻴﺎﻛﻞ ﻗﻮﺍﻋﺪ ﺍﻟﺒﻴﺎﻧﺎﺕ ﺍﻟﻤﻨﻄﻘﻴﺔ‬
‫ﻭﺍﻟﻤﺎﺩﻳﺔ‬
– The database has logical structures and physical structures. ‫ﺗﺤﺘﻮﻱ ﻗﺎﻋﺪﺓ ﺍﻟﺒﻴﺎﻧﺎﺕ ﻋﻠﻰ ﻫﻴﺎﻛﻞ ﻣﻨﻄﻘﻴﺔ‬
.‫ﻭﻫﻴﺎﻛﻞ ﻣﺎﺩﻳﺔ‬
– Tablespaces A database is divided into logical storage units called tablespaces, which group
related logical structures together.
– .‫ ﻭﺍﻟﺘﻲ ﺗﺠﻤﻊ ﺍﻟﻬﻴﺎﻛﻞ ﺍﻟﻤﻨﻄﻘﻴﺔ ﺫﺍﺕ ﺍﻟﺼﻠﺔ ﻣﻌًﺎ‬، ‫ﺗﻨﻘﺴﻢ ﻗﺎﻋﺪﺓ ﺍﻟﺒﻴﺎﻧﺎﺕ ﺇﻟﻰ ﻭﺣﺪﺍﺕ ﺗﺨﺰﻳﻦ ﻣﻨﻄﻘﻴﺔ ﺗﺴﻤﻰ ﻣﺴﺎﺣﺎﺕ ﺍﻟﺠﺪﺍﻭﻝ‬
– For example, tablespaces commonly group all of an application’s objects to simplify some
administrative operations. You may have a tablespace for application data and an additional
one for application indexes.
– Databases, Tablespaces, and Data Files
The relationship among databases, tablespaces, and data files is illustrated in the slide.
Each database is logically divided into one or more tablespaces.
.‫ﺗﻨﻘﺴﻢ ﻛﻞ ﻗﺎﻋﺪﺓ ﺑﻴﺎﻧﺎﺕ ﻣﻨﻄﻘﻴًﺎ ﺇﻟﻰ ﻣﺴﺎﺣﺔ ﺟﺪﻭﻝ ﻭﺍﺣﺪﺓ ﺃﻭ ﺃﻛﺜﺮ‬
One or more data files are explicitly created for each tablespace to physically store the data of
all logical structures in a tablespace.
‫ﻳﺘﻢ ﺇﻧﺸﺎء ﻣﻠﻒ ﺑﻴﺎﻧﺎﺕ ﻭﺍﺣﺪ ﺃﻭ ﺃﻛﺜﺮ ﺑﺸﻜﻞ ﺻﺮﻳﺢ ﻟﻜﻞ ﻣﺴﺎﺣﺔ ﺟﺪﻭﻝ ﻟﺘﺨﺰﻳﻦ ﺑﻴﺎﻧﺎﺕ ﺟﻤﻴﻊ ﺍﻟﻬﻴﺎﻛﻞ ﺍﻟﻤﻨﻄﻘﻴﺔ ﻓﻌﻠﻴًﺎ ﻓﻲ ﻣﺴﺎﺣﺔ‬
.‫ﺍﻟﺠﺪﻭﻝ‬
If it is a TEMPORARY tablespace, then instead of a data file, the tablespace has a temporary
file.

Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley


Logical and Physical Database Structures (continued)
‫ﻫﻴﺎﻛﻞ ﻗﻮﺍﻋﺪ ﺍﻟﺒﻴﺎﻧﺎﺕ ﺍﻟﻤﻨﻄﻘﻴﺔ ﻭﺍﻟﻤﺎﺩﻳﺔﻫﻴﺎﻛﻞ ﻗﻮﺍﻋﺪ ﺍﻟﺒﻴﺎﻧﺎﺕ ﺍﻟﻤﻨﻄﻘﻴﺔ ﻭﺍﻟﻤﺎﺩﻳﺔ‬
– Schemas ‫ﺍﻟﻤﺨﻄﻄﺎﺕ‬
– A schema is a collection of database objects that are owned by a database user.
– .‫ﺍﻟﻤﺨﻄﻂ ﻫﻮ ﻣﺠﻤﻮﻋﺔ ﻣﻦ ﻛﺎﺋﻨﺎﺕ ﻗﺎﻋﺪﺓ ﺍﻟﺒﻴﺎﻧﺎﺕ ﺍﻟﺘﻲ ﻳﻤﻠﻜﻬﺎ ﻣﺴﺘﺨﺪﻡ ﻗﺎﻋﺪﺓ ﺍﻟﺒﻴﺎﻧﺎﺕ‬
– Schema objects are the logical structures that directly refer to the database’s data.
– ‫ﻛﺎﺋﻨﺎﺕ ﺍﻟﻤﺨﻄﻂ ﻫﻲ ﺍﻟﻬﻴﺎﻛﻞ ﺍﻟﻤﻨﻄﻘﻴﺔ ﺍﻟﺘﻲ ﺗﺸﻴﺮ ﻣﺒﺎﺷﺮﺓ ﺇﻟﻰ ﺑﻴﺎﻧﺎﺕ ﻗﺎﻋﺪﺓ ﺍﻟﺒﻴﺎﻧﺎﺕ‬
– Schema objects include such structures as tables, views, sequences, stored procedures,
synonyms, indexes, clusters, and database links.
– ‫ﺗﺘﻀﻤﻦ ﻛﺎﺋﻨﺎﺕ ﺍﻟﻤﺨﻄﻂ ﻫﻴﺎﻛﻞ ﻣﺜﻞ ﺍﻟﺠﺪﺍﻭﻝ ﻭﻁﺮﻕ ﺍﻟﻌﺮﺽ ﻭﺍﻟﺘﺴﻠﺴﻼﺕ ﻭﺍﻹﺟﺮﺍءﺍﺕ ﺍﻟﻤﺨﺰﻧﺔ ﻭﺍﻟﻤﺮﺍﺩﻓﺎﺕ ﻭﺍﻟﻔﻬﺎﺭﺱ‬
.‫ﻭﺍﻟﻤﺠﻤﻮﻋﺎﺕ ﻭﺍﺭﺗﺒﺎﻁﺎﺕ ﻗﺎﻋﺪﺓ ﺍﻟﺒﻴﺎﻧﺎﺕ‬

– Data Blocks ‫ﻛﺘﻞ ﺍﻟﺒﻴﺎﻧﺎﺕ‬


– At the finest level of granularity, an Oracle database’s data is stored in data blocks.
– ‫ ﻳﺘﻢ ﺗﺨﺰﻳﻦ ﺑﻴﺎﻧﺎﺕ ﻗﺎﻋﺪﺓ ﺑﻴﺎﻧﺎﺕ‬، ‫ﻋﻠﻰ ﺃﻋﻠﻰ ﻣﺴﺘﻮﻯ ﻣﻦ ﺍﻟﺘﻔﺼﻴﻞ‬Oracle ‫ﻓﻲ ﻛﺘﻞ ﺑﻴﺎﻧﺎﺕ‬
– One data block corresponds to a specific number of bytes of physical database space on the
disk. .‫ﻛﺘﻠﺔ ﺑﻴﺎﻧﺎﺕ ﻭﺍﺣﺪﺓ ﺗﺘﻮﺍﻓﻖ ﻣﻊ ﻋﺪﺩ ﻣﺤﺪﺩ ﻣﻦ ﻭﺣﺪﺍﺕ ﺍﻟﺒﺎﻳﺖ ﻣﻦ ﻣﺴﺎﺣﺔ ﻗﺎﻋﺪﺓ ﺍﻟﺒﻴﺎﻧﺎﺕ ﺍﻟﻔﻌﻠﻴﺔ ﻋﻠﻰ ﺍﻟﻘﺮﺹ‬
– A database uses and allocates free database space in Oracle data blocks.
• ‫ﺗﺳﺗﺧﺩﻡ ﻗﺎﻋﺩﺓ ﺍﻟﺑﻳﺎﻧﺎﺕ ﻣﺳﺎﺣﺔ ﻗﺎﻋﺩﺓ ﺍﻟﺑﻳﺎﻧﺎﺕ ﺍﻟﻣﺟﺎﻧﻳﺔ ﻭﺗﺧﺻﺻﻬﺎ ﻓﻲ ﻛﺗﻝ ﺑﻳﺎﻧﺎﺕ‬Oracle.

Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley


Extents : The next level of logical database space is called an extent. An extent is
a specific number of contiguous data blocks (obtained in a single allocation)
that are used to store a specific type of information.
‫ ﺍﻟﻤﺪﻯ ﻫﻮ ﻋﺪﺩ ﻣﺤﺪﺩ ﻣﻦ‬.‫ ﻳُﻄﻠﻖ ﻋﻠﻰ ﺍﻟﻤﺴﺘﻮﻯ ﺍﻟﺘﺎﻟﻲ ﻣﻦ ﻣﺴﺎﺣﺔ ﻗﺎﻋﺪﺓ ﺍﻟﺒﻴﺎﻧﺎﺕ ﺍﻟﻤﻨﻄﻘﻴﺔ ﻧﻄﺎﻕ‬:‫ﺍﻟﻨﻄﺎﻗﺎﺕ‬
‫ﻣﺠﻤﻮﻋﺎﺕ ﺍﻟﺒﻴﺎﻧﺎﺕ ﺍﻟﻤﺘﺠﺎﻭﺭﺓ )ﻳﺘﻢ ﺍﻟﺤﺼﻮﻝ ﻋﻠﻴﻬﺎ ﻓﻲ ﺗﺨﺼﻴﺺ ﻭﺍﺣﺪ( ﻭﺍﻟﺘﻲ ﺗُﺴﺘﺨﺪﻡ ﻟﺘﺨﺰﻳﻦ ﻧﻮﻉ‬
.‫ﻣﻌﻴﻦ ﻣﻦ ﺍﻟﻤﻌﻠﻮﻣﺎﺕ‬

Segments : The level of logical database storage above an extent is called a segment.
.‫ ﻳُﻄﻠﻖ ﻋﻠﻰ ﻣﺴﺘﻮﻯ ﺗﺨﺰﻳﻦ ﻗﺎﻋﺪﺓ ﺍﻟﺒﻴﺎﻧﺎﺕ ﺍﻟﻤﻨﻄﻘﻲ ﻓﻮﻕ ﺣﺪ ﻣﺎ ﺍﺳﻢ ﻣﻘﻄﻊ‬:‫ﺍﻟﻤﻘﺎﻁﻊ‬
A segment is a set of extents allocated for a certain logical structure. For example, the
different types of segments include
‫ ﺗﺸﻤﻞ ﺍﻷﻧﻮﺍﻉ‬، ‫ ﻋﻠﻰ ﺳﺒﻴﻞ ﺍﻟﻤﺜﺎﻝ‬.‫ﺍﻟﻤﻘﻄﻊ ﻋﺒﺎﺭﺓ ﻋﻦ ﻣﺠﻤﻮﻋﺔ ﻣﻦ ﺍﻟﻨﻄﺎﻗﺎﺕ ﺍﻟﻤﺨﺼﺼﺔ ﻟﻬﻴﻜﻞ ﻣﻨﻄﻘﻲ ﻣﻌﻴﻦ‬
‫ﺍﻟﻤﺨﺘﻠﻔﺔ ﻣﻦ ﺍﻟﺸﺮﺍﺋﺢ‬

Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley


• Data segments. All of the table’s data is stored in the extents of its data segment. For a
partitioned table, each partition has a data segment.
• ‫ ﻳﺤﺘﻮﻱ ﻛﻞ ﻗﺴﻢ‬، ‫ ﺑﺎﻟﻨﺴﺒﺔ ﻟﻠﺠﺪﻭﻝ ﺍﻟﻤﻘﺴﻢ‬.‫ ﻳﺘﻢ ﺗﺨﺰﻳﻦ ﺟﻤﻴﻊ ﺑﻴﺎﻧﺎﺕ ﺍﻟﺠﺪﻭﻝ ﻓﻲ ﻧﻄﺎﻗﺎﺕ ﻣﻘﻄﻊ ﺍﻟﺒﻴﺎﻧﺎﺕ ﺍﻟﺨﺎﺹ ﺑﻪ‬.‫ﺷﺮﺍﺋﺢ ﺍﻟﺒﻴﺎﻧﺎﺕ‬
.‫ﻋﻠﻰ ﻣﻘﻄﻊ ﺑﻴﺎﻧﺎﺕ‬
• Index segments: Each index has an index segment that stores all of its data. For a partitioned
index, each partition has an index segment.
• ‫ ﻳﺤﺘﻮﻱ ﻛﻞ ﻗﺴﻢ ﻋﻠﻰ ﻣﻘﻄﻊ‬، ‫ ﺑﺎﻟﻨﺴﺒﺔ ﻟﻠﻔﻬﺮﺱ ﺍﻟﻤﻘﺴﻢ‬.‫ ﻳﺤﺘﻮﻱ ﻛﻞ ﻓﻬﺮﺱ ﻋﻠﻰ ﻣﻘﻄﻊ ﻓﻬﺮﺱ ﻳﺨﺰﻥ ﺟﻤﻴﻊ ﺑﻴﺎﻧﺎﺗﻪ‬:‫ﻣﻘﺎﻁﻊ ﺍﻟﻔﻬﺮﺱ‬
.‫ﻓﻬﺮﺱ‬
• Undo segments: One UNDO tablespace is created per database instance that contains numerous
undo segments to temporarily store undo information.
• ‫ ﻳﺘﻢ ﺇﻧﺸﺎء ﻣﺴﺎﺣﺔ ﺟﺪﻭﻝ ﻭﺍﺣﺪﺓ ﻟﻠﺘﺮﺍﺟﻊ ﻟﻜﻞ ﻁﺒﻌﺔ ﻗﺎﻋﺪﺓ ﺑﻴﺎﻧﺎﺕ ﺗﺤﺘﻮﻱ ﻋﻠﻰ ﺍﻟﻌﺪﻳﺪ ﻣﻦ ﺃﺟﺰﺍء ﺍﻟﺘﺮﺍﺟﻊ‬:‫ﺗﺮﺍﺟﻊ ﻋﻦ ﺍﻟﺸﺮﺍﺋﺢ‬
‫ﻟﺘﺨﺰﻳﻦ ﻣﻌﻠﻮﻣﺎﺕ ﺍﻟﺘﺮﺍﺟﻊ ﻣﺆﻗﺘًﺎ‬
• The information in an undo segment is used for database recovery and to roll back
uncommitted transactions for users.
• ‫ﻳﺘﻢ ﺍﺳﺘﺨﺪﺍﻡ ﺍﻟﻤﻌﻠﻮﻣﺎﺕ ﺍﻟﻤﻮﺟﻮﺩﺓ ﻓﻲ ﻣﻘﻄﻊ ﺍﻟﺘﺮﺍﺟﻊ ﻻﺳﺘﻌﺎﺩﺓ ﻗﺎﻋﺪﺓ ﺍﻟﺒﻴﺎﻧﺎﺕ ﻭﻟﻠﺘﺮﺍﺟﻊ ﻋﻦ ﺍﻟﻤﻌﺎﻣﻼﺕ ﻏﻴﺮ ﺍﻟﻤﻠﺘﺰﻡ ﺑﻬﺎ‬
.‫ﻟﻠﻤﺴﺘﺨﺪﻣﻴﻦ‬

Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley


• Temporary segments: :‫ﺷﺮﺍﺋﺢ ﻣﺆﻗﺘﺔ‬
• Temporary segments are created by the Oracle database when a Structured query
language statement needs a temporary work area to complete execution.
• ‫ﻳﺘﻢ ﺇﻧﺸﺎء ﺍﻟﻤﻘﺎﻁﻊ ﺍﻟﻤﺆﻗﺘﺔ ﺑﻮﺍﺳﻄﺔ ﻗﺎﻋﺪﺓ ﺍﻟﺒﻴﺎﻧﺎﺕ ﻋﻨﺪﻣﺎ ﻳﺤﺘﺎﺝ ﺑﻴﺎﻥ ﻟﻐﺔ ﺍﻻﺳﺘﻌﻼﻡ ﺍﻟﻤﻬﻴﻜﻞ ﺇﻟﻰ ﻣﻨﻄﻘﺔ ﻋﻤﻞ ﻣﺆﻗﺘﺔ‬
.‫ﻹﻛﻤﺎﻝ ﺍﻟﺘﻨﻔﻴﺬ‬
• When the statement finishes execution, the temporary segment’s extents are returned to
the instance for future use.
• .‫ ﻳﺘﻢ ﺇﺭﺟﺎﻉ ﻧﻄﺎﻗﺎﺕ ﺍﻟﻤﻘﻄﻊ ﺍﻟﻤﺆﻗﺖ ﺇﻟﻰ ﺍﻟﻤﺜﻴﻞ ﻻﺳﺘﺨﺪﺍﻣﻬﺎ ﻓﻲ ﺍﻟﻤﺴﺘﻘﺒﻞ‬، ‫ﻋﻨﺪﻣﺎ ﺗﻨﺘﻬﻲ ﺍﻟﻌﺒﺎﺭﺓ ﻣﻦ ﺍﻟﺘﻨﻔﻴﺬ‬
• Specify a default temporary tablespace for every user. ‫ﺣﺪﺩ ﻣﺴﺎﺣﺔ ﺟﺪﻭﻝ ﺍﻓﺘﺮﺍﺿﻴﺔ ﻣﺆﻗﺘﺔ ﻟﻜﻞ‬
‫ﻣﺴﺘﺨﺪﻡ‬

• The Oracle database dynamically allocates space. When the existing


extents of a segment are full, additional extents are added. Because
extents are allocated as needed, the extents of a segment may or may not
be contiguous on the disk.
• ‫ﺗﻘﻭﻡ ﻗﺎﻋﺩﺓ ﺑﻳﺎﻧﺎﺕ‬Oracle ‫ ﺗﺗﻡ ﺇﺿﺎﻓﺔ ﻧﻁﺎﻗﺎﺕ‬، ‫ ﻋﻧﺩ ﺍﻣﺗﻼء ﺍﻟﻧﻁﺎﻗﺎﺕ ﺍﻟﻣﻭﺟﻭﺩﺓ ﻟﺟﺯء ﻣﺎ‬.‫ﺑﺗﺧﺻﻳﺹ ﺍﻟﻣﺳﺎﺣﺔ ﺩﻳﻧﺎﻣﻳﻛﻳًﺎ‬
.‫ ﻗﺩ ﺗﻛﻭﻥ ﻧﻁﺎﻗﺎﺕ ﺍﻟﻣﻘﻁﻊ ﻣﺗﺟﺎﻭﺭﺓ ﻋﻠﻰ ﺍﻟﻘﺭﺹ ﻭﻗﺩ ﻻ ﺗﻛﻭﻥ ﻛﺫﻟﻙ‬، ‫ﻧﻅﺭﺍ ﻟﺗﺧﺻﻳﺹ ﺍﻟﻧﻁﺎﻗﺎﺕ ﺣﺳﺏ ﺍﻟﺣﺎﺟﺔ‬ ً .‫ﺇﺿﺎﻓﻳﺔ‬

Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley


Tablespaces and Data Files
‫ﻣﺳﺎﺣﺎﺕ ﺍﻟﺟﺩﺍﻭﻝ ﻭﻣﻠﻔﺎﺕ ﺍﻟﺑﻳﺎﻧﺎﺕ‬

– Tablespaces consist of one or more data files. ‫ﺗﺗﻛﻭﻥ ﻣﺳﺎﺣﺎﺕ ﺍﻟﺟﺩﺍﻭﻝ ﻣﻥ ﻣﻠﻑ ﺑﻳﺎﻧﺎﺕ‬
.‫ﻭﺍﺣﺩ ﺃﻭ ﺃﻛﺛﺭ‬
– Data files belong to only one tablespace..‫ﺗﻧﺗﻣﻲ ﻣﻠﻔﺎﺕ ﺍﻟﺑﻳﺎﻧﺎﺕ ﺇﻟﻰ ﻣﺳﺎﺣﺔ ﺟﺩﻭﻝ ﻭﺍﺣﺩﺓ ﻓﻘﻁ‬

Data file 1 Data file 2

USERS tablespace

Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley


Tablespaces and Data Files ‫ﻣﺴﺎﺣﺎﺕ ﺍﻟﺠﺪﺍﻭﻝ ﻭﻣﻠﻔﺎﺕ ﺍﻟﺒﻴﺎﻧﺎﺕ‬
– A database is divided into logical storage units called tablespaces, which can be used to
group related logical structures together.
– ‫ ﻭﺍﻟﺘﻲ ﻳﻤﻜﻦ ﺍﺳﺘﺨﺪﺍﻣﻬﺎ ﻟﺘﺠﻤﻴﻊ ﺍﻟﻬﻴﺎﻛﻞ‬، ‫ﺗﻨﻘﺴﻢ ﻗﺎﻋﺪﺓ ﺍﻟﺒﻴﺎﻧﺎﺕ ﺇﻟﻰ ﻭﺣﺪﺍﺕ ﺗﺨﺰﻳﻦ ﻣﻨﻄﻘﻴﺔ ﺗﺴﻤﻰ ﻣﺴﺎﺣﺎﺕ ﺍﻟﺠﺪﺍﻭﻝ‬
.‫ﺍﻟﻤﻨﻄﻘﻴﺔ ﺫﺍﺕ ﺍﻟﺼﻠﺔ ﻣﻌًﺎ‬
– Each database is logically divided into one or more tablespaces. One or more data files
are explicitly created for each tablespace to physically store the data of all logical
structures in a tablespace.
– ‫ ﻳﺘﻢ ﺇﻧﺸﺎء ﻣﻠﻒ ﺑﻴﺎﻧﺎﺕ ﻭﺍﺣﺪ ﺃﻭ ﺃﻛﺜﺮ ﺑﺸﻜﻞ ﺻﺮﻳﺢ ﻟﻜﻞ ﻣﺴﺎﺣﺔ ﺟﺪﻭﻝ ﻟﺘﺨﺰﻳﻦ ﺑﻴﺎﻧﺎﺕ ﺟﻤﻴﻊ ﺍﻟﻬﻴﺎﻛﻞ ﺍﻟﻤﻨﻄﻘﻴﺔ ﻓﻌﻠﻴًﺎ‬.
.‫ﻓﻲ ﻣﺴﺎﺣﺔ ﺍﻟﺠﺪﻭﻝ‬
– Note: You can also create bigfile tablespaces. These tablespaces can have only a single
file, which is often very large.
– ‫ ﻳﻤﻜﻦ ﺃﻥ ﺗﺤﺘﻮﻱ ﻣﺴﺎﺣﺎﺕ ﺍﻟﺠﺪﺍﻭﻝ ﻫﺬﻩ ﻋﻠﻰ ﻣﻠﻒ ﻭﺍﺣﺪ ﻓﻘﻂ‬.‫ﻀﺎ ﺇﻧﺸﺎء ﻣﺴﺎﺣﺎﺕ ﺟﺪﺍﻭﻝ ﺫﺍﺕ ﻣﻠﻔﺎﺕ ﻛﺒﻴﺮﺓ‬ ً ‫ﻳﻤﻜﻨﻚ ﺃﻳ‬
.‫ﻛﺒﻴﺮﺍ ﺟﺪًﺍ‬
ً ‫ ﻭﺍﻟﺬﻱ ﻏﺎﻟﺒًﺎ ﻣﺎ ﻳﻜﻮﻥ‬،
– The file may be any size up to maximum that the row ID architecture will
permit(Usually in TB size). The traditional smallfile tablespaces (which are the default)
usually contain multiple data files, but the files cannot be as large.
– ‫ ﻟﻜﻦ ﻻ‬، ‫ﻋﺎﺩﺓ ً ﻣﺎ ﺗﺤﺘﻮﻱ ﻣﺴﺎﺣﺎﺕ ﺟﺪﺍﻭﻝ ﺍﻟﻤﻠﻔﺎﺕ ﺍﻟﺼﻐﻴﺮﺓ ﺍﻟﺘﻘﻠﻴﺪﻳﺔ )ﻭﻫﻲ ﺍﻻﻓﺘﺮﺍﺿﻴﺔ( ﻋﻠﻰ ﻣﻠﻔﺎﺕ ﺑﻴﺎﻧﺎﺕ ﻣﺘﻌﺪﺩﺓ‬
.‫ﻳﻤﻜﻦ ﺃﻥ ﺗﻜﻮﻥ ﺍﻟﻤﻠﻔﺎﺕ ﻛﺒﻴﺮﺓ‬

Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley


SYSTEM and SYSAUX

Tablespaces
The SYSTEM and SYSAUX tablespaces are mandatory tablespaces.
– .‫ﻣﺴﺎﺣﺎﺕ ﻁﺎﻭﻻﺕ ﺇﻟﺰﺍﻣﻴﺔ‬
– They are created at the time of database creation..‫ﺗﻢ ﺇﻧﺸﺎﺅﻫﺎ ﻓﻲ ﻭﻗﺖ ﺇﻧﺸﺎء ﻗﺎﻋﺪﺓ ﺍﻟﺒﻴﺎﻧﺎﺕ‬
– The SYSTEM tablespace is used for core functionality (for example, data dictionary
tables)..(‫ ﺟﺪﺍﻭﻝ ﻗﺎﻣﻮﺱ ﺍﻟﺒﻴﺎﻧﺎﺕ‬، ‫ﻳﺘﻢ ﺍﺳﺘﺨﺪﺍﻡ ﻣﺴﺎﺣﺔ ﺟﺪﻭﻝ ﺍﻟﻨﻈﺎﻡ ﻟﻠﻮﻅﺎﺋﻒ ﺍﻷﺳﺎﺳﻴﺔ )ﻋﻠﻰ ﺳﺒﻴﻞ ﺍﻟﻤﺜﺎﻝ‬
– The auxiliary SYSAUX tablespace is used for additional database components (such
as the Enterprise Manager Repository).
– .(‫ﻳﺘﻢ ﺍﺳﺘﺨﺪﺍﻣﻪ ﻟﻤﻜﻮﻧﺎﺕ ﻗﺎﻋﺪﺓ ﺍﻟﺒﻴﺎﻧﺎﺕ ﺍﻹﺿﺎﻓﻴﺔ )ﻣﺜﻞ ﻣﺴﺘﻮﺩﻉ ﻣﺪﻳﺮ ﺍﻟﻤﺆﺳﺴﺔ‬

Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley


SYSTEM and SYSAUX Tablespaces
– Each Oracle database must contain a SYSTEM tablespace and a SYSAUX tablespace. They are
automatically created when the database is created. The system default is to create a smallfile
tablespace. You can also create bigfile tablespaces, which enable the Oracle database to manage
ultralarge files.
– A tablespace can be online (accessible) or offline (not accessible). ‫ﻳﻤﻜﻦ ﺃﻥ ﺗﻜﻮﻥ ﻣﺴﺎﺣﺔ ﺍﻟﺠﺪﻭﻝ ﻋﺒﺮ‬
.(‫ﺍﻹﻧﺘﺮﻧﺖ )ﻳﻤﻜﻦ ﺍﻟﻮﺻﻮﻝ ﺇﻟﻴﻬﺎ( ﺃﻭ ﻏﻴﺮ ﻣﺘﺼﻠﺔ )ﻻ ﻳﻤﻜﻦ ﺍﻟﻮﺻﻮﻝ ﺇﻟﻴﻬﺎ‬
– The SYSTEM tablespace is always online when the database is open.
– .‫ﺗﻜﻮﻥ ﻣﺴﺎﺣﺔ ﺟﺪﺍﻭﻝ ﺍﻟﻨﻈﺎﻡ ﻣﺘﺼﻠﺔ ﺑﺎﻹﻧﺘﺮﻧﺖ ﺩﺍﺋ ًﻤﺎ ﻋﻨﺪﻣﺎ ﺗﻜﻮﻥ ﻗﺎﻋﺪﺓ ﺍﻟﺒﻴﺎﻧﺎﺕ ﻣﻔﺘﻮﺣﺔ‬
– It stores tables that support the core functionality of the database, such as the data dictionary
tables.
– .‫ ﻣﺜﻞ ﺟﺪﺍﻭﻝ ﻗﺎﻣﻮﺱ ﺍﻟﺒﻴﺎﻧﺎﺕ‬، ‫ﻳﺨﺰﻥ ﺍﻟﺠﺪﺍﻭﻝ ﺍﻟﺘﻲ ﺗﺪﻋﻢ ﺍﻟﻮﻅﺎﺋﻒ ﺍﻷﺳﺎﺳﻴﺔ ﻟﻘﺎﻋﺪﺓ ﺍﻟﺒﻴﺎﻧﺎﺕ‬
– The SYSAUX tablespace is an auxiliary tablespace to the SYSTEM tablespace. The SYSAUX
tablespace stores many database components, and it must be online for the correct functioning of
all database components.
– .‫ﻳﺠﺐ ﺃﻥ ﻳﻜﻮﻥ ﻣﺘﺼﻼً ﺑﺎﻹﻧﺘﺮﻧﺖ ﻣﻦ ﺃﺟﻞ ﺍﻷﺩﺍء ﺍﻟﺼﺤﻴﺢ ﻟﺠﻤﻴﻊ ﻣﻜﻮﻧﺎﺕ ﻗﺎﻋﺪﺓ ﺍﻟﺒﻴﺎﻧﺎﺕ‬
– Note: The SYSAUX tablespace may be taken offline to do tablespace recovery,
– may be taken offline to do tablespace recovery,
– whereas this is not possible for SYSTEM tablespace.

Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley


Segments, Extents, and Blocks
– Segments exist within a tablespace..‫ﺗﻭﺟﺩ ﺍﻟﺷﺭﺍﺋﺢ ﺩﺍﺧﻝ ﻣﺳﺎﺣﺔ ﺟﺩﻭﻝ‬
– Segments are made up of a collection of extents. ‫ﺗﺗﻛﻭﻥ ﺍﻟﻣﻘﺎﻁﻊ ﻣﻥ ﻣﺟﻣﻭﻋﺔ ﻣﻥ‬
.‫ﺍﻟﻧﻁﺎﻗﺎﺕ‬
– Extents are a collection of data blocks. .‫ﺍﻟﻧﻁﺎﻗﺎﺕ ﻋﺑﺎﺭﺓ ﻋﻥ ﻣﺟﻣﻭﻋﺔ ﻣﻥ ﻛﺗﻝ ﺍﻟﺑﻳﺎﻧﺎﺕ‬
– Data blocks are mapped to disk blocks. .‫ﻳﺗﻡ ﺗﻌﻳﻳﻥ ﻛﺗﻝ ﺍﻟﺑﻳﺎﻧﺎﺕ ﺇﻟﻰ ﻛﺗﻝ ﺍﻟﻘﺭﺹ‬

Segment Extents Data Disk blocks


blocks

Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley


Segments, Extents, and Blocks
– Database objects, such as tables and indexes, are stored as segments in tablespaces.
– ‫ ﻋﻠﻰ ﻫﻴﺌﺔ ﺷﺮﺍﺋﺢ ﻓﻲ ﻣﺴﺎﺣﺎﺕ ﺍﻟﺠﺪﺍﻭﻝ‬، ‫ ﻣﺜﻞ ﺍﻟﺠﺪﺍﻭﻝ ﻭﺍﻟﻔﻬﺎﺭﺱ‬، ‫ﻳﺘﻢ ﺗﺨﺰﻳﻦ ﻛﺎﺋﻨﺎﺕ ﻗﺎﻋﺪﺓ ﺍﻟﺒﻴﺎﻧﺎﺕ‬
– Each segment contains one or more extents. An extent consists of contiguous data
blocks, which means that each extent can exist only in one data file.
– ‫ ﻣﻤﺎ ﻳﻌﻨﻲ ﺃﻥ ﻛﻞ ﻣﺪﻯ‬، ‫ ﻳﺘﻜﻮﻥ ﺍﻟﻤﺪﻯ ﻣﻦ ﻛﺘﻞ ﺑﻴﺎﻧﺎﺕ ﻣﺘﺠﺎﻭﺭﺓ‬.‫ﻳﺤﺘﻮﻱ ﻛﻞ ﻣﻘﻄﻊ ﻋﻠﻰ ﻭﺍﺣﺪ ﺃﻭ ﺃﻛﺜﺮ ﻣﻦ ﺍﻟﻨﻄﺎﻗﺎﺕ‬
.‫ﻳﻤﻜﻦ ﺃﻥ ﻳﻮﺟﺪ ﻓﻘﻂ ﻓﻲ ﻣﻠﻒ ﺑﻴﺎﻧﺎﺕ ﻭﺍﺣﺪ‬
– Data blocks are the smallest unit of I/O in the database.
– .‫ ﺍﻹﺧﺮﺍﺝ ﻓﻲ ﻗﺎﻋﺪﺓ ﺍﻟﺒﻴﺎﻧﺎﺕ‬/ ‫ﻛﺘﻞ ﺍﻟﺒﻴﺎﻧﺎﺕ ﻫﻲ ﺃﺻﻐﺮ ﻭﺣﺪﺓ ﺍﻹﺩﺧﺎﻝ‬
– When the database requests a set of data blocks from the operating system (OS), the OS
maps this to an actual file system or disk block on the storage device. Because of this,
you need not know the physical address of any of the data in your database. This also
means that a data file can be striped or mirrored on several disks.

Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley


– The size of the data block is defined by the DB_BLOCK_SIZE
parameter.
– The default size of 8 KB is adequate for most databases.
– If your database supports a data warehouse application that has
large tables and indexes, then a larger block size may be
beneficial.
– If your database supports a transactional application where
reads and writes are random, then specifying a smaller block
size may be beneficial. The maximum block size depends on
your OS.

Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley


Database Architecture:
Summary of Structural Components

– Memory structures:
• System Global Area (SGA): Database buffer cache, redo
buffer, and various pools
• Program Global Area (PGA)
– Process structures:
• User process and server process
• Background processes: SMON, PMON, DBWn, CKPT,
LGWR, ARCn, and so on
– Storage structures:
• Logical: Database, schema, tablespace, segment, extent,
and Oracle block
• Physical: data files, control files, and redo log files

Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley


Summary
• If the environment where the DBMS must operate is not
performing efficiently, it is impossible for the DBMS, and
indeed any database access, to perform efficiently.
• The DBA needs to understand every DBMS configuration
value and the impact it can have on the overall
performance of the system.
• Furthermore, the DBA must control the integration of the
DBMS with the hardware on which the DBMS runs and any
allied agent software.

Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley

You might also like