Database Forensics Flashcards

1
Q

SQL Server Data Storage has three components

A

Primary Data Files (MDF)
Secondary Data Files (NDF)
Transactional LOG Data Files (LDF)

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

Primary Data File (MDF)

A

The primary data file contains the startup information for the database and points to the other files in the database. User data and objects can be stored in this file or in secondary data files. Every database has one primary data file. The recommended file name extension for primary data files is .mdf

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

Secondary Data Files (NDF)

A

Secondary data files are optional, are user-defined, and store user data. Secondary files can be used to spread data across multiple disks by putting each file on a different disk drive. The recommended file name extension for secondary data files is .ndf

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

Transaction LOG Data Files (LDF)

A

The transaction log files hold the log information that is used to recover the database. There must be at least one log file for each database. The recommended file name extension for transaction logs is .ldf

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

SQL Database File Locations

A

Database & logs files:
\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\DATA*.MDF | *.LDF

Trace files:
\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\LOG\LOG_#.TRC

SQL Server error logs:
\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\LOG\ERRORLOG

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

What command will help in collecting the active transaction log?

A

sp_helpdb

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

What function allows you to retrieve the active portion of the transaction log file

A

The fn_dblog() function

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

fn_dblog () function filters transactions by:

A

Target database object
Specific columns
SPID and/or date/time range

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

What is the Database Consistancy Checker (DBCC)?

A

The DBCC LOG command allows you to view and retrieve the active transaction log files for a specific database. Following are the other DBCC commands that allow you to obtain additional information related to the specified database.
DBCC DBTABLE: Returns the structure of the selected database table
DBCC DBINFO: Returns information related to the database metadata
DBCC PROCBUF: Returns the contents of the SQL Server Procedure Buffer.

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

DBCC BUFFER:

A

Returns the buffer headers and pages from SQL Server’s buffer cache, where SQL Server stores results.

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

DBCC SHOWFILESTATS:

A

Returns information related to the space occupied by the data files in the active database.

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

DBCC PAGE:

A

Returns the data page structure of the selected database

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

To collect the database plan cache, the following query is used in SSMS:

A

select * from sys.dm_exec_cached_plans cross apply sys.dm_exec_sql_text(plan_handle)

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

Issuing sys.dm_exec_cached_plans

A

returns a row for each query plan that the SQL server had cached to speed up query execution. This dynamic management view will help users to find cached query plans, cached query text, the amount of memory taken by cached plans, and the reuse count of the cached plans.

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

To collect the trace files (.trc) navigate to:

A

C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\LOG

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

To collect the SQL Server error logs navigate to:

A

C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\LOG

17
Q

Methodology for Database Forensics Using SQL Server Management Studio (SSMS)

A
  1. Examine Windows Logs
  2. Examine Error Logs
  3. Examine Trace Files
  4. Examine Active Transaction Logs
  5. Examine Data Page
  6. View the Object(s) that have been modified
  7. Gather the Object Schema
  8. View the Modified Record
  9. Identify the Data Type
  10. Compare the Row Logs
18
Q

What is MySQL?

A

MySQL is an open source relational database. Data stored in a MySQL database is duplicated and stored in multiple locations. Therefore, any users deleting data in the database either accidentally or intentionally will not completely delete the data. You can examine all the files containing a copy of the deleted data and recover it.

19
Q

By default, the data directory is located at

A

C:\ProgramData\MySQL\MySQL Server 5.n\ in Windows based machines.

20
Q

The InnoDB storage engine contains two types of logs:

A

Undo logs, help you to roll back the transactions

Redo logs, help you to re-execute the transactions (ib_logfile0 and ib_logfile1)

21
Q

Mysqldump

A

The utility allows you to dump a database or a collection of databases for backup purposes

22
Q

mysqlaccess

A

Checks the access privileges defined for host name, user name, etc.
Validates access using the user, db, and host tables

23
Q

myisamlog

A

Processes the contents of MyISAM log file and perform recovery operation, display version information, etc., depending on the situation

24
Q

myusamchk

A

Views the status of the MyISAM table or checks, repairs, or optimizes them.

25
Q

mysqlbinlog

A

Reads the binary log files directly and displays them in text format
Displays the content of bin logs (mysql-bin.nnnnnn) in text format

26
Q

mysqldbexport

A

Export metadata/data definitions