Backup and Restore Flashcards

1
Q

What are the four different media types for backup and restore procedures?

A

File (local or remote)
URL
Backup Device
Tape

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

What is the syntax to restore a database from backup (file)?

A
USE MASTER
RESTORE DATABASE [DATABASENAME] FROM DISK = N'C:\LOCATION' 
WITH FILE = 1,
MOVE N'DATAFILE' TO N'C:\LOCATION',
MOVE N'LOGFILE' TO N'C:\LOCATION'
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are the different recovery models available for SQL Servers?

A

SIMPLE
FULL
BULK LOGGED

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

What is the SIMPLE Recovery model for SQL?

A

No details are kept in the transaction log so the log file is small.

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

What is the FULL Recovery model for SQL?

A

All transactions are recorded in the log file and they are able to be restored

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

What is the BULK LOGGED Recovery model for SQL?

A

All transactions are recorded in the log file and they are able to be restored

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

What is the syntax for changing the recovery model of a database?

A

USE MASTER
GO
ALTER DATABASE [DATABASENAME] SET RECOVERY WITH NO_WAIT
GO

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

Where is the location of the recovery model in the GUI?

A

DATABASE->Properties->Options->Recovery Model

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

What are the three different backup types?

A

FULL
DIFFERENTIAL
TRANSACTION (Simple cannot do transaction backups)

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

What’s the difference between full and bulk logged recovery models?

A

With Bulk Logged, you can determine if you want to keep bulk inserted records into the transaction log.

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

What is a FULL backup?

A

It backs up everything in the database. Creates a new baseline for differential backups.

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

What is a DIFFERENTIAL backup?

A

It backs up everything since the last backup (FULL or DIFFERENTIAL)

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

What is a TRANSACTION LOG BACKUP?

A

It backs up every transaction since the last backup, whether it was FULL, DIFFERENTIAL OR TRANSACTION LOG.

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

How do you restore back to a specific point in time?

A

Restore in this order:

Full
Differential
All Transaction backups until the time needed

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

What are the different recovery states that you can put for a database restore?

A

RECOVERY
NORECOVERY
STANDBY

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

What does RECOVERY state mean?

A

It brings the database up in full access mode.

17
Q

What does STANDBY state mean?

A

It brings up the database in READ-ONLY mode.

18
Q

What does NORECOVERY state mean?

A

It makes it so the database is not accessible, but you can still make changes to the database settings. Useful if you are planning on doing more data restoration to it.

19
Q

What is a tail log backup?

A

When you do a restore to a specific time, the tail log tries to get a new TRANSACTION log that it can then use to get the restore.

20
Q

What is the syntax for finding out how much space a full database will require?

A

EXEC SP_SPACEUSED –USE TABLE IN QUOTES TO SEE SPECIFICALLY HOW MUCH SPACE A TABLE USES

21
Q

What is a COPY-ONLY backup?

A

It does not disrupt the main backups that you are doing. It is strictly a copy. Used with Transaction Logs. Sometimes with full.

22
Q

What are the reliability settings when performing a backup?

A

Verify backup when finished
Perform Checksum before writing to media
Continue on Error

23
Q

What is the syntax for moving forward with a restore even if there are problems?

A

Use CONTINUE_AFTER_ERROR

RESTORE DATABASE [databasename] FROM DISK = N’C:\PATH’ WITH CONTINUE_AFTER_ERROR

24
Q

How do you check a database integrity?

A
DBCC CHECKDB ([DATABASE])
If you want to repair:
DBCC CHECKDB ([DATABASE], REPAIR_ALLOW_DATA_LOSS)

For that though, you need to put Database into Single User Mode

25
Q

What is the syntax to put a database into Single User Mode?

A

ALTER DATABASE [DATABASENAME] SET SINGLE_USER WITH ROLLBACK IMMEDIATE

26
Q

What are the different user modes that you can set for a database?

A

MULTI_USER
SINGLE_USER
RESTRICTED_USER