zoukankan      html  css  js  c++  java
  • SqlServer 清空日志

    --清空日志    
    USE [master]
         ALTER DATABASE his2020 SET RECOVERY SIMPLE WITH NO_WAIT   ----blog为需要清除日志的数据库名称
         ALTER DATABASE his2020 SET RECOVERY SIMPLE   --简单模式   ----blog为需要清除日志的数据库名称
         
    USE his2020     ----blog为需要清除日志的数据库名称
         DBCC SHRINKFILE (N'his2020_Log' , 11, TRUNCATEONLY)    ----blog_Log为需要清除日志的数据库名日志名称
         
    USE [master]
         ALTER DATABASE his2020 SET RECOVERY FULL WITH NO_WAIT   ----blog为需要清除日志的数据库名称
         ALTER DATABASE his2020 SET RECOVERY FULL  --还原为完全模式   ----blog为需要清除日志的数据库名称
    --查锁表进程
    select
    request_session_id spid,OBJECT_NAME(resource_associated_entity_id) tableName from sys.dm_tran_locks where resource_type='OBJECT'
    --杀进程 declare @spid int Set @spid = 101 --锁表进程 declare @sql varchar(1000) set @sql='kill '+cast(@spid as varchar) exec(@sql)
    --已存在表 os_operator
    insert into os_operator(ope_code,open_mac,myrloe_code,rloe_code) select pass_operator,1,'[]',0 from ITSV.his.dbo.aps_operator_pass

    --不存在表 os_operator
    select * into os_operator from ITSV.his.dbo.aps_operator_pass
  • 相关阅读:
    亚马逊云储存器S3 BCUKET安全性学习笔记
    (web)Bugs_Bunny_CTF_writeup 部分简单web
    给windows右键添加快捷启动程序
    nmap学习笔记
    暴力美学
    Metasploit学习笔记
    钓鱼+DNS欺骗学习笔记
    第 5 章 if 语句
    第 4 章 操作列表
    3.3 组织列表
  • 原文地址:https://www.cnblogs.com/mapstar/p/13187014.html
Copyright © 2011-2022 走看看