You have an SQL query that takes one minute to execute. You use the following code segment to execute the SQL query asynchronously.Dim ar As IAsyncResult = cmd.BeginExecuteReader( )You need to execute a method named DoWork( ) that takes one second to run while the SQL query is executing. DoWork( ) must run as many times as possible while the SQL query is executing. Which code segment should you use?()A、While ar.AsyncWaitHandle Is Nothing DoWork()End Whiledr = cmd.EndExecuteReader(ar)B、While Not ar.IsCompleted DoWork()End Whiledr = cmd.EndExecuteReader(ar)C、While T hread.CurrentThread.ThreadState = ThreadState.Running DoWork()End Whiledr = cmd.EndExecuteReader(ar)D、While Not ar.AsyncWaitHandle.WaitOne() DoWork()End Whiledr = cmd.EndExecuteReader(ar)

You have an SQL query that takes one minute to execute. You use the following code segment to execute the SQL query asynchronously.Dim ar As IAsyncResult = cmd.BeginExecuteReader( )You need to execute a method named DoWork( ) that takes one second to run while the SQL query is executing. DoWork( ) must run as many times as possible while the SQL query is executing. Which code segment should you use?()

  • A、While ar.AsyncWaitHandle Is Nothing DoWork()End Whiledr = cmd.EndExecuteReader(ar)
  • B、While Not ar.IsCompleted DoWork()End Whiledr = cmd.EndExecuteReader(ar)
  • C、While T hread.CurrentThread.ThreadState = ThreadState.Running DoWork()End Whiledr = cmd.EndExecuteReader(ar)
  • D、While Not ar.AsyncWaitHandle.WaitOne() DoWork()End Whiledr = cmd.EndExecuteReader(ar)

相关考题:

If you have ever polished some hard, ()material like metal or marble you know how much energy it takes. A、toughB、cooperativeC、capableD、negative

You have an SQL query that takes one minute to execute. You use the following code segment to execute theSQL query asynchronously.Dim ar As IAsyncResult = cmd.BeginExecuteReader()You need to execute a method named DoWork() that takes one second to run while the SQL query is executing.DoWork() must run as many times as possible while the SQL query is executing.Which code segment should you use?()A.B.C.D.

You define a multiple-row subquery in the WHERE clause of an SQL query with a comparison operator "=". What happens when the main query is executed? () A. The main query executes with the first value returned by the subquery.B. The main query executes with the last value returned by the subquery.C. The main query executes with all the values returned by the subquery.D. The main query fails because the multiple-row subquery cannot be used with the comparison operator.E. You cannot define a multiple-row subquery in the WHERE clause of a SQL query.

A new report process containing a complex query is written, with high impact on the database. You wantto collect basic statistics about query, such as the level of parallelism, total database time, and the number of I/O requests.For the database instance STATISTICS_LEVEL, the initialization parameter is set to TYPICAL and theCONTROL_MANAGEMENT_PACK_ACCESS parameter is set to DIAGNOSTIC+TUNING.What should you do to accomplish this task?()A. Execute the query and view Active Session History (ASH) for information about the query.B. Enable SQL trace for the query.C. Create a database operation, execute the query, and use the DBMS_SQL_MONITOR. REPORT_SQL_MONITOR function to view the report.D. Use the DBMS_APPLICATION_INFO.SET_SESSION_LONGOPS procedure to monitor query execution and view the information from the V$SESSION_LONGOPS view.

You have applications that have frequently executed queries, and produce small and static result sets.You configure the sqlnet.ora file in the client machine to set a nonzero value for the OCI_RESULT_CACHE_MAX_SIZE parameter. What is the purpose of this configuration?()A、to avoid round trips to the server by enabling caching of query results in client memoryB、to improve performance by storing a copy of the data from the private SQL area of the PGAC、to enhance the query performance by creating a cache in the client memory for sorting operationsD、to avoid the storing of query plans and results in the server by creating a cache in the client memory

You define a multiple-row subquery in the WHERE clause of an SQL query with a comparison operator "=".What happens when the main query is executed?()A、The main query executes with the first value returned by the subquery.B、The main query executes with the last value returned by the subquery.C、The main query executes with all the values returned by the subquery.D、The main query fails because the multiple-row subquery cannot be used with the comparison operator.E、You cannot define a multiple-row subquery in the WHERE clause of a SQL query.

