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?
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
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?
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?
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.
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???
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.
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.
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?
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
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.
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.
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!
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.
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?
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
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?
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)?
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
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.
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?
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
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
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?
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.
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.
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?