Recover Master Database Fron Only MDF File

Jul 20, 2005

I have SQL server 2000 which recently crashed. I try to recover it and
found out that the Master database is corrupt. I never backup my
server using inline sql backup nor any third party backup program that
aware to SQL server. But I have full system backup of volume c on tape
(using NTBackup), which includes old version of Master database. My
questions are:

1. How can I recover this file into SQL server?
2. If so, it is not risky to recover Master database from two weeks
ago?

Thanks in advance!

View 1 Replies


ADVERTISEMENT

How To Recover Master Database Table Data

Aug 14, 2006

Hi all, I am working with SQL Server2000 and I have done a horrible thing here.
We here have an script that delete all data from all user tables of a database, and I run it in the master DATABASE.
As we don't made backups of this database, now somethings of the database aren't working.

Here is the script:

declare @table_name sysname
declare @alter_table_statement varchar(256)
declare @delete_statement varchar(256)

-- definindo o cursor...
declare table_name_cursor cursor local fast_forward for
select
name
from
sysobjects
where
xtype = 'U'
and
name <> 'dtproperties'

-- desligando os vĂ­nculos...
open table_name_cursor
fetch next from table_name_cursor into @table_name
select @alter_table_statement = 'alter table ' + ltrim(rtrim(@table_name)) + ' nocheck constraint all'
exec(@alter_table_statement)
while @@Fetch_Status = 0
begin
fetch next from table_name_cursor into @table_name
select @alter_table_statement = 'alter table ' + ltrim(rtrim(@table_name)) + ' nocheck constraint all'
exec(@alter_table_statement)
end
close table_name_cursor

open table_name_cursor
fetch next from table_name_cursor into @table_name
select @delete_statement = 'delete from ' + ltrim(rtrim(@table_name))
exec(@delete_statement)
while @@Fetch_Status = 0
begin
fetch next from table_name_cursor into @table_name
select @delete_statement = 'delete from ' + ltrim(rtrim(@table_name))
exec(@delete_statement)
end
close table_name_cursor

open table_name_cursor
fetch next from table_name_cursor into @table_name
select @alter_table_statement = 'alter table ' + ltrim(rtrim(@table_name)) + ' check constraint all'
exec(@alter_table_statement)
while @@Fetch_Status = 0
begin
fetch next from table_name_cursor into @table_name
select @alter_table_statement = 'alter table ' + ltrim(rtrim(@table_name)) + ' check constraint all'
exec(@alter_table_statement)
end
close table_name_cursor


deallocate table_name_cursor


I have tried to restore master table with the restore function, but it doesn't work. When I try to do this I received a message informing that it can't copy the data because one file was in use. The server was in a single user mode.

Is there anyway to recover the data that I have lost?

View 5 Replies View Related

Recover Database File

Aug 24, 2006

hi all,

i have SQL 2000 server with SP3, yesterday my database was suddenly goes to suspect mode. then i found log in sql server log. and it shows following text:



I/O error (bad page ID) detected during read at offset 0x00000000030000 in file 'C:Program FilesMicrosoft SQL ServerMSSQLDataMFS_Data.MDF'..



kindly, do needful for recover data from this file...



Tejas Kishanwala

View 4 Replies View Related

How To Recover Database From LDF File

Oct 21, 2015

I am working on SQL Server 2008 R2 and unfortunately I have lost my .mdf file after detaching it from my database, but the .ldf is still in my system. Is there a way to recover my database from .ldf file?

View 3 Replies View Related

SQL 2012 :: Recover Database Without Log File?

Jul 10, 2015

Recently i got task from Senior DBA, as : Recover a database without LOG file Currently Data File is available.

Log file is also available, but shows size as 0 KB. Means Log file is corrupted.

Currently existing DB is shown as Offline Mode in SSMS.

So i got below link:

[URL]

When i tried 1st/2nd solution from above link, i got below message:The log cannot be rebuilt because there were open transactions/users when the database was shutdown, no checkpoint occurred to the database, or the database was read-only. This error could occur if the transaction log file was manually deleted or lost due to a hardware or environment failure.

To try that 3rd solution, I had to DELETE/Remove existing DB from SSMS, so i can create New DB with same name.

When i tried to delete Log file from Command Prompt, using below command, Windows replied that File is corrupted, so it cannot be deleted.

DEL /F /Q /A C:Program FilesMicrosoft SQL ServerMSSQL11.SQLEXPRESS2012MSSQLDATAMyDB.ldf

Meanwhile my Senior DBA brought DB in Recovery Pending mode.

So if i want to go for 3rd solution,then i need to DELETE file, But Windows is not allowing me.

[URL]

View 3 Replies View Related

Restore / Recover SQL Database From Data File