You are a database administrator for your company. The company uses a vendor company’s application that is based on a proprietary database. You query data from the application database and import the data into a SQL Server 2005 database. The application vendor provides you with a new OLE DB driver to be used when querying the application database. Company policy prohibits connections between the SQL Server database and the application database, except when querying this data. You need to provide a way to query data from the application database. What should you?()A、Configure a Linked Server connection to the application database.B、Write a query that uses an OPENDATASOURCE command.C、Write a query that uses an OPENQUERY command.D、Configure a Remote Server connection to the application database.

You work in a company which uses SQL Server 2008. You are the administrator of the company database. Now you are in charge of a SQL Server 2008 instance. There are queries that have an estimated execution cost less than 3. You intend to configure the instance, make it use a single thread for these queries. In the options below, which sp_configure configuration option should you set?()A、You should set query governor cost limitB、You should set cost threshold for parallelismC、You should set priority boost D、You should set precompute rank

You work in a company which uses SQL Server 2008. You are the administrator of the company database. Now you are in charge of a SQL Server 2008 instance. The instance has databases for a finance application and a manufacturing application. You want to put some limitation on the maximum CPU query time allowed by the applications, so you configure the Resource Governor to achieve this. But you notice that certain reports do not execute successfully any longer on the manufacturing application. You have to allow the manufacturing application to consume more CPU time, so you have to change the Resource Governor configuration.  Which Resource Governor component should you configure?()  A、The workload group which is used by default B、The workload group which is used by the finance application C、The classifier function which identifies the finance application D、The workload group which is used by the manufacturing application

TestKing.com has multiple servers in a distributed environment. You work with two SQL Server 2005 computers named SQL1 and SQL2. Each server uses SQL Server Authentication and they use different logins.You need to write a distributed query that joins the data on SQL1 with the data on SQL2. What should you do?()A、Ensure that both SQL1 and SQL2 use the same login name as the security context for each server.B、Configure SQL2 as a remote server. Write the query on SQL1.C、Configure SQL2 as a linked server to impersonate the remote login.D、Configure SQL2 as a distributed server. Use pass-through authentication.

You are a professional level SQL Server 2005 database administrator in an international corporation named Wiikigo. You are experienced in implementing high-availability solutions, monitoring the database server, and design deployment. In the company, you major job is the deployment, maintenance and support of Microsoft SQL Server 2005.You work as a database administrator for your company. You find a problem that when the following query is executed, a SQL Server 2005 application will perform slowly. SELECT * FROM Orders WHERE OrderStatus = ’InProgress’ This query is executed by the application as an ad hoc query. In most occasions, this query performs much more quickly. The company has the OrderStatus column indexed. The value InProgress is included by only a small number of the rows. Nevertheless, the OrderStatus column index which is the most ideal for this query is not being utilized. The performance of this query should be enhanced. However, the application that executes the query should not be changed. In addition, the effect on end users should be cut to the least.  Which action should be performed to finish the task?()A、To finish the task, the index should be built by utilizing a FILLFACTOR of 10 percent.B、To finish the task, the index should be recreated to have all of the columns in the table included.C、To finish the task, an indexed view of the Orders table should be viewed.D、To finish the task, the statistics should be updated on the index.

You have a DNS server named Server1 that runs Windows Server 2003 Service Pack 2 (SP2). You create a primary zone on Server1 for contoso.com.You run the DNS simple query test and recursive query test. The simple query test completes successfully, but the recursive query test fails.You need to ensure that the recursive query test can complete successfully.  What should you do on Server1?()A、Clear the cache.B、Disable recursion.C、Enable access to the Internet.D、Configure a reverse lookup zone.

You work in a company which uses SQL Server 2008. You are the administrator of the company database. Now you are in charge of a SQL Server 2008 instance. A user reports that when he runs a query, it takes a quite long time and it is still unfinished. As the IT support, you have to verify whether the query is blocked.  Which tool should you use? () A、You should use the Database Engine Tuning Advisor tool B、You should use the Windows System Monitor tool C、You should use the Job Activity Monitor tool in Microsoft SQL Server Management Studio D、You should use the Activity Monitor tool in Microsoft SQL Server Management Studio

You work in a company which uses SQL Server 2008. You are the administrator of the company database. Now you are in charge of a SQL Server 2008 instance which contains a database. Now your company CIO assigns a task to you. You have to check the performance of the SQL Server 2008 instance. You have to find out which common language runtime (CLR) queries takes the longest-running time.  So in the options below, which dynamic management view should you choose to use?()  A、sys.dm_os_wait_stats B、sys.dm_exec_requests C、sys.dm_exec_sessions D、sys.dm_exec_query_stats

You work in a company which uses SQL Server 2008. You are the administrator of the company database. In your company there is a server which contains a default SQL Server 2005 instance. For a new application, you have to install a SQL Server 2008 instance on the server. Your company CIO assigns a task to you. You must make sure that the respective certified third-party applications have access to both database instances. You have to achieve this goal without changing the existing application environments. So what should you do to achieve this by using as little database administrative effort as possible?()A、You should install SQL Server 2008 as a named instance, and make the new application to use the new instance. B、You should install SQL Server 2008 as the default instance, and make the new application to use the default instance. C、You should upgrade the SQL Server 2005 application to use SQL Server 2008. D、You should upgrade the SQL Server 2005 instance to a SQL Server 2008 instance.

单选题You received complaints about the degradation of SQL query performance. You identified top SQL queries that consume time. What would be your next step to find out recommendations about statistics collection and restructuring of the SQL statement to improve query performance?()Arun Segment AdvisorBrun SQL Tuning Advisor on top SQL statementsCrun the Automatic Workload Repository (AWR) reportDrun the Automatic Database Diagnostic Monitor (ADDM)on top SQL statements

单选题A new report process containing a complex query is written, with high impact on the database. You wantto collect basic statistics about query, such as the level of parallelism, total database time, and the number of I/O requests. For the database instance STATISTICS_LEVEL, the initialization parameter is set to TYPICAL and theCONTROL_MANAGEMENT_PACK_ACCESS parameter is set to DIAGNOSTIC+TUNING. What should you do to accomplish this task?()AExecute the query and view Active Session History (ASH) for information about the query.BEnable SQL trace for the query.CCreate a database operation, execute the query, and use the DBMS_SQL_MONITOR. REPORT_SQL_MONITOR function to view the report.DUse the DBMS_APPLICATION_INFO.SET_SESSION_LONGOPS procedure to monitor query execution and view the information from the V$SESSION_LONGOPS view.

单选题You are a professional level SQL Server 2005 database administrator in an international corporation named Wiikigo. You are experienced in implementing high-availability solutions, monitoring the database server, and design deployment. In the company, you major job is the deployment, maintenance and support of Microsoft SQL Server 2005. You work as a database administrator for your company. A vendor company’s application is utilized, and the application is based on a proprietary database. Data is queried from the application database and the data is imported into a SQL Server 2005 database. A new OLE DB driver is offered by the application vendor, and the new OLE DB driver will be utilized when the application database is queried. According the company requirements, the connections between the SQL Server database and the application database is prohibited, except when this data is queried. You should think out a method to have data queried from the application database.  Which action should be performed to achieve the goal?()ATo achieve the goal, a Linked Server connection should be configured to the application database.BTo achieve the goal, a query should be written, and an OPENQUERY command is utilized by the query.CTo achieve the goal, a Remote Server connection to the application database should be configured.DTo achieve the goal, a query should be written, and an OPENDATASOURCE command is utilized by the query.

单选题You have an SQL query that takes one minute to execute. You use the following code segment to execute the SQL query asynchronously.IAsyncResult ar = cmd.BeginExecuteReader( );You need to execute a method named Do Work( ) that takes one second to run while the SQL query is executing. DoWork( ) must run as many times as possible while the SQL query is executing. Which code segment should you use? ()Awhile(ar.AsyncWaitHandle==null){DoWork();}dr=cmd.EndExecuteReader(ar);Bwhile(!ar.IsCompleted){DoWork();}dr=cmd.EndExecuteReader(ar);Cwhile(Thread.CurrentThread.ThreadState==ThreadState.Running){DoWork();}dr=cmd.EndExecuteReader(ar);Dwhile(!ar.AsyncWaitHandle.WaitOne()){DoWork();}dr=cmd.EndExecuteReader(ar);

单选题You work in a company which uses SQL Server 2008. You are the administrator of the company database. Now you are in charge of a SQL Server 2008 instance. A user reports that when he runs a query, it takes a quite long time and it is still unfinished. As the IT support, you have to verify whether the query is blocked.  Which tool should you use? ()AYou should use the Database Engine Tuning Advisor tool BYou should use the Windows System Monitor tool CYou should use the Job Activity Monitor tool in Microsoft SQL Server Management Studio DYou should use the Activity Monitor tool in Microsoft SQL Server Management Studio

单选题You are creating an online catalog application that will display product information on the company Web site. The product data is stored in a SQL Server 2005 database. The data is stored as relational data but must be passed to the application as an XML document by using FOR XML. You test your application and notice that not all of the items matching your query appear in the XML document. Only those products that have values for all elements in the schema appear.   You need to modify your Transact-SQL statement so that all products matching your query appear in the XML document. What should you do?()AAdd an XML index to the table that contains the product data.BAdd the XSINIL argument to the ELEMENTS directive in the query.CAdd a HAVING clause to the query.DAdd the replace value of clause to the query.

单选题You define a multiple-row subquery in the WHERE clause of an SQL query with a comparison operator "=".What happens when the main query is executed?()AThe main query executes with the first value returned by the subquery.BThe main query executes with the last value returned by the subquery.CThe main query executes with all the values returned by the subquery.DThe main query fails because the multiple-row subquery cannot be used with the comparison operator.EYou cannot define a multiple-row subquery in the WHERE clause of a SQL query.

单选题You work in a company which uses SQL Server 2008. You are the administrator of the company database. Now you are in charge of a SQL Server 2008 instance. There are queries that have an estimated execution cost less than 3. You intend to configure the instance, make it use a single thread for these queries. In the options below, which sp_configure configuration option should you set?()AYou should set query governor cost limitBYou should set cost threshold for parallelismCYou should set priority boost DYou should set precompute rank

单选题You have applications that have frequently executed queries, and produce small and static result sets.You configure the sqlnet.ora file in the client machine to set a nonzero value for the OCI_RESULT_CACHE_MAX_SIZE parameter. What is the purpose of this configuration?()Ato avoid round trips to the server by enabling caching of query results in client memoryBto improve performance by storing a copy of the data from the private SQL area of the PGACto enhance the query performance by creating a cache in the client memory for sorting operationsDto avoid the storing of query plans and results in the server by creating a cache in the client memory

单选题You need to resolve the blocking issue that is affecting the performance of the CRM system. What should you do?()AReplace the named query with an SQL view.BSet the transaction isolation level to serializable in the named query.CSet the source database to use snapshot isolation.DSet the transaction isolation level to repeatable read in the named query.

单选题Your application must access data that is located on two SQL Server 2005 computers. One of these servers is named SQL1 and the other is SQL2. You have permissions to create a stored procedure on SQL1 to support your application. However,on SQL2 you only have permissions to select data. You write the stored procedure on SQL1. The stored procedure accesses SQL2 by using the OPENQUERY Transact-SQL statement. However,the query fails when executed.You need to troubleshoot the cause of the error. What should you do?()AJoin the two servers by using the four-part syntax of server.database.schema.table.BReference SQL2 by using an alias.CAdd SQL2 as a remote server to SQL1.DAdd SQL2 as a linked server to SQL1.

单选题By mistake, you ran the batch job (for updating the BILL_DETAILS table) twice. You are not sure which rows in the BILL_DETAILS table were affected. You need to identify:  a) a list of changes made along with the transaction identifier of each change  b) the necessary SQL statements to undo the erroneous changes  Which option would you choose?()ARMAN onlyBFlashback Table onlyCFlashback Versions Query onlyDFlashback Database and Flashback Transaction QueryEFlashback Versions Query and Flashback Transaction Query

单选题You work in a company which uses SQL Server 2008. You are the administrator of the company database. Now you are in charge of a SQL Server 2008 instance. The instance has databases for a finance application and a manufacturing application. You want to put some limitation on the maximum CPU query time allowed by the applications, so you configure the Resource Governor to achieve this. But you notice that certain reports do not execute successfully any longer on the manufacturing application. You have to allow the manufacturing application to consume more CPU time, so you have to change the Resource Governor configuration.  Which Resource Governor component should you configure?()AThe workload group which is used by default BThe workload group which is used by the finance application CThe classifier function which identifies the finance application DThe workload group which is used by the manufacturing application