Showing posts with label file. Show all posts
Showing posts with label file. Show all posts

Friday, March 30, 2012

Recovery of database on a mount point

When restoring a database where the data file(s) are located under a mount point, seems to be a problem with reporting free space available.

DB Size - Say 30GB (25 Data, 5 Log)

E:\ Drive 20GB with 15GB Free

Restoring database file to

E:\SQLMountPoint\

- This points to separate disk with more than enough free space

SQL prevents the restore by stating there is not enough free space.

A long work around is

assign a drive letter to the large disk

Restore database using temp drive letter - F:\SQLDATA\MyDB_Data.mdf

Update sysfiles - changing drive & path - E:\SQLMountPoint\SQLDATA\MyDB_Data.mdf

Stop & restart database...

Is there a better way?

Wishlist - Restore only warns about free space - but allows continue...

Regards

Which OS version and SQL Server version are you using?

WesleyB

Visit my SQL Server weblog @. http://dis4ea.blogspot.com

|||

Thanks for the reply.

OS: Windows2003 x64 Datacenter R2

SQL: Now running 9.00.3175 - seems to have resolved the problem?

- unable to find mention in fixlists

More testing required just to be sure.

LateNightDBA...

|||

You will typically not find every fix in the published fix list.

I'm glad it works now.

WesleyB

Visit my SQL Server weblog @. http://dis4ea.blogspot.com

Recovery of a corrupted Database due to power failure

Hi,
Iam looking for some tools or methods to recover a corrupted mdf file (SQL
-MSDE 2000)..please help me and I have tried the following :
1. used osql to open the master database and run the DBCC checkdb with
specified database name and given the following message :
Database 'RubyDB' cannot be opened. It has been marked SUSPECT by recovery.
See the SQL Server errorlog for more information.
... i didn't find any useful information in the error log and looked in the
msdn articles and tried to reset the status using sp_resetstatus and didn't
helped. also tried to used the update to change the suspect flag status.
didn't helped
2. also tried to detach the database using the sp_detach_db and tried to
re-attach the particular db by using :
sp_attach_db @.dbname = N'RubyDB', @.filename1 = N'C:\Program Files\Microsoft
SQL Server\MSSQL$RUBYMSDEINSTANCE\Data\RubyDB_Data.MDF ', @.filename2 =
N'C:\Program Files\Microsoft SQL
Server\MSSQL$RUBYMSDEINSTANCE\Data\RubyDB_Log.LDF' ;
An got a message :
Msg 9003, Level 20, State 6, Server ADDSV1WD67Z461\RUBYMSDEINSTANCE, Line 1
The LSN (742:208:1) passed to log scan in database 'RubyDB' is invalid.
Please help me if there are any tools to analyze the database problem (in
the .mdf file) and a way to get back the data (at least in partial)...
Thanks in advance
Hari
"Got Backup?"
If you're against restoring from your last good backup for some reason, then
Google up on suspect databases. There are "unofficial" ways to reset
suspect databases. They're not 100% though, and you may end up having to
restore from backup anyway.
"Hari" <Hari@.discussions.microsoft.com> wrote in message
news:3AB6DE2D-FE0A-450C-A8CF-8E597C97ED5B@.microsoft.com...
> Hi,
> Iam looking for some tools or methods to recover a corrupted mdf file (SQL
> -MSDE 2000)..please help me and I have tried the following :
> 1. used osql to open the master database and run the DBCC checkdb with
> specified database name and given the following message :
> Database 'RubyDB' cannot be opened. It has been marked SUSPECT by
> recovery.
> See the SQL Server errorlog for more information.
> ... i didn't find any useful information in the error log and looked in
> the
> msdn articles and tried to reset the status using sp_resetstatus and
> didn't
> helped. also tried to used the update to change the suspect flag status.
> didn't helped
> 2. also tried to detach the database using the sp_detach_db and tried to
> re-attach the particular db by using :
> sp_attach_db @.dbname = N'RubyDB', @.filename1 = N'C:\Program
> Files\Microsoft
> SQL Server\MSSQL$RUBYMSDEINSTANCE\Data\RubyDB_Data.MDF ', @.filename2 =
> N'C:\Program Files\Microsoft SQL
> Server\MSSQL$RUBYMSDEINSTANCE\Data\RubyDB_Log.LDF' ;
> An got a message :
>
> Msg 9003, Level 20, State 6, Server ADDSV1WD67Z461\RUBYMSDEINSTANCE, Line
> 1
> The LSN (742:208:1) passed to log scan in database 'RubyDB' is invalid.
>
> Please help me if there are any tools to analyze the database problem (in
> the .mdf file) and a way to get back the data (at least in partial)...
>
> Thanks in advance
> Hari
>
|||Mike C# wrote:
> "Got Backup?"
>
What is this "backup" of which you speak? :-)
Tracy McKibben
MCDBA
http://www.realsqlguy.com
|||Mike, could you give me more deatils on this unoffical way of resetting the
suspect database.
hari
"Mike C#" wrote:

> "Got Backup?"
> If you're against restoring from your last good backup for some reason, then
> Google up on suspect databases. There are "unofficial" ways to reset
> suspect databases. They're not 100% though, and you may end up having to
> restore from backup anyway.
> "Hari" <Hari@.discussions.microsoft.com> wrote in message
> news:3AB6DE2D-FE0A-450C-A8CF-8E597C97ED5B@.microsoft.com...
>
>
|||I haven't had to do it in a long time, but basically you try to trick SQL
Server into thinking the database is no longer suspect. As I mentioned, my
good buddies Larry Page and Sergey Brin have a ton of information on it over
at their website (GOOGLE.COM).
If you do get it to work, then I would recommend immediately copying
everything to a NEW database and immediately starting to take daily BACKUPS
so you don't have to go through this again.
"Hari" <Hari@.discussions.microsoft.com> wrote in message
news:BB4CE1FD-CC3C-4DFA-A1D2-6BA056CBFA79@.microsoft.com...[vbcol=seagreen]
> Mike, could you give me more deatils on this unoffical way of resetting
> the
> suspect database.
> hari
> "Mike C#" wrote:
|||"Tracy McKibben" <tracy@.realsqlguy.com> wrote in message
news:45AF77C7.8000807@.realsqlguy.com...
> Mike C# wrote:
> What is this "backup" of which you speak? :-)
It's them high-falutin' words I done heard the DBA's slangin' around the
uther day
On the plus side, nothing makes you start thinking about backups like losing
(or almost losing) a bunch of critical data because you didn't bother
backing it up in the first place

Recovery of a corrupted Database due to power failure

Hi,
Iam looking for some tools or methods to recover a corrupted mdf file (SQL
-MSDE 2000)..please help me and I have tried the following :
1. used osql to open the master database and run the DBCC checkdb with
specified database name and given the following message :
Database 'RubyDB' cannot be opened. It has been marked SUSPECT by recovery.
See the SQL Server errorlog for more information.
... i didn't find any useful information in the error log and looked in the
msdn articles and tried to reset the status using sp_resetstatus and didn't
helped. also tried to used the update to change the suspect flag status.
didn't helped
2. also tried to detach the database using the sp_detach_db and tried to
re-attach the particular db by using :
sp_attach_db @.dbname = N'RubyDB', @.filename1 = N'C:\Program Files\Microsoft
SQL Server\MSSQL$RUBYMSDEINSTANCE\Data\RubyD
B_Data.MDF', @.filename2 =
N'C:\Program Files\Microsoft SQL
Server\MSSQL$RUBYMSDEINSTANCE\Data\RubyD
B_Log.LDF' ;
An got a message :
Msg 9003, Level 20, State 6, Server ADDSV1WD67Z461\RUBYMSDEINSTANCE, Line 1
The LSN (742:208:1) passed to log scan in database 'RubyDB' is invalid.
Please help me if there are any tools to analyze the database problem (in
the .mdf file) and a way to get back the data (at least in partial)...
Thanks in advance
Hari"Got Backup?"
If you're against restoring from your last good backup for some reason, then
Google up on suspect databases. There are "unofficial" ways to reset
suspect databases. They're not 100% though, and you may end up having to
restore from backup anyway.
"Hari" <Hari@.discussions.microsoft.com> wrote in message
news:3AB6DE2D-FE0A-450C-A8CF-8E597C97ED5B@.microsoft.com...
> Hi,
> Iam looking for some tools or methods to recover a corrupted mdf file (SQL
> -MSDE 2000)..please help me and I have tried the following :
> 1. used osql to open the master database and run the DBCC checkdb with
> specified database name and given the following message :
> Database 'RubyDB' cannot be opened. It has been marked SUSPECT by
> recovery.
> See the SQL Server errorlog for more information.
> ... i didn't find any useful information in the error log and looked in
> the
> msdn articles and tried to reset the status using sp_resetstatus and
> didn't
> helped. also tried to used the update to change the suspect flag status.
> didn't helped
> 2. also tried to detach the database using the sp_detach_db and tried to
> re-attach the particular db by using :
> sp_attach_db @.dbname = N'RubyDB', @.filename1 = N'C:\Program
> Files\Microsoft
> SQL Server\MSSQL$RUBYMSDEINSTANCE\Data\RubyD
B_Data.MDF', @.filename2 =
> N'C:\Program Files\Microsoft SQL
> Server\MSSQL$RUBYMSDEINSTANCE\Data\RubyD
B_Log.LDF' ;
> An got a message :
>
> Msg 9003, Level 20, State 6, Server ADDSV1WD67Z461\RUBYMSDEINSTANCE, Line
> 1
> The LSN (742:208:1) passed to log scan in database 'RubyDB' is invalid.
>
> Please help me if there are any tools to analyze the database problem (in
> the .mdf file) and a way to get back the data (at least in partial)...
>
> Thanks in advance
> Hari
>|||Mike C# wrote:
> "Got Backup?"
>
What is this "backup" of which you speak? :-)
Tracy McKibben
MCDBA
http://www.realsqlguy.com|||Mike, could you give me more deatils on this unoffical way of resetting the
suspect database.
hari
"Mike C#" wrote:

> "Got Backup?"
> If you're against restoring from your last good backup for some reason, th
en
> Google up on suspect databases. There are "unofficial" ways to reset
> suspect databases. They're not 100% though, and you may end up having to
> restore from backup anyway.
> "Hari" <Hari@.discussions.microsoft.com> wrote in message
> news:3AB6DE2D-FE0A-450C-A8CF-8E597C97ED5B@.microsoft.com...
>
>|||I haven't had to do it in a long time, but basically you try to trick SQL
Server into thinking the database is no longer suspect. As I mentioned, my
good buddies Larry Page and Sergey Brin have a ton of information on it over
at their website (GOOGLE.COM).
If you do get it to work, then I would recommend immediately copying
everything to a NEW database and immediately starting to take daily BACKUPS
so you don't have to go through this again.
"Hari" <Hari@.discussions.microsoft.com> wrote in message
news:BB4CE1FD-CC3C-4DFA-A1D2-6BA056CBFA79@.microsoft.com...[vbcol=seagreen]
> Mike, could you give me more deatils on this unoffical way of resetting
> the
> suspect database.
> hari
> "Mike C#" wrote:
>|||"Tracy McKibben" <tracy@.realsqlguy.com> wrote in message
news:45AF77C7.8000807@.realsqlguy.com...
> Mike C# wrote:
> What is this "backup" of which you speak? :-)
It's them high-falutin' words I done heard the DBA's slangin' around the
uther day
On the plus side, nothing makes you start thinking about backups like losing
(or almost losing) a bunch of critical data because you didn't bother
backing it up in the first place sql

Recovery of a corrupted Database due to power failure

Hi,
Iam looking for some tools or methods to recover a corrupted mdf file (SQL
-MSDE 2000)..please help me and I have tried the following :
1. used osql to open the master database and run the DBCC checkdb with
specified database name and given the following message :
Database 'RubyDB' cannot be opened. It has been marked SUSPECT by recovery.
See the SQL Server errorlog for more information.
... i didn't find any useful information in the error log and looked in the
msdn articles and tried to reset the status using sp_resetstatus and didn't
helped. also tried to used the update to change the suspect flag status.
didn't helped
2. also tried to detach the database using the sp_detach_db and tried to
re-attach the particular db by using :
sp_attach_db @.dbname = N'RubyDB', @.filename1 = N'C:\Program Files\Microsoft
SQL Server\MSSQL$RUBYMSDEINSTANCE\Data\RubyDB_Data.MDF', @.filename2 = N'C:\Program Files\Microsoft SQL
Server\MSSQL$RUBYMSDEINSTANCE\Data\RubyDB_Log.LDF' ;
An got a message :
Msg 9003, Level 20, State 6, Server ADDSV1WD67Z461\RUBYMSDEINSTANCE, Line 1
The LSN (742:208:1) passed to log scan in database 'RubyDB' is invalid.
Please help me if there are any tools to analyze the database problem (in
the .mdf file) and a way to get back the data (at least in partial)...
Thanks in advance
Hari"Got Backup?"
If you're against restoring from your last good backup for some reason, then
Google up on suspect databases. There are "unofficial" ways to reset
suspect databases. They're not 100% though, and you may end up having to
restore from backup anyway.
"Hari" <Hari@.discussions.microsoft.com> wrote in message
news:3AB6DE2D-FE0A-450C-A8CF-8E597C97ED5B@.microsoft.com...
> Hi,
> Iam looking for some tools or methods to recover a corrupted mdf file (SQL
> -MSDE 2000)..please help me and I have tried the following :
> 1. used osql to open the master database and run the DBCC checkdb with
> specified database name and given the following message :
> Database 'RubyDB' cannot be opened. It has been marked SUSPECT by
> recovery.
> See the SQL Server errorlog for more information.
> ... i didn't find any useful information in the error log and looked in
> the
> msdn articles and tried to reset the status using sp_resetstatus and
> didn't
> helped. also tried to used the update to change the suspect flag status.
> didn't helped
> 2. also tried to detach the database using the sp_detach_db and tried to
> re-attach the particular db by using :
> sp_attach_db @.dbname = N'RubyDB', @.filename1 = N'C:\Program
> Files\Microsoft
> SQL Server\MSSQL$RUBYMSDEINSTANCE\Data\RubyDB_Data.MDF', @.filename2 => N'C:\Program Files\Microsoft SQL
> Server\MSSQL$RUBYMSDEINSTANCE\Data\RubyDB_Log.LDF' ;
> An got a message :
>
> Msg 9003, Level 20, State 6, Server ADDSV1WD67Z461\RUBYMSDEINSTANCE, Line
> 1
> The LSN (742:208:1) passed to log scan in database 'RubyDB' is invalid.
>
> Please help me if there are any tools to analyze the database problem (in
> the .mdf file) and a way to get back the data (at least in partial)...
>
> Thanks in advance
> Hari
>|||Mike C# wrote:
> "Got Backup?"
>
What is this "backup" of which you speak? :-)
Tracy McKibben
MCDBA
http://www.realsqlguy.com|||Mike, could you give me more deatils on this unoffical way of resetting the
suspect database.
hari
"Mike C#" wrote:
> "Got Backup?"
> If you're against restoring from your last good backup for some reason, then
> Google up on suspect databases. There are "unofficial" ways to reset
> suspect databases. They're not 100% though, and you may end up having to
> restore from backup anyway.
> "Hari" <Hari@.discussions.microsoft.com> wrote in message
> news:3AB6DE2D-FE0A-450C-A8CF-8E597C97ED5B@.microsoft.com...
> > Hi,
> >
> > Iam looking for some tools or methods to recover a corrupted mdf file (SQL
> > -MSDE 2000)..please help me and I have tried the following :
> >
> > 1. used osql to open the master database and run the DBCC checkdb with
> > specified database name and given the following message :
> >
> > Database 'RubyDB' cannot be opened. It has been marked SUSPECT by
> > recovery.
> > See the SQL Server errorlog for more information.
> >
> > ... i didn't find any useful information in the error log and looked in
> > the
> > msdn articles and tried to reset the status using sp_resetstatus and
> > didn't
> > helped. also tried to used the update to change the suspect flag status.
> > didn't helped
> >
> > 2. also tried to detach the database using the sp_detach_db and tried to
> > re-attach the particular db by using :
> >
> > sp_attach_db @.dbname = N'RubyDB', @.filename1 = N'C:\Program
> > Files\Microsoft
> > SQL Server\MSSQL$RUBYMSDEINSTANCE\Data\RubyDB_Data.MDF', @.filename2 => > N'C:\Program Files\Microsoft SQL
> > Server\MSSQL$RUBYMSDEINSTANCE\Data\RubyDB_Log.LDF' ;
> >
> > An got a message :
> >
> >
> > Msg 9003, Level 20, State 6, Server ADDSV1WD67Z461\RUBYMSDEINSTANCE, Line
> > 1
> > The LSN (742:208:1) passed to log scan in database 'RubyDB' is invalid.
> >
> >
> > Please help me if there are any tools to analyze the database problem (in
> > the .mdf file) and a way to get back the data (at least in partial)...
> >
> >
> > Thanks in advance
> >
> > Hari
> >
> >
>
>|||I haven't had to do it in a long time, but basically you try to trick SQL
Server into thinking the database is no longer suspect. As I mentioned, my
good buddies Larry Page and Sergey Brin have a ton of information on it over
at their website (GOOGLE.COM).
If you do get it to work, then I would recommend immediately copying
everything to a NEW database and immediately starting to take daily BACKUPS
so you don't have to go through this again.
"Hari" <Hari@.discussions.microsoft.com> wrote in message
news:BB4CE1FD-CC3C-4DFA-A1D2-6BA056CBFA79@.microsoft.com...
> Mike, could you give me more deatils on this unoffical way of resetting
> the
> suspect database.
> hari
> "Mike C#" wrote:
>> "Got Backup?"
>> If you're against restoring from your last good backup for some reason,
>> then
>> Google up on suspect databases. There are "unofficial" ways to reset
>> suspect databases. They're not 100% though, and you may end up having to
>> restore from backup anyway.
>> "Hari" <Hari@.discussions.microsoft.com> wrote in message
>> news:3AB6DE2D-FE0A-450C-A8CF-8E597C97ED5B@.microsoft.com...
>> > Hi,
>> >
>> > Iam looking for some tools or methods to recover a corrupted mdf file
>> > (SQL
>> > -MSDE 2000)..please help me and I have tried the following :
>> >
>> > 1. used osql to open the master database and run the DBCC checkdb with
>> > specified database name and given the following message :
>> >
>> > Database 'RubyDB' cannot be opened. It has been marked SUSPECT by
>> > recovery.
>> > See the SQL Server errorlog for more information.
>> >
>> > ... i didn't find any useful information in the error log and looked in
>> > the
>> > msdn articles and tried to reset the status using sp_resetstatus and
>> > didn't
>> > helped. also tried to used the update to change the suspect flag
>> > status.
>> > didn't helped
>> >
>> > 2. also tried to detach the database using the sp_detach_db and tried
>> > to
>> > re-attach the particular db by using :
>> >
>> > sp_attach_db @.dbname = N'RubyDB', @.filename1 = N'C:\Program
>> > Files\Microsoft
>> > SQL Server\MSSQL$RUBYMSDEINSTANCE\Data\RubyDB_Data.MDF', @.filename2 =>> > N'C:\Program Files\Microsoft SQL
>> > Server\MSSQL$RUBYMSDEINSTANCE\Data\RubyDB_Log.LDF' ;
>> >
>> > An got a message :
>> >
>> >
>> > Msg 9003, Level 20, State 6, Server ADDSV1WD67Z461\RUBYMSDEINSTANCE,
>> > Line
>> > 1
>> > The LSN (742:208:1) passed to log scan in database 'RubyDB' is invalid.
>> >
>> >
>> > Please help me if there are any tools to analyze the database problem
>> > (in
>> > the .mdf file) and a way to get back the data (at least in partial)...
>> >
>> >
>> > Thanks in advance
>> >
>> > Hari
>> >
>> >
>>|||"Tracy McKibben" <tracy@.realsqlguy.com> wrote in message
news:45AF77C7.8000807@.realsqlguy.com...
> Mike C# wrote:
>> "Got Backup?"
> What is this "backup" of which you speak? :-)
It's them high-falutin' words I done heard the DBA's slangin' around the
uther day :)
On the plus side, nothing makes you start thinking about backups like losing
(or almost losing) a bunch of critical data because you didn't bother
backing it up in the first place :)

