SQL Server Administration: Backup, Recovery, Indexing, Transactions & Security

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/70

encourage image

There's no tags or description

Looks like no tags are added yet.

71 Terms

1
New cards

Full backup

A complete copy of the database (data plus enough log to recover it); the base for all other backups

2
New cards

Differential backup

All data pages changed since the last full backup

3
New cards

Transaction log backup

A backup of the log records since the last log backup; enables point-in-time recovery and truncates the log (FULL/BULK_LOGGED models)

4
New cards

Simple recovery model

Recovery model where log auto-truncates, no log backups, no point-in-time restore

5
New cards

Full recovery model

Recovery model where all transactions fully logged, point-in-time restore with log backups

6
New cards

Bulk-logged recovery model

Recovery model with minimal logging for bulk operations

7
New cards

Restore with no recovery

Restore with _____ leaves the DB in a restoring state so more backups can be applied

8
New cards

Restore with recovery

Restore with _____ brings the DB online

9
New cards

RPO (recovery point objective)

Max acceptable data loss, measured in time

10
New cards

RTO (recovery time objective)

Max acceptable downtime

11
New cards

High availability

Minimizes downtime from local failures, e.g. Failover Cluster or Always On AG

12
New cards

Disaster recovery

Restores service after a major loss, e.g. a site outage, using offsite backups, log shipping or an async replica

13
New cards

Always on availability groups

HA/DR feature that replicates a set of databases from a primary replica to one or more secondary replicas, with automatic or manual failover; secondaries can be readable

14
New cards

Failover cluster instance

A SQL Server instance installed across multiple nodes of a Windows cluster that uses shared storage; if one node fails, the instance restarts on another

15
New cards

Log shipping

Automatically backing up the log, copying it to a secondary server and restoring it there on a schedule; a simple DR solution with manual failover

16
New cards

Clustered index

Index that defines the physical order of table data (one per table, the leaf level is the data); created by default by primary keys

17
New cards

Nonclustered index

Index with a separate structure with key values plus a pointer back to the row (many per table)

18
New cards

Reorganize

Index fragmentation: lighter, online, defragments leaf pages in place (roughly 5-30% fragmentation)

19
New cards

Rebuild

Index fragmentation: drops and recreates the index, updates statistics (roughly >30%)

20
New cards

Statistics

Metadata about data distribution in columns and indexes that the query optimizer uses to estimate row counts and pick an execution plan

21
New cards

Execution plan

The optimizer's chosen strategy for running a query: which indexes, join types and operators it uses; read it to spot scans, key lookups and costly operators

22
New cards

Blocking

One session waits for locks held by another and resolves when the holder finishes

23
New cards

Deadlock

Two sessions each hold a lock the other needs, so SQL Server kills one as the 'victim'

24
New cards

ACID

Atomicity, Consistency, Isolation, Durability: the properties that make database transactions reliable

25
New cards

Atomicity

A transaction is treated as a single, indivisible unit; either every operation inside the transaction succeeds, or the entire transaction is rolled back (undone) with zero partial changes saved to the database.

26
New cards

Consistency

A transaction takes the database from one valid state to another, strictly obeying all predefined rules, constraints, foreign keys, and triggers; if any rule is violated, the transaction is canceled and the data is reverted.

27
New cards

Isolation

Concurrent transactions run independently without interfering with one another; the intermediate, unfinished changes of one transaction remain invisible to others until that transaction is officially committed

28
New cards

Durability

Once a transaction is committed, its changes are permanently saved—typically written to non-volatile memory or a write-ahead log; if the server crashes or loses power immediately afterward, the data remains intact upon reboot

29
New cards

Transaction isolation levels

Control how much a transaction sees of other transactions' changes. READ COMMITTED is the default; READ UNCOMMITTED allows dirty reads (NOLOCK); SNAPSHOT / RCSI uses row versioning in tempdb so readers don't block writers

30
New cards

Stored procedure

Can modify data, return multiple result sets and use output parameters, called with EXEC

