DETTACH / attach in SQL SERVER 2000
You probably have done a copy of the database to other location by using a database backup Either attach or detach the database operation. Do you know what precisely Happen behind detach the database under the hood?
Detach the database Could Be done only if the database is not being accessed by anyone. If you Would like to make sure none accesses the database, you cans set the database to sql SINGLE_USER in ALTER DATABASE command with one of the termination options: WITH ROLLBACK AFTER n SECONDS WITH ROLLBACK IMMEDIATE or (Where n is a any integer number), for example:
ALTER DATABASE AdventureWorks2008
SET SINGLE_USER
WITH ROLLBACK AFTER 3 SECONDS
After That you cans sp_detach_db <databasename> issue (for example: EXEC sp_detach_db AdventureWorks2008).
Interesting thing to note Is That Pls detach a database is Issued, SQL Server will of copy dirty pages (pages changes since last checkpoint) back to corresponding pages in database files. You just only need to copy / move files into other database location for attaching the SQL Server database and transaction log files Could rebuild for you. But there are two conditions database That you need to be aware about.
If the database is read only, you need to include not only data files but Also Pls attach the transaction log file database. If the database is read write, you need only to include data files.
Since SQL Server 2005, the syntax for attach database is CREATE DATABASE ON <filespec> <database name> [, .... N] FOR {attach | ATTACH_REBUILD_LOG}. The legacy command sp_attach_db Should not be Used Because it Becomes depreciated features and Could Be removed in future SQL Server releases. The difference Between the new syntax and legacy Is That the maximum number of files on legacy is up to 16 files on the new syntax whereas the maximum number of files That Could be attached is up to 32.767 32.767 files and file groups. Certainly you will from never reach the number of files That need to be attached.
To me, attach-detach is as good as a backup-restore the database. The only difference Between Them Is That database is still accessible During the backup-restore whereas attach-detach requires a database to be offline.
** If my friends do not know what it means can translate on google
Bottom line:
DETTACH / Attach
Function: copying files to a server database and SQL Server menginisilisasi
How to Attach:
From Interprise Manager
Database
Right Click - All Task - Attach
Find the file *. MDF
How Dettach:
From Interprise Manager
Click on a database which is
Right click
Monday, May 30, 2011
DETTACH / attach in SQL SERVER 2000
Subscribe to:
Post Comments (Atom)
Popular Posts
-
PHP Definition According to official documents of PHP, PHP stands for PHP Hypertext Preprocessor. It is a form of language scripts that ar...
-
Make Application stopwatch A stopwatch is a handheld timepiece designed to measure the amount of time elapsed from a particular time w...
-
At the beginning of its development, by default the global registers in the set of On the tujuang to give the user ease in learning PHP, ...
-
change picture with button and text and we are learn load picture make change picture apple to orange to haha the steps are 1 . ope...
-
make lowercase letters to uppercase with php how to make a lowercase to uppercase in php? yes, here is the solution. type in textformat ...
-
Data Manipulation Language (DML) ADD DATA INSERT INTO table_name VALUES (value_1, value_2 ,..., nilai_n) OR ...
-
Set His estate : Object Property Nilai Form Name Form1 Caption Program penghitung volume tabung Lab...
-
Creating applications in visual basic text preview the steps are 1 . open microsoft visual basic yours 2 . ...
-
Java scripts and Java differences First in Class X EMP B (Programs and Classes), Most Hated Banget with that name there are 2 JAVA Karna...
-
CONNECTION TO DATABASE, metadata Project for which we can make to a high with the database we have, then we have toconnect your database...
0 comments:
Post a Comment
thank you for visiting my blog and comment here. I hope the commentary contains a comment which intend to build and repair. criticism and suggestions I gladly accept.