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

Tuesday, March 27, 2012

CAN I GET MY DATA BACK AFTER REINSTALLING MSDE

WHEN I REINSTALLED MSDE THE MSQL7/DATA FOLDER HAS MYDB.MDF AND MYDB.LDF FILES IN THERE.
THE NEW INSTALLATION WILL NOT RECOGNISE THESE FROM THE OLD INSTALLATION.
IS THERE ANY WAY TO REINSTATE THESE DBS OTHER THAN FROM THE BACK UP THAT I DID NOT DO?
HOPING AND PRAYING IN YOUR HANDS O LORD GURU.
Hi Lofty,
You can "reattach" the database. Take a look at the sp_attach_db stored proc
in BOL.
Basically, you can just say:
sp_attach_db 'newdbname','pathtomdffile','pathtoldsfile'
HTH,
Greg Low (MVP)
MSDE Manager SQL Tools
www.whitebearconsulting.com
"LOFTY" <anonymous@.discussions.microsoft.com> wrote in message
news:57943C4F-8CC8-4CB8-AC3F-C5B097662168@.microsoft.com...
> WHEN I REINSTALLED MSDE THE MSQL7/DATA FOLDER HAS MYDB.MDF AND MYDB.LDF
FILES IN THERE.
> THE NEW INSTALLATION WILL NOT RECOGNISE THESE FROM THE OLD INSTALLATION.
> IS THERE ANY WAY TO REINSTATE THESE DBS OTHER THAN FROM THE BACK UP THAT I
DID NOT DO?
> HOPING AND PRAYING IN YOUR HANDS O LORD GURU.

Monday, March 19, 2012

can I bring roll back a trasaction log

I am building a test environment. My objective is to be able to bring the
test database from different stage within 15 minutes. The database mdf file
is 6G and the log file is 500M after truncated. The data is updated not
using transaction commit command.
Existing Plan
1/ prepare a full backup of the database to a file called
FullBackup.bak
2/ at each hour , do a transaction log backup. e.g
job1.trn
3/ I restore the database by applying the full backup bak and individual
transaction.log . But the whole process takes about one hour which does not
meet the requirement to bring back the database within 15 minutes.
Question:
1/ consider the following:
8:00 am full backup
9:00 am transaction log backup job 1
10:00am transaction log backup job 2
11:00am transaction log backup job 3
I need to bring back the database at 9:59am.
Is it a way to apply the transaction log so that the database can undo the
change based on the job3 transaction log, job 2 transaction log?
or
2/ What other way can allow me to bring back a data base at different stage
within 15 minutes?
3/ How to find out what database has been modified every one hour? and
what data has been added/deleted/edited.
Regards
SMS1
Hi
1. If you need to bring a database back to 9:59am, you need to restore the
last good full backup and all the transaction logs after that, including the
10:00am one, up to the time you need. See "point in time recovery" in BOL
2. This is the only option, as transaction logs can be restored to an exact
point in time.
3. Look at the commercial products LogPI or Log Explorer to examine log files.
Cheers
Mike
"sms" wrote:

> I am building a test environment. My objective is to be able to bring the
> test database from different stage within 15 minutes. The database mdf file
> is 6G and the log file is 500M after truncated. The data is updated not
> using transaction commit command.
> Existing Plan
> 1/ prepare a full backup of the database to a file called
> FullBackup.bak
> 2/ at each hour , do a transaction log backup. e.g
> job1.trn
> 3/ I restore the database by applying the full backup bak and individual
> transaction.log . But the whole process takes about one hour which does not
> meet the requirement to bring back the database within 15 minutes.
> Question:
> 1/ consider the following:
> 8:00 am full backup
> 9:00 am transaction log backup job 1
> 10:00am transaction log backup job 2
> 11:00am transaction log backup job 3
> I need to bring back the database at 9:59am.
> Is it a way to apply the transaction log so that the database can undo the
> change based on the job3 transaction log, job 2 transaction log?
> or
> 2/ What other way can allow me to bring back a data base at different stage
> within 15 minutes?
>
> 3/ How to find out what database has been modified every one hour? and
> what data has been added/deleted/edited.
> Regards
> SMS1
>
>
|||Depending on your disk configurations, you might reduce the backup and
recovery times by striping your backup files e.g.
BACKUP DATABASE pubs TO DISK = 'f:\backups\pubs1.bak', DISK =
'f:\backups\pubs2.bak' ...
When you mentioned that the recovery took 1 hour, did you delete the
database before restoring it? If you did, try restoring without first
deleting the database. It would save some time as it avoids having SQL
Server create a 6 Gig file before the restore process actually starts.
Lastly, depending again on your hardware configuration, you can reduce
backup and restore times by using backup software that works with compressed
SQL Server backup files e.g. our product, MiniSQLBackup.
Peter Yeoh
http://www.yohz.com
Need smaller SQL2K backups? Use MiniSQLBackup Lite, free!
"sms" <sms1@.pctc.com> wrote in message
news:vsg4d.2575$KF.20421@.tor-nn1.netcom.ca...
> I am building a test environment. My objective is to be able to bring the
> test database from different stage within 15 minutes. The database mdf
file
> is 6G and the log file is 500M after truncated. The data is updated not
> using transaction commit command.
> Existing Plan
> 1/ prepare a full backup of the database to a file called
> FullBackup.bak
> 2/ at each hour , do a transaction log backup. e.g
> job1.trn
> 3/ I restore the database by applying the full backup bak and individual
> transaction.log . But the whole process takes about one hour which does
not
> meet the requirement to bring back the database within 15 minutes.
> Question:
> 1/ consider the following:
> 8:00 am full backup
> 9:00 am transaction log backup job 1
> 10:00am transaction log backup job 2
> 11:00am transaction log backup job 3
> I need to bring back the database at 9:59am.
> Is it a way to apply the transaction log so that the database can undo the
> change based on the job3 transaction log, job 2 transaction log?
> or
> 2/ What other way can allow me to bring back a data base at different
stage
> within 15 minutes?
>
> 3/ How to find out what database has been modified every one hour? and
> what data has been added/deleted/edited.
> Regards
> SMS1
>

