Wednesday, April 30, 2008

Microsoft SQL Server Interview Questions And Answers (SET -6)

Microsoft SQL Server Interview Questions And Answers (SET -6)



In SQL Server 2005, you want to monitor your transactional replication and determine how long it takes for a transaction to move from the publisher to a subscriber. What would you use to help you do this?
Tracer Tokens.
You can use tracer tokens in SQL Server 2005 replication to measure latencies. These are small amounts of data written into your transaction logs.

How many credentials can one login be mapped to?

1
A credential can be mapped to many logins, but a login can only be mapped to one credential.

You are looking to secure your publisher to prevent unauthorized logins from accessing the data through replication. Where do you add the list of logins that have access?
Add them to the Publication Access List in the publication database.
All access to publications is controlled with the Publication Access List (PAL), which is similar to the Windows ACLs. A list is created for each publication that is set up.

What does the ERROR_PROCEDURE() function return?
The name of the stored procedure that caused an error.
The ERROR_PROCEDURE() function is placed in the catch block of a TRY..CATCH construct and returns the name of the procedure that caused an error to be thrown.

Credentials in SQL Server 2005 are used to access what?
Resources outside the SQL Server
A credential is used to access resources outside of SQL Server. It contains the authentication information needed for accessing these resources.

Which of the following is an invalid file name for a database file?
None of the above
Explanation from BOL: SQL Server 2005 does not enforce the .mdf, .ndf, and .ldf file name extensions, but these extensions help you identify the different kinds of files and their use.

What does @@options return?
The current SET options for the connection.
The @@options variable returns a list of the options set for the current connection. This is returned as integer and each bit in the integer represents an option.

You have setup forwarding for your SQL Server 2005 Service Broker queues to another server. You edit a route to move a queue to a new server. What do you need to do now to ensure you can recover the routes in the event of a disaster?
Back up the msdb database.
The routes for forwarding are stored in msdb.sys.routes. If you back up the msdb database, the routes will be captured.

You are looking to setup a large Notification Services application and you are planning on a 40GB database. When installing Notification Services, the creation fails. What is the likely problem?
Notification Services installation has a 10 minute timeout and the database creation probably took longer than that.
The Notification Services timeout for database creation is 10 minutes. If the database takes longer to create, the installation of the instance fails. You need to reduce the size of the database for installation and then increase it when you are done.

You have enabled AWE for your SQL Server 2005 server and allocated 4GB or RAM on one of your servers. An ASP.NET application on the same server is feeling memory pressure and you want to release some memory and reduce SQL Server to 3GB or RAM. How can you do this?
Change the max amount of memory allocated and shut down and restart SQL Server to have it take affect.
Once memory is allocated through AWE, it cannot be released unless the SQL Server is restarted.

You are troubleshooting a Service Broker application and find that messages are remaining on the queue. You determine that there is no active queue monitor. What should you do?
Use the ALTER QUEUE statement to turn activation on.
One of the troubleshooting steps if messages remain in the queue is to check for an active queue monitor. If one is not on, then it needs to be activated. The ALTER QUEUE statement is used to change this.

You are implementing replication across the Internet for a large bank that wishes to move up to date pricing information to an analyst's laptop. They are concerned about spoofing of their main site by criminals. What can you do to secure the replication solution with SQL Server 2005?
Set the encryption level to verify the certificate is issued by a trusted authority.
Since you are asked to use replication, a replication solution is to use encryption for the connection and verify the certificate being used is from a trusted authority. Setting the encrpytion level to 2 will do this.

In SQL Server 2005, you are looking to implement full-text search. One of the tables you are looking to index stores Mircrosoft Word documents in a varbinary(max) column. Can you use Full-text search to index this column?
Yes
You can use full-text search for formatted data such as Word that contains text stored in a varbinary column.

To recover an instance of Notification Services in 2005 on another server, what information would you need?
A backup of the database holding Notification Services and the XSD and XSLT files as well as the name and password for the service account.
To recover SSNS, you need the database backup as well as the operational files, XSD and XSLT files, stored on the file system and the account information used for the service account. Since SSNS usually works with data outside of the SQL Server, a domain account is usually used to ensure proper permissions.

What type of connectivity does the readpipe/makepipe utility test?
Named Pipes
The readpipe and makepipe utility combination will test named pipe connectivity.

In SQL Server 2005, which of the following schema changes are supported for the publication objects of a replicated database?
All of the above.
SQL Server 2005 replicated databases support the following schema changes for objects:
* ALTER TABLE
* ALTER VIEW
* ALTER PROCEDURE
* ALTER FUNCTION
* ALTER TRIGGER (DML only)

You want to disable the receipt of messages in one of your databases by the Service Broken. How should you do this?
ALTER DATABASE Sales SET DISABLE_BROKER
To disable the receipt of messages, you can disable the Service Broker by disabling it with the ALTER DATABASE command. The SET command is "DISABLE_BROKER".

You are building a .NET assembly that will access the registry of the local machine for a factor used in a computer column. What permission set should you assign it?
EXTERNAL_ACCESS
The most restrictive permission set should always be used for .NET assemblies in keeping with a secure SQL Server environment. Only the EXTERNAL_ACCESS and UNSAFE permission sets will allow registry access and UNSAFE permissions are not required.

0 comments: