What should you do?

You work as a database administrator at Domain.com. Domain.com is using a SQL Server 2008 instance.
The SQL Server 2008 instance contains a database named CK_DB.
CK_DB has its data file and the transaction log file on drive D. You have received instructions to move both the
data file and the transaction log file to drive G.
What should you do?

You work as a database administrator at Domain.com. Domain.com is using a SQL Server 2008 instance.
The SQL Server 2008 instance contains a database named CK_DB.
CK_DB has its data file and the transaction log file on drive D. You have received instructions to move both the
data file and the transaction log file to drive G.
What should you do?

A.
You should consider adding the following Transact-SQL statement:
ALTER DATABASE CK_DB SET RESTRICTED_USER WITH ROLLBACK_IMMEDIATE;

B.
You should consider moving the data file and use the following Transact-SQL statement:
ALTER DATABASE CK_DB MODIFY FILE(NAME = CK_DB_Data, FILENAME = mdf’);
ALTER DATABASE CK_DB SET MULTI_USER;

C.
You should consider adding the following Transact-SQL statement:
ALTER DATABASE CK_DB SET OFFLINE WITH ROLLBACK_IMMEDIATE;
ALTER DATABASE CK_DB mdf’;
ALTER DATABASE CK_DB SET ONLINE;

D.
You should consider moving the data file and then start the SQL Server service with the following Transact-SQL statement:
IEXEC sp_attach_single_file_db @dbname = N’ CK_DB ‘,@physname = N’v:SQLServerCK_DB_Data.mdf’;

E.
You should consider moving the data file and transaction log file and then start the SQL Server service with the following Transact-SQL statement:
EXEC sp_attach_db @dbname = N’ CK_DB ‘,@filename1 = N’G:SQLServerCK_DB_Data.mdf’,@filename2 = ldf’;

F.
You should consider moving the data file and transaction log file and then start the SQL Server service with the following Transact-SQL statement:
EXEC sp_attach_db @dbname = N’ CK_DB ‘, @filename1 = N’G:SQLServerCK_DB_Data.mdf’, @filename2 = N ‘g:SQLServer CK_DB_log.ldf’;

G.
ALTER DATABASE CK_DB SET OFFLINE WITH ROLLBACK_IMMEDIATE;
You should consider adding the following Transact-SQL statement:
ALTER DATABASE CK_DB @filename1 = N’G:SQLServerCK_DB_Data.mdf’
ALTER DATABASE CK_LOG @filename2 = N ‘g:SQLServer CK_DB_log.ldf’;
ALTER DATABASE CK_DB SET ONLINE;

Explanation:
MyNote:not 2 alter to add db and log but do in io one step by sp_attach DB and LOG

Incorrect answer:
"You should consider moving the data file and then start the SQL Server service with the following
Transact-SQL statement: IEXEC sp_attach_single_file_db @ dbname = N’ CK_DB ‘,@ physname
= N’v : SQLServer CK_DB_Data.mdf’;"

If you take a look at this, you are only attaching a single file, in this case the data file(. mdf ) and
from the’v:’ Drive. So with this answer, we did not fulfill the requirements of moving both data and
log from g:’.
Part 2, Configure SQL Server instances. (4 questions)



Leave a Reply 0

Your email address will not be published. Required fields are marked *