lec exam Flashcards
What are the most important files (file types) in an Oracle database?
parameter file, password file, backup files, archive log files.
Give the most important memory structures of an Oracle instance.
? data dictionary cache, server result cache, response queue, request queue
Give the most important processes of an Oracle instance
? PMON, RMON, RECO, MMON etc.
List 5 data dictionary views in an Oracle database.
dba views dba objects dba tables dba synonyms dba indexes dba_tab_columns
List 10 different schema objects in an Oracle database?
Clusters
Database links
Database triggers
Dimensions
External procedure libraries
Indexes and index types
Java classes, Java resources, and Java sources
Materialized views and materialized view logs
Object tables, object types, and object views
Operators
Sequences
Stored functions, procedures, and packages
Synonyms
Tables and index-organized tables
Views
What is a sequence in an Oracle database? Give SQL examples for the creation and usage.
A sequence is a mechanism for automatically generating integers that follow a pattern.
creation:
CREATE SEQUENCE seq1
MINVALUE 1 MAXVALUE 100 INCREMENT BY 5
START WITH 50 CYCLE;
SELECT * FROM DBA_SEQUENCES
WHERE sequence_name=’SEQ1’;
usage:
INSERT INTO dept VALUES(seq1.NEXTVAL, ‘IT’, ‘Budapest’);
Give the data storage concepts (segment, extent etc.) in an Oracle database, and draw the relationships among them.
https://imgur.com/a/g7b6E9K
Describe RAID level 0, 1, 2, 3, 4, 5, 6 technology.
RAID 0 (also known as a stripe set or striped volume) splits (“stripes”) data evenly across two or more disks, without parity information, redundancy, or fault tolerance.
RAID 1 consists of an exact copy (or mirror) of a set of data on two or more disks; a classic RAID 1 mirrored pair contains two disks.
RAID 2, which is rarely used in practice, stripes data at the bit (rather than block) level, and uses a Hamming code for error correction.
RAID 3, which is rarely used in practice, consists of byte-level striping with a dedicated parity disk.
RAID 4 consists of block-level striping with a dedicated parity disk.
RAID 5 consists of block-level striping with distributed parity.
RAID 6 extends RAID 5 by adding another parity block; thus, it uses block-level striping with two parity blocks distributed across all member disks.
What does it mean: spanned vs unspanned record? Draw example data blocks for both.
?
Give 3 sequencing options for records.
Next record physically contiguous, linked, overflow area
Describe the difference between row store and column store. Give example records for both.
In row storing fields of a record are stored contiguously but in column storing fields are stored together(in a column)
What is the difference between a sparse index and a dense index?
A dense index has an index entry for every search key value in the data file. A sparse index, on the other hand, has index entries for only some of the search values
What is the difference between a primary index and secondary index?
Primary index is defined on an ordered data file. The data file is ordered on a key field. The key field is generally the primary key of the relation.
Secondary index may be generated from a field which is a candidate key and has a unique value in every record, or a non-key with duplicate values.
What is a clustering index?
Clustering index is defined on an ordered data file. The data file is ordered on a non-key field. It includes one index entry for each distinct value of the field; the index entry points to the first data block that contains records with that field value. It is an example of non-dense index where Insertion and Deletion is relatively straightforward with a clustering index.
What is the difference between a B-tree and a B+ tree?
A B+ tree only stores data in the leaf nodes but a B- tree stores data in the interior nodes as well
What is a bitmap index? What are there in the leaf nodes?
A bitmap index is a special kind of database index that uses bitmaps. A leaf node is made up of the following components:
An entry header, which stores the number of columns and locking information
Key column length-value pairs, which define the size of a column in the key followed by the value for the column (The number of such pairs is a maximum of the number of columns in the index.)
ROWID of a row that contains the key values
What is dynamic hashing?
Dynamic hashing is a method of hashing, or shortening a string of characters in computer programming, where the set of shortened characters grows, shrinks, and reorganizes to fit the way the data is being accessed.
What is the most important cost factor in query execution?
? Disk I/Os
Give the meaning of the following notations that we use in cost estimation: T(R), B(R), bf(R), V(R,A), SC(R,A).
T(R): number of records in R
B(R): number of pages to store relation R
bf(R): blocking factor
V(R,A): number of distinct values of attribute A in R
SC(R,A): selection cardinality of A in R
What is the average cost of a selection operation (“sigma”A=xR) if we use a clustered B+ tree index?
in case of single record/multiple record
single record: HTi + 1
multiple records: HTi + ceil( SC(R,A)/bfR )
What is the average cost of a selection operation (“sigma”A=xR) if we use a secondary B+ tree index?
in case of key field/nonkey filed
key field: HTi + 1
nonkey field: HTi + SC(A,R)
Describe the external Sort-Merge algorithm. What is the cost of it?
The external merge sort is a technique in which the data is stored in intermediate files and then each intermediate files are sorted independently and then combined or merged to get a sorted data.
https://imgur.com/a/Ek4Deb3
What is the cost of a Nested Loop join algorithm? (best case/worst case)
best case: B(R)+B(S)
worst case: T(R) * B(S) + B(R)
What is the cost of a Block Nested Loop join algorithm? (best case/worst case)
best case: B(R)+B(S)
worst case: B(R) * B(S) + B(R)
What is the cost of the improved Block Nested Loop join algorithm?
best case: B(R)+B(S) general case (B(R) / (M-1)) * B(S) + B(R)
Describe the Indexed Nested Loop join algorithm? What is the cost of it?
B(R) + T(R) * c
c~=T(s)/V(s,A)
Describe the Sort-merge join algorithm. What is the cost of it?
cost of sorting + B(S) + B(R)
Describe the Hash-join algorithm? What is the cost of it?
2*(B(R)+B(S)) + (BR()+B(S))
What is materialization and pipelining?
Materialization: one operation at a time, materialize intermediate results for subsequent use
Pipeline: evaluate several operations simultaneously, no need to store
temporary results
Give some basic relational algebra expression equivalence rules Conjunctive selection decomposition Distribution of selection over join Distribution of projection over join Associativity of joins, products, union
https://imgur.com/a/uFVDigk
Give the meaning of the following index options:
composite index
function-based index
compressed index
A composite index is an index on multiple columns.
?
?
What is a partitioned table?
Table partitioning is a way to divide a large table into smaller, more manageable parts without having to create separate tables for each part.
List the partitioning types an Oracle database supports
Range, hash, list partitioning.
Give the properties of an Index-Organized Table
An IOT(index organized table) must contain a primary key.
Rows are accessed via a logical rowid and not a physical rowid like in heap-organized tables.
An IOT cannot be in a cluster.
An IOT cannot contain a column of LONG data type.
You cannot modify an IOT index property using ALTER INDEX (error ORA-25176), you must use an ALTER TABLE instead.