Wednesday, March 28, 2012

REcovery model for a backup/restore operation

Hello,
I want to do a backup and restore operations of my base, using SQLCMD.exe.
For that, I use backup database mybase to disk='File'
Then, I try to do a backup of transact log but like this:
backup log mybase to disk='File'
But I have this message : Cannot do a backup log on database which is a
simple recovery model.
I read the BOL and I saw there are to type of recovery model: Simple and
full. But I didn't understand very well explications in BOL.
My questions are:
What are this models?
When are they used ?
ThanksIn simple mode, not very much is logged in the transaction log. In full,
almost everything is logged in the transaction log. Thats the basic
difference. Theres a whole lot more to it, so it wouldn be a bad idea to
read up on it.
oh yeah, theres also bulk logged recovery model :)
MC
"bubixx" <bubixx@.discussions.microsoft.com> wrote in message
news:A0AF25DC-B42D-4AF4-9C3E-0F5722B689F8@.microsoft.com...
> Hello,
> I want to do a backup and restore operations of my base, using SQLCMD.exe.
> For that, I use backup database mybase to disk='File'
> Then, I try to do a backup of transact log but like this:
> backup log mybase to disk='File'
> But I have this message : Cannot do a backup log on database which is a
> simple recovery model.
> I read the BOL and I saw there are to type of recovery model: Simple and
> full. But I didn't understand very well explications in BOL.
> My questions are:
> What are this models?
> When are they used ?
> Thanks
>|||Hi, bubixx.
http://vyaskn.tripod.com/ sql_serve...ices
.htm
In this URL you will find a very good white paper about backups and other
administration practices.
Good luck.
Pau.
"bubixx" <bubixx@.discussions.microsoft.com> escribi en el mensaje
news:A0AF25DC-B42D-4AF4-9C3E-0F5722B689F8@.microsoft.com...
> Hello,
> I want to do a backup and restore operations of my base, using SQLCMD.exe.
> For that, I use backup database mybase to disk='File'
> Then, I try to do a backup of transact log but like this:
> backup log mybase to disk='File'
> But I have this message : Cannot do a backup log on database which is a
> simple recovery model.
> I read the BOL and I saw there are to type of recovery model: Simple and
> full. But I didn't understand very well explications in BOL.
> My questions are:
> What are this models?
> When are they used ?
> Thanks
>|||> In simple mode, not very much is logged in the transaction log. In full, almost everythin
g is
> logged in the transaction log.
IMO, that is too much of a simplification. For all but a few special operati
ons, the amount logged
is the same for all recovery models. In simple, SQL Server will by itself em
pty the log each time it
does a checkpoint. In full mode, you have to empty the log using BACKUP LOG.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"MC" <marko_culo#@.#yahoo#.#com#> wrote in message news:uOAqxL07FHA.2092@.TK2MSFTNGP12.phx.gb
l...
> In simple mode, not very much is logged in the transaction log. In full, a
lmost everything is
> logged in the transaction log. Thats the basic difference. Theres a whole
lot more to it, so it
> wouldn be a bad idea to read up on it.
> oh yeah, theres also bulk logged recovery model :)
>
> MC
> "bubixx" <bubixx@.discussions.microsoft.com> wrote in message
> news:A0AF25DC-B42D-4AF4-9C3E-0F5722B689F8@.microsoft.com...
>|||Well, thank you for that.
I thought to simplify as much as I can, since I didnt think that I should go
into explaining the transaction log as such. You managed to write a really
short explanation though, I'll have to use it next time someone asks me to
explain the difference ;).
MC
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:eDetSr17FHA.2816@.tk2msftngp13.phx.gbl...
> IMO, that is too much of a simplification. For all but a few special
> operations, the amount logged is the same for all recovery models. In
> simple, SQL Server will by itself empty the log each time it does a
> checkpoint. In full mode, you have to empty the log using BACKUP LOG.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
> "MC" <marko_culo#@.#yahoo#.#com#> wrote in message
> news:uOAqxL07FHA.2092@.TK2MSFTNGP12.phx.gbl...
>|||> I thought to simplify as much as I can, since I didnt think that I should go into explain
ing the
> transaction log as such.
I figured that was the case. :-)

> , I'll have to use it next time someone asks me to explain the difference ;).[/col
or]
Feel free... :-)
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"MC" <marko_culo#@.#yahoo#.#com#> wrote in message news:%23Sk2Iv17FHA.3660@.TK2MSFTNGP09.phx.
gbl...
> Well, thank you for that.
> I thought to simplify as much as I can, since I didnt think that I should
go into explaining the
> transaction log as such. You managed to write a really short explanation t
hough, I'll have to use
> it next time someone asks me to explain the difference ;).
>
> MC
> "Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote i
n message
> news:eDetSr17FHA.2816@.tk2msftngp13.phx.gbl...
>|||Are you the admin of this server? I assume since you are performing backups.
If you are not sure about the difference between 'full' and 'simple'
recovery and how it affects backups, then it would be best to leave the
recovery model at it's default of 'full'.
SQL Server 2000 Administrator's Pocket Consultant: Database Backup and
Recovery
http://www.microsoft.com/technet/pr...s/c11ppcsq.mspx
SQL Server 2000 Operations Guide: System Administration
http://www.microsoft.com/technet/pr...in/sqlops4.mspx
"bubixx" <bubixx@.discussions.microsoft.com> wrote in message
news:A0AF25DC-B42D-4AF4-9C3E-0F5722B689F8@.microsoft.com...
> Hello,
> I want to do a backup and restore operations of my base, using SQLCMD.exe.
> For that, I use backup database mybase to disk='File'
> Then, I try to do a backup of transact log but like this:
> backup log mybase to disk='File'
> But I have this message : Cannot do a backup log on database which is a
> simple recovery model.
> I read the BOL and I saw there are to type of recovery model: Simple and
> full. But I didn't understand very well explications in BOL.
> My questions are:
> What are this models?
> When are they used ?
> Thanks
>

Recovery model backup and restore database


I want to do a backup and restore operations of my base, using SQLCMD.exe.

For that, I use backup database mybase to disk='File'

Then, I try to do a backup of transact log but like this:

backup log mybase to disk='File'

But I have this message : Cannot do a backup log on database which is a simple recovery model.

I read the BOL and I saw there are to type of recovery model: Simple and full. But I didn't understand very bien explications in BOL.

My questions are:

What is this models?

When are they used ?

ThanksRecovery model determines how the transaction log files are handled in the database. This is in turn affects performance, log file usage, backup/recovery, amount of data loss etc. Please refer to topic below for overview:

ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/udb9/html/606e0487-0c76-4875-af44-ef763cc5a73a.htm

You should also look at the transaction log architecture topic and why it is necessary in a relational database system.

recovery model and dbcc dbreindex

Hello,
I have a log file that grows significantly during DBCC DBREINDEX. Does
anyone know of a good reason why I shouldn't switch the recovery model
from FULL to BULK_LOGGED, perform DBCC DBREINDEX and then switch back to
FULL again?
Thanks,
Craig.
"...how we thwart the natural love of learning by leaving the natural
method of teaching what each wishes to learn, and insisting that you
shall learn what you have no taste or capacity for."
Just watch the size of the following tlog backup (read about details for bulk logged in Books
Online). Also, during time period while in bulk mode and if during that time you perform minimally
logged operations, forthcoming log backup will not have point in time restore (STOPAT). Also, if db
files crash during this same period, not backing up tlog using NO_TRUNCATE option.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
http://www.sqlug.se/
"Craig H." <spam@.thehurley.com> wrote in message news:ejUEgayLFHA.3296@.TK2MSFTNGP15.phx.gbl...
> Hello,
> I have a log file that grows significantly during DBCC DBREINDEX. Does anyone know of a good
> reason why I shouldn't switch the recovery model from FULL to BULK_LOGGED, perform DBCC DBREINDEX
> and then switch back to FULL again?
> Thanks,
> Craig.
>
> --
> "...how we thwart the natural love of learning by leaving the natural method of teaching what each
> wishes to learn, and insisting that you shall learn what you have no taste or capacity for."
|||On 2005-03-22 13:41, Tibor Karaszi wrote:
> Just watch the size of the following tlog backup (read about details
> for bulk logged in Books Online). Also, during time period while in
> bulk mode and if during that time you perform minimally logged
> operations, forthcoming log backup will not have point in time
> restore (STOPAT). Also, if db files crash during this same period,
> not backing up tlog using NO_TRUNCATE option.
>
So the rate at which the log file grows during DBCC DBREINDEX will
decrease and regular inserts will still be logged while the db is using
the BULK_LOGGED model... this will do fine.
Craig.
"The power of accurate observation is frequently called cynicism by
those who don't have it."

recovery model and dbcc dbreindex

Hello,
I have a log file that grows significantly during DBCC DBREINDEX. Does
anyone know of a good reason why I shouldn't switch the recovery model
from FULL to BULK_LOGGED, perform DBCC DBREINDEX and then switch back to
FULL again?
Thanks,
Craig.
"...how we thwart the natural love of learning by leaving the natural
method of teaching what each wishes to learn, and insisting that you
shall learn what you have no taste or capacity for."Just watch the size of the following tlog backup (read about details for bul
k logged in Books
Online). Also, during time period while in bulk mode and if during that time
you perform minimally
logged operations, forthcoming log backup will not have point in time restor
e (STOPAT). Also, if db
files crash during this same period, not backing up tlog using NO_TRUNCATE o
ption.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
http://www.sqlug.se/
"Craig H." <spam@.thehurley.com> wrote in message news:ejUEgayLFHA.3296@.TK2MSFTNGP15.phx.gbl.
.
> Hello,
> I have a log file that grows significantly during DBCC DBREINDEX. Does an
yone know of a good
> reason why I shouldn't switch the recovery model from FULL to BULK_LOGGED,
perform DBCC DBREINDEX
> and then switch back to FULL again?
> Thanks,
> Craig.
>
> --
> "...how we thwart the natural love of learning by leaving the natural meth
od of teaching what each
> wishes to learn, and insisting that you shall learn what you have no taste or capa
city for."|||On 2005-03-22 13:41, Tibor Karaszi wrote:
> Just watch the size of the following tlog backup (read about details
> for bulk logged in Books Online). Also, during time period while in
> bulk mode and if during that time you perform minimally logged
> operations, forthcoming log backup will not have point in time
> restore (STOPAT). Also, if db files crash during this same period,
> not backing up tlog using NO_TRUNCATE option.
>
So the rate at which the log file grows during DBCC DBREINDEX will
decrease and regular inserts will still be logged while the db is using
the BULK_LOGGED model... this will do fine.
Craig.
"The power of accurate observation is frequently called cynicism by
those who don't have it."

recovery model and dbcc dbreindex

Hello,
I have a log file that grows significantly during DBCC DBREINDEX. Does
anyone know of a good reason why I shouldn't switch the recovery model
from FULL to BULK_LOGGED, perform DBCC DBREINDEX and then switch back to
FULL again?
Thanks,
Craig.
--
"...how we thwart the natural love of learning by leaving the natural
method of teaching what each wishes to learn, and insisting that you
shall learn what you have no taste or capacity for."Just watch the size of the following tlog backup (read about details for bulk logged in Books
Online). Also, during time period while in bulk mode and if during that time you perform minimally
logged operations, forthcoming log backup will not have point in time restore (STOPAT). Also, if db
files crash during this same period, not backing up tlog using NO_TRUNCATE option.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
http://www.sqlug.se/
"Craig H." <spam@.thehurley.com> wrote in message news:ejUEgayLFHA.3296@.TK2MSFTNGP15.phx.gbl...
> Hello,
> I have a log file that grows significantly during DBCC DBREINDEX. Does anyone know of a good
> reason why I shouldn't switch the recovery model from FULL to BULK_LOGGED, perform DBCC DBREINDEX
> and then switch back to FULL again?
> Thanks,
> Craig.
>
> --
> "...how we thwart the natural love of learning by leaving the natural method of teaching what each
> wishes to learn, and insisting that you shall learn what you have no taste or capacity for."|||On 2005-03-22 13:41, Tibor Karaszi wrote:
> Just watch the size of the following tlog backup (read about details
> for bulk logged in Books Online). Also, during time period while in
> bulk mode and if during that time you perform minimally logged
> operations, forthcoming log backup will not have point in time
> restore (STOPAT). Also, if db files crash during this same period,
> not backing up tlog using NO_TRUNCATE option.
>
So the rate at which the log file grows during DBCC DBREINDEX will
decrease and regular inserts will still be logged while the db is using
the BULK_LOGGED model... this will do fine.
Craig.
"The power of accurate observation is frequently called cynicism by
those who don't have it."

recovery mode and log size

