Showing posts with label mdf. Show all posts
Showing posts with label mdf. Show all posts

Tuesday, March 27, 2012

BackUp SQLEXPRESS mdf files

Hi All,

I searched the archives but I could not find any useful stuff for me.

I can backup a database on SQLExpress like

USE master
EXEC sp_addumpdevice 'disk', 'Store_1', 'c:\Store_1.dat'
BACKUP DATABASE Store TO Store_1

Here is my problem:

If I use logins,roles etc. in an application automatically a mdf file is created. Or I can create a new sql database. SQLExpress dynamically use the mdf file when connection string defined.

This mdf file is not defined as a database on SQLExpress. Because SQLExpress has not a gui, I cannot see the registered database.

How can I backup any sqlexpress mdf file without deattaching or attaching?

Thanks

That has changed there is now a Management tool now download it install it and use the backup and restore wizard or modify the code in the thread below and use it. Hope this helps.

http://forums.asp.net/thread/1049663.aspx
http://msdn.microsoft.com/vstudio/express/sql/compare/default.aspx

backup sql with sripts

I have database in sql 'crmsource.mdf" I like to automate a backup for it.
OSQL -Usa -PmyPasword -n -Q "BACKUP DATABASE crmsource TO DISK =
'c:\backup\crmsource.dat_bak'"
I get an error:
[shared memory] SQL Server does not exist or access denied.
[shared memory]connectionOpen <connect>>.
Am I haveing this problem because the database is open? Is there a way to
backup without closing the database?
No you wont need to close the DB, you want to perform a hot backup. Hot
backups are done during the database is in use.
Make sure that you are heading for the right server with specifying the
server you wan to connect and issue the command via the
switch -SServername[\InstanceName].
If you aalready stuck with this, read the article
http://support.microsoft.com/default...;en-us;Q328306 that will
guide you to identify your problem.
HTH, Jens Suessmeyer.
http://www.sqlserver2005.de
"gemirkhanian@.hotmail.com"
<gemirkhanianhotmailcom@.discussions.microsoft.com> schrieb im Newsbeitrag
news:263E0B7C-D7AB-4474-A074-D3B177DD6CF3@.microsoft.com...
>I have database in sql 'crmsource.mdf" I like to automate a backup for it.
> OSQL -Usa -PmyPasword -n -Q "BACKUP DATABASE crmsource TO DISK =
> 'c:\backup\crmsource.dat_bak'"
> I get an error:
> [shared memory] SQL Server does not exist or access denied.
> [shared memory]connectionOpen <connect>>.
> Am I haveing this problem because the database is open? Is there a way to
> backup without closing the database?
|||Hello Jens
I created a batch file, content of the batch file is
OSQL -Sfs5-win\grouplink -Usa -Ppassword -n "BACKUP DATABASE crmsource TO
DISK" = 'c:\backup\crmsource.dat_bak'
I now get a syntax error.
I am still trying to automate a backup please help.
"Jens Sü?meyer" wrote:

> No you won′t need to close the DB, you want to perform a hot backup. Hot
> backups are done during the database is in use.
> Make sure that you are heading for the right server with specifying the
> server you wan to connect and issue the command via the
> switch -SServername[\InstanceName].
> If you aalready stuck with this, read the article
> http://support.microsoft.com/default...;en-us;Q328306 that will
> guide you to identify your problem.
> HTH, Jens Suessmeyer.
> --
> http://www.sqlserver2005.de
> --
>
> "gemirkhanian@.hotmail.com"
> <gemirkhanianhotmailcom@.discussions.microsoft.com> schrieb im Newsbeitrag
> news:263E0B7C-D7AB-4474-A074-D3B177DD6CF3@.microsoft.com...
>
>
|||What always helps in newsgroups is the exact error information, becasue
syntax errors are a wide range to search for, i guess in your examples you
didnt put the quotes right around that and that qour switch isnt mentioned
in a right way you, the best way is to use the -Q for the Query you want to
execute:
OSQL -Sfs5-win\grouplink -Usa -Ppassword -n -Q"BACKUP DATABASE crmsource TO
DISK = 'c:\backup\crmsource.dat_bak'"
That should work via Copy & Paste.
HTH, Jens Suessmeyer.
http://www.sqlserver2005.de
"gemirkhanian@.hotmail.com"
<gemirkhanianhotmailcom@.discussions.microsoft.com> schrieb im Newsbeitrag
news:65E020C3-67CB-4EDE-9E88-AF6B0994240B@.microsoft.com...[vbcol=seagreen]
> Hello Jens
> I created a batch file, content of the batch file is
> OSQL -Sfs5-win\grouplink -Usa -Ppassword -n "BACKUP DATABASE crmsource TO
> DISK" = 'c:\backup\crmsource.dat_bak'
> I now get a syntax error.
> I am still trying to automate a backup please help.
>
> "Jens Smeyer" wrote:

Friday, February 10, 2012

backup files

Hello,
Could someone tell me which files i definitly need to backup in sql server
2000. I know i need to backup the master.mdf, but do i also need the
master.trn? If so, why.
Greetings,
Zeke
First off you should not backup at the file level as the resulting backup
may not be transactionally consistent or useable to restore. There is a
backup command in SQL Server that you use to produce a file(s). Check out
the BACKUP and RESTORE commands in BooksOnLine for more information. This
may be useful as well:
http://www.microsoft.com/technet/pro...n/sqlops0.mspx
Andrew J. Kelly SQL MVP
"Ezekil" <ezekiel@.lycos.nl> wrote in message
news:u7cPkz7bEHA.2972@.TK2MSFTNGP12.phx.gbl...
> Hello,
> Could someone tell me which files i definitly need to backup in sql server
> 2000. I know i need to backup the master.mdf, but do i also need the
> master.trn? If so, why.
> Greetings,
> Zeke
>

backup files

Hello,
Could someone tell me which files i definitly need to backup in sql server
2000. I know i need to backup the master.mdf, but do i also need the
master.trn? If so, why.
Greetings,
ZekeFirst off you should not backup at the file level as the resulting backup
may not be transactionally consistent or useable to restore. There is a
backup command in SQL Server that you use to produce a file(s). Check out
the BACKUP and RESTORE commands in BooksOnLine for more information. This
may be useful as well:
http://www.microsoft.com/technet/pr...in/sqlops0.mspx
Andrew J. Kelly SQL MVP
"Ezekil" <ezekiel@.lycos.nl> wrote in message
news:u7cPkz7bEHA.2972@.TK2MSFTNGP12.phx.gbl...
> Hello,
> Could someone tell me which files i definitly need to backup in sql server
> 2000. I know i need to backup the master.mdf, but do i also need the
> master.trn? If so, why.
> Greetings,
> Zeke
>

backup files

Hello,
Could someone tell me which files i definitly need to backup in sql server
2000. I know i need to backup the master.mdf, but do i also need the
master.trn? If so, why.
Greetings,
ZekeFirst off you should not backup at the file level as the resulting backup
may not be transactionally consistent or useable to restore. There is a
backup command in SQL Server that you use to produce a file(s). Check out
the BACKUP and RESTORE commands in BooksOnLine for more information. This
may be useful as well:
http://www.microsoft.com/technet/prodtechnol/sql/2000/maintain/sqlops0.mspx
Andrew J. Kelly SQL MVP
"Ezekiël" <ezekiel@.lycos.nl> wrote in message
news:u7cPkz7bEHA.2972@.TK2MSFTNGP12.phx.gbl...
> Hello,
> Could someone tell me which files i definitly need to backup in sql server
> 2000. I know i need to backup the master.mdf, but do i also need the
> master.trn? If so, why.
> Greetings,
> Zeke
>