473,785 Members | 2,220 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Is there a way to find growth in log (ldf) and database(mdf) ?

Hello,

I need to monitor every 15 minutes growth in data file and log file .
Since mdf and intial file sizes are set to high value,
measuring these values at 15 min interval will not provide the change
in size .

My intention is to measure the log file size growth which helps to
calculate the disk space and bandwidth required to setup log shipping .
We need to set up this infrastructure based on this calculation

Thanks

M A Srinivas

Sep 22 '05 #1
6 5153


I found that on Google and added some further stuff like ID and
Reporting Date in order to keep the information stored permantly, for
permanent storage of the table create a non-temporary one.:

create table #dbinfo
(
ReportId INT IDENTITY(1,1),
dbname sysname,
dbsize decimal(10,2),
dbused decimal(10,2),
ReportDate datetime DEFAULT GETDATE()
)
exec sp_MSforeachdb 'insert into #dbinfo(dbname, dbsize, dbused) select

''?'', dbsize = sum(convert(dec (15),size))/128, (select
sum(convert(dec (15),used))/128 from [?]..sysindexes where indid in (0,
1,
255)) from [?].dbo.sysfiles where status & 0x40 = 0'

Select * from #dbinfo

Sep 22 '05 #2
I executed the query at different time intervals and found that dbsize
is not changing.

What I basically requires to know the size of the log file ( every 15
mins) without actually implementing log shipping . Is this possible ?

Thanks

Srinivas

Sep 22 '05 #3
Query gives the same database size at different intervals , even though
activity has occured on the database.

What I require is to find the size of log file ( every 15 mins )
without actually implementing Log shipping. I need to set up a script
in production server and measure the log size (every 15 mins ) and Log
shipping set up is not allowed at this point of time .

Thanks

Srinivas

Sep 22 '05 #4
SQL
Unless the file expands the size won't change
When you have autogrow of 10 percent and you fill up only 8 percent the
file size won't change until it hits that threshold

http://sqlservercode.blogspot.com/


ma******@gmail. com wrote:
Query gives the same database size at different intervals , even though
activity has occured on the database.

What I require is to find the size of log file ( every 15 mins )
without actually implementing Log shipping. I need to set up a script
in production server and measure the log size (every 15 mins ) and Log
shipping set up is not allowed at this point of time .

Thanks

Srinivas


Sep 22 '05 #5
(ma******@gmail .com) writes:
Query gives the same database size at different intervals , even though
activity has occured on the database.

What I require is to find the size of log file ( every 15 mins )
without actually implementing Log shipping. I need to set up a script
in production server and measure the log size (every 15 mins ) and Log
shipping set up is not allowed at this point of time .


What do you want to know? The size of the log file, or the size of
the transaction log actually in use? The log file only increases in
size when it has to.

For the current log size, DBCC SQLPERF may be an alternative.
--
Erland Sommarskog, SQL Server MVP, es****@sommarsk og.se

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

Sep 22 '05 #6
Stu
Having just recently begun to g othrough log shipping processes myselg,
I think I understand what you're asking: you want to know how big will
the individual log files be (on average) during the log shipping
process, correct? You don't have to actually ship these files to find
out, but you will need to implement a transaction log plan that backs
up your transaction log every 15 minutes.

Use the Maintenance Plan wizard, and without implementing log shipping,
set up a plan that backs up your transaction logs. This can be safely
implemented on a production server, assuming that you don't already
have a backup plan in place that relies on transaction logs for
point-in-time restoration; if you do, then you should already have
method of answering this question. :)

Be sure that your database recovery mode is set to FULL.

HTH,
Stu

Sep 25 '05 #7

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

Similar topics

1
2230
by: Nabhonil Sinha | last post by:
hi, There is facility to do backup of the database. I can use that facility to backup the database. But before i do a backup i want to check if the disk space available enough to backup that database. I have a 22gb database mdf file, when i took a backup of that its only 3gb. SO i cannot use the size of mdf file to determine the database dump file. Is there any facility available to find out the backup database dump size before doing...
2
7405
by: gurdipv | last post by:
Hello, I recently deleted the directory C:\Program Files\Microsoft SQL Server\MSSQL\Data On my production database server. I managed using undelete software to get back most of the LDF/MDF files and reattached them. But there are a few that simply do not reattach.
0
944
by: micky | last post by:
there are three wesite called A,B,C these are just share 1 database file called database.mdf in app_data it's that i wanna make design. i don't want to use sql server machine. just use database file it is not working... <add key="Conn" value="Data Source=.\SQLExpress;Integrated Security=True;User Instance=True;AttachDBFilename=A\App_Data\Database.mdf"
4
5635
by: Arne | last post by:
How do I create aspnet.mdf on a production machine? How do I administer users on a production machine?
4
5629
by: Goofy | last post by:
The add database ( MDF ) in Visual Studio 2005 seems to be in SQL Server 2005 format as far as I can tell. Does anyone know how I can import tables ( without having to start writing queries ) from Access ? -- Goofy
3
2029
by: Goofy | last post by:
The add database ( MDF ) in Visual Studio 2005 seems to be in SQL Server 2005 format as far as I can tell. Does anyone know how I can import tables ( without having to start writing queries ) from Access ? -- Goofy -- Goofy
5
2160
by: sal21 | last post by:
admit i have a sql in c:\scrpit\myscript\database.mdf how to Attache (or register) in one instance of my sql server? All in vb classic, tks.
3
2621
by: leonaisse | last post by:
Hi I have a bunch on tables and data in my local SQL Server 2005 Express master DB and I want to export it to a database.mdf within my wwwroot (visual studio) file - how can i do this? Thanks for you help leonaisse
0
1069
by: Bassem | last post by:
Sorry for the basic question, but I searched much and got nothing. A C#, SQLServer 2005 database (*.mdf) using SqlClient what I got here. What do I need to delver this software to an end user, beside .NET Framework? I tried to install SQLServer Express, but didn't work. Please not tell me install VS! Thanks in advance.
0
9647
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10356
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10100
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9959
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8988
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7509
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5396
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5528
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3665
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.