Вы находитесь на странице: 1из 20

Data Objects ----? Number of databases Parameter---?

SYSTEM TABLES SYSDATABASES & SYSUSAGES Types of Databases

Master DB stores information regarding all other databases, Logins, Devices, etc. It keeps track of all the databases. It has nearly 32 system tables. Some of them are syslogins, sysdb, sysdevices,sysroles, sysprocess, etc. Server wide details are stored in here. It is the heart of the Server. Model DB Is the template for all the databases, excluding the Master. Temp DB can be referred as a workspace for the users to perform operations. Itis a volatile memory, so whenever the server is rebooted, it has to be recreated using the template from Model DB SYBSYSTEMPROCS DB stores all the system procedures

DATA

TABLE

EXTENT

PAGES 2K,4K,16K

0 8

1 9

2 10

3 11 . . .

4 12

5 13

6 14

7 15

248

249 0 0-7 0 - 255

250

251

252

253

254

255

ALLOCATION PAGE EXTENT ALLOCATION UNIT

GLOBAL ALLOCATION MAP - GAM AU1 AU2 . .. .

. . ALLOCTION UNIT (AU1) AP OAM

. ..

. .. AU n ALLOCTION UNIT (AU2) AP OAM

DATABASE

ADPATIVE SERVER

DEVICE [DISK] DATABASE

DATABASE

DEVICE

SEGMENTS

PHYSICAL NAME

ALLOCATION UNIT

LOGICAL NAME
EXTENTS

PAGES

SEGEMENTS

SYSTEM

USER

*SYSTEM *LOG *DEFAULT

MAX 32SEGMENTS CAN BE CREATED INCLUDING 3 SYSTEM S SEGMENTS

SYSTEM- system tables for a particular database LOG- All data modifications in the database are temporarily
stored temporary in the log

DEFAULT- User created data objects


that stores information about segments & DB size

SYSSEGMENTS & SYSUSAGES are SYSTEM TABLES


sp_addsegments To add the segments to the database.

bcp --- take a backup copy of the objects and then copy them back to new segment clustered index --- By recreating a clustered index for the object on new object sp_placeobject --- It moves the next coming up objects to the new segment

Why indexes are needed ..?? What is HOT SPOT & HEAP TABLE .?? Now if we don t have Indexes in DB then .?? Types of Indexes ??
Format - Root page, Intermediate, Data/Leaf Pages SYSINDEXES table

KEY ABC DEF GHI

POINTER 1111 2222 3333

SELECT

STATEMENT

KEY APPLE MAC JIM

POINTER 1110 1112 1113

KEY ABC DEF GHI ROOT PAGE

POINTER 4444 5555 6666

DATA/LEAF PAGE

INTERMEDIATE

1) 2) 3)

When ever a query is executed it is executed in three phases. Parser -- > checks for the syntactical errors Compiler -- > checks for the query plan in data cache Execute -- > checks for the result in the data cache

During the phases of execution, the single process can change to various states depending on the availability of the i/o, query plan, data, etc. Below are mentioned the possible states of a process.

During the execution of a query, it goes through many phases, which can result as a HIT or a MISS depending on the availability of the data in the cache The below diagrams clearly explain the steps involved during HIT or MISS

STATUS Sleeping

CONDITION
Waiting disk I/O, or some other resource. Probably indicates a process that is running, but doing extensive disk I/O In the queue of runnable processes Actively running on one on the Server engines

Runnable Running

Вам также может понравиться