Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
sunsanvin
Master Smack Fu Yak Hacker
1274 Posts |
Posted - 2008-10-23 : 02:26:22
|
| Dear all,i've taken the fullbackup of the database which logfile size initially is 383 gb. after the full backup, the backup file size is 10mb. now i'm restoring the backup, but again it is taking the initial size. so please help me how can i restore the database with initial size 1 mb. please help me in this regardArnavEven you learn 1%, Learn it with 100% confidence. |
|
|
SimpleSQL
Yak Posting Veteran
85 Posts |
Posted - 2008-10-23 : 03:02:22
|
| As I understand, you want your Log file size to be 1 MB after restore. The restore process will create log file the same size as it was during backup. There is no workaround to that. You can shrink the log file once created. |
 |
|
|
GilaMonster
Master Smack Fu Yak Hacker
4507 Posts |
Posted - 2008-10-23 : 10:44:57
|
| A restore will always restore the DB into the state it was when the backup was taken. That includes file sizes.--Gail ShawSQL Server MVP |
 |
|
|
sunsanvin
Master Smack Fu Yak Hacker
1274 Posts |
Posted - 2008-10-27 : 02:11:25
|
| I've restored the database, after that detached the database, and renamed the log file, and while attaching the database, it created the new log file with the default 1Mb size. and deleted the renamed log file.here my assumption is there will be no data in the log file as that was freshly restored. and all the data will be available in the datafile. that is the reason I've done like this. am i correct?ArnavEven you learn 1%, Learn it with 100% confidence. |
 |
|
|
GilaMonster
Master Smack Fu Yak Hacker
4507 Posts |
Posted - 2008-10-27 : 02:57:01
|
| Don't ever delete the log file. It's the quickest way to get a corrupt and unusable database. It also breaks the log chain, and you will be unable to do a point-in-time restore to any point after than until you take a full backup. By deleting the log, you have potentially discarded transactions that were done but not written to disk.I would recommend that you restore from that backup again, then shrink the log file down to reasonable size. It sounds like the log file is large but the contents of the log are not. If the contents of the log were large, the backup would have been more than 10MB in size.Make sure, if you're in full recovery, to have regular log backups to keep the log size under control.--Gail ShawSQL Server MVP |
 |
|
|
|
|
|
|
|