Kết nối tới database• Connection: là sự giao tiếp giữa một user process và một database.. • Session: là kết nối cụ thể của một user tới một database thông qua một user process... Kiến t
Trang 1Oracle Architecture
Trang 2Kết nối tới database
• Connection: là sự giao tiếp giữa một user process và một database.
• Session: là kết nối cụ thể của một user tới một database thông qua một user
process
Trang 3Kiến trúc Oracle Database Server
Trang 4Kiến trúc bộ nhớ (memory structures)
Trang 5Kiến trúc bộ nhớ trong SGA
– Được cấp phát lúc khởi động instance và giải phóng khi tắt instance.
– Được chia sẻ bởi tất cả server process và background process.
Trang 6The Database Buffer Cache
• Được chia sẻ bởi tất cả users
Trang 7The Log Buffer
lệnh DML)
Trang 8The Shared Pool
Trang 9The Library Cache
nhất, dưới hình thức đã được phân tích cú pháp.
nhằm nâng cao hiệu suất
Trang 10The Data Dictionary Cache
user và metadata
Trang 12The SQL Query and PL/SQL Function Result Cache
• Giá trị trả về được cache, sẵn sàng cho lần chạy tiếp theo
Trang 13The Large Pool
– Bộ nhớ phiên làm việc (session memory) cho multi-threaded server và Oracle XA interface.
– I/O server processes
– Oracle backup and restore operations
Trang 14The Java Pool và The Streams Pool
trong database
Trang 15Process Structures
Trang 16DBWn, the Database Writer
• Ghi những dữ liệu đã bị thay đổi (dirty) trong database buffer cache vào ổ đĩa (disk)
– buffer đầy dữ liệu.
– Quá nhiều dữ liệu đã bị thay đổi.
– Hết 3 giây.
– Có một checkpoint
Trang 17LGWR, the Log Writer
• Ghi nội dung của log buffer vào online redo log file
– Khi một user process commit một transaction.
– Khi redo log buffer đầy 1/3.
– Trước khi DBWn process ghi những dữ liệu thay đổi vào ổ đĩa.
Trang 18SMON, the System Monitor
• Hợp nhất những extents trống (free) liền nhau trong từ điển dữ liệu (từ điển quản
lý table space)
Trang 19PMON, the Process Monitor
process đang dùng
• Đăng ký thông tin về instance và dispatcher process với network listener
Trang 20CKPT, the Checkpoint Process
• Chịu trách nhiệm trong việc ghi lại địa chỉ của redo byte hiện tại
Trang 21ARCn, the Archiver
• Copy redo log file vào một thiết bị lưu trữ nào đó sau khi log switch xảy ra
Trang 22Database Storage Structures
Trang 23Physical Storage Structures
Trang 24Datafiles
Trang 25Control Files
– Tên database.
– Tên và vị trí của datafile và redo log file.
– Các số thứ tự quan trọng khác nhau (sequence number) và nhãn thời gian.
Trang 26The Online Redo Log Files
Trang 27Other Database Files
• Alert log and trace files
Trang 28The Logical Database Structures
• Oracle abstracts the logical from the physical storage by means of the tablespace
Trang 29The Data Dictionary
• contains metadata that describes the database: both physically and logically, and its contents
• Contains user definitions, security information, integrity constraints, performance
monitoring information
Trang 30The Data Dictionary
Trang 31The Data Dictionary
• To find the list of tables in current schema that have the column “EMPLOYEE_NUMBER”
• To find the list of tables in schema accessible to the current user that have the column
“EMPLOYEE_NUMBER”
• To find the list of tables across schemas that have the column “EMPLOYEE_NUMBER”
SELECT * FROM user_tab_columns WHERE column_name = 'EMPLOYEE_NUMBER'
SELECT * FROM all_tab_columns WHERE column_name = 'EMPLOYEE_NUMBER'
SELECT * FROM dba_tab_columns WHERE column_name = 'EMPLOYEE_NUMBER'
Trang 32The Data Dictionary
• DICT (short for DICTIONARY) – View of All Views: SELECT * FROM
DICT
DBA_TAB_COLS Columns of user’s tables, views and clusters
DBA_OBJECT_TABLES Description of all object tables in the database
DBA_ALL_TABLES Description of all object and relational tables in the database
DBA_TABLES Description of all relational tables in the database
DBA_TAB_COLUMNS Columns of user’s tables, views and clusters
DBA_TAB_COMMENTS Comments on all tables and views in the database
DBA_TAB_PRIVS All grants on objects in the database
DBA_VIEWS Description of all views in the database