31
New cards

User-defined function

Must return a value (scalar or table), can be used inside queries, and cannot modify data

32
New cards

Login

A server-level principal that authenticates to the instance (Windows or SQL auth)

33
New cards

User

A database-level principal mapped to a login that gets permissions in that database

34
New cards

Principle of least privilege

Grant only the minimum permissions needed, using roles (db_datareader, db_datawriter, custom roles) and Windows authentication/AD groups where possible; also consider TDE for data at rest, encrypted backups, and auditing

35
New cards

SQL Server Agent

The service that schedules and runs jobs (backups, index maintenance, SSIS packages, T-SQL scripts), with alerts and operator notifications

36
New cards

SSIS (SQL Server Integration Services)

An ETL (extract, transform, load) platform for building packages that move and transform data between sources and destinations; deployed to the SSIS catalog and often run via SQL Agent jobs

37
New cards

INNER JOIN

Join matching rows in both tables

38
New cards

LEFT JOIN

Join every left row plus matches, unmatched right columns are NULL

39
New cards

RIGHT JOIN

Join every right row plus matches, unmatched left columns are NULL

40
New cards

FULL OUTER JOIN

Join all rows from both, matched where possible, NULL-filled otherwise

41
New cards

WHERE

Filters individual rows before grouping and aggregation

42
New cards

HAVING

Filters groups after grouping and aggregation

43
New cards

Primary key

Uniquely identifies each row and can't be NULL

44
New cards

Foreign key

Enforces a relationship to a key in another table (referential integrity)

45
New cards

Composite key

Made of multiple columns, e.g. (characterid, abilityid) in a junction table

46
New cards

Aggregate functions

Functions like COUNT, SUM, AVG, MIN, MAX that calculate one value over a set of rows

47
New cards

GROUP BY

Combines rows with the same grouping values so aggregates are computed per group

48
New cards

UNION

Combines results and removes duplicate rows

49
New cards

UNION ALL

Keeps duplicates and is generally faster because it skips duplicate elimination

50
New cards

DELETE

Removes selected rows (optional WHERE, can fire delete triggers)

51
New cards

TRUNCATE

Removes all rows efficiently (no WHERE, generally less logging, restrictions like foreign-key references)

52
New cards

DROP

Removes the table definition and its data

53
New cards

NULL

A missing, unknown, or inapplicable value

54
New cards

COALESCE

Returns the first non-NULL expression in a list (standard SQL)

55
New cards

ISNULL

The SQL Server-specific two-argument version of COALESCE()

56
New cards

View

Named query that behaves like a virtual table (a regular view stores its definition, not result data)

57
New cards

Normalization

Organizing data into related tables to reduce duplication and prevent update anomalies

58
New cards

1NF

Single values, no repeating groups

59
New cards

2NF

1NF plus non-key columns depend on the whole key

60
New cards

3NF

2NF plus no transitive dependencies

61
New cards

BEGIN TRANSACTION

Starts a transaction

62
New cards

COMMIT

Makes changes permanent

63
New cards

ROLLBACK

Undoes uncommitted changes

64
New cards

Index

A data structure that helps SQL Server locate rows efficiently, like a book's index. Pros: faster reads, joins, filtering, sorting. Cons: uses storage and adds overhead to inserts, updates and deletes

65
New cards

Common causes of slow queries

Missing or unsuitable indexes, outdated statistics, returning too many rows or columns, blocking or deadlocks, CPU/memory/disk I/O pressure, inefficient joins or logic, parameter-sensitive behavior

66
New cards

SSMS

Microsoft's graphical tool for connecting, running queries, managing objects, reviewing execution plans and admin tasks

67
New cards

T-SQL

Microsoft's SQL dialect with extra programming and admin features

68
New cards

Master

Server-level config, logins, database metadata

69
New cards

Model

Template for new databases

70
New cards

MSDB

Agent jobs, job history, backup history

71
New cards

Tempdb

Temporary objects and internal workspace