473,507 Members | 9,962 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how data file and log file grow?

Greetings,

The following shows how the Properties of a database look like:

Data Files:

File Name: student_dat
Location: e:\data\MSSQL\Data\student.mdf
Space allocated (MB): 62
'Automatically grow file' checked
File growth: 'By percent 10%' checked
Maximum file size: 'Unrestricted file growth' checked

Transaction Log:

File Name: student_log
Location: e:\data\MSSQL\Data\student.ldf
Space allocated (MB): 52
'Automatically grow file' checked
File growth: 'By percent 10%' checked
Maximum file size: 'Unrestricted file growth' checked

The physical files look like this:

Name Size Type Modified
------------------------------------------------
student.ldf 52,416 KB Database File 2/11/2004 10:34PM
student.mdf 63,424 KB Database File 2/11/2004 10:34PM

My question is now that it has been specified 'Unrestricted file growth'
for both the data and the log file, why both haven't increased any in
size since 2/11/2004? Actually, the modified timestamps of some other
databases files are also '2/11/2004 10:34PM'. That's weird.

I found the following message that's relevent to the above timestamp in
the SQL Server Logs:

=====
2004-02-11 22:34:10.12 server SQL Server terminating because of
system shutdown.
=====

I'm pretty sure there have been a lot updates taking place on this
database. We don't hear any complaints from the customers that they
have had any problems (such as, no space left) with the databases.
Did the SQL server write the data and log somewhere else?

Any insight on what's going on would be appreciated.

Bing

Jul 20 '05 #1
7 7925
Bing Du (bd*@iastate.edu) writes:
The physical files look like this:

Name Size Type Modified
------------------------------------------------
student.ldf 52,416 KB Database File 2/11/2004 10:34PM
student.mdf 63,424 KB Database File 2/11/2004 10:34PM

My question is now that it has been specified 'Unrestricted file growth'
for both the data and the log file, why both haven't increased any in
size since 2/11/2004? Actually, the modified timestamps of some other
databases files are also '2/11/2004 10:34PM'. That's weird.
If the files are said to be modified in November this year, then there
is something fishy.
I found the following message that's relevent to the above timestamp in
the SQL Server Logs:

=====
2004-02-11 22:34:10.12 server SQL Server terminating because of
system shutdown.
=====


But if the date is supposed to be in February, then it seems that files
has not been touched since. Either the files were detached, or the
databases has not been set to autoclose. Or the entire SQL Server instance
has not been running since then.

On my machine, about all my databases has a last modified date of
2004-03-01. I started SQL Server today, but I have not visited all
databases. But on startup, SQL Server performs recovery of all databases,
and thus writes to them.

--
Erland Sommarskog, SQL Server MVP, so****@algonet.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp
Jul 20 '05 #2
Thanks for the instant response!

No, not November. The files were last modified on 2/11/2004. That's
Feb. 11, 2004. If the files were detached, the users would not be able
to access the databases, right? But we have not heard any complaints.
I don't think those databases haven't been touched since 2/11/2004.
These databases are in production. A lot updates are going on every
day. From my understanding, any updates (insert, update, delete) should
trigger the modified timestamp change on the files. Also, the SQL
server instance has been running fine since then. The only thing I'm
not sure is 'databases has not been set to autoclose' you mentioned.
Where can I find that setting?

Bing

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 20 '05 #3
I've checked the sysdatabases table. The 'status' is 16 for all our
user databases. Per SQL Server Online Book, '1 = autoclose, set with
sp_dboption' and
'16 = torn page detection, set with sp_dboption'. Do I need to change
'status'?

Another thing was the SQL Server Agent was not set to start
automatically whenever the SQL Server instance is started. Our server
instance terminated and started on 2/11/2004. We started the SQL Server
Agent manually on 2/15/2004. Would this have done anything to make the
database files not been changed since 2/11/2004?

Bing

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 20 '05 #4
I've checked the sysdatabases table. The 'status' is 16 for all our
user databases. Per SQL Server Online Book, '1 = autoclose, set with
sp_dboption' and
'16 = torn page detection, set with sp_dboption'. Do I need to change
'status'?

Another thing was the SQL Server Agent was not set to start
automatically whenever the SQL Server instance is started. Our server
instance terminated and started on 2/11/2004. We started the SQL Server
Agent manually on 2/15/2004. Would this have done anything to make the
database files not been changed since 2/11/2004?

