You are on page 1of 4

Data Ware Housing

Assignment # 3

Submitted By:
Rao Waqas Akram
FA16-BSE-077

Submitted To:

Dr. M. Shoaib

COMSATS University Islamabad, Sahiwal Campus


1.Snapshots
A database snapshot is a read-only, static view of a SQL Server database (the source database).
The database snapshot is transitionally consistent with the source database as of the moment of
the snapshot's creation. A database snapshot always resides on the same server instance as its
source database. While database snapshots provide a read-only view of the data in the same state
as when the snapshot was created.

Database snapshots operate at the data-page level. Before a page of the source database is
modified for the first time, the original page is copied from the source database to the snapshot.
The snapshot stores the original page, preserving the data records as they existed when the
snapshot was created. The same process is repeated for every page that is being modified for the
first time. To the user, a database snapshot appears never to change, because read operations on a
database snapshot always access the original data pages, regardless of where they reside.

Figure 1 Storage Mechanism

1
Benefits of Snapshot
 Snapshots can be used for reporting purposes.

Clients can query a database snapshot, which makes it useful for writing reports based on
the data at the time of snapshot creation.

 Maintaining historical data for report generation.

A snapshot can extend user access to data from a particular point in time. For example, you
can create a database snapshot at the end of a given time period (such as a financial
quarter) for later reporting. You can then run end-of-period reports on the snapshot. If disk
space permits, you can also maintain end-of-period snapshots indefinitely, allowing queries
against the results from these periods; for example, to investigate organizational
performance.

2.VARRAYs
VARRAYs which is an acronym of Variable Sized Arrays were introduced in Oracle 8i back in
1998 as a modified format of nested tables. The major modifications can be seen in storage
orientation. There are no noticeable changes in the implementation but their storage orientation is
completely different compared to the nested tables.

Unlike nested table which requires an external table for its storage, VARRAYs are stored in-line
with their parent record as raw value in the parent table. It means no more need for STORE AS
clause. Similar to Nested Tables VARRAYs are Persistent type of Collection which means they
can be created as database object that can be saved for later use. VARRAYs can also be created
as member of PL/SQL Blocks. The scope of the VARRAY which is declared inside a PL/SQL
block is limited to the block in which it is created.

Unlike Nested table VARRAYs are bounded form of collection. By bounded I mean, you have to
decide how many elements you want to store in your collection while declaring it. Whereas in
nested table which is unbounded type of collection there is no upper cap on number of elements.

2
3.Materialized View
Materialized views are also the logical view of our data-driven by the select query but the result
of the query will get stored in the table or disk, also the definition of the query will also store in
the database. It is the redefined version of the Snapshot

When we see the performance of Materialized view it is better than normal View because the
data of materialized view will be stored in table and table may be indexed so faster for joining
also joining is done at the time of materialized views refresh time so no need to every time fire
join statement as in case of view.

You might also like