New 10MB Database has 8MB Log

Is this correct? Is there a way to remove or shrink this log?

1 Like

Have you tried SSMS or SQL Operations Studio?

The same problem. Following this article I’ve tried SSMS (have 32-bit system by hand, so the SQL Operations Studio is no go) and deleting log file is not possible through the mentioned dialog (the Remove button remains disabled). T-SQL command fails on the error:

The primary data or log file cannot be removed from a database.

So maybe that SQL Operations Studio…

1 Like

You don’t want to remove the log tables, you want to clear them. So try the log shipping stored procedures such as: https://docs.microsoft.com/en-us/sql/relational-databases/system-stored-procedures/sp-cleanup-log-shipping-history-transact-sql?view=sql-server-2017

There is also a delete log shipping database procedure: https://docs.microsoft.com/en-us/sql/relational-databases/system-stored-procedures/sp-delete-log-shipping-primary-database-transact-sql?view=sql-server-2017

And a procedure to delete the seconday: https://docs.microsoft.com/en-us/sql/relational-databases/system-stored-procedures/sp-delete-log-shipping-primary-secondary-transact-sql?view=sql-server-2017

If none of these work you can try a simple DELETE * FROM [TableName]

Thank you for your effort! However, both mentioned procedures can be executed by sysadmin, which we, as users are not. And the database is empty (no table has been created), so clearing table is not the way. This is the screenshot of what I can see. Log size is at 8MB since the time of database creation.

1 Like

Are you sure that the “database usage” graph is the file size of the log? Because I think what it’s trying to convey is the amount of data that it has served. Because I’ve looked at my usage and it goes up then back down. Here is a screenshot: