Searching for "st"

Q:

You are an administrator of a SQL Server 2000 computer. The server contains a database that stores inventory data. Another database administrator has created a number of scheduled jobs to maintain the inventory database. Each weeknight the following jobs occur.


- A BULK INSERT job imports data at 10:00 P.M
- Indexes are rebuilt at 10:15 P.M
- Data integrity checks are performed at 10:30 P.M
- A differential backup is performed at 10:45 P.M
- A DBCC SHRINKDATABASE job runs at 11:00 P.M.


You notice that the final job often fails and returns the following error message: "Server: Msg 3140, Level 16, State 3. Could not adjust the space allocation for file  'inventory_data'."You need to ensure that the final job runs without errors.

What should you do?

A) Modify the DBCC SHRINKDATABASE job so that it uses DBCC SHRINKFILE statement to shrink each file individually. B) Create a new DBCC SHRINKFILE job to shrink the inventory_data file. Schedule the new job to run at the same time as the DBCC SHRINKDATABASE job.
C) Increase the time between the differential backup and the DBCC SHRINKDATABASE job. D) Increase the time between the data integrity checks and the differential backup.
 
Answer & Explanation Answer: C) Increase the time between the differential backup and the DBCC SHRINKDATABASE job.

Explanation:

The DBCC SHRINKDATABSE cannot be executed until the previous job step, the differential backup, has been completed. We should increase the time between these two job steps, or even better configure the last job step to run only after the differential backup has been completed.

 

Note: The DBCC SHRINKDATABASE statement shrinks data files on a per-file basis but shrinks log files as if all the log files existed in one contiguous log pool. The target size for the data and log files cannot be smaller than the minimum size of a file that was specified when the file was originally created, or the last explicit size set with a file size changing operation such as the ALTER DATABASE statement with the MODIFY FILE option or the DBCC SHRINKFILE statement.

Report Error

View Answer Report Error Discuss

Q:

You are the administrator of a SQL Server 2000 computer. You configure SQL Server to perform C2 auditing. Audit logs are saved in the C:MSSQLAudit folder.The server functions normally for several days, but then the MSSQLServer service shuts down without warning. You cannot restart the service.You need to restart the MSSQLServer service. What should you do?

A) Start the MSSQLServer service manually by using the -m startup option. B) Start the MSSQLServer service manually by using the -s startup option.
C) Set the SQLServerAgent service's startup method to Disabled. Start the MSSQLServer service. D) Delete the audit logs from the C:\MSSQL\Audit folder. Start the MSSQLServer service.
 
Answer & Explanation Answer: D) Delete the audit logs from the C:\MSSQL\Audit folder. Start the MSSQLServer service.

Explanation:

SQL Server functioned for several days but now it is impossible to start it.
The most likely cause is the size of the auditing log files. The maximum file size for the audit log is fixed at 200 megabytes (MB). When the audit log file reaches 200 MB, a new file will be created and the old file handle will be closed. If the directory fills up, then the instance of Microsoft SQL Server is stopped. The system administrator needs to either free up disk space for the audit log before restarting the instance of SQL Server or restart the instance of SQL Server

Note 1: SQL Server Agent monitors itself and the SQL Server service.
SQL Server Agent can restart the local instance of SQL Server if it has terminated for reasons other than a typical shutdown.

Note 2: Start the MSSQLServer service manually by using the -f startup option would start the service with minimal configuration. It could be used when some configuration errors have been made and the MSSQLServer service isn't able to start.

Report Error

View Answer Report Error Discuss

Q:

You are the administrator of a SQL Server 2000 computer. The server contains a database named Inventory. The database has a Parts table that has a field named InStock.When parts are shipped, a table named PartsShipped is updated. When parts are received, a table named PartsReceived is updated. The relationship of these tables is shown in the exhibit. (Click the Exhibit button.)

You want the database to update the InStock field automatically. What should you do?

