Showing posts with label file. Show all posts
Showing posts with label file. Show all posts

Thursday, March 29, 2012

database in simple mode yet txn log file can be out of diskspace ?

Hi ,

I have set up my database to be using "Simple" mode. This will not log any
txns ?

I have got the err message saying the log file is full and i need to do a
txn log backup

i do not understand why , could anyone kindly advise ?

tks & rdgs

--
Message posted via SQLMonster.com
http://www.sqlmonster.com/Uwe/Forum...eneral/200510/1Having you database in SIMPLE recovery mode does NOT mean that
transactions are not logged. All it means is that all committed
transactions are removed from the T-log when a checkpoint occurs. So if
you run lot's of and especially longrunning transactions, it still can
happen that your T-log grows out of space.

M

Database in Recovering/suspect mode

Hi,
We have database of around 500 GB. Y'day nite we got a error msg saying
unable to write error to errorlog file.We were not able to login to the
sqlserver this morning.
So we restarted our server. It went to recover mode & started recovering
the database. It was fine till 96% then
we got a error msg
"Could not redo log record (635160:1109455:186),
for transaction ID (0:733497362), on page (4:840931), database 'VADI_NFDW'
(8). Page: LSN = (635147:63129:440), type = 2. Log: OpCode = 3, context 3,
PrevPageLSN: (635160:1100226:202)."
and one more msg as
"Error while redoing logged operation in database 'VADI_NFDW'. Error at log
record ID (635160:1109455:186)"
How could we solve this problem...It's our production db...
Thanks
Muthu
You need to contact PSS to help you with this.
Paul Randal
Dev Lead, Microsoft SQL Server Storage Engine
This posting is provided "AS IS" with no warranties, and confers no rights.
"muthu" <muthu@.discussions.microsoft.com> wrote in message
news:DFB0D7F3-5236-48B9-8A4B-87BB0C1F8D24@.microsoft.com...
> Hi,
> We have database of around 500 GB. Y'day nite we got a error msg saying
> unable to write error to errorlog file.We were not able to login to the
> sqlserver this morning.
> So we restarted our server. It went to recover mode & started recovering
> the database. It was fine till 96% then
> we got a error msg
> "Could not redo log record (635160:1109455:186),
> for transaction ID (0:733497362), on page (4:840931), database 'VADI_NFDW'
> (8). Page: LSN = (635147:63129:440), type = 2. Log: OpCode = 3, context 3,
> PrevPageLSN: (635160:1100226:202)."
> and one more msg as
> "Error while redoing logged operation in database 'VADI_NFDW'. Error at
log
> record ID (635160:1109455:186)"
> How could we solve this problem...It's our production db...
> Thanks
> Muthu
>

Database in Recovering/suspect mode

Hi,
We have database of around 500 GB. Y'day nite we got a error msg saying
unable to write error to errorlog file.We were not able to login to the
sqlserver this morning.
So we restarted our server. It went to recover mode & started recovering
the database. It was fine till 96% then
we got a error msg
"Could not redo log record (635160:1109455:186),
for transaction ID (0:733497362), on page (4:840931), database 'VADI_NFDW'
(8). Page: LSN = (635147:63129:440), type = 2. Log: OpCode = 3, context 3,
PrevPageLSN: (635160:1100226:202)."
and one more msg as
"Error while redoing logged operation in database 'VADI_NFDW'. Error at log
record ID (635160:1109455:186)"
How could we solve this problem...It's our production db...
Thanks
MuthuYou need to contact PSS to help you with this.
Paul Randal
Dev Lead, Microsoft SQL Server Storage Engine
This posting is provided "AS IS" with no warranties, and confers no rights.
"muthu" <muthu@.discussions.microsoft.com> wrote in message
news:DFB0D7F3-5236-48B9-8A4B-87BB0C1F8D24@.microsoft.com...
> Hi,
> We have database of around 500 GB. Y'day nite we got a error msg saying
> unable to write error to errorlog file.We were not able to login to the
> sqlserver this morning.
> So we restarted our server. It went to recover mode & started recovering
> the database. It was fine till 96% then
> we got a error msg
> "Could not redo log record (635160:1109455:186),
> for transaction ID (0:733497362), on page (4:840931), database 'VADI_NFDW'
> (8). Page: LSN = (635147:63129:440), type = 2. Log: OpCode = 3, context 3,
> PrevPageLSN: (635160:1100226:202)."
> and one more msg as
> "Error while redoing logged operation in database 'VADI_NFDW'. Error at
log
> record ID (635160:1109455:186)"
> How could we solve this problem...It's our production db...
> Thanks
> Muthu
>

Database in Recovering/suspect mode

Hi,
We have database of around 500 GB. Y'day nite we got a error msg saying
unable to write error to errorlog file.We were not able to login to the
sqlserver this morning.
So we restarted our server. It went to recover mode & started recovering
the database. It was fine till 96% then
we got a error msg
"Could not redo log record (635160:1109455:186),
for transaction ID (0:733497362), on page (4:840931), database 'VADI_NFDW'
(8). Page: LSN = (635147:63129:440), type = 2. Log: OpCode = 3, context 3,
PrevPageLSN: (635160:1100226:202)."
and one more msg as
"Error while redoing logged operation in database 'VADI_NFDW'. Error at log
record ID (635160:1109455:186)"
How could we solve this problem...It's our production db...
Thanks
MuthuYou need to contact PSS to help you with this.
--
Paul Randal
Dev Lead, Microsoft SQL Server Storage Engine
This posting is provided "AS IS" with no warranties, and confers no rights.
"muthu" <muthu@.discussions.microsoft.com> wrote in message
news:DFB0D7F3-5236-48B9-8A4B-87BB0C1F8D24@.microsoft.com...
> Hi,
> We have database of around 500 GB. Y'day nite we got a error msg saying
> unable to write error to errorlog file.We were not able to login to the
> sqlserver this morning.
> So we restarted our server. It went to recover mode & started recovering
> the database. It was fine till 96% then
> we got a error msg
> "Could not redo log record (635160:1109455:186),
> for transaction ID (0:733497362), on page (4:840931), database 'VADI_NFDW'
> (8). Page: LSN = (635147:63129:440), type = 2. Log: OpCode = 3, context 3,
> PrevPageLSN: (635160:1100226:202)."
> and one more msg as
> "Error while redoing logged operation in database 'VADI_NFDW'. Error at
log
> record ID (635160:1109455:186)"
> How could we solve this problem...It's our production db...
> Thanks
> Muthu
>

Tuesday, March 27, 2012

Database has grown too big (5 GB)

Hello
My database should have a normal size on about 500-1000 mb, but it now has
the size of 5 gb. I am talking about the MDF file, not the log file.
I think it is because of a wrong setup of the maintenance plan. Now I have
altered the optimization and checked "remove unused space from database
files", so it is set to shrink database when it grows beyond 50 Mb.
So do you think that next time the maintenance plan runs the Optimization,
the database size will be set to normal ?
I use MSSQL 2000, service pack 3, MDAC 2.8
\AndersIt depends on how much space is being used. Run a sp_spaceused inside the
database name. The reserved number (which equals data + log+ unused) is
roughly how much space to expect from shrinking, which can also be
accomplished by running dbcc shrinkfile (<data name>, 0) -- see SQL Server
Books online for details (which can be downloaded for free from Microsoft's
SQL site -- http://www.microsoft.com/sql)
--
*******************************************************************
Andy S.
MCSE NT/2000, MCDBA SQL 7/2000
andymcdba1@.NOMORESPAM.yahoo.com
Please remove NOMORESPAM before replying.
Always keep your antivirus and Microsoft software
up to date with the latest definitions and product updates.
Be suspicious of every email attachment, I will never send
or post anything other than the text of a http:// link nor
post the link directly to a file for downloading.
This posting is provided "as is" with no warranties
and confers no rights.
*******************************************************************
"anders" <a.vindal@.techotel.dk> wrote in message
news:%23hSDU9I$DHA.2636@.TK2MSFTNGP09.phx.gbl...
> Hello
> My database should have a normal size on about 500-1000 mb, but it now has
> the size of 5 gb. I am talking about the MDF file, not the log file.
> I think it is because of a wrong setup of the maintenance plan. Now I have
> altered the optimization and checked "remove unused space from database
> files", so it is set to shrink database when it grows beyond 50 Mb.
> So do you think that next time the maintenance plan runs the Optimization,
> the database size will be set to normal ?
> I use MSSQL 2000, service pack 3, MDAC 2.8
>
>
> \Anders
>|||If after shrinking the DB, you see the same problem, then try the following:
Do you have clustered index on your tables? If not, add and see if you see
the change.
"anders" <a.vindal@.techotel.dk> wrote in message
news:%23hSDU9I$DHA.2636@.TK2MSFTNGP09.phx.gbl...
> Hello
> My database should have a normal size on about 500-1000 mb, but it now has
> the size of 5 gb. I am talking about the MDF file, not the log file.
> I think it is because of a wrong setup of the maintenance plan. Now I have
> altered the optimization and checked "remove unused space from database
> files", so it is set to shrink database when it grows beyond 50 Mb.
> So do you think that next time the maintenance plan runs the Optimization,
> the database size will be set to normal ?
> I use MSSQL 2000, service pack 3, MDAC 2.8
>
>
> \Anders
>

Database has grown too big (5 GB)

Hello
My database should have a normal size on about 500-1000 mb, but it now has
the size of 5 gb. I am talking about the MDF file, not the log file.
I think it is because of a wrong setup of the maintenance plan. Now I have
altered the optimization and checked "remove unused space from database
files", so it is set to shrink database when it grows beyond 50 Mb.
So do you think that next time the maintenance plan runs the Optimization,
the database size will be set to normal ?
I use MSSQL 2000, service pack 3, MDAC 2.8
\AndersIt depends on how much space is being used. Run a sp_spaceused inside the
database name. The reserved number (which equals data + log+ unused) is
roughly how much space to expect from shrinking, which can also be
accomplished by running dbcc shrinkfile (<data name>, 0) -- see SQL Server
Books online for details (which can be downloaded for free from Microsoft's
SQL site -- http://www.microsoft.com/sql)
****************************************
***************************
Andy S.
MCSE NT/2000, MCDBA SQL 7/2000
andymcdba1@.NOMORESPAM.yahoo.com
Please remove NOMORESPAM before replying.
Always keep your antivirus and Microsoft software
up to date with the latest definitions and product updates.
Be suspicious of every email attachment, I will never send
or post anything other than the text of a http:// link nor
post the link directly to a file for downloading.
This posting is provided "as is" with no warranties
and confers no rights.
****************************************
***************************
"anders" <a.vindal@.techotel.dk> wrote in message
news:%23hSDU9I$DHA.2636@.TK2MSFTNGP09.phx.gbl...
> Hello
> My database should have a normal size on about 500-1000 mb, but it now has
> the size of 5 gb. I am talking about the MDF file, not the log file.
> I think it is because of a wrong setup of the maintenance plan. Now I have
> altered the optimization and checked "remove unused space from database
> files", so it is set to shrink database when it grows beyond 50 Mb.
> So do you think that next time the maintenance plan runs the Optimization,
> the database size will be set to normal ?
> I use MSSQL 2000, service pack 3, MDAC 2.8
>
>
> \Anders
>|||If after shrinking the DB, you see the same problem, then try the following:
Do you have clustered index on your tables? If not, add and see if you see
the change.
"anders" <a.vindal@.techotel.dk> wrote in message
news:%23hSDU9I$DHA.2636@.TK2MSFTNGP09.phx.gbl...
> Hello
> My database should have a normal size on about 500-1000 mb, but it now has
> the size of 5 gb. I am talking about the MDF file, not the log file.
> I think it is because of a wrong setup of the maintenance plan. Now I have
> altered the optimization and checked "remove unused space from database
> files", so it is set to shrink database when it grows beyond 50 Mb.
> So do you think that next time the maintenance plan runs the Optimization,
> the database size will be set to normal ?
> I use MSSQL 2000, service pack 3, MDAC 2.8
>
>
> \Anders
>

Sunday, March 25, 2012

Database free space: big discrepancy between sp_spaceused and EM taskpad view

I am monitoring free space in my database so I can manually grow the
data file rather than relying on autogrow. I get the free space by
using the 'unallocated space' value returned by sp_spaceused.
Today I was alerted that there was less than 2% free space remaining
in my database. I verified with sp_spaceused and it was reporting ~8GB
unallocated space in a ~500GB database. Then I checked the free space
by looking at the taskpad view for my database in Enterprise Manager.
This showed ~60GB free. I ran a profiler trace to see what EM is doing
to calculate free space but I can't tell what calculations it does,
other than to see that in addition to sp_spaceused it uses the
following two commands:
select sum(convert(float,size)) * (8192.0/1024.0) from dbo.sysfiles
and
DBCC showfilestats
Am I wrong in thinking that the 'unallocated space' and free space
reported by EM should be similar? Is one a more reliable indicator
than the other?
ThanksHi
Before using sp_spaceused run DBCC UPDATEUSAGE command
<pshroads@.gmail.com> wrote in message
news:1184779707.553225.56190@.d30g2000prg.googlegroups.com...
>I am monitoring free space in my database so I can manually grow the
> data file rather than relying on autogrow. I get the free space by
> using the 'unallocated space' value returned by sp_spaceused.
> Today I was alerted that there was less than 2% free space remaining
> in my database. I verified with sp_spaceused and it was reporting ~8GB
> unallocated space in a ~500GB database. Then I checked the free space
> by looking at the taskpad view for my database in Enterprise Manager.
> This showed ~60GB free. I ran a profiler trace to see what EM is doing
> to calculate free space but I can't tell what calculations it does,
> other than to see that in addition to sp_spaceused it uses the
> following two commands:
> select sum(convert(float,size)) * (8192.0/1024.0) from dbo.sysfiles
> and
> DBCC showfilestats
> Am I wrong in thinking that the 'unallocated space' and free space
> reported by EM should be similar? Is one a more reliable indicator
> than the other?
> Thanks
>

Database free space: big discrepancy between sp_spaceused and EM taskpad view

I am monitoring free space in my database so I can manually grow the
data file rather than relying on autogrow. I get the free space by
using the 'unallocated space' value returned by sp_spaceused.
Today I was alerted that there was less than 2% free space remaining
in my database. I verified with sp_spaceused and it was reporting ~8GB
unallocated space in a ~500GB database. Then I checked the free space
by looking at the taskpad view for my database in Enterprise Manager.
This showed ~60GB free. I ran a profiler trace to see what EM is doing
to calculate free space but I can't tell what calculations it does,
other than to see that in addition to sp_spaceused it uses the
following two commands:
select sum(convert(float,size)) * (8192.0/1024.0) from dbo.sysfiles
and
DBCC showfilestats
Am I wrong in thinking that the 'unallocated space' and free space
reported by EM should be similar? Is one a more reliable indicator
than the other?
ThanksHi
Before using sp_spaceused run DBCC UPDATEUSAGE command
<pshroads@.gmail.com> wrote in message
news:1184779707.553225.56190@.d30g2000prg.googlegroups.com...
>I am monitoring free space in my database so I can manually grow the
> data file rather than relying on autogrow. I get the free space by
> using the 'unallocated space' value returned by sp_spaceused.
> Today I was alerted that there was less than 2% free space remaining
> in my database. I verified with sp_spaceused and it was reporting ~8GB
> unallocated space in a ~500GB database. Then I checked the free space
> by looking at the taskpad view for my database in Enterprise Manager.
> This showed ~60GB free. I ran a profiler trace to see what EM is doing
> to calculate free space but I can't tell what calculations it does,
> other than to see that in addition to sp_spaceused it uses the
> following two commands:
> select sum(convert(float,size)) * (8192.0/1024.0) from dbo.sysfiles
> and
> DBCC showfilestats
> Am I wrong in thinking that the 'unallocated space' and free space
> reported by EM should be similar? Is one a more reliable indicator
> than the other?
> Thanks
>

Thursday, March 22, 2012

Database files (VS 2005) - usage?

I'm just getting to grips with the new SQL Database file concept in VS 2005
and have a couple of questions in the hope that someone can clarify my
understanding.
I understand that I can now add both the <dbname>.mdf and <dbname>.ldf files
traditionally associated with a SQL Server into my application folder, and
that these are attached to SQL Express at runtime. I see this an ideal
replacement for an Access database on single user desktop applications,
leveraging the power of a SQL Server whilst offering the advantages of a
file-based db like Access (x-copy backups for example).
However, for a small multi-user system (say 5 users), am I right in thinking
that the database is now shared and therefore the database files need to be
available to all users on a network share? It seems obvious, but then does
each user attach these shared files to their local SQL Express, or is there
one application / SQL Express nominated as the 'server' with the remaining
applications running in a pure 'client' mode? And if the latter, how is the
connection string managed?
Am I barking up the wrong tree with this?
CheersAndrew Kidd wrote:
> However, for a small multi-user system (say 5 users), am I right in thinki
ng
> that the database is now shared and therefore the database files need to b
e
> available to all users on a network share?
No. The database files just need to be visible to the server. In fact
it's probably a good idea to make sure that user's can't see the
network share where the database resides.

> It seems obvious, but then does
> each user attach these shared files to their local SQL Express, or is ther
e
> one application / SQL Express nominated as the 'server' with the remaining
> applications running in a pure 'client' mode? And if the latter, how is th
e
> connection string managed?
>
One server. Multiple clients. The clients don't need Express they just
need SQL Server connectivity: Native Client or MDAC.
David Portas
SQL Server MVP
--|||Thanks David.
"David Portas" <REMOVE_BEFORE_REPLYING_dportas@.acm.org> wrote in message
news:1133528080.622239.309940@.o13g2000cwo.googlegroups.com...
> Andrew Kidd wrote:
> No. The database files just need to be visible to the server. In fact
> it's probably a good idea to make sure that user's can't see the
> network share where the database resides.
>
> One server. Multiple clients. The clients don't need Express they just
> need SQL Server connectivity: Native Client or MDAC.
> --
> David Portas
> SQL Server MVP
> --
>|||When would a department, with say only 5 users and < 2GB of data, want to
move from using SQL Server Express to Workgroup Edition?
"David Portas" <REMOVE_BEFORE_REPLYING_dportas@.acm.org> wrote in message
news:1133528080.622239.309940@.o13g2000cwo.googlegroups.com...
> Andrew Kidd wrote:
> No. The database files just need to be visible to the server. In fact
> it's probably a good idea to make sure that user's can't see the
> network share where the database resides.
>
> One server. Multiple clients. The clients don't need Express they just
> need SQL Server connectivity: Native Client or MDAC.
> --
> David Portas
> SQL Server MVP
> --
>|||JT wrote:
> When would a department, with say only 5 users and < 2GB of data, want to
> move from using SQL Server Express to Workgroup Edition?
>
When they need the scalability or functionality of one of the other
editions:
http://www.microsoft.com/sql/prodin...e-features.mspx
David Portas
SQL Server MVP
--

Database Files (file name)

I've detached a database and then reactached it specifing a new name for
the database within SQL Server 2000. But, if i right click and select
the database properties and then select the "Data Files" tab the file
name is still the same as the original database. How do i go about
changing that? Thanks in advance.
Vincent
*** Sent via Developersdex http://www.codecomments.com ***
Don't just participate in USENET...get rewarded for it!
Hi Vincent
Changing the database name only changes one value, in the sysdatabases table
in the master database. It doesn't change any info in the database itself,
including the logical names associated with the database files which are
stored in the sysfiles table in the database itself.
To change the logical file names, you can use ALTER DATABASE... MODIFY FILE,
and specify a value for NEWNAME.
Please see the complete ALTER DATABASE syntax in the Books Online.
HTH
Kalen Delaney
SQL Server MVP
www.SolidQualityLearning.com
"Vincent Cristiano" <vincec@.mail.com> wrote in message
news:eTK%23YXruEHA.1984@.TK2MSFTNGP14.phx.gbl...
> I've detached a database and then reactached it specifing a new name for
> the database within SQL Server 2000. But, if i right click and select
> the database properties and then select the "Data Files" tab the file
> name is still the same as the original database. How do i go about
> changing that? Thanks in advance.
> Vincent
>
> *** Sent via Developersdex http://www.codecomments.com ***
> Don't just participate in USENET...get rewarded for it!
sql

Database Files

Hi,
I Inserted a new file in my database, and when I try to exclude it from my database sql says that the file is not empty ! The question is : Is there a way to clean up the file so can be deleted ! What shoud i Do !
Thank's
DBCC Shrinkfile (<yourdbname>, EMPTYFILE)
Look it up in BOL for a complete description.
Geoff N. Hiten
Microsoft SQL Server MVP
Senior Database Administrator
Careerbuilder.com
I support the Professional Association for SQL Server
www.sqlpass.org
"Doubt" <anonymous@.discussions.microsoft.com> wrote in message
news:4803DDD7-1B38-4D71-9016-CED5BFD66A65@.microsoft.com...
> Hi,
> I Inserted a new file in my database, and when I try to exclude it from my
database sql says that the file is not empty ! The question is : Is there a
way to clean up the file so can be deleted ! What shoud i Do !
> Thank's
|||Hi-
You can use :-
USE MyDB
GO
DBCC SHRINKFILE (MyDataFile, 7)
GO
This example shrinks the size of a file named MyDataFile in the MyDB user
database to 7 MB.
Thanks
-Surajit
surajits@.nospam.yahoo.com
"Doubt" <anonymous@.discussions.microsoft.com> wrote in message
news:4803DDD7-1B38-4D71-9016-CED5BFD66A65@.microsoft.com...
> Hi,
> I Inserted a new file in my database, and when I try to exclude it from my
database sql says that the file is not empty ! The question is : Is there a
way to clean up the file so can be deleted ! What shoud i Do !
> Thank's
|||Argh!...
I should have known better.
The real code snippit shoudl be:
Use <MyDatabaseName>
go
DBCC Shrinkfile (<MyFileName>, EMPTYFILE)
You can then use the ALTER DATABASE command to remove the file.
Geoff N. Hiten
Microsoft SQL Server MVP
Senior Database Administrator
Careerbuilder.com
I support the Professional Association for SQL Server
www.sqlpass.org
"Geoff N. Hiten" <SRDBA@.Careerbuilder.com> wrote in message
news:ezg5X%23LTEHA.3548@.TK2MSFTNGP09.phx.gbl...[vbcol=seagreen]
> DBCC Shrinkfile (<yourdbname>, EMPTYFILE)
> Look it up in BOL for a complete description.
> --
> Geoff N. Hiten
> Microsoft SQL Server MVP
> Senior Database Administrator
> Careerbuilder.com
> I support the Professional Association for SQL Server
> www.sqlpass.org
> "Doubt" <anonymous@.discussions.microsoft.com> wrote in message
> news:4803DDD7-1B38-4D71-9016-CED5BFD66A65@.microsoft.com...
my
> database sql says that the file is not empty ! The question is : Is there
a
> way to clean up the file so can be deleted ! What shoud i Do !
>

Database Files

Hi
I Inserted a new file in my database, and when I try to exclude it from my database sql says that the file is not empty ! The question is : Is there a way to clean up the file so can be deleted ! What shoud i Do
Thank'sDBCC Shrinkfile (<yourdbname>, EMPTYFILE)
Look it up in BOL for a complete description.
--
Geoff N. Hiten
Microsoft SQL Server MVP
Senior Database Administrator
Careerbuilder.com
I support the Professional Association for SQL Server
www.sqlpass.org
"Doubt" <anonymous@.discussions.microsoft.com> wrote in message
news:4803DDD7-1B38-4D71-9016-CED5BFD66A65@.microsoft.com...
> Hi,
> I Inserted a new file in my database, and when I try to exclude it from my
database sql says that the file is not empty ! The question is : Is there a
way to clean up the file so can be deleted ! What shoud i Do !
> Thank's|||Hi-
You can use :-
USE MyDB
GO
DBCC SHRINKFILE (MyDataFile, 7)
GO
This example shrinks the size of a file named MyDataFile in the MyDB user
database to 7 MB.
Thanks
-Surajit
surajits@.nospam.yahoo.com
"Doubt" <anonymous@.discussions.microsoft.com> wrote in message
news:4803DDD7-1B38-4D71-9016-CED5BFD66A65@.microsoft.com...
> Hi,
> I Inserted a new file in my database, and when I try to exclude it from my
database sql says that the file is not empty ! The question is : Is there a
way to clean up the file so can be deleted ! What shoud i Do !
> Thank's|||Argh!...
I should have known better.
The real code snippit shoudl be:
Use <MyDatabaseName>
go
DBCC Shrinkfile (<MyFileName>, EMPTYFILE)
You can then use the ALTER DATABASE command to remove the file.
--
Geoff N. Hiten
Microsoft SQL Server MVP
Senior Database Administrator
Careerbuilder.com
I support the Professional Association for SQL Server
www.sqlpass.org
"Geoff N. Hiten" <SRDBA@.Careerbuilder.com> wrote in message
news:ezg5X%23LTEHA.3548@.TK2MSFTNGP09.phx.gbl...
> DBCC Shrinkfile (<yourdbname>, EMPTYFILE)
> Look it up in BOL for a complete description.
> --
> Geoff N. Hiten
> Microsoft SQL Server MVP
> Senior Database Administrator
> Careerbuilder.com
> I support the Professional Association for SQL Server
> www.sqlpass.org
> "Doubt" <anonymous@.discussions.microsoft.com> wrote in message
> news:4803DDD7-1B38-4D71-9016-CED5BFD66A65@.microsoft.com...
> > Hi,
> >
> > I Inserted a new file in my database, and when I try to exclude it from
my
> database sql says that the file is not empty ! The question is : Is there
a
> way to clean up the file so can be deleted ! What shoud i Do !
> >
> > Thank's
>

Database Files

Hi,
I Inserted a new file in my database, and when I try to exclude it from my d
atabase sql says that the file is not empty ! The question is : Is there a w
ay to clean up the file so can be deleted ! What shoud i Do !
Thank'sDBCC Shrinkfile (<yourdbname>, EMPTYFILE)
Look it up in BOL for a complete description.
Geoff N. Hiten
Microsoft SQL Server MVP
Senior Database Administrator
Careerbuilder.com
I support the Professional Association for SQL Server
www.sqlpass.org
"Doubt" <anonymous@.discussions.microsoft.com> wrote in message
news:4803DDD7-1B38-4D71-9016-CED5BFD66A65@.microsoft.com...
> Hi,
> I Inserted a new file in my database, and when I try to exclude it from my
database sql says that the file is not empty ! The question is : Is there a
way to clean up the file so can be deleted ! What shoud i Do !
> Thank's|||Hi-
You can use :-
USE MyDB
GO
DBCC SHRINKFILE (MyDataFile, 7)
GO
This example shrinks the size of a file named MyDataFile in the MyDB user
database to 7 MB.
Thanks
-Surajit
surajits@.nospam.yahoo.com
"Doubt" <anonymous@.discussions.microsoft.com> wrote in message
news:4803DDD7-1B38-4D71-9016-CED5BFD66A65@.microsoft.com...
> Hi,
> I Inserted a new file in my database, and when I try to exclude it from my
database sql says that the file is not empty ! The question is : Is there a
way to clean up the file so can be deleted ! What shoud i Do !
> Thank's|||Argh!...
I should have known better.
The real code snippit shoudl be:
Use <MyDatabaseName>
go
DBCC Shrinkfile (<MyFileName>, EMPTYFILE)
You can then use the ALTER DATABASE command to remove the file.
Geoff N. Hiten
Microsoft SQL Server MVP
Senior Database Administrator
Careerbuilder.com
I support the Professional Association for SQL Server
www.sqlpass.org
"Geoff N. Hiten" <SRDBA@.Careerbuilder.com> wrote in message
news:ezg5X%23LTEHA.3548@.TK2MSFTNGP09.phx.gbl...
> DBCC Shrinkfile (<yourdbname>, EMPTYFILE)
> Look it up in BOL for a complete description.
> --
> Geoff N. Hiten
> Microsoft SQL Server MVP
> Senior Database Administrator
> Careerbuilder.com
> I support the Professional Association for SQL Server
> www.sqlpass.org
> "Doubt" <anonymous@.discussions.microsoft.com> wrote in message
> news:4803DDD7-1B38-4D71-9016-CED5BFD66A65@.microsoft.com...
my[vbcol=seagreen]
> database sql says that the file is not empty ! The question is : Is there
a
> way to clean up the file so can be deleted ! What shoud i Do !
>

Database file... or on server

So with SQL server... I have have a file in my app_code or I can have the database directly on the server.

I don't really understand the difference or the benifits/disadvantages or each.

Could somebody quickly explain?

Dougal

There is supposedly an advantage in associating the database file with the project, whcih in some cases of shared hosting may be helpful.

For commercial applications, the database stays very much in the database server, only a script expert is saved into the program hierarchy.

|||

This is something about layering your application.

If your application is wide enough to cover many topics and is a candidate to progress in the future or may change modifications alot, like even a database change, etc. it better to keep your data layer seperate from business layer and also from presentation layer.

App_Code file is actually like data layer and business layer.

|||

>This is something about layering your application.

No - the location of the database is irrelevant to the layering methodology!

|||

Cool, thanks all.

I think i was just getting myself a bit confused and over thinking it. It's sometimes hard to know what method you should pck when presented with multiple options. I'm still learning the basics so I'm going to stick with a file in my App_Code folder for now.

When I move the website to a server, do I need to associate it with the file? or is it independent, similar in the way an access file is independent.

Dougal

Database file size question please

Hi,

I have set the DB to auto grow by 30 %. As well I have set it to
unrestricted size... However , I see the available size continually being
reduced to now less then .54 MB... Why is there not enough available ?

Gtime_to_go (camper_66@.hotmail.com) writes:
> I have set the DB to auto grow by 30 %. As well I have set it to
> unrestricted size... However , I see the available size continually being
> reduced to now less then .54 MB... Why is there not enough available ?

Where do you see thie available size?

Auto-grow does not set in, until there are no free extents at all, and a
new extent is needed.

Note that if there is no free disk space for these 30%, auto-grow will
fail.

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp|||Hi,

I see the available space in the general tab > space allocation. it shows
used as 35.5 MB and availble .53. I have checked disk space available and
it is sufficient.

r,
g
"Erland Sommarskog" <esquel@.sommarskog.se> wrote in message
news:Xns96C0C9EE71401Yazorman@.127.0.0.1...
> time_to_go (camper_66@.hotmail.com) writes:
> > I have set the DB to auto grow by 30 %. As well I have set it to
> > unrestricted size... However , I see the available size continually
being
> > reduced to now less then .54 MB... Why is there not enough available
?
> Where do you see thie available size?
> Auto-grow does not set in, until there are no free extents at all, and a
> new extent is needed.
> Note that if there is no free disk space for these 30%, auto-grow will
> fail.
> --
> Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
> Books Online for SQL Server SP3 at
> http://www.microsoft.com/sql/techin.../2000/books.asp|||time_to_go (camper_66@.hotmail.com) writes:
> I see the available space in the general tab > space allocation. it shows
> used as 35.5 MB and availble .53. I have checked disk space available and
> it is sufficient.

Have you experienced any errors which claims that you are out of space?

Also, try running DBCC UPDATEUSAGE and then sp_spaceused in Query Analyzer.
Enterprise Manager is not always trustable for size information.

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp

database File size problem

Hi,
I have a database which is 10 GB big but on disk it shows 20GB. I did
backup and shrinkdb but it doesn't shrink. I could shrink log but not
the actual db. Any hints why I cannot do this? Also weird thing is that
when I run DBCC shrinkdb I don't get any error message.
Here is the exact command I run:
DBCC SHRINKDATABASE (MYDB, 5, TRUNCATEONLY)
GO
Tnank you,
hjHi
DBCC SHRINKDATABASE will not shrink a file smaller than it's initial size,
which may be the issue in your case. Use DBCC SHRINKFILE to shrink the
individual file, but if you are will be expanding to 20GB at some time, then
you may not want to shrink it at all. Your log file should be a reasonably
constant size, if you backup the log regularly (in FULL recovery mode).
John
"Hitesh" wrote:

> Hi,
> I have a database which is 10 GB big but on disk it shows 20GB. I did
> backup and shrinkdb but it doesn't shrink. I could shrink log but not
> the actual db. Any hints why I cannot do this? Also weird thing is that
> when I run DBCC shrinkdb I don't get any error message.
> Here is the exact command I run:
> DBCC SHRINKDATABASE (MYDB, 5, TRUNCATEONLY)
> GO
> Tnank you,
> hj
>|||DBCC SHRINKDATABASE will not shrink a file smaller than its shrinkpoint.
The shrinkpoint starts out at the initial size of the file, but once you use
DBCC SHRINKFILE, that can set a new shrinkpoint, and subsequent DBCC
SHRINKDATABASE operations can shrink to that new smaller size.
Also, Hitesh, make sure you're aware what the parameters to DBCC
SHRINKDATABASE mean. The 5 parameter means to shrink so that there is 5%
free space in the file. If there is already more than 5% free space, no
shrinking will take place.
When you run DBCC SHRINKFILE, then the number is the size in MB to which you
want to shrink the file.
Why do you think you might get an error message?
--
HTH
Kalen Delaney, SQL Server MVP
"John Bell" <jbellnewsposts@.hotmail.com> wrote in message
news:79C1DC8D-4BB0-4D11-BBED-A98A9BA35A2C@.microsoft.com...[vbcol=seagreen]
> Hi
> DBCC SHRINKDATABASE will not shrink a file smaller than it's initial size,
> which may be the issue in your case. Use DBCC SHRINKFILE to shrink the
> individual file, but if you are will be expanding to 20GB at some time,
> then
> you may not want to shrink it at all. Your log file should be a reasonably
> constant size, if you backup the log regularly (in FULL recovery mode).
> John
> "Hitesh" wrote:
>|||Thank you John & Kalean.
When I used DBCC SHRINKFILE on indivisual database files, it worked.
Kalean is right I might be using wrong free space percentage.
Thank you both for your help.
hj
Kalen Delaney wrote:[vbcol=seagreen]
> DBCC SHRINKDATABASE will not shrink a file smaller than its shrinkpoint.
> The shrinkpoint starts out at the initial size of the file, but once you u
se
> DBCC SHRINKFILE, that can set a new shrinkpoint, and subsequent DBCC
> SHRINKDATABASE operations can shrink to that new smaller size.
> Also, Hitesh, make sure you're aware what the parameters to DBCC
> SHRINKDATABASE mean. The 5 parameter means to shrink so that there is 5%
> free space in the file. If there is already more than 5% free space, no
> shrinking will take place.
> When you run DBCC SHRINKFILE, then the number is the size in MB to which y
ou
> want to shrink the file.
> Why do you think you might get an error message?
> --
> HTH
> Kalen Delaney, SQL Server MVP
>
> "John Bell" <jbellnewsposts@.hotmail.com> wrote in message
> news:79C1DC8D-4BB0-4D11-BBED-A98A9BA35A2C@.microsoft.com...

database File size problem

Hi,
I have a database which is 10 GB big but on disk it shows 20GB. I did
backup and shrinkdb but it doesn't shrink. I could shrink log but not
the actual db. Any hints why I cannot do this? Also weird thing is that
when I run DBCC shrinkdb I don't get any error message.
Here is the exact command I run:
DBCC SHRINKDATABASE (MYDB, 5, TRUNCATEONLY)
GO
Tnank you,
hjHi
DBCC SHRINKDATABASE will not shrink a file smaller than it's initial size,
which may be the issue in your case. Use DBCC SHRINKFILE to shrink the
individual file, but if you are will be expanding to 20GB at some time, then
you may not want to shrink it at all. Your log file should be a reasonably
constant size, if you backup the log regularly (in FULL recovery mode).
John
"Hitesh" wrote:
> Hi,
> I have a database which is 10 GB big but on disk it shows 20GB. I did
> backup and shrinkdb but it doesn't shrink. I could shrink log but not
> the actual db. Any hints why I cannot do this? Also weird thing is that
> when I run DBCC shrinkdb I don't get any error message.
> Here is the exact command I run:
> DBCC SHRINKDATABASE (MYDB, 5, TRUNCATEONLY)
> GO
> Tnank you,
> hj
>|||DBCC SHRINKDATABASE will not shrink a file smaller than its shrinkpoint.
The shrinkpoint starts out at the initial size of the file, but once you use
DBCC SHRINKFILE, that can set a new shrinkpoint, and subsequent DBCC
SHRINKDATABASE operations can shrink to that new smaller size.
Also, Hitesh, make sure you're aware what the parameters to DBCC
SHRINKDATABASE mean. The 5 parameter means to shrink so that there is 5%
free space in the file. If there is already more than 5% free space, no
shrinking will take place.
When you run DBCC SHRINKFILE, then the number is the size in MB to which you
want to shrink the file.
Why do you think you might get an error message?
--
HTH
Kalen Delaney, SQL Server MVP
"John Bell" <jbellnewsposts@.hotmail.com> wrote in message
news:79C1DC8D-4BB0-4D11-BBED-A98A9BA35A2C@.microsoft.com...
> Hi
> DBCC SHRINKDATABASE will not shrink a file smaller than it's initial size,
> which may be the issue in your case. Use DBCC SHRINKFILE to shrink the
> individual file, but if you are will be expanding to 20GB at some time,
> then
> you may not want to shrink it at all. Your log file should be a reasonably
> constant size, if you backup the log regularly (in FULL recovery mode).
> John
> "Hitesh" wrote:
>> Hi,
>> I have a database which is 10 GB big but on disk it shows 20GB. I did
>> backup and shrinkdb but it doesn't shrink. I could shrink log but not
>> the actual db. Any hints why I cannot do this? Also weird thing is that
>> when I run DBCC shrinkdb I don't get any error message.
>> Here is the exact command I run:
>> DBCC SHRINKDATABASE (MYDB, 5, TRUNCATEONLY)
>> GO
>> Tnank you,
>> hj
>>|||Thank you John & Kalean.
When I used DBCC SHRINKFILE on indivisual database files, it worked.
Kalean is right I might be using wrong free space percentage.
Thank you both for your help.
hj
Kalen Delaney wrote:
> DBCC SHRINKDATABASE will not shrink a file smaller than its shrinkpoint.
> The shrinkpoint starts out at the initial size of the file, but once you use
> DBCC SHRINKFILE, that can set a new shrinkpoint, and subsequent DBCC
> SHRINKDATABASE operations can shrink to that new smaller size.
> Also, Hitesh, make sure you're aware what the parameters to DBCC
> SHRINKDATABASE mean. The 5 parameter means to shrink so that there is 5%
> free space in the file. If there is already more than 5% free space, no
> shrinking will take place.
> When you run DBCC SHRINKFILE, then the number is the size in MB to which you
> want to shrink the file.
> Why do you think you might get an error message?
> --
> HTH
> Kalen Delaney, SQL Server MVP
>
> "John Bell" <jbellnewsposts@.hotmail.com> wrote in message
> news:79C1DC8D-4BB0-4D11-BBED-A98A9BA35A2C@.microsoft.com...
> > Hi
> >
> > DBCC SHRINKDATABASE will not shrink a file smaller than it's initial size,
> > which may be the issue in your case. Use DBCC SHRINKFILE to shrink the
> > individual file, but if you are will be expanding to 20GB at some time,
> > then
> > you may not want to shrink it at all. Your log file should be a reasonably
> > constant size, if you backup the log regularly (in FULL recovery mode).
> >
> > John
> >
> > "Hitesh" wrote:
> >
> >> Hi,
> >>
> >> I have a database which is 10 GB big but on disk it shows 20GB. I did
> >> backup and shrinkdb but it doesn't shrink. I could shrink log but not
> >> the actual db. Any hints why I cannot do this? Also weird thing is that
> >> when I run DBCC shrinkdb I don't get any error message.
> >> Here is the exact command I run:
> >>
> >> DBCC SHRINKDATABASE (MYDB, 5, TRUNCATEONLY)
> >>
> >> GO
> >>
> >> Tnank you,
> >> hj
> >>
> >>

Database File size monitor

What are folks using to monitor database file sizes? I have been tasked
with writing a script to monitor our db's (Yes I know there are growth
controls, etc...). I was hoping there maybe a way to keep track of this via
some widget dashboard, etc... I have Solarwinds and will look at importing
SAN mibs, but still would like to hear thoughts from others.
--
Paul Bergson
MVP - Directory Services
MCT, MCSE, MCSA, Security+, BS CSci
2003, 2000 (Early Achiever), NT
http://www.pbbergs.com
Please no e-mails, any questions should be posted in the NewsGroup
This posting is provided "AS IS" with no warranties, and confers no rights.Take a look at sp_helpdb. It'll show you how the db sizes are calculated.
Instead of just displaying the values, store then in a table and then you'll
be able to see how fast you db is growing each day, month, minute, hour...or
whatever.
--
MG
"Paul Bergson [MVP-DS]" wrote:
> What are folks using to monitor database file sizes? I have been tasked
> with writing a script to monitor our db's (Yes I know there are growth
> controls, etc...). I was hoping there maybe a way to keep track of this via
> some widget dashboard, etc... I have Solarwinds and will look at importing
> SAN mibs, but still would like to hear thoughts from others.
> --
> Paul Bergson
> MVP - Directory Services
> MCT, MCSE, MCSA, Security+, BS CSci
> 2003, 2000 (Early Achiever), NT
> http://www.pbbergs.com
> Please no e-mails, any questions should be posted in the NewsGroup
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
>|||DECLARE @.DB sysname
DECLARE @.SQL nvarchar(255)
if exists ( select * from tempdb..sysobjects where name LIKE
'#FileStats__%' ) drop table #FileStats
CREATE TABLE #FileStats(
[FileId] INT,
[FileGroup] INT,
[TotalExtents] INT,
[UsedExtents] INT,
[Name] sysname,
[Filename] varchar(255)
)
DECLARE @.FileStats TABLE (
[FileId] INT,
[FileGroup] INT,
[TotalExtents] INT,
[UsedExtents] INT,
[Name] sysname,
[Filename] varchar(255)
)
DECLARE cDatabases CURSOR FOR
SELECT QUOTENAME(sdb.name)
FROM master.dbo.sysdatabases sdb
WHERE status & 32 != 32
AND status & 64 != 64
AND status & 128 != 128
AND status & 256 != 256
AND status & 512 != 512
AND status & 1024 != 1024
AND status & 4096 != 4096
AND status & 32768 !=32768
OPEN cDatabases
FETCH FROM cDatabases INTO @.DB
WHILE (@.@.FETCH_STATUS = 0)
BEGIN
DELETE FROM #FileStats
SET @.SQL = 'USE ' + @.DB + '; INSERT INTO #FileStats EXEC (''DBCC
SHOWFILESTATS'')'
EXEC (@.SQL)
UPDATE #FileStats SET name = @.DB
INSERT INTO @.FileStats SELECT * FROM #FileStats
FETCH FROM cDatabases INTO @.DB
END
CLOSE cDatabases
DEALLOCATE cDatabases
SELECT
[Name]
,[TotalExtents]*64/1024. AS TotalExtInMB
,[UsedExtents]*64/1024. AS UsedExtInMB
,([TotalExtents] - [UsedExtents]) / 16. AS UnAllocExtInMB --* 64 /
1024. AS UnAllocExtInMB
,CAST(FLOOR(ROUND([UsedExtents] * 100. / [TotalExtents], 0)) AS
VARCHAR(3)) + '%' AS Pct_Full
FROM @.FileStats
ORDER BY TotalExtInMB DESC
--exec sp_spaceused
DBCC sqlperf(logspace)
"Paul Bergson [MVP-DS]" <pbergson@.allete_nospam.com> wrote in message
news:uxH3fPY8HHA.2004@.TK2MSFTNGP06.phx.gbl...
> What are folks using to monitor database file sizes? I have been tasked
> with writing a script to monitor our db's (Yes I know there are growth
> controls, etc...). I was hoping there maybe a way to keep track of this
> via some widget dashboard, etc... I have Solarwinds and will look at
> importing SAN mibs, but still would like to hear thoughts from others.
> --
> Paul Bergson
> MVP - Directory Services
> MCT, MCSE, MCSA, Security+, BS CSci
> 2003, 2000 (Early Achiever), NT
> http://www.pbbergs.com
> Please no e-mails, any questions should be posted in the NewsGroup
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
>|||I use a custom script based around aggregating data from DBCC SHOWFILESTATS.
--
Geoff N. Hiten
Senior SQL Infrastructure Consultant
Microsoft SQL Server MVP
"Paul Bergson [MVP-DS]" <pbergson@.allete_nospam.com> wrote in message
news:uxH3fPY8HHA.2004@.TK2MSFTNGP06.phx.gbl...
> What are folks using to monitor database file sizes? I have been tasked
> with writing a script to monitor our db's (Yes I know there are growth
> controls, etc...). I was hoping there maybe a way to keep track of this
> via some widget dashboard, etc... I have Solarwinds and will look at
> importing SAN mibs, but still would like to hear thoughts from others.
> --
> Paul Bergson
> MVP - Directory Services
> MCT, MCSE, MCSA, Security+, BS CSci
> 2003, 2000 (Early Achiever), NT
> http://www.pbbergs.com
> Please no e-mails, any questions should be posted in the NewsGroup
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
>|||Thanks for your feedback, it is appreciated.
--
Paul Bergson
MVP - Directory Services
MCT, MCSE, MCSA, Security+, BS CSci
2003, 2000 (Early Achiever), NT
http://www.pbbergs.com
Please no e-mails, any questions should be posted in the NewsGroup
This posting is provided "AS IS" with no warranties, and confers no rights.
"Hurme" <michael.geles@.thomson.com> wrote in message
news:F8CA1619-B919-45B9-9C76-75DF14160A66@.microsoft.com...
> Take a look at sp_helpdb. It'll show you how the db sizes are calculated.
> Instead of just displaying the values, store then in a table and then
> you'll
> be able to see how fast you db is growing each day, month, minute,
> hour...or
> whatever.
> --
> MG
>
> "Paul Bergson [MVP-DS]" wrote:
>> What are folks using to monitor database file sizes? I have been tasked
>> with writing a script to monitor our db's (Yes I know there are growth
>> controls, etc...). I was hoping there maybe a way to keep track of this
>> via
>> some widget dashboard, etc... I have Solarwinds and will look at
>> importing
>> SAN mibs, but still would like to hear thoughts from others.
>> --
>> Paul Bergson
>> MVP - Directory Services
>> MCT, MCSE, MCSA, Security+, BS CSci
>> 2003, 2000 (Early Achiever), NT
>> http://www.pbbergs.com
>> Please no e-mails, any questions should be posted in the NewsGroup
>> This posting is provided "AS IS" with no warranties, and confers no
>> rights.
>>|||Thanks for your feedback, it is appreciated.
--
Paul Bergson
MVP - Directory Services
MCT, MCSE, MCSA, Security+, BS CSci
2003, 2000 (Early Achiever), NT
http://www.pbbergs.com
Please no e-mails, any questions should be posted in the NewsGroup
This posting is provided "AS IS" with no warranties, and confers no rights.
"Jay" <nospam@.nospam.org> wrote in message
news:uUlhoBZ8HHA.5012@.TK2MSFTNGP02.phx.gbl...
> DECLARE @.DB sysname
> DECLARE @.SQL nvarchar(255)
> if exists ( select * from tempdb..sysobjects where name LIKE
> '#FileStats__%' ) drop table #FileStats
> CREATE TABLE #FileStats(
> [FileId] INT,
> [FileGroup] INT,
> [TotalExtents] INT,
> [UsedExtents] INT,
> [Name] sysname,
> [Filename] varchar(255)
> )
> DECLARE @.FileStats TABLE (
> [FileId] INT,
> [FileGroup] INT,
> [TotalExtents] INT,
> [UsedExtents] INT,
> [Name] sysname,
> [Filename] varchar(255)
> )
> DECLARE cDatabases CURSOR FOR
> SELECT QUOTENAME(sdb.name)
> FROM master.dbo.sysdatabases sdb
> WHERE status & 32 != 32
> AND status & 64 != 64
> AND status & 128 != 128
> AND status & 256 != 256
> AND status & 512 != 512
> AND status & 1024 != 1024
> AND status & 4096 != 4096
> AND status & 32768 !=32768
> OPEN cDatabases
> FETCH FROM cDatabases INTO @.DB
> WHILE (@.@.FETCH_STATUS = 0)
> BEGIN
> DELETE FROM #FileStats
> SET @.SQL = 'USE ' + @.DB + '; INSERT INTO #FileStats EXEC (''DBCC
> SHOWFILESTATS'')'
> EXEC (@.SQL)
> UPDATE #FileStats SET name = @.DB
> INSERT INTO @.FileStats SELECT * FROM #FileStats
> FETCH FROM cDatabases INTO @.DB
> END
> CLOSE cDatabases
> DEALLOCATE cDatabases
> SELECT
> [Name]
> ,[TotalExtents]*64/1024. AS TotalExtInMB
> ,[UsedExtents]*64/1024. AS UsedExtInMB
> ,([TotalExtents] - [UsedExtents]) / 16. AS UnAllocExtInMB --* 64 /
> 1024. AS UnAllocExtInMB
> ,CAST(FLOOR(ROUND([UsedExtents] * 100. / [TotalExtents], 0)) AS
> VARCHAR(3)) + '%' AS Pct_Full
> FROM @.FileStats
> ORDER BY TotalExtInMB DESC
> --exec sp_spaceused
> DBCC sqlperf(logspace)
> "Paul Bergson [MVP-DS]" <pbergson@.allete_nospam.com> wrote in message
> news:uxH3fPY8HHA.2004@.TK2MSFTNGP06.phx.gbl...
>> What are folks using to monitor database file sizes? I have been tasked
>> with writing a script to monitor our db's (Yes I know there are growth
>> controls, etc...). I was hoping there maybe a way to keep track of this
>> via some widget dashboard, etc... I have Solarwinds and will look at
>> importing SAN mibs, but still would like to hear thoughts from others.
>> --
>> Paul Bergson
>> MVP - Directory Services
>> MCT, MCSE, MCSA, Security+, BS CSci
>> 2003, 2000 (Early Achiever), NT
>> http://www.pbbergs.com
>> Please no e-mails, any questions should be posted in the NewsGroup
>> This posting is provided "AS IS" with no warranties, and confers no
>> rights.
>>
>|||Thanks for your feedback, it is appreciated.
--
Paul Bergson
MVP - Directory Services
MCT, MCSE, MCSA, Security+, BS CSci
2003, 2000 (Early Achiever), NT
http://www.pbbergs.com
Please no e-mails, any questions should be posted in the NewsGroup
This posting is provided "AS IS" with no warranties, and confers no rights.
"Geoff N. Hiten" <SQLCraftsman@.gmail.com> wrote in message
news:ON2b3EZ8HHA.5752@.TK2MSFTNGP04.phx.gbl...
>I use a custom script based around aggregating data from DBCC
>SHOWFILESTATS.
> --
> Geoff N. Hiten
> Senior SQL Infrastructure Consultant
> Microsoft SQL Server MVP
>
> "Paul Bergson [MVP-DS]" <pbergson@.allete_nospam.com> wrote in message
> news:uxH3fPY8HHA.2004@.TK2MSFTNGP06.phx.gbl...
>> What are folks using to monitor database file sizes? I have been tasked
>> with writing a script to monitor our db's (Yes I know there are growth
>> controls, etc...). I was hoping there maybe a way to keep track of this
>> via some widget dashboard, etc... I have Solarwinds and will look at
>> importing SAN mibs, but still would like to hear thoughts from others.
>> --
>> Paul Bergson
>> MVP - Directory Services
>> MCT, MCSE, MCSA, Security+, BS CSci
>> 2003, 2000 (Early Achiever), NT
>> http://www.pbbergs.com
>> Please no e-mails, any questions should be posted in the NewsGroup
>> This posting is provided "AS IS" with no warranties, and confers no
>> rights.
>>
>

Database File Size

I have a Database which when I Right Click and go to Properties size is 52 GB

But the Size of MDF + NDF Files is 25 + 7 = 32 GB. Log file Size is 20 GB. So I am thinking -- Properties Size of DB includes size of Log Files too -- is that correct?

But when I do a Full Backup the .bak File Size is 26 GB -- does the Full Backup Shrink a DB ?

I thot Full Backup only Shrink the Log Files and could not find anywhere in BOL where it says BACKUP shrinks the empty space in Database -- can somebody confirm this?

Hi JaguarRDA,

Its because backup is always lower than original size of database, because backup copy only used pages.

|||

Yeah -- also Backups dont touch the Log Files -- that was a wrong statement on my behalf that they shrunk the log files

|||

JaguarRDA283361 wrote:

Yeah -- also Backups dont touch the Log Files --

Depends on the type of "recovery model", see

sql

database file has incorrect modified date

Hello all,
I have a very critical data file currently in use showing a modified date of
5/13/06, and the file is modified very often by an invoice application. When
I attempt to do a restore the file has the right date, I don't understand wh
y
the modified date is incorrect.
Should the file modified date not be very current, although if query for
invoices with date greater than 6/2 it return several. am I missreading the
modified date?
Please help.ITDUDE27 wrote on Mon, 5 Jun 2006 09:05:01 -0700:

> Hello all,
> I have a very critical data file currently in use showing a modified date
> of 5/13/06, and the file is modified very often by an invoice application.
> When I attempt to do a restore the file has the right date, I don't
> understand why the modified date is incorrect.
> Should the file modified date not be very current, although if query for
> invoices with date greater than 6/2 it return several. am I missreading
> the modified date?
> Please help.
You can't go by the last modified date of the mdf/ldf files on the hard
disk, as these dates are only normally updated when SQL Server feels the
need to. I have a database on my main server right now that processes all
the transactions for the company and has a last modified date of 25th May
2006, and a matching LDF with last modified of 15th September 2005.
Actually, most of the files in there are dated 15th Sept 2005, which is the
day this server had them all restored to it when it went live.
Dan|||"ITDUDE27" <ITDUDE27@.discussions.microsoft.com> wrote in message
news:1A118DF6-E57A-428A-935D-AE676D8BEF83@.microsoft.com...
> Hello all,
> I have a very critical data file currently in use showing a modified date
of
> 5/13/06, and the file is modified very often by an invoice application.
When
> I attempt to do a restore the file has the right date, I don't understand
why
> the modified date is incorrect.
>
The last modified date will only change when the file size is changed or the
database is open or closed.
Unless you have autoclose enabled (you should NOT normally) the only time
the database will normally close is when you stop or start the server.
If your server is up for a year, it's not unheard of to have a last modified
date of a year ago.

> Should the file modified date not be very current, although if query for
> invoices with date greater than 6/2 it return several. am I missreading
the
> modified date?
> Please help.