can I bring roll back a trasaction log

I am building a test environment. My objective is to be able to bring the
test database from different stage within 15 minutes. The database mdf file
is 6G and the log file is 500M after truncated. The data is updated not
using transaction commit command.
Existing Plan
1/ prepare a full backup of the database to a file called
FullBackup.bak
2/ at each hour , do a transaction log backup. e.g
job1.trn
3/ I restore the database by applying the full backup bak and individual
transaction.log . But the whole process takes about one hour which does not
meet the requirement to bring back the database within 15 minutes.
Question:
1/ consider the following:
8:00 am full backup
9:00 am transaction log backup job 1
10:00am transaction log backup job 2
11:00am transaction log backup job 3
I need to bring back the database at 9:59am.
Is it a way to apply the transaction log so that the database can undo the
change based on the job3 transaction log, job 2 transaction log?
or
2/ What other way can allow me to bring back a data base at different stage
within 15 minutes?
3/ How to find out what database has been modified every one hour? and
what data has been added/deleted/edited.
Regards
SMS1Depending on your disk configurations, you might reduce the backup and
recovery times by striping your backup files e.g.
BACKUP DATABASE pubs TO DISK = 'f:\backups\pubs1.bak', DISK ='f:\backups\pubs2.bak' ...
When you mentioned that the recovery took 1 hour, did you delete the
database before restoring it? If you did, try restoring without first
deleting the database. It would save some time as it avoids having SQL
Server create a 6 Gig file before the restore process actually starts.
Lastly, depending again on your hardware configuration, you can reduce
backup and restore times by using backup software that works with compressed
SQL Server backup files e.g. our product, MiniSQLBackup.
--
Peter Yeoh
http://www.yohz.com
Need smaller SQL2K backups? Use MiniSQLBackup Lite, free!
"sms" <sms1@.pctc.com> wrote in message
news:vsg4d.2575$KF.20421@.tor-nn1.netcom.ca...
> I am building a test environment. My objective is to be able to bring the
> test database from different stage within 15 minutes. The database mdf
file
> is 6G and the log file is 500M after truncated. The data is updated not
> using transaction commit command.
> Existing Plan
> 1/ prepare a full backup of the database to a file called
> FullBackup.bak
> 2/ at each hour , do a transaction log backup. e.g
> job1.trn
> 3/ I restore the database by applying the full backup bak and individual
> transaction.log . But the whole process takes about one hour which does
not
> meet the requirement to bring back the database within 15 minutes.
> Question:
> 1/ consider the following:
> 8:00 am full backup
> 9:00 am transaction log backup job 1
> 10:00am transaction log backup job 2
> 11:00am transaction log backup job 3
> I need to bring back the database at 9:59am.
> Is it a way to apply the transaction log so that the database can undo the
> change based on the job3 transaction log, job 2 transaction log?
> or
> 2/ What other way can allow me to bring back a data base at different
stage
> within 15 minutes?
>
> 3/ How to find out what database has been modified every one hour? and
> what data has been added/deleted/edited.
> Regards
> SMS1
>|||Hi
1. If you need to bring a database back to 9:59am, you need to restore the
last good full backup and all the transaction logs after that, including the
10:00am one, up to the time you need. See "point in time recovery" in BOL
2. This is the only option, as transaction logs can be restored to an exact
point in time.
3. Look at the commercial products LogPI or Log Explorer to examine log files.
Cheers
Mike
"sms" wrote:
> I am building a test environment. My objective is to be able to bring the
> test database from different stage within 15 minutes. The database mdf file
> is 6G and the log file is 500M after truncated. The data is updated not
> using transaction commit command.
> Existing Plan
> 1/ prepare a full backup of the database to a file called
> FullBackup.bak
> 2/ at each hour , do a transaction log backup. e.g
> job1.trn
> 3/ I restore the database by applying the full backup bak and individual
> transaction.log . But the whole process takes about one hour which does not
> meet the requirement to bring back the database within 15 minutes.
> Question:
> 1/ consider the following:
> 8:00 am full backup
> 9:00 am transaction log backup job 1
> 10:00am transaction log backup job 2
> 11:00am transaction log backup job 3
> I need to bring back the database at 9:59am.
> Is it a way to apply the transaction log so that the database can undo the
> change based on the job3 transaction log, job 2 transaction log?
> or
> 2/ What other way can allow me to bring back a data base at different stage
> within 15 minutes?
>
> 3/ How to find out what database has been modified every one hour? and
> what data has been added/deleted/edited.
> Regards
> SMS1
>
>

Thursday, March 8, 2012

Can data be retrieved from a SQL LDF file (Log)

I have a database that has a corrupt .MDF file, but
the .LDF file is still accessible. My most recent backup
is a week old. My question is: After I re-create the
database, is there any way I can recover the past weeks
transactions from the .LDF file. No transaction dump has
been done since the last backup, so I would think that
theoretically the week's transactions are still in the LDF
file.If you haven't done any transaction log backups since the most recent
database backup you can now backup the log, restore the full backup and then
restore the transaction log backup.
See Books Online for the details.
--
Jacco Schalkwijk
SQL Server MVP
"SteveB" <steve_brooks@.adp.com> wrote in message
news:430d01c39e52$c1fa2950$7d02280a@.phx.gbl...
> I have a database that has a corrupt .MDF file, but
> the .LDF file is still accessible. My most recent backup
> is a week old. My question is: After I re-create the
> database, is there any way I can recover the past weeks
> transactions from the .LDF file. No transaction dump has
> been done since the last backup, so I would think that
> theoretically the week's transactions are still in the LDF
> file.|||"SteveB" <steve_brooks@.adp.com> wrote in message
news:430d01c39e52$c1fa2950$7d02280a@.phx.gbl...
> I have a database that has a corrupt .MDF file, but
> the .LDF file is still accessible. My most recent backup
> is a week old. My question is: After I re-create the
> database, is there any way I can recover the past weeks
> transactions from the .LDF file. No transaction dump has
> been done since the last backup, so I would think that
> theoretically the week's transactions are still in the LDF
> file.
Yes.
Before restoring back up your log with NOTRUNCATE
BACKUP LOG mydb
TO mydevice1
WITH NOTRUNCATE
RESTORE DATABASE mydb
FROM mydevice2
WITH RESTORE.
That should roll your log file forward.
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.532 / Virus Database: 326 - Release Date: 27/10/2003

Wednesday, March 7, 2012

Can aspnetdb.mdf be moved from development to production machine?

1.) Can an aspnetdb.mdf database be configured and setup on one server and then be moved to a production server or is there something machine specific that keeps this from being possible?
2.) Is putting this file in the app_data folder something that is used only for SQL 2005 or SQL express? I had to set up a connection string in my SQL 2000 installation to get the connection to work.

Thanks for any input!

Colelaus

aspnetdb.mdf is the default sql express database created, if you want to move it onto production, your production server has to install sql express and reference it in your connection string|||

I'm using aspnetdb.mdf as my security database but not SQL Express due to llimitations on the server. I guess my question is really is there anything that is generated in the database when setting up security that is machine specific that would keep the database from being moved from one machine to another?

If it is machine specific, it would require as you referenced, me to recreate on the production server and reset all the users again.

Colelaus

|||

Hi Colelaus,

If your production server provides SQL server other editions than the Express edition, you will need to have the .mdf database files attach to server manually, since other edtions of SQL server does not support attaching database files automatically at runtime.

Also, you will need to modify your connection string and make it look like "Data Source=ServerName\InstanceName;Initial Catelog=DatabaseName". It points to a database on server instead of a .mdf file.For other information, you will need to contact the hosting service.

The tool you may use : Aspnet_regsql.exe ( More details about the tool, pls visit http://msdn2.microsoft.com/en-us/library/ms229862(VS.80).aspx )

Thanks.

|||

Thanks. That is exactly the info I needed.

Colelaus