hi friends,
after setting merge replication my log file is incresing continuouly.its going in gbs.what should be the optimum log file size for a database.what are the microsoft recommendations regarding this
what should be the best recovery mode to implement.it is simple,full,bulklogback.
which should be the efficient .
what is the microsoft recommendations for this
please help
thanks
reddy
Reddy,
the size of the transaction log depends on too many factors to recommend a fixed value. As you're using merge replication, this shouldn't be related to transactions not read from the log.
The frequency of the backup of the database depends on the normal factors - personally I backup the database each evening and the log every 30 mins.
If it is particularly large then you might increase the frequency of your log backups (if you're doing things this way). Generally, to remove committed transactions - backup the log, truncate the log or use simple recovery mode. To reduce the log size, ru
n DBCC SHRINGFILE.
HTH,
Paul Ibison
|||paul,
thanks for your solution
regards
reddy
"Paul Ibison" wrote:

> Reddy,
> the size of the transaction log depends on too many factors to recommend a fixed value. As you're using merge replication, this shouldn't be related to transactions not read from the log.
> The frequency of the backup of the database depends on the normal factors - personally I backup the database each evening and the log every 30 mins.
> If it is particularly large then you might increase the frequency of your log backups (if you're doing things this way). Generally, to remove committed transactions - backup the log, truncate the log or use simple recovery mode. To reduce the log size,
run DBCC SHRINGFILE.
> HTH,
> Paul Ibison

Recovery Full vs Simple

Hi,
Once in a while I have to do a set of things to avoid the db halts in the
middle of the day to resize the log file as it grows. These are the ones in
the correct order:
1) ALTER DATABASE MyDb SET RECOVERY SIMPLE
2) dbcc shrinkfile(MyDb_log,1)
3) ALTER DATABASE MyDb SET RECOVERY FULL
4) Then allocate a big junk of space for the log file to have enough buffer.
This operation can take a long time.
Is there an alternative to that? I already set up real-time replication and
full backup every night, so I'm also wondering what other benefits that the
log file set in full mode would give me, would someone know?
Thanks!!If you don't require log backups then set recovery mode permanently to
Simple. Set the log file size as big as you need it and then leave it alone.
The one thing NOT to do is regularly shrik the log. Doing so achieves
nothing except harm performance and probably bring your server to a halt.
http://www.karaszi.com/SQLServer/info_dont_shrink.asp
--
David Portas
SQL Server MVP
--|||Zeng wrote:
> Hi,
> Once in a while I have to do a set of things to avoid the db halts in
> the middle of the day to resize the log file as it grows. These are
> the ones in the correct order:
> 1) ALTER DATABASE MyDb SET RECOVERY SIMPLE
> 2) dbcc shrinkfile(MyDb_log,1)
> 3) ALTER DATABASE MyDb SET RECOVERY FULL
> 4) Then allocate a big junk of space for the log file to have enough
> buffer. This operation can take a long time.
> Is there an alternative to that? I already set up real-time
> replication and full backup every night, so I'm also wondering what
> other benefits that the log file set in full mode would give me,
> would someone know?
> Thanks!!
To add to what David said, once you go from Simple to Full recovery, you
have to immediately perform a full database backup to prevent the log
file from continuing to truncate.
--
David Gugick
Quest Software
www.imceda.com
www.quest.com|||In which scenerios/reasons I should have log backups? thanks
"David Portas" <REMOVE_BEFORE_REPLYING_dportas@.acm.org> wrote in message
news:VY2dnZpdAtWA1CrfRVn-sw@.giganews.com...
> If you don't require log backups then set recovery mode permanently to
> Simple. Set the log file size as big as you need it and then leave it
alone.
> The one thing NOT to do is regularly shrik the log. Doing so achieves
> nothing except harm performance and probably bring your server to a halt.
> http://www.karaszi.com/SQLServer/info_dont_shrink.asp
> --
> David Portas
> SQL Server MVP
> --
>|||Log backup allow things like:
More frequent backup. Like every 10 minutes or every hour.
Pint in time restore. When you restore from a log backup, you can STOPAT a specified time.
Backup the log of a damaged database.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"Zeng" <Zeng5000@.hotmail.com> wrote in message news:uC%237rVfdFHA.1456@.TK2MSFTNGP15.phx.gbl...
> In which scenerios/reasons I should have log backups? thanks
> "David Portas" <REMOVE_BEFORE_REPLYING_dportas@.acm.org> wrote in message
> news:VY2dnZpdAtWA1CrfRVn-sw@.giganews.com...
>> If you don't require log backups then set recovery mode permanently to
>> Simple. Set the log file size as big as you need it and then leave it
> alone.
>> The one thing NOT to do is regularly shrik the log. Doing so achieves
>> nothing except harm performance and probably bring your server to a halt.
>> http://www.karaszi.com/SQLServer/info_dont_shrink.asp
>> --
>> David Portas
>> SQL Server MVP
>> --
>>
>|||It depends what level of recovery you need. If you believe backing up
once a day meets your needs then maybe you don't require transaction
log backups. In most OLTP scenarios however it's usually unacceptable
for the business to lose a day's work in the event of a disaster. Log
backups mean you can take much more frequent backups during the during
the day and therefore minimize the risk of data loss and downtime.
--
David Portas
SQL Server MVP
--|||If I have continuous replication set up, would it be any beneficial to me?
That is, is there a case where my replication db is bad that I need to
rollback/restore my db back to 10 min before the disaster happens?
thanks
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:OdGFl0idFHA.960@.TK2MSFTNGP10.phx.gbl...
> Log backup allow things like:
> More frequent backup. Like every 10 minutes or every hour.
> Pint in time restore. When you restore from a log backup, you can STOPAT a
specified time.
> Backup the log of a damaged database.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
> Blog: http://solidqualitylearning.com/blogs/tibor/
>
> "Zeng" <Zeng5000@.hotmail.com> wrote in message
news:uC%237rVfdFHA.1456@.TK2MSFTNGP15.phx.gbl...
> > In which scenerios/reasons I should have log backups? thanks
> >
> > "David Portas" <REMOVE_BEFORE_REPLYING_dportas@.acm.org> wrote in message
> > news:VY2dnZpdAtWA1CrfRVn-sw@.giganews.com...
> >> If you don't require log backups then set recovery mode permanently to
> >> Simple. Set the log file size as big as you need it and then leave it
> > alone.
> >> The one thing NOT to do is regularly shrik the log. Doing so achieves
> >> nothing except harm performance and probably bring your server to a
halt.
> >>
> >> http://www.karaszi.com/SQLServer/info_dont_shrink.asp
> >>
> >> --
> >> David Portas
> >> SQL Server MVP
> >> --
> >>
> >>
> >
> >|||I'm not sure I understand the question. Are you saying you want to use replication for some disaster
recovery scenario instead of backup? If so, don't. If you are looking for high avability, read
http://www.microsoft.com/technet/prodtechnol/sql/2000/deploy/sqlhalp.mspx
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"Zeng" <Zeng5000@.hotmail.com> wrote in message news:ur59lcqdFHA.4040@.TK2MSFTNGP14.phx.gbl...
> If I have continuous replication set up, would it be any beneficial to me?
> That is, is there a case where my replication db is bad that I need to
> rollback/restore my db back to 10 min before the disaster happens?
> thanks
> "Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
> message news:OdGFl0idFHA.960@.TK2MSFTNGP10.phx.gbl...
>> Log backup allow things like:
>> More frequent backup. Like every 10 minutes or every hour.
>> Pint in time restore. When you restore from a log backup, you can STOPAT a
> specified time.
>> Backup the log of a damaged database.
>> --
>> Tibor Karaszi, SQL Server MVP
>> http://www.karaszi.com/sqlserver/default.asp
>> http://www.solidqualitylearning.com/
>> Blog: http://solidqualitylearning.com/blogs/tibor/
>>
>> "Zeng" <Zeng5000@.hotmail.com> wrote in message
> news:uC%237rVfdFHA.1456@.TK2MSFTNGP15.phx.gbl...
>> > In which scenerios/reasons I should have log backups? thanks
>> >
>> > "David Portas" <REMOVE_BEFORE_REPLYING_dportas@.acm.org> wrote in message
>> > news:VY2dnZpdAtWA1CrfRVn-sw@.giganews.com...
>> >> If you don't require log backups then set recovery mode permanently to
>> >> Simple. Set the log file size as big as you need it and then leave it
>> > alone.
>> >> The one thing NOT to do is regularly shrik the log. Doing so achieves
>> >> nothing except harm performance and probably bring your server to a
> halt.
>> >>
>> >> http://www.karaszi.com/SQLServer/info_dont_shrink.asp
>> >>
>> >> --
>> >> David Portas
>> >> SQL Server MVP
>> >> --
>> >>
>> >>
>> >
>> >
>|||It might be worth that you read about Backup/Restore Architecture in Books
On Line. It seems like you are missing some basic knowledge about how backup
works - and why you need to backup...:-).
Using replication might be ok in the case where your database becomes
corrupt, but what if a user makes a mistake in the database? Then this
mistake will be replicated as well, so you can't recreate data from the
replicated database. If you have a backup you can restore to a point in time
and then get data from there.
Regards
Steen
Zeng wrote:
> If I have continuous replication set up, would it be any beneficial
> to me? That is, is there a case where my replication db is bad that I
> need to rollback/restore my db back to 10 min before the disaster
> happens?
> thanks
> "Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com>
> wrote in message news:OdGFl0idFHA.960@.TK2MSFTNGP10.phx.gbl...
>> Log backup allow things like:
>> More frequent backup. Like every 10 minutes or every hour.
>> Pint in time restore. When you restore from a log backup, you can
>> STOPAT a specified time. Backup the log of a damaged database.
>> --
>> Tibor Karaszi, SQL Server MVP
>> http://www.karaszi.com/sqlserver/default.asp
>> http://www.solidqualitylearning.com/
>> Blog: http://solidqualitylearning.com/blogs/tibor/
>>
>> "Zeng" <Zeng5000@.hotmail.com> wrote in message
> news:uC%237rVfdFHA.1456@.TK2MSFTNGP15.phx.gbl...
>> In which scenerios/reasons I should have log backups? thanks
>> "David Portas" <REMOVE_BEFORE_REPLYING_dportas@.acm.org> wrote in
>> message news:VY2dnZpdAtWA1CrfRVn-sw@.giganews.com...
>> If you don't require log backups then set recovery mode
>> permanently to Simple. Set the log file size as big as you need it
>> and then leave it alone. The one thing NOT to do is regularly
>> shrik the log. Doing so achieves nothing except harm performance
>> and probably bring your server to a halt.
>> http://www.karaszi.com/SQLServer/info_dont_shrink.asp
>> --
>> David Portas
>> SQL Server MVP
>> --|||we back up every night as well. Why would it be so important to recover user
mistake within the same day (smaller window of time -> less amount of work
to reconstruct)? If a computer user makes a mistake - such as overwriting a
file on their personal computer, there won't be much to recover, that's
widely accepted. If we have 1000 users and 10% of them eventually want to
recover their mistake, it would be messy. Maybe you are concerned about
system mistake/bug?
If I go to my bank and withdraw a money out of the checking account and
trigger a fee because it goes below certain balance threshold, nobody would
allow me to cover it.
Rolling back entire db to certain point in time and make it production db
won't work well either, there must have been many changes since that point
in time that won't be honored in the rollback.
"Steen Persson (DK)" <spe@.REMOVEdatea.dk> wrote in message
news:%23LUzwSydFHA.2776@.TK2MSFTNGP10.phx.gbl...
> It might be worth that you read about Backup/Restore Architecture in Books
> On Line. It seems like you are missing some basic knowledge about how
backup
> works - and why you need to backup...:-).
> Using replication might be ok in the case where your database becomes
> corrupt, but what if a user makes a mistake in the database? Then this
> mistake will be replicated as well, so you can't recreate data from the
> replicated database. If you have a backup you can restore to a point in
time
> and then get data from there.
> Regards
> Steen
> Zeng wrote:
> > If I have continuous replication set up, would it be any beneficial
> > to me? That is, is there a case where my replication db is bad that I
> > need to rollback/restore my db back to 10 min before the disaster
> > happens?
> >
> > thanks
> >
> > "Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com>
> > wrote in message news:OdGFl0idFHA.960@.TK2MSFTNGP10.phx.gbl...
> >> Log backup allow things like:
> >>
> >> More frequent backup. Like every 10 minutes or every hour.
> >> Pint in time restore. When you restore from a log backup, you can
> >> STOPAT a specified time. Backup the log of a damaged database.
> >>
> >> --
> >> Tibor Karaszi, SQL Server MVP
> >> http://www.karaszi.com/sqlserver/default.asp
> >> http://www.solidqualitylearning.com/
> >> Blog: http://solidqualitylearning.com/blogs/tibor/
> >>
> >>
> >> "Zeng" <Zeng5000@.hotmail.com> wrote in message
> > news:uC%237rVfdFHA.1456@.TK2MSFTNGP15.phx.gbl...
> >> In which scenerios/reasons I should have log backups? thanks
> >>
> >> "David Portas" <REMOVE_BEFORE_REPLYING_dportas@.acm.org> wrote in
> >> message news:VY2dnZpdAtWA1CrfRVn-sw@.giganews.com...
> >> If you don't require log backups then set recovery mode
> >> permanently to Simple. Set the log file size as big as you need it
> >> and then leave it alone. The one thing NOT to do is regularly
> >> shrik the log. Doing so achieves nothing except harm performance
> >> and probably bring your server to a halt.
> >>
> >> http://www.karaszi.com/SQLServer/info_dont_shrink.asp
> >>
> >> --
> >> David Portas
> >> SQL Server MVP
> >> --
>|||Generally, you don't use backups to recovery from plain user mistakes. If a user deletes an order,
that user call up the customer, admits the mistake and re-enter the order. And learn from that. Or,
in reality use some logged information by the app or on paper to recover.
What you protect is from things like deleting a table by mistake. Or deleting all rows in a table by
mistake. The problem with undoing only certain operations in a database is that the database has a
state from two different points in time. And one operations can very well be depending on another
operation. "We wouldn't have allowed this loan if it weren't for..." I.e., you have an inconsistent
database. You will only allow this if you know your data *very* well.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"Zeng" <Zeng5000@.hotmail.com> wrote in message news:OiAZWU1dFHA.1384@.TK2MSFTNGP09.phx.gbl...
> we back up every night as well. Why would it be so important to recover user
> mistake within the same day (smaller window of time -> less amount of work
> to reconstruct)? If a computer user makes a mistake - such as overwriting a
> file on their personal computer, there won't be much to recover, that's
> widely accepted. If we have 1000 users and 10% of them eventually want to
> recover their mistake, it would be messy. Maybe you are concerned about
> system mistake/bug?
> If I go to my bank and withdraw a money out of the checking account and
> trigger a fee because it goes below certain balance threshold, nobody would
> allow me to cover it.
> Rolling back entire db to certain point in time and make it production db
> won't work well either, there must have been many changes since that point
> in time that won't be honored in the rollback.
>
> "Steen Persson (DK)" <spe@.REMOVEdatea.dk> wrote in message
> news:%23LUzwSydFHA.2776@.TK2MSFTNGP10.phx.gbl...
>> It might be worth that you read about Backup/Restore Architecture in Books
>> On Line. It seems like you are missing some basic knowledge about how
> backup
>> works - and why you need to backup...:-).
>> Using replication might be ok in the case where your database becomes
>> corrupt, but what if a user makes a mistake in the database? Then this
>> mistake will be replicated as well, so you can't recreate data from the
>> replicated database. If you have a backup you can restore to a point in
> time
>> and then get data from there.
>> Regards
>> Steen
>> Zeng wrote:
>> > If I have continuous replication set up, would it be any beneficial
>> > to me? That is, is there a case where my replication db is bad that I
>> > need to rollback/restore my db back to 10 min before the disaster
>> > happens?
>> >
>> > thanks
>> >
>> > "Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com>
>> > wrote in message news:OdGFl0idFHA.960@.TK2MSFTNGP10.phx.gbl...
>> >> Log backup allow things like:
>> >>
>> >> More frequent backup. Like every 10 minutes or every hour.
>> >> Pint in time restore. When you restore from a log backup, you can
>> >> STOPAT a specified time. Backup the log of a damaged database.
>> >>
>> >> --
>> >> Tibor Karaszi, SQL Server MVP
>> >> http://www.karaszi.com/sqlserver/default.asp
>> >> http://www.solidqualitylearning.com/
>> >> Blog: http://solidqualitylearning.com/blogs/tibor/
>> >>
>> >>
>> >> "Zeng" <Zeng5000@.hotmail.com> wrote in message
>> > news:uC%237rVfdFHA.1456@.TK2MSFTNGP15.phx.gbl...
>> >> In which scenerios/reasons I should have log backups? thanks
>> >>
>> >> "David Portas" <REMOVE_BEFORE_REPLYING_dportas@.acm.org> wrote in
>> >> message news:VY2dnZpdAtWA1CrfRVn-sw@.giganews.com...
>> >> If you don't require log backups then set recovery mode
>> >> permanently to Simple. Set the log file size as big as you need it
>> >> and then leave it alone. The one thing NOT to do is regularly
>> >> shrik the log. Doing so achieves nothing except harm performance
>> >> and probably bring your server to a halt.
>> >>
>> >> http://www.karaszi.com/SQLServer/info_dont_shrink.asp
>> >>
>> >> --
>> >> David Portas
>> >> SQL Server MVP
>> >> --
>>
>sql

Monday, March 26, 2012

Recovery Full vs Simple

Hi,
Once in a while I have to do a set of things to avoid the db halts in the
middle of the day to resize the log file as it grows. These are the ones in
the correct order:
1) ALTER DATABASE MyDb SET RECOVERY SIMPLE
2) dbcc shrinkfile(MyDb_log,1)
3) ALTER DATABASE MyDb SET RECOVERY FULL
4) Then allocate a big junk of space for the log file to have enough buffer.
This operation can take a long time.
Is there an alternative to that? I already set up real-time replication and
full backup every night, so I'm also wondering what other benefits that the
log file set in full mode would give me, would someone know?
Thanks!!
If you don't require log backups then set recovery mode permanently to
Simple. Set the log file size as big as you need it and then leave it alone.
The one thing NOT to do is regularly shrik the log. Doing so achieves
nothing except harm performance and probably bring your server to a halt.
http://www.karaszi.com/SQLServer/info_dont_shrink.asp
David Portas
SQL Server MVP
|||Zeng wrote:
> Hi,
> Once in a while I have to do a set of things to avoid the db halts in
> the middle of the day to resize the log file as it grows. These are
> the ones in the correct order:
> 1) ALTER DATABASE MyDb SET RECOVERY SIMPLE
> 2) dbcc shrinkfile(MyDb_log,1)
> 3) ALTER DATABASE MyDb SET RECOVERY FULL
> 4) Then allocate a big junk of space for the log file to have enough
> buffer. This operation can take a long time.
> Is there an alternative to that? I already set up real-time
> replication and full backup every night, so I'm also wondering what
> other benefits that the log file set in full mode would give me,
> would someone know?
> Thanks!!
To add to what David said, once you go from Simple to Full recovery, you
have to immediately perform a full database backup to prevent the log
file from continuing to truncate.
David Gugick
Quest Software
www.imceda.com
www.quest.com
|||In which scenerios/reasons I should have log backups? thanks
"David Portas" <REMOVE_BEFORE_REPLYING_dportas@.acm.org> wrote in message
news:VY2dnZpdAtWA1CrfRVn-sw@.giganews.com...
> If you don't require log backups then set recovery mode permanently to
> Simple. Set the log file size as big as you need it and then leave it
alone.
> The one thing NOT to do is regularly shrik the log. Doing so achieves
> nothing except harm performance and probably bring your server to a halt.
> http://www.karaszi.com/SQLServer/info_dont_shrink.asp
> --
> David Portas
> SQL Server MVP
> --
>
|||Log backup allow things like:
More frequent backup. Like every 10 minutes or every hour.
Pint in time restore. When you restore from a log backup, you can STOPAT a specified time.
Backup the log of a damaged database.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"Zeng" <Zeng5000@.hotmail.com> wrote in message news:uC%237rVfdFHA.1456@.TK2MSFTNGP15.phx.gbl...
> In which scenerios/reasons I should have log backups? thanks
> "David Portas" <REMOVE_BEFORE_REPLYING_dportas@.acm.org> wrote in message
> news:VY2dnZpdAtWA1CrfRVn-sw@.giganews.com...
> alone.
>
|||It depends what level of recovery you need. If you believe backing up
once a day meets your needs then maybe you don't require transaction
log backups. In most OLTP scenarios however it's usually unacceptable
for the business to lose a day's work in the event of a disaster. Log
backups mean you can take much more frequent backups during the during
the day and therefore minimize the risk of data loss and downtime.
David Portas
SQL Server MVP
|||If I have continuous replication set up, would it be any beneficial to me?
That is, is there a case where my replication db is bad that I need to
rollback/restore my db back to 10 min before the disaster happens?
thanks
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:OdGFl0idFHA.960@.TK2MSFTNGP10.phx.gbl...
> Log backup allow things like:
> More frequent backup. Like every 10 minutes or every hour.
> Pint in time restore. When you restore from a log backup, you can STOPAT a
specified time.
> Backup the log of a damaged database.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
> Blog: http://solidqualitylearning.com/blogs/tibor/
>
> "Zeng" <Zeng5000@.hotmail.com> wrote in message
news:uC%237rVfdFHA.1456@.TK2MSFTNGP15.phx.gbl...[vbcol=seagreen]
halt.[vbcol=seagreen]
|||I'm not sure I understand the question. Are you saying you want to use replication for some disaster
recovery scenario instead of backup? If so, don't. If you are looking for high avability, read
http://www.microsoft.com/technet/pro...y/sqlhalp.mspx
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"Zeng" <Zeng5000@.hotmail.com> wrote in message news:ur59lcqdFHA.4040@.TK2MSFTNGP14.phx.gbl...
> If I have continuous replication set up, would it be any beneficial to me?
> That is, is there a case where my replication db is bad that I need to
> rollback/restore my db back to 10 min before the disaster happens?
> thanks
> "Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
> message news:OdGFl0idFHA.960@.TK2MSFTNGP10.phx.gbl...
> specified time.
> news:uC%237rVfdFHA.1456@.TK2MSFTNGP15.phx.gbl...
> halt.
>
|||It might be worth that you read about Backup/Restore Architecture in Books
On Line. It seems like you are missing some basic knowledge about how backup
works - and why you need to backup...:-).
Using replication might be ok in the case where your database becomes
corrupt, but what if a user makes a mistake in the database? Then this
mistake will be replicated as well, so you can't recreate data from the
replicated database. If you have a backup you can restore to a point in time
and then get data from there.
Regards
Steen
Zeng wrote:[vbcol=seagreen]
> If I have continuous replication set up, would it be any beneficial
> to me? That is, is there a case where my replication db is bad that I
> need to rollback/restore my db back to 10 min before the disaster
> happens?
> thanks
> "Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com>
> wrote in message news:OdGFl0idFHA.960@.TK2MSFTNGP10.phx.gbl...
> news:uC%237rVfdFHA.1456@.TK2MSFTNGP15.phx.gbl...
|||we back up every night as well. Why would it be so important to recover user
mistake within the same day (smaller window of time -> less amount of work
to reconstruct)? If a computer user makes a mistake - such as overwriting a
file on their personal computer, there won't be much to recover, that's
widely accepted. If we have 1000 users and 10% of them eventually want to
recover their mistake, it would be messy. Maybe you are concerned about
system mistake/bug?
If I go to my bank and withdraw a money out of the checking account and
trigger a fee because it goes below certain balance threshold, nobody would
allow me to cover it.
Rolling back entire db to certain point in time and make it production db
won't work well either, there must have been many changes since that point
in time that won't be honored in the rollback.
"Steen Persson (DK)" <spe@.REMOVEdatea.dk> wrote in message
news:%23LUzwSydFHA.2776@.TK2MSFTNGP10.phx.gbl...
> It might be worth that you read about Backup/Restore Architecture in Books
> On Line. It seems like you are missing some basic knowledge about how
backup
> works - and why you need to backup...:-).
> Using replication might be ok in the case where your database becomes
> corrupt, but what if a user makes a mistake in the database? Then this
> mistake will be replicated as well, so you can't recreate data from the
> replicated database. If you have a backup you can restore to a point in
time
> and then get data from there.
> Regards
> Steen
> Zeng wrote:
>