Bing

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 20 '05 #5
comp.databases.ms-sqlserver (an*******@devdex.com) writes:
No, not November. The files were last modified on 2/11/2004. That's
Feb. 11, 2004.
Not in any date format I would use. :-)
If the files were detached, the users would not be able to access the
databases, right? But we have not heard any complaints. I don't think
those databases haven't been touched since 2/11/2004. These databases
are in production. A lot updates are going on every day. From my
understanding, any updates (insert, update, delete) should trigger the
modified timestamp change on the files. Also, the SQL server instance
has been running fine since then. The only thing I'm not sure is
'databases has not been set to autoclose' you mentioned. Where can I
find that setting?


Looks like I spoke too soon when I said that my files had a date that
agreed with my latest startup of SQL Server. I forgot that I rarely to
to bed before midnight, so the times I saw was from the last shutdown
as in your case. So I guess that everything's normal.

As for autogrow not setting in, one has to assume that the number of inserts
vs. the number deletes balances each other fairly well.

--
Erland Sommarskog, SQL Server MVP, so****@algonet.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp
Jul 20 '05 #6
So are you saying the time actually shown for those MDF and LDF files
was the time the Server instance last terminated? Any updates (lke
INSERT, DELETE or UPDATE) won't get the timestamps changed?

Bing

Erland Sommarskog wrote:
comp.databases.ms-sqlserver (an*******@devdex.com) writes:
No, not November. The files were last modified on 2/11/2004. That's
Feb. 11, 2004.

Not in any date format I would use. :-)

If the files were detached, the users would not be able to access the
databases, right? But we have not heard any complaints. I don't think
those databases haven't been touched since 2/11/2004. These databases
are in production. A lot updates are going on every day. From my
understanding, any updates (insert, update, delete) should trigger the
modified timestamp change on the files. Also, the SQL server instance
has been running fine since then. The only thing I'm not sure is
'databases has not been set to autoclose' you mentioned. Where can I
find that setting?

Looks like I spoke too soon when I said that my files had a date that
agreed with my latest startup of SQL Server. I forgot that I rarely to
to bed before midnight, so the times I saw was from the last shutdown
as in your case. So I guess that everything's normal.

As for autogrow not setting in, one has to assume that the number of inserts
vs. the number deletes balances each other fairly well.


Jul 20 '05 #7
Bing Du (bd*@iastate.edu) writes:
So are you saying the time actually shown for those MDF and LDF files
was the time the Server instance last terminated? Any updates (lke
INSERT, DELETE or UPDATE) won't get the timestamps changed?


It does not seem like that.

I would guess that if you set the database to autoclose, the date would
be updated each time the database was closed.

--
Erland Sommarskog, SQL Server MVP, so****@algonet.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp
Jul 20 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
9604
by: Thomas Lotze | last post by:
Hi, another question: What's the most efficient way of copying data between two file-like objects? f1.write(f2.read()) doesn't seem to me as efficient as it might be, as a string containing...
0
2832
by: JohnLH | last post by:
Hi, I am having an issue with the LOAD DATA LOCAL FILE command on the latest 3.0.9 JDBC Driver. The command works on Windows, but doesn't seem to work on OSX and Linux. The error that I get on...
14
5809
by: Luiz Antonio Gomes Pican?o | last post by:
How i can store a variable length data in file ? I want to do it using pure C, without existing databases. I'm thinking to use pages to store data. Anyone has idea for the file format ? I...
5
2603
by: Joe Van Dyk | last post by:
I have a file that looks like this: 25.000000 55.000000 23.000000 51.000000 5 8 8700 6000 <and then, at byte 128, starts binary stuff> What's the proper way to make sure that I'm reading in...
2
2429
by: Bill | last post by:
I have an Access 2003 database application that I split into an application component MDB file (i.e., forms, etc) and a data component MDB file (i.e., tables, etc.). I used the 2003 developer...
4
42730
by: tlcvetan158 | last post by:
Hi, I'm a newbie at C++. I am just trying to read a file with three columns of data into arrays and write it back out, to see how arrays work. This runs with no errors, but the output doesn't look...
2
4805
abdoelmasry
by: abdoelmasry | last post by:
hi any one can help me plz ?? my code is about opening file as binary then get data from file to edit and rewrite data to file this is the code: #include <cstdlib> #include <iostream>...
3
3240
by: psbasha | last post by:
Hi , When ever we read any data from file ,we read as a single line string ,and we convert the respective field data available in that string based on the data type ( say int,float ). ...
0
14254
ADezii
by: ADezii | last post by:
Rather than using CurrentProject.Connection or entering your own Connection information, ADO supports storing Connection information in an external file called a Data Link File (which normally has a...
6
6773
by: Dave067 | last post by:
Hi This is my first attempt at writing Python script - it's probably a bit ambitious, but there again, whatever doesn't kill you makes you stronger... ;-) I'm trying to write a script for a...
0
7109
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7313
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
7029
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7481
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5619
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4702
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3179
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
758
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
411
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.