A) Add triggers to the PartsShipped and the PartsReceived tables that update the InStock field in the Parts table. B) Use a view that creates anInStock field as part of an aggregate query.
C) Create stored procedures for modifying the PartsReceived and the PartsShipped tables that also modify the InStock field in the Parts table. Use these procedures exclusively when modifying data in the PartsReceived and the PartsShipped tables. D) Create a user-defined function that calculates current inventory by running aggregate queries on the PartsShipped and PartsReceived tables.
 
Answer & Explanation Answer: A) Add triggers to the PartsShipped and the PartsReceived tables that update the InStock field in the Parts table.

Explanation:

Triggers are a special class of stored procedure defined to fire automatically when an UPDATE, INSERT, or DELETE statement is issued against a table or view. They are powerful tools that can be used to enforce business rules automatically when data is modified. Triggers can extend the integrity checking logic of SQL Server constraints, defaults, and rules, although constraints and defaults should be used instead whenever they provide all the needed functionality. In this scenario an AFTER UPDATE trigger can be used to update the tables to update the PartsShipped and the PartsReceived tables that update the InStock column in the parts table.

Report Error

View Answer Report Error Discuss

Q:

You are the administrator of a Microsoft Windows NT Server 4.0 computer. The server is the PDC in your domain and also runs SQL Server 2000. The server has four processors and 1 GB of RAM.Your network consists of 500 client computers that are running Microsoft Windows Millennium Edition. Users report that when they log on in the morning their computers respond slowly and occasionally return error messages.You use System Monitor to monitor processor performance and RAM utilization. You discover that the % Total Time and % User Time counters average 90 percent and the % Privileged Time counter averages 20 percent. The Available Mbytes counter averages 800 MB. You need to improve server performance for user logons. What should you do?

A) Increase the physical RAM on the computer to 2 GB. B) Increase the virtual RAM on the computer to 4 GB.
C) Configure SQL Server to use only processors 0, 1, and 2. D) Configure SQL Server to use only processors 1, 2, and 3.
 
Answer & Explanation Answer: D) Configure SQL Server to use only processors 1, 2, and 3.

Explanation:

The system monitor clearly indicates that the processors are overloaded. We need to decide which processors we should use for SQL Server. Processor 0 is the default CPU for the I/O subsystem. Network Interface Cards (NIC) are assigned to the remaining CPUs, starting from the highest-numbered CPU. The NIC would get processor 3.
SQL Server would be using all four processors by default.

The Windows NT/2000/XP operating system use processor 0. In order to avoid the logon
problems we should not let SQL Server to use this processor. Instead SQL Server should be configured to use processor 1, 2, and 3.

Note 1: The Affinity mask is used to exclude a processor on a multiprocessor computer from processing SQL Server 2000 threads. Default is equal distribution of SQL Server 2000 processes across all processors.

Note 2: Monitoring the Processor and System object counters provides information about the CPU utilization and helps in determining whether or not a bottleneck exists. The %Total Processor Time is used on multiple CPU Severs to gauge the average activity of the processors and shows the percentage of elapsed time that a processor is busy executing a nonidle thread. Values around 100 percent on a Server computer that processes many client requests indicate that processes are queuing up, waiting for processor time, and causing a bottleneck. Such a sustained high level of processor usage is unacceptable for a server.

Report Error

View Answer Report Error Discuss

Q:

You are the administrator of a SQL Server 2000 computer. The server contains a database named FinanceData that is used by a client/server application. Each employee has a SQL Server login that the application uses to access the server.Your company hires a new employee named Andrew. You create a SQL Server login named Andrew. You also create a database user named Andrew in the database and grant the database user full permissions in the database.Whenever Andrew runs the client/server application, he receives the following error message: "Invalid object name." Andrew also reports that he cannot access the database by using the application.You need to ensure that Andrew can use the application. Which Transact-SQL statement should you execute?

A) EXEC sp_defaultdb 'Andrew','FinanceData' B) GRANT ALL ON FinanceData TO Andrew
C) EXEC sp_addlogin 'Andrew' D) EXEC sp_grantdbaccess 'FinanceData','Andrew'GOsp_addrolemember 'db_datareader','Andrew'
 
Answer & Explanation Answer: A) EXEC sp_defaultdb 'Andrew','FinanceData'

Explanation:

Error 208 produces the message 'Invalid object name' and occurs when an object that does not exist in the current database is referenced. If the object exists in another database, we must use the USE statement to explicitly switch the context to the correct database or we must qualify the object name with the database name. A third option is to use the sp_defaultdb stored procedure. This stored procedure is used to change the default database for a login. When a client connects with SQL Server, the default database defined for its login becomes the current database without an explicit USE statement. The default database can be defined when the login is added with
sp_addlogin. When executing sp_addlogin the master database is the default database if a database is not specified. In this scenario a SQL Server 2000 login and a user account has been created for Andrew and he has been given database access and the required permissions.

Report Error

View Answer Report Error Discuss

Q:

You are the database administrator for a financial services company. Employees enter data 24 hours a day into a SQL Server 2000 database. These employees report slower response times when new account information is gathered from branch offices and added to the database. You currently use the following BULK INSERT statement to add the account information.BULK INSERT finance.dbo.customersFROM 'd:bulkaccts143_10142000.txt'WITH DATAFILETYPE = 'char', FIELDTERMINATOR = 't', ROWTERMINATOR = 'n', TABLOCK You want to ensure that response times do not slow when new account information is added to the database. What should you do?

A) Add the BATCHSIZE option to the BULK INSERT statement, and then set the option equal to 10 percent of the number of rows to be loaded. B) Add the ROWS_PER_BATCH option to the BULK INSERT statement, and then set the option equal to 10 percent of the number of rows to be loaded.
C) Drop the indexes for the Customers table before the data load, and then re-create the indexes after the data load is complete. D) Remove the TABLOCK option from the BULK INSERT statement.
 
Answer & Explanation Answer: D) Remove the TABLOCK option from the BULK INSERT statement.

Explanation:

The TABLOCK hint increases the number of locks during the adding process. This is the reason why response time are slows down during this process. By removing the TABLOCK hint the default more granular row-level lock will be used. This would decrease the scope of the locks which would result in less waiting jobs and performance would improve.


Note: The BULK INSERT statement is used to copy a data file into a database table or view in a format specified by the user. The BULK INSERT statement accepts the TABLOCK hint, which allows the user to specify the locking behavior that the BULK INSERT statement should use. TABLOCK specifies that a bulk update table-level lock is taken for the duration of the bulk copy. If TABLOCK is not specified, the default uses row-level locks.

Report Error

View Answer Report Error Discuss

Q:

You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to create an application. You use the ADO.NET Entity Data Model (EDM) to define a Customer entity. You need to add a new Customer to the data store without setting all the customer's properties. What should you do?

A) Call the Create method of the Customer object. B) Call the CreateObject method of the Customer object.
C) Override the Create method for the Customer object. D) Override the SaveChanges method for the Customer object.
 
Answer & Explanation Answer: B) Call the CreateObject method of the Customer object.

Explanation:
Report Error

View Answer Report Error Discuss

Q:

You use Microsoft Visual Studio 2010 and Microsoft ADO.NET Framework 4 to create an application. The application connects to a Microsoft SQL Server 2008 database. You use the ADO.NET LINQ to SQL model to retrieve data from the database. You use stored procedures to return multiple result sets. You need to ensure that the result sets are returned as strongly typed values. What should you do?

A) Apply the FunctionAttribute and ResultTypeAttribute to the stored procedure function. Use the GetResult B) Apply the FunctionAttribute and ParameterAttribute to the stored procedure function and directly access the strongly typed object from the results collection.
C) Apply the ResultTypeAttribute to the stored procedure function and directly access the strongly typed object from the results collection. D) Apply the ParameterAttribute to the stored procedure function. Use the GetResult
 
Answer & Explanation Answer: A) Apply the FunctionAttribute and ResultTypeAttribute to the stored procedure function. Use the GetResult

Explanation:
Report Error

View Answer Report Error Discuss