SQL Server Questions and Answers – Data Audit

This set of SQL Server Multiple Choice Questions & Answers (MCQs) focuses on “Data Audit”.

1. Which of the following tool is used for purpose of data auditing for SQL Server only?
a) ApexSQL
b) SQL Ninja
c) SQL Audit
d) Idera
View Answer

Answer: a
Explanation: ApexSQL Audit is a tool for auditing SQL Server data changes specifically for Microsoft SQL Server.

2. Point out the correct statement.
a) The CREATE SERVER AUDIT statement is in a transaction scope
b) An audit must exist before deleting a server audit specification for it
c) To insert a server audit, principles require the ALTER ANY SERVER AUDIT or the CONTROL SERVER permission
d) None of the mentioned
View Answer

Answer: a
Explanation: If the transaction is rolled back, the statement is also rolled back.

3. Which of the following object is only available for audit actions in Create Server Audit Specification?
a) Audit Action Type
b) Object Name
c) Audit Name
d) All of the mentioned
View Answer

Answer: b
Explanation: Object Name is the name of the object to audit.It does not apply to audit groups.

4. Selecting the _________ option can allow unaudited activity which could violate your security policies.
a) Fail
b) Shut down
c) Continue
d) Break
View Answer

Answer: c
Explanation: Select Continue option when continuing the operation of the Database Engine is more important than maintaining a complete audit. This is the default selection.

advertisement
advertisement

5. Point out the wrong statement.
a) Users with the ALTER ROLE permission can create server audit specifications and bind them to any audit
b) SQL Server audit uses Extended Events to help create an audit
c) You can have multiple audits per SQL Server instance
d) You can create one server audit specification per audit
View Answer

Answer: a
Explanation: Users with the ALTER ANY SERVER AUDIT permission can create server audit specifications and bind them to any audit.

6. Which of the following code creates a server audit called “HIPPA_Audit” with a binary file as the target and no options?
a)

Sanfoundry Certification Contest of the Month is Live. 100+ Subjects. Participate Now!
CREATE SERVER AUDIT HIPAA_Audit
    TO SUBJECT ( FILEPATH ='\\SQLPROD_1\Audit\' );

b)

advertisement
CREATE SERVER AUDIT HIPAA_Audit
    TO FILE ( FILEPATH ='\\SQLPROD_1\Audit\' );

c)

advertisement
CREATE AUDIT HIPAA_Audit
    TO FILE ( FILEPATH ='\\SQLPROD_1\Audit\' );

d)

CREATE SERVER AUDIT HIPAA
    TO FILE ( FILEPATH ='\\SQLPROD_1\Audit\' );
View Answer
Answer: b
Explanation: Server audit can be created using SSMS also.
 
 

7. Which of the following code Enables the audit ‘HIPAA_Audit’?
a)

ALTER SERVER AUDIT HIPAA_Audit
WITH (STATE ==1);

b)

ALTER SERVER AUDIT HIPAA_Audit
WITH (STATE = OFF);

c)

ALTER SERVER AUDIT HIPAA_Audit
WITH (STATE = ON);

d) None of the mentioned
View Answer

Answer: c
Explanation: ON State enables the audit.

8. Which of the following code creates database audit specification?
a)

CREATE AUDIT SPECIFICATION Audit_Pay_Tables
FOR SERVER AUDIT Payrole_Security_Audit
ADD (SELECT , INSERT
     ON HumanResources.EmployeePayHistory BY dbo ) 
WITH (STATE = ON) ;

b)

CREATE DATABASE AUDIT Audit_Pay_Tables
FOR SERVER AUDIT Payrole_Security_Audit
ADD (SELECT , INSERT
     ON HumanResources.EmployeePayHistory BY dbo ) 
WITH (STATE = ON) ;

c)

CREATE DATABASE AUDIT SPECIFICATION Audit_Pay_Tables
FOR SERVER AUDIT Payrole_Security_Audit
ADD (SELECT , INSERT
     ON HumanResources.EmployeePayHistory BY dbo ) 
WITH (STATE = ON) ;

d) All of the mentioned
View Answer

Answer: c
Explanation: The following code creates a database audit specification called Audit_Pay_Tables that audits SELECT and INSERT statements by the dbo user, for the HumanResources.EmployeePayHistory table.

9. Which of the following views log from a file that is named \\serverName\Audit\HIPPA_AUDIT.sqlaudit?
a) SELECT * FROM sys.fn_audit_file (‘\\serverName\Audit\HIPPA_AUDIT.sqlaudit’, default,default);
b) SELECT * FROM sys.fn_get_audit_file (‘\\serverName\Audit\HIPPA_AUDIT.sqlaudit’, default,default);
c) SELECT * FROM sys.fn_get_audit(‘\\serverName\Audit\HIPPA_AUDIT.sqlaudit’, default,default);
d) None of the mentioned
View Answer

Answer: b
Explanation: sys.fn_audit_file returns information from an audit file created by a server audit in SQL Server.

10. Which of the following statement is used to enable auditing from SQL Server?
a) auditpol /set /subcategory:”application generated” /success:enable /failure:enable
b) polaudit /set /subcategory:”application generated” /success:enable /failure:enable
c) auditpolenable /set /subcategory:”application generated” /success:enable /failure:enable
d) auditenable /set /subcategory:”application generated” /success:enable /failure:enable
View Answer

Answer: a
Explanation: auditpol is command is new to Windows Server 2008 and Vista and is required for querying or configuring audit policy at the subcategory level.

Sanfoundry Global Education & Learning Series – SQL Server.

To practice all areas of SQL Server, here is complete set of 1000+ Multiple Choice Questions and Answers.

If you find a mistake in question / option / answer, kindly take a screenshot and email to [email protected]

advertisement
advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.