Templog file size auto increase daily in SQL Server - sql-server

SQL Server database generated a temp log file and I am frustrated because this file daily takes near about 10-12 GB space so I have to daily shrink the log file.
What can I do to solve this? Can I set it to auto-shrink ? Or any update in the query?

Related

Backup specific tables from production into a .bak file (not BCP) in SQL Server

I need to backup a couple of tables from my prod database.
Each table has 250 million rows.
The complete backup is almost 1TB
I don't want the full backup due to space (Needs double space for backup & restore)
I can't use BCP due to volume and heavy inserts involved.
SQL Server backups (.bak) are always all or nothing.
The only "selection" you can get is if you had multiple filegroups - then you could back up just one filegroup and ignore all others.
But you cannot selectively backup just a handful of tables into a .bak file. There's just no feature for that.
Create an auxiliary database, select from your 250mil tables into corresponding columnstores (in mil batches) , backup the aux db and you have your data "suitcase"

Correct process for reducing SQL Log file size

SQL 2008 R2. Full back-up every night with replication to a 2nd server for reporting. Business critical multiple databases. SQL Log files in danger of exceeding available disk space
Shrinkfile did not seem effective. Created backup of log file and then chose GUI option to shrink log file. Having done this log file size is much more manageable. When is it safe to delete the Log file backup, or is it never?
You need to keep the transaction log backups for the full backups that you will potentially use to recover the database. E.g. if you keep the last 7 full backups, you just need to keep the log backups for the last week so you can recover the db to any point of time in the week if something is wrong.

TRN file is very big

We had a maintenance plan on our SQL server 2000 database with log shipping from main server to standby server. We had to disable the plan due to disk space issues. After resolving that we did a log backup and enabled the plan, but now the initial trn file being created is huge and we had to stop the job in the middle as it was going towards low disk space again. We didn't do any index rebuild, what could be the cause of trn file getting so big?
We also have an archive server (SQL server 2012), which runs an SSIS module, which copies certain data across and deletes it from main server, could that be related to this? The archive did bloat the main transaction log file (.ldf) but after running the aforementioned log backup the percentage of log space used was reduced and the LDF is not growing anymore for now. The LDF file itself is pretty big.

empty sql server database slow backup

I have a SQL Server 2012 database, using filestream, which I have backed up. The backup took 24 hours and produced a 300gb file. I now want a backup of just the schema. So I truncated all the tables, and started the backup again. It is taking hours and has not yet reached 10%. I have checked the filestream folder and it is empty. The machine has 8gb of ram, and SQL is using 5gb of it. The database is in Simple recovery mode. Why would the backup still be slow now it is empty?

SQL Server Database Size Reduction Query

I have a SQL Server 2008 Express Database which is 7.8 GB in size
DataFile 1.2 GB
LogFile 6.6 GB
Recovery Model = Full
Auto Shrink = False
On a Live database, what is the best way to reduce the size of this database?
Before you can shrink a database running in full recovery model, you must backup the transaction log. So the procedure is to run a transaction log backup, and then shrink the log file.
If you have never performed a transaction log backup then you will continue to suffer from run-away log files and shrinking it will only be a band-aid solution.
You can also identify unused tables and remove those tables(if there is)
you can create Archive database that will stored some old unused data
you can normalize your database more to reduce table size.
hope this information helps you.

Resources