exploring SQL and file systems Flashcards

1
Q

What is SQL Physical Architecture?

A

Tells about how the data is actually stored in file system of an operating system.
Page, extent, database files, transaction log etc. are core components of physical architecture

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is logical architecture?

A

Tells how data is logically grouped and presented to the user.
eg: Tables, constraints, views, stored procedures, triggers etc. are core components of logical architecture

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are examples of Physical data structure components?

A
Page
extent
table
index
database files
database file group
transaction log file
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What are File groups?

A

collections of files and are used to help with data placement and administrative tasks such as backup and restore operations.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

SQL Server maps a _______over a set of operating-system files.

A

database

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Data and log information are _____ mixed in the same file, and individual files are used only by _____ database(s).

A

never, one

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What do read only files help to reduce?

A

reduce the number of backups

by not backing up read only files due to not modifying

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

what is the typical log file extension?

A

.ldf

these are not apart of file groups

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What are the three types of SQL file types?

A

Primary database files
Secondary database files
Transaction log files

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Databases have two different file names. They are:

A

Logical file names

OS file names

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What are logical file names?

A

Used in T-SQL to refer to a physical file

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What are OS file names?

A

full name; folder path and physical file

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What are primary database files?

A

-contains startup info for the database
- every database has one primary data file
file name extension : .mdf
-user data and objects stored here or in secondary

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

what are secondary database files?

A

files that are optional, user-defined, and store user data

  • can be used to spread data across multiple disks, by putting each file on a different drive
  • file name extension- .ndf
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What are transaction log files?

A

holds log info that is used to recover the database

  • must be at least one log file for each database
  • file name extension .ldf
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

4 steps for modifying a file in a database

A
  1. runs a query to modify row in table
  2. change is recorded in transaction log
  3. query returns
  4. change is recorded in data file
17
Q

What are pages in a database

A

fundamental unit of storage
8kb per page
96 byte header
contains header and body (body=data rows)

18
Q

What is included in a page header?

A

Stores system info

- page number, page type, amount of free space, allocation unit ID pf the object that owns the page

19
Q

What are slot arrays?

A

Slot arrays indicate the logical order of the data row on the page

20
Q

What are different page types?

A
Data
index
text/image
page free space
index allocation map
globally allocated map
etc.
21
Q

What are extents?

A

Basic unit in which space is managed

  • 8 physically contiguous pages
  • 16 extents per megabyte
  • New tables are usually mixed extents until allocated space is full.
22
Q

Uniform extents are?

A

owned by a single objects

-all 8 pages in the extent can only be owned by one object

23
Q

mixed extents

A
  • share by up to 8 objects

each page can be owned by a different object

24
Q

What is the difference between log and database files

A

-database system is comprised of both
- all transactions write to log file immediately
pages are read from database memory
modified when needed.