Re: Kopieren offener Datenbanken...
- From: Erland Sommarskog <esquel@xxxxxxxxxxxxx>
- Date: Sun, 6 Dec 2009 11:06:46 +0000 (UTC)
Tellie (tellie@xxxxxx) writes:
ich bekomme regelmäßig MS-SQL-Server Datenbanken zugeschickt und
vermute, dass diese manchmal vor dem Kopieren nicht heruntergefahren
wurden. Mich interessieren nur die Inhalte der Datenbanken, daher
folgende Fragen:
Kann man aus einem mitkopierten *.ldb File analog wie bei Access
schließen, dass die Datenbank nicht runtergefahren wurde? Welche
Programme / Dienste reicht es zu beenden, damit Datenbanken sicher
kopiert werden können?
(Dann diese Gruppe ist ein internaziolle Gruppe, ich antworte in Englisch.)
To copy a data base in SQL Server, the best option is to use
BACKUP/RESTORE. You run these commands from with in a query window.
To backup up a database is easy:
BACKUP DATABASE yourdb TO DISK = 'somefile'
To restore a copy, takes a little more job. First run "sp_helpdb yourdb",
the using that output you can do:
RESTORE DATABASE yourcopy FROM disk = 'somefile'
WITH MOVE 'name1' TO 'filepath1-modified',
MOVE 'name2' TO 'filepath2-modified',
REPLACE
name1 and name2 are the names in the rightmost column in the output.
Those are the logical names of the files.
filepath1 and filepath2 are the physical names for the files, and you
need to modify these names, preferably to match the names of your copy.
There are also wizards etc in Management Studio, but they mainly serve
to leave you at a guess what is actually going on. And by using commands,
you can save those in a file and reuse later.
--
Erland Sommarskog, SQL Server MVP, esquel@xxxxxxxxxxxxx
Links for SQL Server Books Online:
SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx
SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx
SQL 2000: http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
.
- References:
- Kopieren offener Datenbanken...
- From: Tellie
- Kopieren offener Datenbanken...
- Prev by Date: Kopieren offener Datenbanken...
- Next by Date: Fetching Data from 2 tables and send in text File using query
- Previous by thread: Kopieren offener Datenbanken...
- Next by thread: Fetching Data from 2 tables and send in text File using query
- Index(es):
Relevant Pages
|