Proactively Grow Data File Size

Jan 9, 2008

My primary (and only) data file has reached the point where it is auto growing. I would like to grow this file in one big chunk at an off peak time. I can't seem to find the code I need to make the file grow when I want it to?

View 1 Replies


ADVERTISEMENT

SQL Server 2012 :: Dynamically Grow A Data File?

Dec 5, 2014

Is it possible to dynamically grow a data file for TempDB?

I have some TSQL that I want to execute (this is raw tsql, not something I'd typically share) when I get an alert that TempDB is growing.

SET NOCOUNT ON;
DECLARE @TempDB TABLE (FileID tinyint, name varchar(50), size bigint)
DECLARE @TotalSize decimal(19,4), @TotalFiles int, @CurrentTempDBSize bigint, @SQL varchar(1000), @DBName varchar(50)
SET @SQL = ''
INSERT INTO @TempDB

[code]....

ENDThe code runs fine, but doesn't actually increase the size of the file.

View 7 Replies View Related

How Data File And Log File Grow?

Jul 20, 2005

Greetings,The following shows how the Properties of a database look like:Data Files:File Name: student_datLocation: e:dataMSSQLDatastudent.mdfSpace allocated (MB): 62'Automatically grow file' checkedFile growth: 'By percent 10%' checkedMaximum file size: 'Unrestricted file growth' checkedTransaction Log:File Name: student_logLocation: e:dataMSSQLDatastudent.ldfSpace allocated (MB): 52'Automatically grow file' checkedFile growth: 'By percent 10%' checkedMaximum file size: 'Unrestricted file growth' checkedThe physical files look like this:Name Size Type Modified------------------------------------------------student.ldf 52,416 KB Database File 2/11/2004 10:34PMstudent.mdf 63,424 KB Database File 2/11/2004 10:34PMMy 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 insize since 2/11/2004? Actually, the modified timestamps of some otherdatabases files are also '2/11/2004 10:34PM'. That's weird.I found the following message that's relevent to the above timestamp inthe SQL Server Logs:=====2004-02-11 22:34:10.12 server SQL Server terminating because ofsystem shutdown.=====I'm pretty sure there have been a lot updates taking place on thisdatabase. We don't hear any complaints from the customers that theyhave 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

View 7 Replies View Related

LDF File Does Not Grow..

Jun 27, 2007

Bear with me - My SQL Server 2005 Maintenance is as good as a Newbie..

I was running a Very Large Transaction over the weekend (Say 10Mill Inserts)..
And after waiting for 3/4 Hrs for the transaction to complete -- Checked the LDF File, I has grown to a 100 GB.

After that i discovered that i had the Recovery Model as FULL .. So Killed the Job and Changed the recovery mode from Full -> Simple.

Now i see that the LDF file is not growing in size even though there are many transactions that were complete successfully (Still Very slow though)...

What am i missing here - Iam clueless as to why my LDF is not growing in size?

Any Ideas??

View 4 Replies View Related

Automatically Grow File

Jan 8, 2004

Hello everyone,
I have 45 GB db with
-Automatically grow file by 10 %
- full recovery
-log shipping every 5 minutes.
-full backup every 24 hrs

database grown from 33GB to 45 GB for 1 year period
4-5 times a year massive insert
done to database(no specific dates)

if I change autogrow to by 300MB or 4%

1.how would it affect insert process ?
2.how it affect daily performance ?

Thank you
Alex

View 3 Replies View Related

Automaticallly Grow File

Oct 1, 2004

What is the best option to set for File Growth?

Is it in megabytes or by percent?

View 3 Replies View Related

Sql 2005 Log File Grow Too Much

Oct 9, 2007



Hello,

I'm running a long and heavy query. during the running the log file of the DB is growing more than 20 GB and i'm running out of disk space consequently. Is there a way to restrict the log file size without demaging my query?

Thanks.

View 9 Replies View Related

SQL 2005 Resize Initial Log Size: MODIFY FILE Failed. Specified Size Is Less Than Current Size.

Sep 4, 2007


I am trying to resize a database initial log file from 500M to 2M. I€™m using€?

ALTER DATABASE <DBNAME> MODIFY FILE ( NAME = <DBLOGFILENAME, SIZE = 2 ) "



And I'm getting "MODIFY FILE failed. Specified size is less than current size." I tried going into the database properties and setting the log file to 2M, but it doesn€™t keep the changes.



Any help with this process?

View 1 Replies View Related

My Log File Has Grow The Disk Full

Mar 20, 2004

My logfile has grow the disk full - the logfil is 25 gb and I have 4 gb free.

I can't shrink the log fil !

Can I set the log file to null ??

I have backup my datafil successfully!

Help!

View 9 Replies View Related

Log File Size (IDF) Is 4 Time Greater Than Data File (MDF)

Feb 19, 2013

I have a database whose log file size is 4 time greater then data file size, and its continuously growing day by day. Recently face limited disk related issue.

Is there any way to truncate log file???

What is impact on db if i truncate log file???

Is there any way to prevent this file continuously growing???

View 13 Replies View Related

Auto Grow Enabled But DB Won't Grow

Jan 15, 2005

I've been through the forum and read a number of threads on people's DBs not growing and the answer usually is they don't have auotmatically grow data file. Unfortunately I have this on, but when I look at the properties of the database it reports the space available is 0.00 MB? Up until about two weeks ago I was showing appx 48% space utilization. When I ran an SP to show growth, it tells me that it was expanded by 20% yesterday, but SQL Server is still telling me the space available is zero.

The log file is also set for auto growth. The DB is 14.5 GB in size and the drives still have around 92 GB of space.

Has anyone experienced this before? Any ideas? Does anyone know of an SPs that can give me detailed info on internal data file size compared to stated size (i.e. wasted space in data file)? Is SQL Server doing something funny in the way it is seeing the database or data files individually? Any help is appreciated.

View 6 Replies View Related

DB Engine :: Analyzing What Is Causing The Log File To Grow

Aug 20, 2015

For one of our database we have an issue where its log file got increased rapidly last week on Fri and Sat. The database is on SQL  server 2008 R2 with compatibility level at 80. Please see below log grow events :

First, we thought Index maintenance like Re-index and update stats could have been the reason, but when check the schedule that job ran on 16th using below code:

USE ABC
GO
EXEC sp_MSforeachtable @command1="print '?' DBCC DBREINDEX ('?', ' ', 80)"
GOEXEC sp_updatestatsGO

I know above is OLD fashioned, but we believe that should not be the major cause here? How can i determine what happened on 14th and 15th which cause the event to trigger and log file bumps to 80 and 70 GB both days.

View 8 Replies View Related

DB Engine :: Why Does Log File Grow When Recovery Mode Is Simple

Jul 30, 2015

My understanding is that the log file is not supposed to grow if the database is under simple recovery mode.I am in a situation where the log grows if do any inserts that involve millions of rows.How do i make sure that it does not grow?

View 11 Replies View Related

Check Db Size Data File And Log File

Apr 27, 2008

Hi,

i'm trying to write this script that check my database file and log size(in MB) and insert them into a table.i need the following columns
dbid,dbname,compatability_level,recovery_model,db_size_in_MB,log_size_in_MB.
i try to write this a got stuck.
select sysdb.database_id,sysdb.name,sysdb.compatibility_level,
sysdb.recovery_model_desc,sysmaster.size from sys.databases sysdb,sys.master_files sysmaster
where sysdb.database_id = sysmaster.database_id

can anyone help me with this script?
THX

View 13 Replies View Related

Data File Size

Apr 27, 2004

SELECT size_in_mb,used_size_in_mb,size_in_mb-used_size_in_mb as free_in_mb FROM (
SELECT cntr_value/1024 size_in_mb ,
(SELECT cntr_value/1024 FROM master..sysperfinfo WHERE counter_name='Log File(s) Used Size (KB)' AND instance_name='mydb') used_size_in_mb
FROM master..sysperfinfO WHERE counter_name='Log File(s) Size (KB)' AND INSTANCE_NAME='mydb'
) a

I need to store totalsize,usedsize,freesize of the datafiles in a table to get an average of how much my datafile has increased over a week.
The above query i am using is for logfile size. Can any one help me with datafile size plz.
I've checked sp_helpfile, sysfiles but couldn't find what i am lookin for(used and free space). EM in taskpad view for a database shows the statistics for the datafile. I've tried a trace to find out a stored procedure but couldn't!!!
May be i am unaware of a simple stored-procedure that can do this for me.

Howdy!

View 3 Replies View Related

How Data/log Files Grow

Dec 4, 2007

Hi All
i am bit confused about how data and log files grow in databases. suppose i turn off the auto grow and restrict the maxsize upto some limit but size of data/log file is less then maxsize at some stage because what i understand is size of data/log file keep changing depends upon the activities going on the database. in future if data/log file need to grow can it grow upto the maxsize without turing on the auto grow.

regards

View 4 Replies View Related

Data File Size Problem

Jun 30, 2007

how can i change the initial size of the data and log file size ??? in my database properties it shows that my data file size is 81 mb and log file size is 985 mb! but my database only contains some tables and stored procedures with few rows of data in each tableand i checked that the actual mdf and ldf files are really that big... i tried to change it but it didn't work...can someone please teach me how to change it thanks! 

View 2 Replies View Related

How To Decrease The Size Of Data File ?

Jul 30, 2007

Hello Guys,

Just wondering if someone can help me decrease the size of mdf and ldf files. In the past production database "NewUniverse" had been allocated space of 100 GB for mdf file and 8 GB of ldf file. However the data file has only used 30 GB of data. But now due to disk space related reason, I tried to decrease the datafile size from 100 GB to 40 GB. But I am not able to do it.

Any help in this regard would be appreciated.

View 4 Replies View Related

How To Increase The Data File Size?

Aug 2, 2006

Hi All,
Is it possible to increase the size of data file in SQL Server 2005 Express Edition.
I think the licensed limit is 4096MB whcih i am unable to increase.
Could anyone let if is it possible to increase the data file size and if yes then how?

Thanks,
Varun

View 4 Replies View Related

Data File Size Full

Nov 16, 2007

I'm new to the DBA world, and have no one else in the company to look up to. Does anyone know what I might need to check out or do when the Data File Size is 204% full? Or is this not necessarily a bad thing?

I'm getting this from a Diagnostic tool I have.

The number of tables is 148
Data file size 35,941 MB
Data Size 26,549.92 MB
Index Size 177,130.02 MB
Log File Size 5.05 MB

Thanks,

View 6 Replies View Related

Monitoring Data File Size

Jul 23, 2005

I am looking to automate monitoring space used for each file in eachdatabase on a SQL Server 2000. Does anybody have any SQL Scripts to dothis or to find the space used?

View 1 Replies View Related

How To Increase The Data File Size?

Aug 2, 2006

Hi All,

Is it possible to increase the data file size in SQL Server 2005 Express edition?

If yes then how?



Thanks,

Varun

View 1 Replies View Related

Data File Size Alert By Email

Sep 14, 2012

I've set up an alert to email me whenever the database is over a certain size. The amount is calculated by taking 80% of the total data file size. The problem I'm having is that it keeps generating a false positive alert because MS SQL seems to treat the currently used value as the total allocated space for the database data file. For example, the data file is 100MB, it's currently using 60MB, and if I enter 80MB in the alert, it generates an email alert claiming the current size is 100MB. Could it be because the data file size is set to 100MB (since autogrowth is disabled)?

View 4 Replies View Related

Delete Data, But File Size Increase

Jul 23, 2005

I encounter one weird problem, I have a database with around 7 GB ...when I delete a bunch of data from it, it suppose to reduce thedatabase file size, but weirdly, the file size increase to 8 GB.Wondering why. Is it suppose to be like that?Is it the architecture is designed to work like that?Is there any way for me to reduce the database file size?Thanks.Peter CCH

View 2 Replies View Related

What Is The Data File Size Counter Of SQL Server?

Dec 12, 2007

Hi

I am trying to track the size of my SQL Server database. Could someone please tell me if the "Data File Size (KB)" counter of the "Databases" performance object of SQL Server actually gives the size of the database?


I dont know if i have posted this query in the correct category, sorry if i haven't, but could not find any suitable category for this thread.


Thanks in advance

View 4 Replies View Related

DB Engine :: 2008 R2 - Shrink Data File Size?

Nov 9, 2015

I have a sharepoint content database in sql 2008 R2 (WSS_Content) that is at 230Gb size, but has 40% of it is empty space.  This is because we have removed a large amount of old content from sharepoint.  The log file is fine.  I have 60GB left in my drive that host the database files.  I would like to shrink the datafile to get disk space back.  I found that under the files property, the WSS_Content data file's initial size is 228702 MB (220 Gb or so).  

When i try to do a shrink file (data file) from management studio, i see the 60 GB of drive space keep dropping.  So i have to kill the process. what i should do to reduce this data file.

why it keep using up all the free space in the drive when i try to shrink the data file?

View 10 Replies View Related

HELP-Create Sample Data By Microsofst Spoil And Grow My Mdf Ldf -from 5 MB TO 6 GB

May 21, 2008

help i run this
from this link
http://code.msdn.microsoft.com/SQLExamples/Wiki/View.aspx?title=NumbersTable&referringTitle=Home
and it stuck my sql server!!!!!

and after i run this
my my mdf ldf is 6 GB




Code Snippet-- Suppress data loading messages
SET NOCOUNT ON

-- Create Sample Data using a Table Varable
SELECT TOP 2147483647 IDENTITY(INT,0,1) AS N
INTO Numbers
FROM sysobjects a, sysobjects b, sysobjects c, sysobjects d, sysobjects e


before i was 6 mb
help
now how to fix this problem and shrinking my data



View 8 Replies View Related

SQL Server 2008 :: Initial Size For TempDB Data And Log File?

Sep 12, 2011

We have installed SQL Server 2008 R2 SP1 instance and it's having Share Point 2010 databases.

We have 2 dedicated drives for Tempdb on SAN with 50 GB space. Both tempdb data & log files are created with default size. I would like to presize them.

What are the best values to start with?

U ->Tempdbdata having tempdb.mdf file
V->Tempdblog having templog.ldf file

View 9 Replies View Related

SQL 2012 :: Estimate Size Of Data-file While Creating Database?

Mar 24, 2015

How to estimate the size of datafile while creating the database?

View 2 Replies View Related

Increase Data File Size Of Database Which Is Configured For AlwaysOn?

Jun 7, 2015

Need to confirm if we can add space(increase data file size) for the database which is configured for always on similar to that of mirroring or we need to follow any different procedure.

I have a requirement wherein the datafiles on both the primary and secondary replica got full, if i add space to the primary database will it automatically get added to the secondary replica or not?

View 5 Replies View Related

Limit On SSIS String Variable Size, Trying To Get Big Xml File Into Xml Data Field

Nov 28, 2007

I have a SSIS package that opens an xml file, puts the contents into a string, then runs a stored procedure that dumps it into an xml column in a table. One of the xml files is huge. Putting the data into a ssis string causes an error. The length of the string variable is 58,231,886. The file will only get bigger.

How else can I get this data into a SQL Server XML field.

View 1 Replies View Related

Log Backup File Size Not Matching Log File Size

Apr 15, 2008

I have a log file that is approximately 50 GIG. I backed up just the log and the file size of the .bak is 192 GIG . Why is this? Shouldn't it be closer to the 50 GIG.

Normally I wouldn't let log grow this much. But we are in process of getting new server up and running and don't have backups going yet. They are working on getting that up and running this week.

So I did a log backup to give me back some log space for now but was concerned when I saw the size of the .bak file.

When I view media contents of the backup device it shows one tranaction log back up and size of 192 GIG.

What is up with this. I know in SQL 2000 the log backup files where never this big. they were about the size of the log itself.

Any ideas?

Stacy

View 8 Replies View Related

Transport Level Error Returned When Trying To Shrink A Data File Using DBCCSHRINKFILE ('DB', Size)

Nov 30, 2007

Greetings:

I have a database that is 1.7terabyte in size with 136gb free and throws a "transport level error" telling me to discard the results when I run dbccshrinkfile ('DBNAME', size). I have tried various increments of size, from truncateonly to 1MB below its current value, and nothing works. I have tried to detach and reattach the db, restart the service, restart the server, and none have provided a solution. Any ideas?

Regards,
Derek

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved