Link to home
Start Free TrialLog in
Avatar of A Y
A YFlag for United States of America

asked on

Cannot Increase Initial Size of log file in SQL DB.

Hi, I did encounter a miscellaneous error in SQL 2012 STD edition. I am trying to increase the initial size of the log file for couple databases on a SQL server  and I did it using the script and Management studio GUI. Both completes executing successful but the log size still remains the same old size and it's not increased to the new configured value. Please help.
Avatar of Raja Jegan R
Raja Jegan R
Flag of India image

>> Both completes executing successful but the log size still remains the same old size and it's not increased to the new configured value

If that is the case, then I suspect the new Log size you have provided is less than the current size..
Otherwise there is no way, it will inform the script or GUI wizard as completed..
Kindly check the physical size and the size you have provided once..
Avatar of A Y

ASKER

Raja,
No, the new log size is much greater than what it is currently.. The current size of the log is just 100MB and I am trying to increase it to 50GB. The total drive size is 180GB. Also the autogrowth is set to unrestricted in MB.
Avatar of waynezhu
waynezhu

Have you tried if it works for small change, say, from100MB to 1GB?
Avatar of A Y

ASKER

Yes sir, i did it didn't work
What gonna happen if you try to create a new experiment database by specifying a mid size initial file size, say, 5GB?
>> The current size of the log is just 100MB and I am trying to increase it to 50GB. The total drive size is 180GB.

Kindly try it once using some other login, may I know whether you are receiving any error while trying to increase the Log file size..
Avatar of A Y

ASKER

I tried both the options suggested by Raja and waynezhu, but nothing worked. I didn't get any errors, it just executes successfully and right after when I check the size it is same as old size.
Something wrong..
Can you kindly provide the TSQL scripts you are using to increase the log file size to verify once..
Also confirm the size of your database by running the below command.
SELECT *
FROM sys.sysaltfiles
where dbid = db_id()

Open in new window

I tried a test on my laptop’s sql server 2012, and it took a few minutes to increase log file from 100mb to to 50gb. Wonder how long did it take for you to run on your server?
Avatar of A Y

ASKER

It took about 7-10 mins to complete the execution
Based on the timing, the size were changed.
If you query sys.master_files, what is the file size now? In addition, instead of using file explorer, can you open a cmd window, cd to file location, and use dir to check the file size?
Avatar of A Y

ASKER

Raja,
Below is the script I used to increase the initial size, it doesn't matter what method we use to increase either script or GUI, it still goes back to the original size.

USE [master]
GO
ALTER DATABASE [CDP_TB] MODIFY FILE ( NAME = N'CDP_TB_log', SIZE = 1024000KB )
GO
Avatar of A Y

ASKER

Wayne,

I confirmed both ways, but it's still the same.
That’s interesting, meaning, the size change got rolled back and  the message still saying completed successful.
Anything being logged on OS level?
>> SIZE = 1024000KB

Seems you are trying to increase the size to 1 GB.
Kindly provide the below details to troubleshoot your issue better..
1. Execute below script after replacing your database name -- To Identify the current file size of your log file
exec sp_helpdb 'ur_db_name'

Open in new window

2. Try to increase your Log file to 10 GB using below script.
USE [master]
GO
ALTER DATABASE [CDP_TB] MODIFY FILE ( NAME = N'CDP_TB_log', SIZE = 10GB)
GO 

Open in new window

3. Execute below script after replacing your database name -- To verify the file for any changes.
exec sp_helpdb 'ur_db_name'

Open in new window


Kindly post the result set either in txt format or as image to guide you better..
ASKER CERTIFIED SOLUTION
Avatar of A Y
A Y
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial