Friday, March 30, 2012
How to rename physical file name
db1_log.ldf, both locating on the same folder. I want to copy both the files
to db2.mdf, db2_log.ldf (in the same folder) and attach as DB2. I know the
commands to attach a database with different name. I want to know, how to
change db1.mdf to db2.mdf
TIA
J JustinJustin
I prefer RESTORE DATABASE from QA rather than EM. In the QA just before a
running change the names of the files
RESTORE DATABASE MyDatabase FROM DISK='C:\MyDatabase20050206.bak'
WITH RECOVERY,
MOVE MyDatabase_Data' TO 'C:\Program Files\Microsoft SQL
Server\MSSQL\Data\ChangeItHere.mdf',
MOVE MyDatabase _Log' TO 'C:\Program Files\Microsoft SQL
Server\MSSQL\Data\ChangeItHere_log.ldf'
"J Justin" <justin@.gjsoft.com> wrote in message
news:eRxy9uXdFHA.3184@.TK2MSFTNGP15.phx.gbl...
> I have a database, which consists of two physical files db1.mdf,
> db1_log.ldf, both locating on the same folder. I want to copy both the
files
> to db2.mdf, db2_log.ldf (in the same folder) and attach as DB2. I know the
> commands to attach a database with different name. I want to know, how to
> change db1.mdf to db2.mdf
> TIA
> J Justin
>|||Thanks for your quick reply. I don't have BAK file, rather I have the raw
mdf and ldf files. Is there any command now?
Regards
J Justin
"Uri Dimant" <urid@.iscar.co.il> wrote in message
news:%233lXN0XdFHA.2688@.TK2MSFTNGP14.phx.gbl...
> Justin
> I prefer RESTORE DATABASE from QA rather than EM. In the QA just before a
> running change the names of the files
> RESTORE DATABASE MyDatabase FROM DISK='C:\MyDatabase20050206.bak'
> WITH RECOVERY,
> MOVE MyDatabase_Data' TO 'C:\Program Files\Microsoft SQL
> Server\MSSQL\Data\ChangeItHere.mdf',
> MOVE MyDatabase _Log' TO 'C:\Program Files\Microsoft SQL
> Server\MSSQL\Data\ChangeItHere_log.ldf'
>
>
> "J Justin" <justin@.gjsoft.com> wrote in message
> news:eRxy9uXdFHA.3184@.TK2MSFTNGP15.phx.gbl...
>> I have a database, which consists of two physical files db1.mdf,
>> db1_log.ldf, both locating on the same folder. I want to copy both the
> files
>> to db2.mdf, db2_log.ldf (in the same folder) and attach as DB2. I know
>> the
>> commands to attach a database with different name. I want to know, how to
>> change db1.mdf to db2.mdf
>> TIA
>> J Justin
>>
>|||No, after dettaching database rename the files manual .
"J Justin" <justin@.gjsoft.com> wrote in message
news:%23$K7r9XdFHA.1684@.TK2MSFTNGP09.phx.gbl...
> Thanks for your quick reply. I don't have BAK file, rather I have the raw
> mdf and ldf files. Is there any command now?
> Regards
> J Justin
>
> "Uri Dimant" <urid@.iscar.co.il> wrote in message
> news:%233lXN0XdFHA.2688@.TK2MSFTNGP14.phx.gbl...
> > Justin
> > I prefer RESTORE DATABASE from QA rather than EM. In the QA just before
a
> > running change the names of the files
> >
> > RESTORE DATABASE MyDatabase FROM DISK='C:\MyDatabase20050206.bak'
> > WITH RECOVERY,
> > MOVE MyDatabase_Data' TO 'C:\Program Files\Microsoft SQL
> > Server\MSSQL\Data\ChangeItHere.mdf',
> > MOVE MyDatabase _Log' TO 'C:\Program Files\Microsoft SQL
> > Server\MSSQL\Data\ChangeItHere_log.ldf'
> >
> >
> >
> >
> >
> > "J Justin" <justin@.gjsoft.com> wrote in message
> > news:eRxy9uXdFHA.3184@.TK2MSFTNGP15.phx.gbl...
> >> I have a database, which consists of two physical files db1.mdf,
> >> db1_log.ldf, both locating on the same folder. I want to copy both the
> > files
> >> to db2.mdf, db2_log.ldf (in the same folder) and attach as DB2. I know
> >> the
> >> commands to attach a database with different name. I want to know, how
to
> >> change db1.mdf to db2.mdf
> >>
> >> TIA
> >>
> >> J Justin
> >>
> >>
> >
> >
>
Monday, March 26, 2012
How to remove a database without deleting the mdf file ?
If I have attached a mdf file to my local sql server default instance, how can I remove that database from this instance without deleting the underlying mdf file ? I have attached an mdf file under sql 2005 (dev edition) default instance, but now I want to detach it and reattach it under my sql 2005 express named instance. Why is there not a "detach" menu option ?
help ?for some strange reason, a "detach" menu option is there when I select the database node in the left panel of mgt studio, then right-click the db and choose tasks > detach.
Oh wait, its there under the right-click menu in the left pane as well. disregard everything i just said
How to reinitialize when "There is a problem with your selected data store"?
I've been trying to reinitialize the membership database, but something stops me.
I have tried deleting aspnetdb.mdf from the App_Data folder. This works fine, and then a new one is created when I use the asp.net adminstration tool. I can use the server explorer to view the table content (all null).
Although I can open the asp.net configuration page, the problem occurs when I select security. Then I get the error
There is a problem with your selected data store. This can be caused by an invalid server name or credentials, or by insufficient permission. It can also be caused by the role manager feature not being enabled. Click the button below to be redirected to a page where you can choose a new data store.
The following message may help in diagnosing the problem:Database 'C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\asp.netwebadminfiles\App_Data\ASPNETDB.MDF' already exists. Could not attach file 'C:\Documents and Settings\Jeff Leese\My Documents\world\my work\current\counsellor\App_Data\ASPNETDB.MDF' as database 'ASPNETDB_devjeffleese'.
All this seems to have happened after I modified my connection info in the web.config file:
<connectionStrings>
<removename="LocalSqlServer"/>
<addname="LocalSqlServer"connectionString="Data Source=.\SQLEXPRESS; AttachDbFilename=|DataDirectory|\ASPNETDB.MDF; user instance=true; Integrated Security=True; Initial Catalog=ASPNETDB_devjeffleese;"
providerName="System.Data.SqlClient" />
</connectionStrings>
So, two questions:
1) What are the sections about? They seem to have been inserted automatically at some point, and I wonder if its just formatting info or should I remove them?
2) How can I get security going again. How do I deal with the 'already exists' problem that prevents 'attaching' ?
Would greatly appreciate guidance in how to start over...
Hi,
I had a similar problem with the install of the ASPNET DB, and I'll try to recall how I got it running.
What I tried first was to hae the DB istalled automatically from the WS I have running VS 2005, which is networked to a server running SQL Server 2005 (Standard). I wanted the DB installed on that SQL Server instance, but ran into problem. Even pre-creating the DB ther didn't seem to help. I'm not saying it can't be done, but it wasn't worth the effort to me. I DL'ed and installed an instance of SQL Server Express on the WS that has VS, did the aspnet_regsql.exe, and things worked Ok. I figure I can transfer the DB to the full SQL Server when/if I need to, but where it is is fine for development work. (Side note: I installed the Full version client tools on the WS, so I'd have these, rather than the Expess manager - but getting the uninstall/install sequence right was a hassle).
I didn't see a mention of aspnet_regsql.exe in your post. If you havent used it, do a search on msdn.microsoft.com for how and why to use it. You should find it in your Windows\Microsoft.net\Framework\(the version you are running). You should find it there, in the same place as the reg for IIS (if you need that too).
Good luck, hop eit helps. BRN..
Friday, March 23, 2012
How to register an existing database
I use SQL Server 2000 ( could be developer version )
Is there a way to re-register a database.
I have one .MDF file and a log file.
Every menu i have been thrue but no luck.
Is this possible or do i need to add a new database?
Thnaks,
Dennis1. Open Enterprise Manager
2. Open up the tree under your server until you see the "Databases" section.
3. Single click to select it.
4. Right-Click and select "All Tasks->Attach Database"
5. Select your mdf file.|||McMurdoStation,
you have saved me a lot of work.
Thanks a million,
Dennis
Monday, March 19, 2012
How to Recover from: OS on drive C, SQL Server installation & mdf's on X, ldf's on Y
as well (the backup server couldn't handle the temporary strain).
Our OS was installed on one drive (drive C)
Our SQL Server installation is on drive X, along with the MDF files for
the databases.
The LDF files are on drive Y.
Drive C is fried, drive X & Y are fine. We are recreating drive C's OS
installation, but how do we handle the actual server installation being
on drive X? Do we need to run the SQL Server installation over again?
If so, are there special considerations in this case?<ebeiler@.fandr.com> wrote in message
news:1141394015.039948.245470@.j33g2000cwa.googlegroups.com...
> Our main sql server has failed, and our failover procedure has failed
> as well (the backup server couldn't handle the temporary strain).
> Our OS was installed on one drive (drive C)
> Our SQL Server installation is on drive X, along with the MDF files for
> the databases.
> The LDF files are on drive Y.
>
> Drive C is fried, drive X & Y are fine. We are recreating drive C's OS
> installation, but how do we handle the actual server installation being
> on drive X? Do we need to run the SQL Server installation over again?
> If so, are there special considerations in this case?
>
You can install SQL Server normally. The program files will go on the new
drive C.
Then simply attach (or restore) your databases on drive X.
sp_attach_db
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/tsqlref/ts_sp_ae-az_52oy.asp
How to move databases between computers that are running SQL Server
http://www.support.microsoft.com/?id=314546
David|||Thanks for your help.
How to Recover from: OS on drive C, SQL Server installation & mdf's on X, ldf's on Y
as well (the backup server couldn't handle the temporary strain).
Our OS was installed on one drive (drive C)
Our SQL Server installation is on drive X, along with the MDF files for
the databases.
The LDF files are on drive Y.
Drive C is fried, drive X & Y are fine. We are recreating drive C's OS
installation, but how do we handle the actual server installation being
on drive X? Do we need to run the SQL Server installation over again?
If so, are there special considerations in this case?
<ebeiler@.fandr.com> wrote in message
news:1141394015.039948.245470@.j33g2000cwa.googlegr oups.com...
> Our main sql server has failed, and our failover procedure has failed
> as well (the backup server couldn't handle the temporary strain).
> Our OS was installed on one drive (drive C)
> Our SQL Server installation is on drive X, along with the MDF files for
> the databases.
> The LDF files are on drive Y.
>
> Drive C is fried, drive X & Y are fine. We are recreating drive C's OS
> installation, but how do we handle the actual server installation being
> on drive X? Do we need to run the SQL Server installation over again?
> If so, are there special considerations in this case?
>
You can install SQL Server normally. The program files will go on the new
drive C.
Then simply attach (or restore) your databases on drive X.
sp_attach_db
http://msdn.microsoft.com/library/de...ae-az_52oy.asp
How to move databases between computers that are running SQL Server
http://www.support.microsoft.com/?id=314546
David
|||Thanks for your help.
How to recover from mdf file (SQL Server 2000)
Hi,
My database corrupted because when I was running an update query, there is a power failure. After the computer booted, I cannot open the database anymore, it just not responding. Then I stop the sql server service, and tried to rename the .mdf and .ldf. After that it worked normally, but I need the data from the corrupted mdf file, I tried to attach the database but it just hanged. I even tried to attach without the .ldf file but it didn't work either, so I concluded that the problem is with the mdf file.
Is there any way to recover my data ?
Thanks in advance
Regards,
Edwin
Can you rename the mdf,ldf files to their original names and attach them to your SQL Server? (with all SQL Services running)
If that works, try using
DBCC CHECKDB ('DatabaseName' /*,REPAIR_REBUILD*/)
WITH NO_INFOMSGS, ALL_ERRORMSGS, DATA_PURITY
To see what went wrong
A 2nd choice is to restore the mdf,ldf files from a recent backup (if backup exists)
|||Hi,
We'd tried that but we got no luck. Attaching the file in it's original name didn't work, the computer just hanged, we suspected that the .mdf file corrupted
Unfortunately, we don't have any backup.
Thanks for reply
|||Can you try this trick:
Create a new 'dummy' database that has the same name as the old database, say 'TEST'
So now you have 2 files: test.mdf and test.ldf files
Stop SQL Server services and delete these files
Copy and rename your corrupted mdf,ldf files in their place
Restart the services and see what error message you get when SQL tries to read from the corrupted files that are now attached to the TEST db.
Then you can start the debugging 'process' based on error number
Cheers
|||Try this undocumented stuff provided by Kevin [MS].==========
1. Back up the .mdf/.ndf files at first!!!
2. Change the database context to Master and allow updates to system tables:
Use Master
Go
sp_configure 'allow updates', 1
reconfigure with override
Go
3. Set the database in Emergency (bypass recovery) mode:
select * from sysdatabases where name = '<db_name>'
-- note the value of the status column for later use in # 6
begin tran
update sysdatabases set status = 32768 where name = '<db_name>'
-- Verify one row is updated before committing
commit tran
4. Stop and restart SQL server.
5. Call DBCC REBUILD_LOG command to rebuild a "blank" log file based on the
suspected db.
The syntax for DBCC REBUILD_LOG is as follows:
DBCC rebuild_log('<db_name>','<log_filename>')
where <db_name> is the name of the database and <log_filename> is
the physical path to the new log file, not a logical file name. If you
do not
specify the full path, the new log is created in the Windows NT system
root
directory (by default, this is the Winnt\System32 directory).
6. Set the database in single-user mode and run DBCC CHECKDB to validate
physical consistency:
sp_dboption '<db_name>', 'single user', 'true'
DBCC checkdb('<db_name>')
Go
begin tran
update sysdatabases set status = <prior value> where name = '<db_name>'
-- verify one row is updated before committing
commit tran
Go
7. Turn off the updates to system tables by using:
sp_configure 'allow updates', 0
reconfigure with override
Go
============|||
OK.
First off, I don't think I've posted those steps. I've probably posted similar for use in DIRE circumstances (like this one) where there is no backup, and data loss is acceptable.
The procedure above is primarily used for cases where you have only the MDF file and no log.
Attaching the database should not hang the system. It could make it busy for awhile, but not totally hang.
How long did you let the system go before giving up and canceling?
Please look in both the Windows Event Log and in the SQL errorlog files and post any related errors here.
You need to get the database attached to an instance in order to do anything with it. Your best bet is to put the files back in their original locations and just let it run its course. You might try putting the database in emergency mode (using the steps above) before putting the files back in place. Then the database wouldn't run recovery when the instance started up.
You could then run DBCC CHECKDB , and presuming that there are serious problems, you can then re-run the CHECKDB with REPAIR_ALLOW_DATA_LOSS, taking into consideration that the command means what it says: data will be lost.
How to recover Database from .MDF
Hi there,
I lost my .LDF file. Is there a possibility to recover Database from the MDF file with all data and Stored procedures?
Im using SQL Server 2000.
Please help....and sry if this is the wrong Forum for it...
Thx T. Gnewuch
Can you explain what you mean by losing the .ldf file?
Do you have your databases backed up regularly. If so, you can recover your database from the latest backup.
|||Try to use sp_attach_single_file_db, it can recreate the logfile if the database is not corrupt.HTH, Jens Suessmeyer.
http://www.sqlserver205.de
|||thx , that solved my problem, everything is working fine now again ;)
How to recover corrupted MDF file?
I have a big problem.
I cannot attach my DB to the server again after detached it.
Error is "...file you've specified is not a valid data file ...".
After checked the system event log, I found "...torn page found at..."
errors before it was detached.
Is there any to recover the database file or recover the data from it?
Thanks a lot.
--
Regards
Wicky HuI think that the only people who can help you now would be
microsoft.
There are some ways of repairing the file but it assumes
that the database is running and has not been detached.
The only execption to the rule is if its the master
database, then there is a tool to do it.
The best cause would be to restore from the last backup.
Peter
"Action speaks louder than words but not nearly as often"
Mark Twain
>--Original Message--
>Hi, all,
>I have a big problem.
>I cannot attach my DB to the server again after detached
it.
>Error is "...file you've specified is not a valid data
file ...".
>After checked the system event log, I found "...torn page
found at..."
>errors before it was detached.
>Is there any to recover the database file or recover the
data from it?
>Thanks a lot.
>--
>Regards
>Wicky Hu
>
>.
>
how to recover an MDF without the LDF file?
exists. I still have the data file (mdf). Does anyone
know how I can recover the mdf without having the ldf?
Charlie CunninghamTry using sp_attach_single_file_db.
Also refer to following url
Attaching .MDF file when transaction log is corrupt
http://www.sqlservercentral.com/scripts/scriptdetails.asp?scriptid=599
--
-Vishal
"Charlie Cunningham" <charliec2@.cox.net> wrote in message
news:099a01c36d8c$ab99ac90$a001280a@.phx.gbl...
> A database's log file (ldf) has been lost and no backup
> exists. I still have the data file (mdf). Does anyone
> know how I can recover the mdf without having the ldf?
> Charlie Cunningham|||Vishal,
Your recommended solution worked like a charm.
sp_attach_single_file did not work...it kept wanting the
original log file noted in the MDF internal info.
Thank you for your assistance.
Charlie
>--Original Message--
>Try using sp_attach_single_file_db.
>Also refer to following url
>Attaching .MDF file when transaction log is corrupt
>http://www.sqlservercentral.com/scripts/scriptdetails.asp
?scriptid=599
>--
>-Vishal
>"Charlie Cunningham" <charliec2@.cox.net> wrote in message
>news:099a01c36d8c$ab99ac90$a001280a@.phx.gbl...
>> A database's log file (ldf) has been lost and no backup
>> exists. I still have the data file (mdf). Does anyone
>> know how I can recover the mdf without having the ldf?
>> Charlie Cunningham
>
>.
>
Monday, March 12, 2012
How to recover a SQL Server database after a crash
I had my Windows 2000 crashed and after that I reinstalled windows, sql
server etc. after taking backup of all mdf ( and no ldfs by mistake).
Now when I try to restore it, it says,
--
Could not open new database 'kothari1'. CREATE DATABASE is aborted.
Device activation error. The physical file name 'D:\Program Files\Microsoft
SQL Server\MSSQL\data\Kothari_log.LDF' may be incorrect.
--
Any help please - I do not have ANY backup of this database :(
Thanks
AmitSee if you can use
sp_attach_db OR
sp_attach_single_file_db
--
Allan Mitchell (Microsoft SQL Server MVP)
MCSE,MCDBA
www.SQLDTS.com
I support PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org
"Amit Basu" <amit@.winruler.com> wrote in message
news:OHKSpDSRDHA.3768@.tk2msftngp13.phx.gbl...
> Hi,
> I had my Windows 2000 crashed and after that I reinstalled windows, sql
> server etc. after taking backup of all mdf ( and no ldfs by mistake).
> Now when I try to restore it, it says,
> --
> Could not open new database 'kothari1'. CREATE DATABASE is aborted.
> Device activation error. The physical file name 'D:\Program
Files\Microsoft
> SQL Server\MSSQL\data\Kothari_log.LDF' may be incorrect.
> --
> Any help please - I do not have ANY backup of this database :(
> Thanks
> Amit
>
HOw to recover a database from the .LDF file.
Due to a hardware problem I lost my mydatabase.MDF file, but my
mydatabase.LDF file is still OK because it is on another partition. I can
restore the database, but (here comes Murphy) the tape containing the
transaction logs backups is corrupt too. Since my last full backup I made
transaction log backups with the NO_TRUNCATE option, so everything should be
in the mydatabase.LDF file. After restoring the database in no_recover mode,
how can I apply the transactions that are still in mydatabase.LDF file
(NO_TRUNCATE)?
Any help is welcome.
Thanks
Felix> Since my last full backup I made
> transaction log backups with the NO_TRUNCATE option, so everything should be
> in the mydatabase.LDF file.
I'm afraid not. The name of that option is misleading. See
http://www.karaszi.com/SQLServer/info_restore_no_truncate.asp
Your best bet is probably to use a log reader tool and see if you can salvage anything from the
existing log backup. But, as per the article, the information in the prior log backups is most
probably lost. You might want to open a case with MS Support and see if they have anything up their
sleeves.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"Felix" <Felix@.discussions.microsoft.com> wrote in message
news:D686735A-BF91-40EA-BBD3-16ED67B13E3B@.microsoft.com...
> Hi,
> Due to a hardware problem I lost my mydatabase.MDF file, but my
> mydatabase.LDF file is still OK because it is on another partition. I can
> restore the database, but (here comes Murphy) the tape containing the
> transaction logs backups is corrupt too. Since my last full backup I made
> transaction log backups with the NO_TRUNCATE option, so everything should be
> in the mydatabase.LDF file. After restoring the database in no_recover mode,
> how can I apply the transactions that are still in mydatabase.LDF file
> (NO_TRUNCATE)?
> Any help is welcome.
> Thanks
> Felix|||Hi Tibor,
Thanks for your answer, this helped us a lot.
Lucky enough, this was not a production database, but a test we were
performing.
Indead, the NO_TRUNCATE is misleading.
This means also that you are only able to restore till the time of failure
if you are able to backup the still existing logs first, else you can only
restore untill the latest log backup. This means that you should backup as
often as possible for critical DB's!
Kind regards
Felix
"Tibor Karaszi" wrote:
> > Since my last full backup I made
> > transaction log backups with the NO_TRUNCATE option, so everything should be
> > in the mydatabase.LDF file.
> I'm afraid not. The name of that option is misleading. See
> http://www.karaszi.com/SQLServer/info_restore_no_truncate.asp
> Your best bet is probably to use a log reader tool and see if you can salvage anything from the
> existing log backup. But, as per the article, the information in the prior log backups is most
> probably lost. You might want to open a case with MS Support and see if they have anything up their
> sleeves.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
> Blog: http://solidqualitylearning.com/blogs/tibor/
>
> "Felix" <Felix@.discussions.microsoft.com> wrote in message
> news:D686735A-BF91-40EA-BBD3-16ED67B13E3B@.microsoft.com...
> > Hi,
> > Due to a hardware problem I lost my mydatabase.MDF file, but my
> > mydatabase.LDF file is still OK because it is on another partition. I can
> > restore the database, but (here comes Murphy) the tape containing the
> > transaction logs backups is corrupt too. Since my last full backup I made
> > transaction log backups with the NO_TRUNCATE option, so everything should be
> > in the mydatabase.LDF file. After restoring the database in no_recover mode,
> > how can I apply the transactions that are still in mydatabase.LDF file
> > (NO_TRUNCATE)?
> >
> > Any help is welcome.
> >
> > Thanks
> >
> > Felix
>
HOw to recover a database from the .LDF file.
Due to a hardware problem I lost my mydatabase.MDF file, but my
mydatabase.LDF file is still OK because it is on another partition. I can
restore the database, but (here comes Murphy) the tape containing the
transaction logs backups is corrupt too. Since my last full backup I made
transaction log backups with the NO_TRUNCATE option, so everything should be
in the mydatabase.LDF file. After restoring the database in no_recover mode,
how can I apply the transactions that are still in mydatabase.LDF file
(NO_TRUNCATE)?
Any help is welcome.
Thanks
Felix
> Since my last full backup I made
> transaction log backups with the NO_TRUNCATE option, so everything should be
> in the mydatabase.LDF file.
I'm afraid not. The name of that option is misleading. See
http://www.karaszi.com/SQLServer/inf...o_truncate.asp
Your best bet is probably to use a log reader tool and see if you can salvage anything from the
existing log backup. But, as per the article, the information in the prior log backups is most
probably lost. You might want to open a case with MS Support and see if they have anything up their
sleeves.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"Felix" <Felix@.discussions.microsoft.com> wrote in message
news:D686735A-BF91-40EA-BBD3-16ED67B13E3B@.microsoft.com...
> Hi,
> Due to a hardware problem I lost my mydatabase.MDF file, but my
> mydatabase.LDF file is still OK because it is on another partition. I can
> restore the database, but (here comes Murphy) the tape containing the
> transaction logs backups is corrupt too. Since my last full backup I made
> transaction log backups with the NO_TRUNCATE option, so everything should be
> in the mydatabase.LDF file. After restoring the database in no_recover mode,
> how can I apply the transactions that are still in mydatabase.LDF file
> (NO_TRUNCATE)?
> Any help is welcome.
> Thanks
> Felix
|||Hi Tibor,
Thanks for your answer, this helped us a lot.
Lucky enough, this was not a production database, but a test we were
performing.
Indead, the NO_TRUNCATE is misleading.
This means also that you are only able to restore till the time of failure
if you are able to backup the still existing logs first, else you can only
restore untill the latest log backup. This means that you should backup as
often as possible for critical DB's!
Kind regards
Felix
"Tibor Karaszi" wrote:
> I'm afraid not. The name of that option is misleading. See
> http://www.karaszi.com/SQLServer/inf...o_truncate.asp
> Your best bet is probably to use a log reader tool and see if you can salvage anything from the
> existing log backup. But, as per the article, the information in the prior log backups is most
> probably lost. You might want to open a case with MS Support and see if they have anything up their
> sleeves.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
> Blog: http://solidqualitylearning.com/blogs/tibor/
>
> "Felix" <Felix@.discussions.microsoft.com> wrote in message
> news:D686735A-BF91-40EA-BBD3-16ED67B13E3B@.microsoft.com...
>
HOw to recover a database from the .LDF file.
Due to a hardware problem I lost my mydatabase.MDF file, but my
mydatabase.LDF file is still OK because it is on another partition. I can
restore the database, but (here comes Murphy) the tape containing the
transaction logs backups is corrupt too. Since my last full backup I made
transaction log backups with the NO_TRUNCATE option, so everything should be
in the mydatabase.LDF file. After restoring the database in no_recover mode,
how can I apply the transactions that are still in mydatabase.LDF file
(NO_TRUNCATE)?
Any help is welcome.
Thanks
Felix> Since my last full backup I made
> transaction log backups with the NO_TRUNCATE option, so everything should
be
> in the mydatabase.LDF file.
I'm afraid not. The name of that option is misleading. See
http://www.karaszi.com/SQLServer/in...no_truncate.asp
Your best bet is probably to use a log reader tool and see if you can salvag
e anything from the
existing log backup. But, as per the article, the information in the prior l
og backups is most
probably lost. You might want to open a case with MS Support and see if they
have anything up their
sleeves.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"Felix" <Felix@.discussions.microsoft.com> wrote in message
news:D686735A-BF91-40EA-BBD3-16ED67B13E3B@.microsoft.com...
> Hi,
> Due to a hardware problem I lost my mydatabase.MDF file, but my
> mydatabase.LDF file is still OK because it is on another partition. I can
> restore the database, but (here comes Murphy) the tape containing the
> transaction logs backups is corrupt too. Since my last full backup I made
> transaction log backups with the NO_TRUNCATE option, so everything should
be
> in the mydatabase.LDF file. After restoring the database in no_recover mod
e,
> how can I apply the transactions that are still in mydatabase.LDF file
> (NO_TRUNCATE)?
> Any help is welcome.
> Thanks
> Felix|||Hi Tibor,
Thanks for your answer, this helped us a lot.
Lucky enough, this was not a production database, but a test we were
performing.
Indead, the NO_TRUNCATE is misleading.
This means also that you are only able to restore till the time of failure
if you are able to backup the still existing logs first, else you can only
restore untill the latest log backup. This means that you should backup as
often as possible for critical DB's!
Kind regards
Felix
"Tibor Karaszi" wrote:
> I'm afraid not. The name of that option is misleading. See
> http://www.karaszi.com/SQLServer/in...no_truncate.asp
> Your best bet is probably to use a log reader tool and see if you can salv
age anything from the
> existing log backup. But, as per the article, the information in the prior
log backups is most
> probably lost. You might want to open a case with MS Support and see if th
ey have anything up their
> sleeves.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
> Blog: http://solidqualitylearning.com/blogs/tibor/
>
> "Felix" <Felix@.discussions.microsoft.com> wrote in message
> news:D686735A-BF91-40EA-BBD3-16ED67B13E3B@.microsoft.com...
>
How to reapply a trasaction log to a database?
Hi everybody,
I'm in a very awfull situation. Because of a big crash in my MS Sql server, y loose the .mdf file of a database. I have an older .mdf file and the complete transaction log (.ldf file) before the crash. [Note: not a backup file, just the .ldf file]. As far as I know, no truncate has been performed since the date of the mdf file, therefore, all transaction shoud be "stored" inside the log file.
Is there any way to re-apply the transactions stored on the log file to the original database?
I will appreciate a lot any help.
Thanks in advance,
Enrique.
enrique_pinaud@.hotmail.com
I don′t know if there is a a thrid party tool, but restoring for Point in time recovery (like you need) is only supported with builtin tools with a backup.HTH, jens Suessmeyer.|||Without a backup to start from you won't be able to use any builtin mechanisms to recover with only an old mdf and the current ldf. There are 3rd party tools out there that can extract dml statements out of the log, and may be of some help to you.