Yes , in SQLSERVER, we use "DBCC sqlperf(logspace)" to check transaction logfile status.
But , for example , we collect it every one hour and save result to a special named table. as record ?
That is not easy but still can.

Here is script:

SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[getsqlperf]
AS
BEGIN
DECLARE @SQL2 VARCHAR(MAX)
DECLARE @createtable VARCHAR(MAX)
DECLARE @inserttable VARCHAR(MAX)
DECLARE @inserttable2 VARCHAR(MAX)
DECLARE @@tablename2 VARCHAR(MAX)

SELECT @SQL2 = (select replace(replace(replace(CONVERT(varchar, getdate(), 120 ),'-',''),' ',''),':',''))
set @createtable='create table log'+@SQL2+' (dbname varchar(20),logSizeMB float,logSpaceUsedPct float,Status int);'
exec(@createtable)
set @inserttable='insert into log'+@SQL2+' EXEC ("DBCC SQLPERF(LOGSPACE)")'
set @inserttable2=(select replace(@inserttable,'"',''''))
exec(@inserttable2)
END
GO

That script can generate a table which record logfile usage status. If you execute that script you could see the result.

execute one time:

How to collect TLOG usage status automatically ?的更多相关文章

  1. oracle tablespace usage status

    select a.tablespace_name, a.bytes / 1024 / 1024 "Sum MB", (a.bytes - b.bytes) / 1024 / 102 ...

  2. FAQ: Automatic Statistics Collection (文档 ID 1233203.1)

    In this Document   Purpose   Questions and Answers   What kind of statistics do the Automated tasks ...

  3. Practical Go: Real world advice for writing maintainable Go programs

    转自:https://dave.cheney.net/practical-go/presentations/qcon-china.html?from=timeline   1. Guiding pri ...

  4. 【转】 svn 错误 以及 中文翻译

    直接Ctrl+F 搜索你要找的错 # # Simplified Chinese translation for subversion package # This file is distribute ...

  5. usb驱动开发12之设备生命线

    函数usb_control_msg完成一些初始化后调用了usb_internal_control_msg之后就free urb.剩下的活,全部留给usb_internal_control_msg去做了 ...

  6. Linux 新手非常有用的命令

    http://www.cnblogs.com/felix-/p/4341773.html Linux 新手非常有用的命令 你打算从Windows换到Linux上来,还是你刚好换到Linux上来?哎哟! ...

  7. troubleshooting tools in JDK 7--转载

    This chapter describes in detail the troubleshooting tools that are available in JDK 7. In addition, ...

  8. Xcode编辑器之基本使用(一)

    前言. 苹果原生xcode使用介绍文档 1.Xcode IDE概览 说明: 从左到右,依次是“导航窗格(Navigator)->边列(Gutter)->焦点列(Ribbon)->代码 ...

  9. Top PG Clustering HA Solutions for PostgreSQL

    转自:https://severalnines.com/blog/top-pg-clustering-ha-solutions-postgresql If your system relies on  ...

随机推荐

  1. Don’t Repeat Yourself,Repeat Yourself

    Don't Repeat Yourself,Repeat Yourself Don't repeat yourself (DRY, or sometimes do not repeat yoursel ...

  2. 有关字符串的算法(KMP,Manacher,BM)陆续补充

    KMP算法: 引言: KMP算法是一种改进的字符串匹配算法 字符串匹配:即寻找str_target在str_source中出现的位置 没有改进的字符串匹配:用暴力法进行搜索,枚举出所有的情况然后一一比 ...

  3. 洛谷P3292 [SCOI2016]幸运数字 线性基+倍增

    P3292 [SCOI2016]幸运数字 传送门 题目描述 A 国共有 n 座城市,这些城市由 n-1 条道路相连,使得任意两座城市可以互达,且路径唯一.每座城市都有一个幸运数字,以纪念碑的形式矗立在 ...

  4. react与redux的一点心得(理解能力有限,蜗牛进度)

    Redux是一款状态管理库,并且提供了react-redux库来与React亲密配合, 但是总是傻傻分不清楚这2者提供的API和相应的关系.这篇文章就来理一理. 如果要用一句话来概括Redux,那么可 ...

  5. 《C++Primer》第五版习题答案--第二章【学习笔记】

    C++Primer第五版习题解答---第二章 ps:答案是个人在学习过程中书写,可能存在错漏之处,仅作参考. 作者:cosefy Date: 2020/1/9 第二章:变量和基本类型 练习2.1: 类 ...

  6. C语言之指针用法总结

    C语言指针概述:1.计算机系统中,无论是存入或是取出数据都需要与内存单元打交道,物理器件通过地址编码寻找内存单元.2.地址编码是一种数据,C语言的指针类型正是为了表示这种计算机所特有的地址数据.3.存 ...

  7. kuangbin专题 专题九 连通图 POJ 3694 Network

    题目链接:https://vjudge.net/problem/POJ-3694 题目:给定一个连通图,求桥的个数,每次查询,加入一条边,问加入这条边后还有多少个桥. 思路:tarjan + 并查集 ...

  8. 快速回顾MySQL:简单查询操作

    利用空闲时间花几分钟回顾一下 7.1 检索数据 为了查询出数据库表中的行(数据),使用SELECE语句. 格式: # 第一种 SELECT * FROM <table_name>; # 第 ...

  9. Spring Boot2 系列教程 (五) | yaml 配置文件详解

    自定义属性加载 首先构建 SpringBoot 项目,不会的看这篇旧文 使用 IDEA 构建 Spring Boot 工程. 首先在项目根目录 src >> resource >&g ...

  10. java面试题-集合类

    准备年后要跳槽,所以最近一直再看面试题,并且把收集到的面试题整理了以下发到博客上,希望对大家有所帮助. 首先是集合类的面试题 1.  HashMap 排序题,上机题. 已知一个 HashMap< ...