{"id":60,"date":"2022-01-19T08:44:04","date_gmt":"2022-01-19T08:44:04","guid":{"rendered":"http:\/\/oraclas.dk\/?p=60"},"modified":"2022-01-19T08:49:15","modified_gmt":"2022-01-19T08:49:15","slug":"i-cannot-schrink-database-log","status":"publish","type":"post","link":"https:\/\/oraclas.dk\/index.php\/2022\/01\/19\/i-cannot-schrink-database-log\/","title":{"rendered":"I cannot schrink database log"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Disk full on log file disk is a bad thing. Often it helps when schrinking  then database log file. It is only a problem when database is in Full recovery model.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">A reason why schrinking isn&#8217;t possible could be that backup is missing. So I needed a script to tell me when last backup is finished<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">SELECT d.name, b.type,<br>MAX(b.backup_finish_date) AS backup_finish_date<br>FROM master.sys.sysdatabases d<br>LEFT JOIN msdb..backupset b ON b.database_name = d.name<br>GROUP BY d.name, b.type<br>ORDER BY backup_finish_date DESC<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Disk full on log file disk is a bad thing. Often it helps when schrinking then database log file. It is only a problem when database is in Full recovery model. A reason why schrinking isn&#8217;t possible could be that backup is missing. So I needed a script to tell me when last backup is&hellip; <a class=\"more-link\" href=\"https:\/\/oraclas.dk\/index.php\/2022\/01\/19\/i-cannot-schrink-database-log\/\">L\u00e6s mere <span class=\"screen-reader-text\">I cannot schrink database log<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[9],"class_list":["post-60","post","type-post","status-publish","format-standard","hentry","category-scripts-using-for-maintenance","tag-log_backup","entry"],"_links":{"self":[{"href":"https:\/\/oraclas.dk\/index.php\/wp-json\/wp\/v2\/posts\/60","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/oraclas.dk\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/oraclas.dk\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/oraclas.dk\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/oraclas.dk\/index.php\/wp-json\/wp\/v2\/comments?post=60"}],"version-history":[{"count":1,"href":"https:\/\/oraclas.dk\/index.php\/wp-json\/wp\/v2\/posts\/60\/revisions"}],"predecessor-version":[{"id":61,"href":"https:\/\/oraclas.dk\/index.php\/wp-json\/wp\/v2\/posts\/60\/revisions\/61"}],"wp:attachment":[{"href":"https:\/\/oraclas.dk\/index.php\/wp-json\/wp\/v2\/media?parent=60"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/oraclas.dk\/index.php\/wp-json\/wp\/v2\/categories?post=60"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/oraclas.dk\/index.php\/wp-json\/wp\/v2\/tags?post=60"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}