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

Sunday, March 11, 2012

compare mdf for success restore of data and file storage

Gurus,
I have a scenario where in if i restore a database file(mdf) onto
say some AppManager,i want to make sure its restored properly comparing with
the mdf that it came from(i take this as base).i hope iam making sense here.Ram,
Restore of a backup (.bak) or an attach of a data file (.mdf)? If the
latter do you have the log file as well? If so the database will resolve to
the same schema and data as the database was when it was detached.
HTH
Jerry
"Ram" <Ram@.discussions.microsoft.com> wrote in message
news:4D3E6347-DCCE-49C4-A1DD-B14D0596AB82@.microsoft.com...
> Gurus,
> I have a scenario where in if i restore a database file(mdf)
> onto
> say some AppManager,i want to make sure its restored properly comparing
> with
> the mdf that it came from(i take this as base).i hope iam making sense
> here.|||Thanks Jerry,
Actually backup file contains the folders database(mdf and logfile) and the
file store.
Ram
"Jerry Spivey" wrote:

> Ram,
> Restore of a backup (.bak) or an attach of a data file (.mdf)? If the
> latter do you have the log file as well? If so the database will resolve
to
> the same schema and data as the database was when it was detached.
> HTH
> Jerry
> "Ram" <Ram@.discussions.microsoft.com> wrote in message
> news:4D3E6347-DCCE-49C4-A1DD-B14D0596AB82@.microsoft.com...
>
>|||Jerry,
Back up file has an extension of _dbbak which is compressed and contains
both mdf and ldf files.
"Jerry Spivey" wrote:

> Ram,
> Restore of a backup (.bak) or an attach of a data file (.mdf)? If the
> latter do you have the log file as well? If so the database will resolve
to
> the same schema and data as the database was when it was detached.
> HTH
> Jerry
> "Ram" <Ram@.discussions.microsoft.com> wrote in message
> news:4D3E6347-DCCE-49C4-A1DD-B14D0596AB82@.microsoft.com...
>
>|||Ram,
Compressed? Try decompressing the .mdf and .ldf files then copy them to the
location(s) where you store your .mdf and .ldf files. Then use sp_attach_db
to associate the database with SQL Server.
HTH
Jerry
"Ram" <Ram@.discussions.microsoft.com> wrote in message
news:A4A34557-DEAA-4E69-81B6-5085E78C0830@.microsoft.com...
> Jerry,
> Back up file has an extension of _dbbak which is compressed and contains
> both mdf and ldf files.
> "Jerry Spivey" wrote:
>

Thursday, March 8, 2012

Compare and Restore Tables

I have a database with 44 user tables that had some data deleted. I have
a 2 month old backup of the .mdf and .ldf files I can reatach to the
Server (not the proper sql backup wizard method).

Is there a way I can compare the data that is in the old database to the
new and pull in the records from the old that don't exist in new
database?

Thanks,
Steve

*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!Hi

Using the INFORMATION_SCHEMA views you can write a script that uses the PKs
for each table to insert into the new table that does not already exist in
the table already.

John
"Steve Bishop" <steveb@.viper.com> wrote in message
news:40eefab0$0$16477$c397aba@.news.newsgroups.ws.. .
> I have a database with 44 user tables that had some data deleted. I have
> a 2 month old backup of the .mdf and .ldf files I can reatach to the
> Server (not the proper sql backup wizard method).
> Is there a way I can compare the data that is in the old database to the
> new and pull in the records from the old that don't exist in new
> database?
> Thanks,
> Steve
>
> *** Sent via Devdex http://www.devdex.com ***
> Don't just participate in USENET...get rewarded for it!

Wednesday, March 7, 2012

Compacting a database MS SQL

Hi
for mS SQL 2000-2500
LDF and MDF files can be very very big, if I import the datas into a new database they can become 10 time smaller
is there a way to compact (reduce the MB) of a database ?
thank youLook up DBCC SHRINKDATABASE and DBCC SHRINKFILE in BOL.|||thank you !|||Do not shrink your databases. It can impair performance. SQL Server databases are not like Microsoft Access databases, and do not need to be regularly compacted.|||if I import the datas into a new database they can become 10 time smaller.

is there a way to compact (reduce the MB) of a database ?

Yeah, you can transfer required data in the new database - using DTS.

Accordingly, make changes in your application for accessing old data too.

Note : Before any action you need to deeply analyze pros & cons for the current issues as well as upcoming issues.