Feb 24, 2002

Our SQL database log file got physically deleted. Now the database is in suspect mode. Is it possible to recover / restore the database just with the data file.

View 3 Replies View Related

SQL 2012 :: How To Recover Corrupted Database File (MDF / IDF)

Nov 28, 2014

I run MSDE on a Windows XP Server and my database was marked as "suspect" by Enterprise Manager and its icon become gray. I detach that database and try to re-attach it but there is an error as the following:

Error 3624:
Location : page.cpp:2801
Expression: rowLength >= offset + deleteLenght
SPID : 56
Precess ID:1612

After that, I uninstall the MSDE and re-install new MSDE SP4 and try to re-attach the database file again and there is still an error. Is there anyway i can recover the data from that database?

View 4 Replies View Related

SQL Server 2014 :: Recover Database Value Through LDF File

Jun 3, 2015

SQL server. By-mistake I updated values of a column in a database hosted online, is there any way undo the transaction. I didn't created any backup of the database. I read that still it can be recoverd through the .ldf (log file) but unable to access it. Is there anyway to get access of the Log file or is there any way to recover the data.

View 3 Replies View Related

SQL Server 2008 :: How To Update The Database Physical File Location In Master Database

Mar 8, 2015

I had to to relocate the database log file and I issued an Alter database command but by mistake I put a space in the file name as below. The space is at the beginning file name. Now I am unable get the database loaded to SQL Server. The database has 2 replications configured, so deleting and re-attaching the database means the replication needs to be re-configured. Is there an alternative way to issue a command to update the database FILENAME ? Not sure if this can be edited in master database (sys files).

ALTER DATABASE [User_DB]
MODIFY FILE (NAME = User_DB_log, FILENAME = 'I:SQLLogs User_DB_log.ldf')
GO

View 1 Replies View Related

LS - Recover A Standby Database - Deleted Standby File (.tuf File)

Nov 19, 2007



Hi,

The standby file (.tuf file) got deleted accidentally on the secondary. How can I recover the database without the standby file?

View 3 Replies View Related

Restore SQL Master Database From A File

Jul 23, 2005

Hello,I need to restore the Master DB in my SQL 2k server (with sp3). Theproblem is that i don't have SQL backups of this file I only havegeneral backup of the entire c: drive i made using NTBackup. So itried all I know and succesfully run the rebuildm utility. Now when Itry to restore it from the general backup (not SQL backup) using"restore database master from gen_backup" i got error: "The file ondevice 'gen_backup' is not a valid Microsoft Tape Format backup set."RESTORE DATABASE is terminating abnormally.Any ideas how I can restore it?

View 2 Replies View Related

Could Not Locate File 'xxx_Log' For Database 'master' In Sys.database_files

Nov 12, 2007

Hi All,

I am truncating Transactionlog€¦ following the steps mentioned in MSKB.. what is the problem?



Use master
Go

Backup log xxx with truncate_only
go
Dbcc shrinkfile(xxx_Log)
Go

Msg 8985, Level 16, State 1, Line 1
Could not locate file 'xxx_Log' for database 'master' in sys.database_files.
The file either does not exist, or was dropped.


Please help me.

Thanks in advance

View 31 Replies View Related

SQL Security :: File Size And Space Used Is Not Displaying For All Database Other Than Master

Aug 26, 2015

I executed the below query and getting the capacity values only for master database.All other DB shows NULL values for spaceused. I'm actually looking for a query to get all the capacity information other than using temp table and the procedures. Is there any way using SQL query ONLY.

select
db.[dbid] as 'DB ID',
db.[name] as 'Database Name',
af.[name] as 'Logical Name',
convert(decimal(12,2),round(size/128.000,2)) as FileSizeMB, 
convert(decimal(12,2),round(fileproperty(db.name,'SpaceUsed')/128.000,2)) as SpaceUsedMB
from sys.sysdatabases db
inner join sys.sysaltfiles af
on db.dbid = af.dbid

Below is the output

DB ID Database Name
Logical Name FileSizeMB
SpaceUsedMB
1 master
master 4.00
3.44
1 master
mastlog 2.00

[Code] ....

View 5 Replies View Related

Recover SDF-File

Nov 4, 2005

Hi,

View 12 Replies View Related

Recover A Corrupted LDF File

Jul 20, 2005

Recently, one of our database's mdf and ldf was corrupted. We were able tobring back the database with the capability of importing and querying thedata. However, the data is not the full list. Some of the data are stillmissing because the tables we want still has sone 'chain mis linkage' errorwhen we did a DBCC checkdb/checktable. DBCC couldn't fix those errorseither. We're pretty sure that there are some data still burry under thecorruption. Then we thought of the life LDF file. This file should haverecorded every transaction up to the point of failure. So we trying torecover that file, but there are 2 problems. First is we don't have back upof that file and 2nd, that file is also corrupted. I couldn't backup thecorrupted ldf file at its current state. It's giving me some unrelated errormessage like disk space is out. All I know now is the only hope to recoverthose missing data are in this LDF file. We tried to use this software fromLimingent Log Explorer to recover it. So far no such luck with that. SoI'm asking anyone who has similar experience or problem. Please let me know.I need to know anyway to recover this LDF file, either by using sql server'snative tools or 3rd party tools. Any input is helpfull. thanks in advance.Wei

View 1 Replies View Related

Recover Data From .mdf And .ldf File?

Jun 15, 2006

Hello!

Hopefully someone can help me with the following (potentially huge) problem:

We've got a simple database application running on microsoft sql desktop engine. This database contains two tables. Up until now all worked fine, but probably due to a programma that crashed part of the database seems to be corrupted or broken while today only one table contains/returns data and the other table does not return any values!

When I open the .ldf and .mdf files in notepad I see that there is data belonging to both the tables. But how do I recover it??

The max. size of the database has not been reached by far (it's only 9Mbs), the sql queries are correct.

This .ldf file is a log file (?) I can't find detailed info about the principles of these .ldf and .mdf files on the internet, is it possible to trace back what has happened en recover the database that way?



Thanks in advance.

Greetings,

Rens Voogd

View 11 Replies View Related

How To Recover Data From A Corrupt Mdf File

Aug 3, 2002

Hi All,
By mistake i delete database from sql server. Due to which the the mdf and ldf file of the datbase are removed from my system. Then i used file recover utility and retrived my mdf and ldf files.But now i am not able to attach those files into databse. These mdf and ldf files has been corrupted. Now how can i recover my data from those mdf and ldf files.Please answer me if you have any solution on this problem.


Regards,
Satish Rotella

View 2 Replies View Related

MS-SQL One .NDF File Missing How To Recover/Rebuild DB??

Jul 6, 2006

Dear All,SOS Please Help.I have a MS-SQL DB with 4 .ndf files. One (first) .ndf file is missing.somehow got deleted??. Is there any way can rebuild my DB.The .MDF and .LDF files are in tact.Please help asap.Dhumbak*** Sent via Developersdex http://www.developersdex.com ***

View 1 Replies View Related

How To Recover From Mdf File (SQL Server 2000)

Dec 22, 2006

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

View 8 Replies View Related

How To Recover Committed Transactions From SQL Server Log(.ldf) File?

Dec 23, 2003

Hi ,

I got problem in production server at client place(No backup copy & not replicated,it's a SQL SERVER 2000 Enterprise server),by mistake client updated the data without using where condition then updated lakhs of rows (in SQL server autocommited),Now I need to recover this data from LOG file(.ldf).I tried with LOG EXPLORER(Third party tool) Trail version recovered from default database(Northwind,Pubs).But client not willing purchase this S/W for simple cause,How can we recover the data from LOG file.

1.Can we write the Program in C# to read the SQL Server Log and show the past transactions?
2.Is There any Stored procedures exist in SQL Server to read the day transactions in log file and take the backup?
3. How to read Transactions Log file in SQL Server 2000?

It's very Urgent,I am not expert in SQL Server 2000.

Could U Please Help me with possible solutions.

Regards,
Harikrishna.

View 1 Replies View Related

Recover With MDF File Only Due To Hard Disk Failure

Nov 10, 2006

catcat writes "Hi All,

Our MSSQL 2000 server crashed yesterday and one database cannot be restored. the latest backup we have is june. We can only recover the MDF file from the harddisk and according to our admin, it cannot be restored anymore because no proper shutdown was made.

Will appreciate your help here."

View 2 Replies View Related

Conv Fron Int To Date

Apr 27, 2000

Hi,
How can I convert a 4-digit date(INT type) to datetime type....
I know we have to use an implicit conversion....but does anyone have an idea how to do the same..
Bindu

View 1 Replies View Related

How To Get A Result Set Fron One Server To Another

Jun 10, 2008

Hi,

I would like to know what are the possibilities if I want to:

- run a query on the tables of the server S1
- load a result set to the server S2

On the server S2, I have a linked server for S1, but it takes much more time to execute the query on S2 via linked server than on S1 . I would prefer something like the code would be executed on S1 and (only) the result set would be transferred to S2.

I already have seen a code somewhere in which a procedure on S2 called another procedure on S1 to execute a code, and (only) the result was transferred to S2.
The problem is I dont have an example of such a code, and also that I dont have rights to create procedures on S1.

If somebody has experience on this, or knows some good links/sources about this, it would be a great help.

Thanks
Katarina

View 11 Replies View Related

Recover Database

Feb 27, 2000

How do I begin? I had previously installed the SQL Server 7.0 with NT Authentication and everything was fine until I Rename domain Name and Computer name. I decided to uninstall SQL Server, and then reinstall it.
From this action unable to see my database in enterprise manager. I Rename old domain and computer name again. and reinstall with Upgrade Version. but still same effect. Can anyone help? What do I need to do to get my database to work again? Any input on this will be appreciated. Thanks in advance.

View 1 Replies View Related

How To Recover A Database?

Aug 25, 2004

I had MS SQL installed on my comp.I had to reformat my hard drive due to some problems.There was a db in the sql server which i needed.So i saved the .mdf & .sdf files.Then i installed sql server in the formatted hard drive & pasted the .mdf & .ldf files in the Data forlder in MSSQL folder.But the problem is that even after doing this the enterprise manager doesnt show that database.Can anyone help me with this?Is there any way to recover the database?
Thanks a lot

P.S.- I also have whole of the earlier MSSQL folder present in the earlier program files backed up.Would that help in anyway.

View 3 Replies View Related

Recover Database

Nov 23, 2004

Hi

I've had a powerfailure, that resulted in I had to scratch my DB server, I've managed to get all the .mdf and .ldf files from the server. On the new server I get a "Error 823: I/O error (torn page)" when I'm trying to attach the .mdf file to the New server.
Both the new and the old server is a win2003 with SQL 2000 SP3

Is there anybody who knows how I can recover the DB?

/Rune

View 1 Replies View Related

Recover Database Help!

Oct 6, 2005

Hello,

Is it possible to restore a SQL 2000 database with data from a transaction log?

I am not sure what happened to my database, all the data in the tables is gone. I generated a db script to create a duplicate database. I saved the .sql file on my local machine, separate from the db server, renamed the database name in the .sql file to a new database. Tested script in query analyzer for syntax, all was fine. Running it at this point would have created a new database with a different name, right?

Now my original database is empty. Can someone please provide me with information on getting my data back. Is there a way of using the transaction log to recover the data.

Thanks

View 2 Replies View Related

Way To Recover A Database?

May 9, 2011

is there any way to recover a database? I accidently drop my database .I don't have any backup.

View 5 Replies View Related

An Attempt To Attach An Auto-named Database For File (file Location).../Database.mdf Failed. A Database With The Same Name Exists, Or Specified File Cannot Be Opened, Or It Is Located On UNC Share.

Sep 2, 2007

Greetings, I have just arrived back into the country (NZ) and back into ASP.NET.
 I am having trouble with the following:An attempt to attach an auto-named database for file (file location).../Database.mdf failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.
It has only begun since i decided i wanted to use IIS, I realise VWD comes with its own localhost, but since it is only temporary, i wanted a permanent shortcut on my desktop to link to my intranet page.
 Anyone have any ideas why i am getting the above error? have searched many places on the internet and not getting any closer.
Cheers ~ J
 

View 3 Replies View Related

Recover Mirror Database From Snapshot Database

Feb 28, 2008

I have a mirred database and have snapshot created from the mirroed database. I can do data selecting from the snapshot. But when the pricipal server is down , I can re-active the mirroed database.( I did succesfully upto this). Then I need to restore the database from snapshot and which failing with following error message.




Code Snippet
Msg 5123, Level 16, State 1, Line 3
CREATE FILE encountered operating system error 3(error not found) while attempting to open or create the physical file 'E:sql_datadevitst_mirrorlog st_mirror_log.ldf'.
Msg 5024, Level 16, State 2, Line 3
No entry found for the primary log file in sysfiles1. Could not rebuild the log.
Msg 5028, Level 16, State 2, Line 3
The system could not activate enough of the database to rebuild the log.
Msg 3013, Level 16, State 1, Line 3
RESTORE DATABASE is terminating abnormally.

View 7 Replies View Related

Recover Database Password

Jul 23, 2007

Hi all,
Is it possible to recover or find the password of database or resetting is the only option? I have a database that has a two users in the Users tab. How to find out the password for these?
Thanks, 

View 4 Replies View Related

Recover Sql Server Database

Feb 1, 2008

Hi,
By mistake i've damaged my .mdf file and i have no backup on this database .  However i have the transaction log intact and an older version of the database .
Is it possible to recover the database using the transaction log? How can it be done?
 Thanks to anyone who can help me.

View 3 Replies View Related

Database Backup And Recover

Jul 14, 2003

Hi all:
In order to test database restore, I create a backup driver and puporse delete one table, then I try to restore my databse use backup, but the delete table donot show up.

Thank you

View 5 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved