[C#]清理数据库日志

可替代 XShell 的 SecureCRT (v6.2.3 / 313)

 

压缩日志文件大小

USE [master]
GO
ALTER DATABASE ODATA SET RECOVERY SIMPLE WITH NO_WAIT
GO
ALTER DATABASE ODATA SET RECOVERY SIMPLE
GO
USE ODATA
GO
DBCC SHRINKFILE (N'ODATA_Log' , 11, TRUNCATEONLY)
GO
USE [master]
GO
ALTER DATABASE ODATA SET RECOVERY FULL WITH NO_WAIT
GO
ALTER DATABASE ODATA SET RECOVERY FULL
GO

 

查看 Oracle 数据库文件剩余空间

select a.tablespace_name ,a.d1 ,b.d1 ,a.d2 ,a.tablespace_name
from (
select tablespace_name,round(sum(bytes)/(1024*1024*1024),2) d1,count(*) d2 from DBA_DATA_FILES group by tablespace_name) a
join (
select tablespace_name,round(sum(bytes)/(1024*1024*1024),2) d1 from dba_free_space group by tablespace_name) b
on a.tablespace_name=b.tablespace_name
order by a.d1 desc

 

查看 Sql Server 表行数

SELECT CONVERT(VARCHAR(10),t.TABLE_SCHEMA) + '.' + CONVERT(VARCHAR(30),t.TABLE_NAME) A1,MAX(i.ROWS) A4
FROM SYSINDEXES i, INFORMATION_SCHEMA.TABLES t
WHERE t.TABLE_NAME = OBJECT_NAME(i.ID)
      AND t.TABLE_TYPE = 'BASE TABLE'
GROUP BY t.TABLE_SCHEMA, t.TABLE_NAME
HAVING MAX(i.ROWS)>3000000
ORDER BY MAX(i.ROWS) DESC

 

上一篇:how to extend odata service


下一篇:SAP BTP 上使用 Mobile Back-End Tools(MBT)进行全栈开发的方法概述