Friday, February 17, 2012

DB is boated when restored

I have a *.bak file that is 1.7GB in size. When I do a restore the log file
is 3.0Gb and the data file is 16GB. Does anyone have any idea on what could
be causing this?
This is related to the other newsgroup post of "SQL 2005 db won't shrink".
Also, this db is a production Dynamics AX 4.0.
Any help/direction/info would be greatly appreciated.A database backup file only includes the data used in the database files and
also the log records
produced while performing the backup. That backup was performed on a databas
e which had free space
in both database file and the log file. When you restore the backup, SQL Ser
ver has to create the
database with the same file size as all the database files had when the back
up was performed. So,
what you see is perfectly normal.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Patrick R." <PatrickR@.discussions.microsoft.com> wrote in message
news:7429D298-69ED-444B-87E1-0659CF2F74B9@.microsoft.com...
>I have a *.bak file that is 1.7GB in size. When I do a restore the log file
> is 3.0Gb and the data file is 16GB. Does anyone have any idea on what coul
d
> be causing this?
> This is related to the other newsgroup post of "SQL 2005 db won't shrink".
> Also, this db is a production Dynamics AX 4.0.
> Any help/direction/info would be greatly appreciated.|||Patrick R. wrote:
> I have a *.bak file that is 1.7GB in size. When I do a restore the log fil
e
> is 3.0Gb and the data file is 16GB. Does anyone have any idea on what coul
d
> be causing this?
> This is related to the other newsgroup post of "SQL 2005 db won't shrink".
> Also, this db is a production Dynamics AX 4.0.
> Any help/direction/info would be greatly appreciated.
>
I didn't happen to read your other reference topic.
Have you looked at the dbcc shrinkdatabase with the truncate only option
TRUNCATEONLY
Releases all free space at the end of the file to the operating
system but does not perform any page movement inside the file. The
data file is shrunk only to the last allocated extent.
/target_percent/ is ignored if specified with TRUNCATEONLY.|||A misunderstanding, so let me clarify...I need to remove all the "space
available" from this db, no matter how it gets there. And I've tried all the
shrinkdatabase, shrinkfiles, put in simple recover mode, backed up, restored
,
etc. And the space is still there. So what can remove the unwanted space?
Thanks
"Tibor Karaszi" wrote:

> A database backup file only includes the data used in the database files a
nd also the log records
> produced while performing the backup. That backup was performed on a datab
ase which had free space
> in both database file and the log file. When you restore the backup, SQL S
erver has to create the
> database with the same file size as all the database files had when the ba
ckup was performed. So,
> what you see is perfectly normal.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
> "Patrick R." <PatrickR@.discussions.microsoft.com> wrote in message
> news:7429D298-69ED-444B-87E1-0659CF2F74B9@.microsoft.com...
>|||>A misunderstanding, so let me clarify...I need to remove all the "space
> available" from this db, no matter how it gets there.
Why, that comes with a huge performance penalty. But, assuming you have your
reasons:
For the log to shrink, you need to work DBCC LOGINFO, BACKUP LOG and DBCC SH
RINKFILE. See
http://www.karaszi.com/SQLServer/info_dont_shrink.asp for details. Pay speci
al attention to the DBCC
LOGINFO part.
For the data part, well, it should shrink using DBCC SHRINKFILE. IT can take
a while to shrink 16
GB, but it should happen (no fancy options, though).
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Patrick R." <PatrickR@.discussions.microsoft.com> wrote in message
news:69E7CBDE-6BA0-4234-9987-7D1AE5529275@.microsoft.com...[vbcol=seagreen]
>A misunderstanding, so let me clarify...I need to remove all the "space
> available" from this db, no matter how it gets there. And I've tried all t
he
> shrinkdatabase, shrinkfiles, put in simple recover mode, backed up, restor
ed,
> etc. And the space is still there. So what can remove the unwanted space?
> Thanks
> "Tibor Karaszi" wrote:
>|||It is not the log file that has the issue, it's the db file. Also, I've
logged a case w/ MS and we've done all the things I've read and done earlier
,
to no availl. I am currently uploading my bak to MS for their evaluation. I
will keep this thread updated on the results, and thank everyone for their
time and effort, thanks, Patrick
"Tibor Karaszi" wrote:

> Why, that comes with a huge performance penalty. But, assuming you have yo
ur reasons:
> For the log to shrink, you need to work DBCC LOGINFO, BACKUP LOG and DBCC
SHRINKFILE. See
> http://www.karaszi.com/SQLServer/info_dont_shrink.asp for details. Pay spe
cial attention to the DBCC
> LOGINFO part.
> For the data part, well, it should shrink using DBCC SHRINKFILE. IT can ta
ke a while to shrink 16
> GB, but it should happen (no fancy options, though).
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
> "Patrick R." <PatrickR@.discussions.microsoft.com> wrote in message
> news:69E7CBDE-6BA0-4234-9987-7D1AE5529275@.microsoft.com...
>

No comments:

Post a Comment