Monday, March 19, 2012

DB Restore

Hi,
I am restoring a DB from osql command line and I am getting following
message at the end of the resotration. I couldn't understand first two
lines. I searched BOL but couldn't find anything.. anyone know what is
the _dat file? and why it was created? I can see that DB was restored
succesfully. Just puzzlling by these two lines...
Processed 1816 pages for database 'mydb_oltp', file 'mydbtemp_dat' on
file 1.
Processed 1 pages for database 'mydb_oltp', file 'mydbtemp_log' on file
1.
RESTORE DATABASE successfully processed 1817 pages in 12.770 seconds
(1.165
MB/sec).
Thank you,
hjHitesh wrote:
> Hi,
> I am restoring a DB from osql command line and I am getting following
> message at the end of the resotration. I couldn't understand first two
> lines. I searched BOL but couldn't find anything.. anyone know what is
> the _dat file? and why it was created? I can see that DB was restored
> succesfully. Just puzzlling by these two lines...
> Processed 1816 pages for database 'mydb_oltp', file 'mydbtemp_dat' on
> file 1.
> Processed 1 pages for database 'mydb_oltp', file 'mydbtemp_log' on file
> 1.
> RESTORE DATABASE successfully processed 1817 pages in 12.770 seconds
> (1.165
> MB/sec).
> Thank you,
> hj
>
First of all, these are NOT error messages, they are simply status
messages. A SQL Server database consists of, at minimum, two physical
files - a data file (.MDF) and a transaction log file (.LDF). Each
physical file is associated with a "logical" internal file within the
database. These messages you see are telling you that the logical files
"mydbtemp_dat" and "mydbtemp_log" were created successfully.
Tracy McKibben
MCDBA
http://www.realsqlguy.com|||I thought it creates MDF and LDF as the name of the database i.e.
mydb_oltp.mdf and mydb_oltp.ldf. I do not have another instance running
on this server that has logical or physical files name like that.. so I
was kind of puzzled why it created temp names.
Thank you anyway,
hj
Tracy McKibben wrote:
> Hitesh wrote:
> First of all, these are NOT error messages, they are simply status
> messages. A SQL Server database consists of, at minimum, two physical
> files - a data file (.MDF) and a transaction log file (.LDF). Each
> physical file is associated with a "logical" internal file within the
> database. These messages you see are telling you that the logical files
> "mydbtemp_dat" and "mydbtemp_log" were created successfully.
> --
> Tracy McKibben
> MCDBA
> http://www.realsqlguy.com|||The database that was backed up has logical file names like
that - nothing in the restore process created temp file
names. The mdf and ldf files are physical files. As Tracy
already pointed out, mydbtemp_dat and mydbtemp_log are the
logical file names. mydb_oltp.mdf and mydb_oltp.ldf are the
physical files. The restore will restore by default with the
same logical and physical file names that the backed up
database used. You can see both the physical file names and
the logical file names by executing the following in query
analyzer or osql:
use mydb_oltp
go
exec sp_helpfile
In the result set, name is the logical file name and
filename is the physical file name.
-Sue
On 8 Aug 2006 06:06:23 -0700, "Hitesh" <hitesh287@.gmail.com>
wrote:
[vbcol=seagreen]
>I thought it creates MDF and LDF as the name of the database i.e.
>mydb_oltp.mdf and mydb_oltp.ldf. I do not have another instance running
>on this server that has logical or physical files name like that.. so I
>was kind of puzzled why it created temp names.
>Thank you anyway,
>hj
>
>Tracy McKibben wrote:

No comments:

Post a Comment