April 27, 2009 at 10:21 pm
Hi friends,
Good morning to all.
Today i learnt how to take DB backup in to two different Drives.But, i am facing a small prob 🙁 , the problem is that how to open a .bak file in SQL server and how to read the info present in it?
Thank you all,
Venu Gopal.K
Software Engineer
INDIA
April 27, 2009 at 10:37 pm
Venu,
.bak file cannot be opened.It is the file which can be restored in sql server as a database.
how to read the info present in it?
What info did u mean?
Once you restore the .bak file ,you can query the tables in the database.
Please mention what r u looking for?
April 27, 2009 at 10:48 pm
Hi Reddy,
Thank u for u r reply.See i am a person who is started learning SQL DBM and want to be a DBA. See i take backup of a DB in two different drives and it is working finely.whats my doubt is
1)What is the importance of .bak file?(i know it is formed during taking Backup of a DB)
2)What is the need of .bak file in future?(means when can we again use it even we cant open it any medium)
3) what are the files formed during
a) While creation of a DB?(Up to my knowledge .mdf,.ldf files are the file which are going to form at the time of Db creation) and what is the use of these files when a DB gets corrupted?
b) While taking DB backup?and Hoe these files will be useful at the time of DB corruption?
Please give me answers in a practical scenario,
Thank you all,
Venu Gopal.K
Software Engineer
INDIA
April 27, 2009 at 11:17 pm
1)What is the importance of .bak file?(i know it is formed during taking Backup of a DB)
A database is to be preserved everyday.That is one of the main task of the DBA.To preserve a DB we take the full database backup every day which has the .bak extension.When the server is down (or) database is corrupted (or) You need older date data (or) you want a production-like database in your development server you need the .bak file to be restored as a database.
2)What is the need of .bak file in future?(means when can we again use it even we cant open it any medium)
answered above.
3) what are the files formed during
a) While creation of a DB?(Up to my knowledge .mdf,.ldf files are the file which are going to form at the time of Db creation) and what is the use of these files when a DB gets corrupted?
yes u r correct.
mdf (primary) data file and ldf (log) file are formed by default while creation of database .
In addition to these ndf(secondary )data files can be created for a database and you can have the data placed in this file also.
when a database is corrupted ,you can restore your backup .bak file ( depends on your backup strategy).
b) While taking DB backup?and Hoe these files will be useful at the time of DB corruption?
.bak file has the entries from the mdf and ldf files.
Please go through BOL ,for furthur understanding.
April 27, 2009 at 11:48 pm
HI reddy thanks a lot for u r valuable answers.
My final doubt is --
Which files are required for restore when a DB gets corrupted (means .mdf, .ldf files or only .bak files)
what exactly my doubt is supose Server1 is a server in which it is corrupted and i am having .mdf,.ldf,.ndf and .bak files of DB on Server1, but i want to restore all the data on Server2 which is a fresh one, Is it possible?
Venu Gopal.K
Software Engineer
INDIA
April 28, 2009 at 12:20 am
Which files are required for restore when a DB gets corrupted (means .mdf, .ldf files or only .bak files)
You will restore the .bak file which was taken recently.In addition to these you need to restore the logbackup files (.trn) also.
ex: you took fullbackup(.bak) at 1 am and logbackup(.trn) at 2 am and your database is crashed at 2:01 am,now you will restore the .bak file and then .trn file.
what exactly my doubt is supose Server1 is a server in which it is corrupted and i am having .mdf,.ldf,.ndf and .bak files of DB on Server1, but i want to restore all the data on Server2 which is a fresh one, Is it possible?
Copy the .bak file to Server2 and restore it there as a database.You now have newly formed mdf and ldf files there in Server2 also.
April 28, 2009 at 12:30 am
Thank you for ur supporting
Let me know that whats the .trn file represents.I hav not seen a file having such type of extention.
Venu Gopal.K
Software Engineer
INDIA
April 28, 2009 at 12:48 am
Backups are of three types.
Full backup
Differential backup
Transactional log backup
The thrid one has the .trn extension.
Please refer Books Online for types of backups.I think you should go through it.
Viewing 8 posts - 1 through 7 (of 7 total)
You must be logged in to reply to this topic. Login to reply