Sei sulla pagina 1di 5

Database Past Paper 2014 Long Questions

Q1: Explain the Working of query in shared server Configuration with diagram?
Ans:
Q2: Differentiate between immediate and deffered Constraints?
Ans:
Immediate Deffered
Also known as Non-Deferred Constraints, are Deferred constraints are constraints that are
enforced at the end of every DML statement. checked only when a transaction is committed.
Not Occur at DML back to the database
A constraint violation causes the statement to be If any constraint violations are detected at
rolled back. commit time, the entire transaction is rolled
back.

If a constraint causes an action such as delete These constraints are most useful when both the
cascade. parent and child rows in a foreign key
relationship are entered at the same time, as in
the case of an order entry system, where the
order and the items in the order are entered at
the same time.

A constraint that is defined as nondeferrable A constraint that is defined as deferrable can be


cannot be modified to be enforced at the end of specified as one of the following:
a transaction.  Initially immediate specifies that by
default it should function as an
immediate constraint, unless explicitly
set otherwise
 Initially deferred specifies that by default
the constraint should only be enforced at
the end of the transaction

Q3: Give a comparison of B-tree Index and Bitmap Index?


Ans:
Comparing B-Tree and Bitmap Indexes

 Bitmap indexes are more compact than B-tree indexes when used with low-cardinality columns.
 Updates to key columns in a bitmap index are more expensive because bitmaps use bitmap-
segment-level locking, whereas in a B-tree index, locks are on entries corresponding to
individual rows of the table.
 Bitmap indexes can be used to perform operations such as bitmap Boolean. The Oracle server
can use two bitmap segments to perform a bitwise Boolean and get a resulting bitmap. This
allows efficient use of bitmaps in queries that use the Boolean predicate.
 In summary, B-tree indexes may be more suitable in an OLTP environment for indexing dynamic
tables, whereas bitmap indexes may be useful in data warehouse environments where complex
queries are used on large, static tables.

Q4: How to multiplex a control file when using spfile?


Ans:
Q5: Explain Row Structure with diagram?
Ans:

Structure of a Row:

Row data is stored in database blocks as variable-length records. Columns for a row
are generally stored in the order in which they are defined and any trailing NULL columns are not stored.
Note: A single byte for column length is required for non-trailing NULL columns.

Each row in a table has:

 Row header: Used to store the number of columns in the row, the chaining information, and the
row lock status
 Row data: For each column, the Oracle server stores the column length and value (One byte is
needed to store the column length if the column will require more than 250 bytes of storage in
which case three bytes will be used for column length. The column value is stored immediately
following the column length bytes.) Adjacent rows do not need any space between them. Each
row in the block has a slot in the row directory. The directory slot points to the beginning of the
row.

Q6: Create a Temporary Tablespace and made it default temporary Tablespace.


Ans:
SQL> Create temporary tablespace temp1 TEMPFILE

‘ $HOME/oradata/orcl/temp01.dbf ’ size 50M

Autoextend on next 5M maxsize unlimited;

SQL> Alter database default temporary Tablespace temp1;

Potrebbero piacerti anche