Recovery Full vs Simple

Hi,
Once in a while I have to do a set of things to avoid the db halts in the
middle of the day to resize the log file as it grows. These are the ones in
the correct order:
1) ALTER DATABASE MyDb SET RECOVERY SIMPLE
2) dbcc shrinkfile(MyDb_log,1)
3) ALTER DATABASE MyDb SET RECOVERY FULL
4) Then allocate a big junk of space for the log file to have enough buffer.
This operation can take a long time.
Is there an alternative to that? I already set up real-time replication and
full backup every night, so I'm also wondering what other benefits that the
log file set in full mode would give me, would someone know?
Thanks!!If you don't require log backups then set recovery mode permanently to
Simple. Set the log file size as big as you need it and then leave it alone.
The one thing NOT to do is regularly shrik the log. Doing so achieves
nothing except harm performance and probably bring your server to a halt.
http://www.karaszi.com/SQLServer/info_dont_shrink.asp
David Portas
SQL Server MVP
--|||Zeng wrote:
> Hi,
> Once in a while I have to do a set of things to avoid the db halts in
> the middle of the day to resize the log file as it grows. These are
> the ones in the correct order:
> 1) ALTER DATABASE MyDb SET RECOVERY SIMPLE
> 2) dbcc shrinkfile(MyDb_log,1)
> 3) ALTER DATABASE MyDb SET RECOVERY FULL
> 4) Then allocate a big junk of space for the log file to have enough
> buffer. This operation can take a long time.
> Is there an alternative to that? I already set up real-time
> replication and full backup every night, so I'm also wondering what
> other benefits that the log file set in full mode would give me,
> would someone know?
> Thanks!!
To add to what David said, once you go from Simple to Full recovery, you
have to immediately perform a full database backup to prevent the log
file from continuing to truncate.
David Gugick
Quest Software
www.imceda.com
www.quest.com|||In which scenerios/reasons I should have log backups? thanks
"David Portas" <REMOVE_BEFORE_REPLYING_dportas@.acm.org> wrote in message
news:VY2dnZpdAtWA1CrfRVn-sw@.giganews.com...
> If you don't require log backups then set recovery mode permanently to
> Simple. Set the log file size as big as you need it and then leave it
alone.
> The one thing NOT to do is regularly shrik the log. Doing so achieves
> nothing except harm performance and probably bring your server to a halt.
> http://www.karaszi.com/SQLServer/info_dont_shrink.asp
> --
> David Portas
> SQL Server MVP
> --
>|||Log backup allow things like:
More frequent backup. Like every 10 minutes or every hour.
Pint in time restore. When you restore from a log backup, you can STOPAT a s
pecified time.
Backup the log of a damaged database.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"Zeng" <Zeng5000@.hotmail.com> wrote in message news:uC%237rVfdFHA.1456@.TK2MSFTNGP15.phx.gbl.
.
> In which scenerios/reasons I should have log backups? thanks
> "David Portas" <REMOVE_BEFORE_REPLYING_dportas@.acm.org> wrote in message
> news:VY2dnZpdAtWA1CrfRVn-sw@.giganews.com...
> alone.
>|||It depends what level of recovery you need. If you believe backing up
once a day meets your needs then maybe you don't require transaction
log backups. In most OLTP scenarios however it's usually unacceptable
for the business to lose a day's work in the event of a disaster. Log
backups mean you can take much more frequent backups during the during
the day and therefore minimize the risk of data loss and downtime.
David Portas
SQL Server MVP
--|||If I have continuous replication set up, would it be any beneficial to me?
That is, is there a case where my replication db is bad that I need to
rollback/restore my db back to 10 min before the disaster happens?
thanks
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:OdGFl0idFHA.960@.TK2MSFTNGP10.phx.gbl...
> Log backup allow things like:
> More frequent backup. Like every 10 minutes or every hour.
> Pint in time restore. When you restore from a log backup, you can STOPAT a
specified time.
> Backup the log of a damaged database.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
> Blog: http://solidqualitylearning.com/blogs/tibor/
>
> "Zeng" <Zeng5000@.hotmail.com> wrote in message
news:uC%237rVfdFHA.1456@.TK2MSFTNGP15.phx.gbl...[vbcol=seagreen]
halt.[vbcol=seagreen]|||I'm not sure I understand the question. Are you saying you want to use repli
cation for some disaster
recovery scenario instead of backup? If so, don't. If you are looking for hi
gh avability, read
http://www.microsoft.com/technet/pr...oy/sqlhalp.mspx
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"Zeng" <Zeng5000@.hotmail.com> wrote in message news:ur59lcqdFHA.4040@.TK2MSFTNGP14.phx.gbl...

> If I have continuous replication set up, would it be any beneficial to me?
> That is, is there a case where my replication db is bad that I need to
> rollback/restore my db back to 10 min before the disaster happens?
> thanks
> "Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote i
n
> message news:OdGFl0idFHA.960@.TK2MSFTNGP10.phx.gbl...
> specified time.
> news:uC%237rVfdFHA.1456@.TK2MSFTNGP15.phx.gbl...
> halt.
>|||It might be worth that you read about Backup/Restore Architecture in Books
On Line. It seems like you are missing some basic knowledge about how backup
works - and why you need to backup...:-).
Using replication might be ok in the case where your database becomes
corrupt, but what if a user makes a mistake in the database? Then this
mistake will be replicated as well, so you can't recreate data from the
replicated database. If you have a backup you can restore to a point in time
and then get data from there.
Regards
Steen
Zeng wrote:[vbcol=seagreen]
> If I have continuous replication set up, would it be any beneficial
> to me? That is, is there a case where my replication db is bad that I
> need to rollback/restore my db back to 10 min before the disaster
> happens?
> thanks
> "Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com>
> wrote in message news:OdGFl0idFHA.960@.TK2MSFTNGP10.phx.gbl...
> news:uC%237rVfdFHA.1456@.TK2MSFTNGP15.phx.gbl...|||we back up every night as well. Why would it be so important to recover user
mistake within the same day (smaller window of time -> less amount of work
to reconstruct)? If a computer user makes a mistake - such as overwriting a
file on their personal computer, there won't be much to recover, that's
widely accepted. If we have 1000 users and 10% of them eventually want to
recover their mistake, it would be messy. Maybe you are concerned about
system mistake/bug?
If I go to my bank and withdraw a money out of the checking account and
trigger a fee because it goes below certain balance threshold, nobody would
allow me to cover it.
Rolling back entire db to certain point in time and make it production db
won't work well either, there must have been many changes since that point
in time that won't be honored in the rollback.
"Steen Persson (DK)" <spe@.REMOVEdatea.dk> wrote in message
news:%23LUzwSydFHA.2776@.TK2MSFTNGP10.phx.gbl...
> It might be worth that you read about Backup/Restore Architecture in Books
> On Line. It seems like you are missing some basic knowledge about how
backup
> works - and why you need to backup...:-).
> Using replication might be ok in the case where your database becomes
> corrupt, but what if a user makes a mistake in the database? Then this
> mistake will be replicated as well, so you can't recreate data from the
> replicated database. If you have a backup you can restore to a point in
time
> and then get data from there.
> Regards
> Steen
> Zeng wrote:
>

Recovery from bak file w/ full text problem

I am having a problem restoring to a new or different database than the backup file being restored was created from. I understand the Move commands, and have figured out how to get this to work by mapping the data and log files from the backup file to the files defined for the restore target database.

The problem is with the full text catalog that is part of the backup.

Here's the T-SQL I'm executing, and the error I receive:

T-SQL:
RESTORE DATABASE New_DB
FROM DISK = 'C:\backup\Old_DB.bak'
WITH RECOVERY, REPLACE,
MOVE 'Old_DB' TO 'C:\SQLData\New_DB.mdf',
MOVE 'Old_DB_log' TO 'C:\SQLData\New_DB_log.ldf'

Error:
Msg 1834, Level 16, State 1, Line 1
The file 'C:\SQLData\FTData\ftKeyWords0007' cannot be overwritten. It is being used by database 'Old_DB'.
Msg 3156, Level 16, State 4, Line 1
File 'sysft_ftKeyWords' cannot be restored to 'C:\SQLData\FTData\ftKeyWords0007'. Use WITH MOVE to identify a valid location for the file.
Msg 3119, Level 16, State 1, Line 1
Problems were identified while planning for the RESTORE statement. Previous messages provide details.
Msg 3013, Level 16, State 1, Line 1
RESTORE DATABASE is terminating abnormally.

Not sure what to do about this, any help would be greatly appreciated!
Before, disabled FullText indexes for a old_db and repeat your command.|||You mean turn off the full text index before running the backup?

Yes, that would work, but that may not be feasible. I'd hate to have a job running that backs up a db hourly, and has to regenerate ft indexes every single time for obvious reasons.

This problem makes restoring backups that include full text indexes to a new restore point extremely frustrating, and it really shouldn't be.
sql

recovery databasse without log file

Help
i have delete log file *.ldf
how can i do to recovery mdf database
i do not detach database before ldf was be deleted.
thanks
For SQL 2005
USE [master]
GO
CREATE DATABASE [DBNAME] ON
(FILENAME = N'C:\DATA\DBNAME_DATA.mdf')
FOR ATTACH_REBUILD_LOG
GO
Replace databasename, drive petter, folder and file name.
For SQL 2000, Try
sp_attach_single_file_db [See booksonline for usage]
Thanks
Hari
"joseph" <desquestions@.gmail.com> wrote in message
news:etORcDkdHHA.3648@.TK2MSFTNGP05.phx.gbl...
> Help
> i have delete log file *.ldf
> how can i do to recovery mdf database
> i do not detach database before ldf was be deleted.
> thanks
|||Just note that this requires a clean shutdown of the database (no recovery work needed at startup).
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"Hari Prasad" <hari_prasad_k@.hotmail.com> wrote in message
news:Ob32GTmdHHA.208@.TK2MSFTNGP05.phx.gbl...
> For SQL 2005
> USE [master]
> GO
> CREATE DATABASE [DBNAME] ON
> (FILENAME = N'C:\DATA\DBNAME_DATA.mdf')
> FOR ATTACH_REBUILD_LOG
> GO
> Replace databasename, drive petter, folder and file name.
> For SQL 2000, Try
> sp_attach_single_file_db [See booksonline for usage]
>
> Thanks
> Hari
> "joseph" <desquestions@.gmail.com> wrote in message news:etORcDkdHHA.3648@.TK2MSFTNGP05.phx.gbl...
>

recovery databasse without log file

Help
i have delete log file *.ldf
how can i do to recovery mdf database
i do not detach database before ldf was be deleted.
thanksFor SQL 2005
USE [master]
GO
CREATE DATABASE [DBNAME] ON
(FILENAME = N'C:\DATA\DBNAME_DATA.mdf')
FOR ATTACH_REBUILD_LOG
GO
Replace databasename, drive petter, folder and file name.
For SQL 2000, Try
sp_attach_single_file_db [See booksonline for usage]
Thanks
Hari
"joseph" <desquestions@.gmail.com> wrote in message
news:etORcDkdHHA.3648@.TK2MSFTNGP05.phx.gbl...
> Help
> i have delete log file *.ldf
> how can i do to recovery mdf database
> i do not detach database before ldf was be deleted.
> thanks|||Just note that this requires a clean shutdown of the database (no recovery w
ork needed at startup).
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"Hari Prasad" <hari_prasad_k@.hotmail.com> wrote in message
news:Ob32GTmdHHA.208@.TK2MSFTNGP05.phx.gbl...
> For SQL 2005
> USE [master]
> GO
> CREATE DATABASE [DBNAME] ON
> (FILENAME = N'C:\DATA\DBNAME_DATA.mdf')
> FOR ATTACH_REBUILD_LOG
> GO
> Replace databasename, drive petter, folder and file name.
> For SQL 2000, Try
> sp_attach_single_file_db [See booksonline for usage]
>
> Thanks
> Hari
> "joseph" <desquestions@.gmail.com> wrote in message news:etORcDkdHHA.3648@.T
K2MSFTNGP05.phx.gbl...
>

recovery databasse without log file

Help
i have delete log file *.ldf
how can i do to recovery mdf database
i do not detach database before ldf was be deleted.
thanksFor SQL 2005
USE [master]
GO
CREATE DATABASE [DBNAME] ON
(FILENAME = N'C:\DATA\DBNAME_DATA.mdf')
FOR ATTACH_REBUILD_LOG
GO
Replace databasename, drive petter, folder and file name.
For SQL 2000, Try
sp_attach_single_file_db [See booksonline for usage]
Thanks
Hari
"joseph" <desquestions@.gmail.com> wrote in message
news:etORcDkdHHA.3648@.TK2MSFTNGP05.phx.gbl...
> Help
> i have delete log file *.ldf
> how can i do to recovery mdf database
> i do not detach database before ldf was be deleted.
> thanks|||Just note that this requires a clean shutdown of the database (no recovery work needed at startup).
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"Hari Prasad" <hari_prasad_k@.hotmail.com> wrote in message
news:Ob32GTmdHHA.208@.TK2MSFTNGP05.phx.gbl...
> For SQL 2005
> USE [master]
> GO
> CREATE DATABASE [DBNAME] ON
> (FILENAME = N'C:\DATA\DBNAME_DATA.mdf')
> FOR ATTACH_REBUILD_LOG
> GO
> Replace databasename, drive petter, folder and file name.
> For SQL 2000, Try
> sp_attach_single_file_db [See booksonline for usage]
>
> Thanks
> Hari
> "joseph" <desquestions@.gmail.com> wrote in message news:etORcDkdHHA.3648@.TK2MSFTNGP05.phx.gbl...
>> Help
>> i have delete log file *.ldf
>> how can i do to recovery mdf database
>> i do not detach database before ldf was be deleted.
>> thanks
>

Recovery database

I have a database, but It's delete. I only file .LDF of database, Please, help recovery database
Thanks,Without the data file (mdf, ndf), you're pretty much stuck. It would help
if you've made backups. Alternatively, you could try using one of the many
disk recovery apps and hope for the best (OnTrack (commercial), Handy
Recovery (freeware)). Try not to store anything onto the disk that used to
contain the data files.
Peter Yeoh
http://www.yohz.com
Need smaller backup files? Try MiniSQLBackup
"HCNT" <anonymous@.discussions.microsoft.com> wrote in message
news:AF33FF5B-0AE0-4F04-BA3A-40E750222E29@.microsoft.com...
> I have a database, but It's delete. I only file .LDF of database, Please,
help recovery database.
> Thanks,|||Hi,
You cant recover a database with an LDF file. LDF file only contains the
active transactions information. All the data / objects will be kept in MDF
file.
Note:
A database can be recovered only if you have the MDF/NDF file for that
database. It is always recommended to take a backup of
database daily.
Thanks
Hari
MCDBA
"HCNT" <anonymous@.discussions.microsoft.com> wrote in message
news:AF33FF5B-0AE0-4F04-BA3A-40E750222E29@.microsoft.com...
> I have a database, but It's delete. I only file .LDF of database, Please,
help recovery database.
> Thanks,|||Without backup, there's nothing you can do but to rebuild your database
from scratch.
Eric
HCNT wrote:
> I have a database, but It's delete. I only file .LDF of database, Please, help recovery database.
> Thanks,
Eric Li
SQL DBA
MCDBA

Recovery database

I have a database, but It's delete. I only file .LDF of database, Please, help recovery database.
Thanks,
Without the data file (mdf, ndf), you're pretty much stuck. It would help
if you've made backups. Alternatively, you could try using one of the many
disk recovery apps and hope for the best (OnTrack (commercial), Handy
Recovery (freeware)). Try not to store anything onto the disk that used to
contain the data files.
Peter Yeoh
http://www.yohz.com
Need smaller backup files? Try MiniSQLBackup
"HCNT" <anonymous@.discussions.microsoft.com> wrote in message
news:AF33FF5B-0AE0-4F04-BA3A-40E750222E29@.microsoft.com...
> I have a database, but It's delete. I only file .LDF of database, Please,
help recovery database.
> Thanks,
|||Hi,
You cant recover a database with an LDF file. LDF file only contains the
active transactions information. All the data / objects will be kept in MDF
file.
Note:
A database can be recovered only if you have the MDF/NDF file for that
database. It is always recommended to take a backup of
database daily.
Thanks
Hari
MCDBA
"HCNT" <anonymous@.discussions.microsoft.com> wrote in message
news:AF33FF5B-0AE0-4F04-BA3A-40E750222E29@.microsoft.com...
> I have a database, but It's delete. I only file .LDF of database, Please,
help recovery database.
> Thanks,
|||Without backup, there's nothing you can do but to rebuild your database
from scratch.
Eric
HCNT wrote:

> I have a database, but It's delete. I only file .LDF of database, Please, help recovery database.
> Thanks,
Eric Li
SQL DBA
MCDBA
sql

Recovery database

I have a database, but It's delete. I only file .LDF of database, Please, he
lp recovery database.
Thanks,Without the data file (mdf, ndf), you're pretty much stuck. It would help
if you've made backups. Alternatively, you could try using one of the many
disk recovery apps and hope for the best (OnTrack (commercial), Handy
Recovery (freeware)). Try not to store anything onto the disk that used to
contain the data files.
Peter Yeoh
http://www.yohz.com
Need smaller backup files? Try MiniSQLBackup
"HCNT" <anonymous@.discussions.microsoft.com> wrote in message
news:AF33FF5B-0AE0-4F04-BA3A-40E750222E29@.microsoft.com...
> I have a database, but It's delete. I only file .LDF of database, Please,
help recovery database.
> Thanks,|||Hi,
You cant recover a database with an LDF file. LDF file only contains the
active transactions information. All the data / objects will be kept in MDF
file.
Note:
A database can be recovered only if you have the MDF/NDF file for that
database. It is always recommended to take a backup of
database daily.
Thanks
Hari
MCDBA
"HCNT" <anonymous@.discussions.microsoft.com> wrote in message
news:AF33FF5B-0AE0-4F04-BA3A-40E750222E29@.microsoft.com...
> I have a database, but It's delete. I only file .LDF of database, Please,
help recovery database.
> Thanks,|||Without backup, there's nothing you can do but to rebuild your database
from scratch.
Eric
HCNT wrote:

> I have a database, but It's delete. I only file .LDF of database, Please,
help recovery database.
> Thanks,
Eric Li
SQL DBA
MCDBA