ansible_all_ipv4_addresses:仅显示ipv4的信息ansible_devices:仅显示磁盘设备信息ansible_distribution:显示是什么系统,例:centos,suse等ansible_distribution_version:仅显示系统版本ansible_machine:显示系统类型,例:32位,还是64位ansible_eth0:仅显示eth0的信息an
IFEXISTS(SELECTFROMSYS.TABLESWHERENAME='SPD')DROPTABLESPD;WITHCTE1AS(SELECTIIF(PD_DueDT>=ISNULL(PD_DebitSuccDT,'9999-12-31'),0,1)ASFLAG/逾期FLAG/,ROW_NUMBER()OVER(PARTITIONBYPD_EFH_SN
--服务器级权限WITHCTEAS(SELECTu.nameAS用户名,u.is_disabledAS是否禁用,g.nameas服务器角色,'√'as'flag'FROMsys.server_principalsuINNERJOINsys.server_role_membersmONu.principal_id=m.member_principal_idINNERJ
--哪个会话引起阻塞并且它们在运行什么SELECTDTL.[request_session_id]AS[session_id],DB_NAME(DTL.[resource_database_id])AS[Database],DTL.resource_type,CASEWHENDTL.resource_typeIN('DATABASE','FILE','MET
--索引上的碎片超过15%并且索引体积较大(超过500页)的索引。SELECT'['+DB_NAME()+'].['+OBJECT_SCHEMA_NAME(ddips.[object_id],DB_ID())+'].['+OBJECT_NAME(ddips.[object_id],DB_ID())+']'AS[statement],i.[name]AS[index_name],ddips.[ind
--丢失索引SELECTuser_seeks*avg_total_user_cost*(avg_user_impact*0.01)AS[index_advantage],dbmigs.last_user_seek,dbmid.[statement]AS[Database.Schema.Table],dbmid.equality_columns,dbmid.inequality_columns,db
CreatePROCEDURE[dbo].[sp_windbi$decrypt](@proceduresysname=NULL,@revflint=1)AS/**//*王成辉翻译整理,转贴请注明出自微软BI开拓者www.windbi.com调用形式为:execdbo.sp__windbi$decrypt@procedure,0如果第二个参数使用1的话,会给出该存储过程的一些提示。--版本4.0修正
createfunction[dbo].[fn_GetQuanPin](@strvarchar(100))returnsvarchar(8000)asbegindeclare@revarchar(8000),@crsvarchar(10)declare@strlenintselect@strlen=len(@str),@re=''while@strlen>0beginset@crs=subs
[client]socket=/var/lib/mysql/mysql.sockdefault-character-set=utf8mb4[mysql]default-character-set=utf8mb4[mysqld]character-set-client-handshake=FALSEcharacter-set-server=utf8mb4collation-server=utf8mb
1、主从服务器分别作以下操作:1.1、版本一致1.2、初始化表,并在后台启动mysql1.3、修改root的密码2、修改主服务器master:#vi/etc/my.cnf[mysqld]log-bin=mysql-bin//[必须]启用二进制日志server-id=222//[必须]服务器唯一ID,默认是1,一般取IP最后一段3、修改从服务器slave:#vi/etc/my.cnf[mysqld]
```Showvariablelike'%sql_mode%'启用严格模式Setsql_mode='STRICT_TRANS_TABLES'5.3.2.SQL服务器模式MySQL服务器可以以不同的SQL模式来操作,并且可以为不同客户端应用不同模式。这样每个应用程序可以根据自己的需求来定制服务器的操作模式。模式定义MySQL应支持哪些SQL语法,以及应执行哪种数据验证
源代码安装版本/usr/local/mysql/varapt二进制发现版本/usr/local/mysql/dataRPM安装版本/var/lib/mysql![](http://i2.51cto.com/images/blog/201805/17/30c3156c6d4ec0319d12983d5c5096bb.png?x-oss-process=image/watermark,size_16,
dbccloginfo(N'SHDAT9154WXADB')查看日志状态,Status=2,表示该段日志为活跃状态SELECT[name],[database_id],[log_reuse_wait],[log_reuse_wait_desc]FROM[sys].[databases]wherename='SHDAT9154WXADB'等待类型为Replicatio
QueryEditor窗口Ctrl+Shift+R刷新IntelliSenseCtrl+K+K添加/删除书签Ctrl+K+A启用所有书签Ctrl+K+N移动到下一个书签Ctrl+K+P移动到上一个书签Ctrl+K+L清除所有格书签Ctrl+K+W打开Bookmark窗口Ctrl+K+C注释选定内容Ctrl+K+U取消注释选定内容Ctrl+K+X插入代码片段Ctrl+K+S插入代码片段以包围代码如果
![](http://i2.51cto.com/images/blog/201805/17/cbb55f16c78d571fc9188711d4008a60.png?x-oss-process=image/watermark,size_16,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_100,g_se,x_10,y_10,shadow_90,type_ZmFuZ3po
--选取了前10个最耗CPU时间的会话SELECTTOP10[session_id],[request_id],[start_time]AS'开始时间',[status]AS'状态',[command]AS'命令',dest.[text]AS'sql语句',DB_NAME([database_id])AS'数据库名',[blocking_session_id]AS'正在阻塞其他会话的会话ID',[
SELECTt1.session_id,t1.internal_objects_alloc_page_count,t1.user_objects_alloc_page_count,t1.internal_objects_dealloc_page_count,t1.user_objects_dealloc_page_count,t3.*fromsys.dm_db_session_space_usag
--从各实例获取作业完成情况,读取MSDB的JOBHISTORY表--=============================================--Author:<Gaokd>--Createdate:<2016-01-15>--Description:<gatherthejobshistory>--=======================
setnocountoncreatetable#Data(FileIDintNOTNULL,[FileGroupId]intNOTNULL,TotalExtentsintNOTNULL,UsedExtentsintNOTNULL,[FileName]sysnameNOTNULL,[FilePath]nvarchar(MAX)NOTNULL,[FileGroup]varchar(MAX)NULL)c
OPENQUERY(linked_server,'query')UPDATEOPENQUERY(OracleSvr,'SELECTnameFROMjoe.titlesWHEREid=101')SETname='ADifferentName';INSERTOPENQUERY(OracleSvr,'SELECTnameFROMjoe.titles')VALUES('NewTitle');DELETEO
withcas(selectempid,orderdate,orderid,custid,val,casewhenROW_NUMBER()over(PARTITION_FRAGMENT_IDbyempid,custidorderbyorderdate)=1thencustidendasdistinct_custidfromsales.ordervalues)selectempid,orderdat
usemastergoselect@@servername,serverproperty('servername')------IFserverproperty('servername')<>@@servernameBEGINDECLARE@serverSYSNAMESET@server=@@servernameEXECsp_dropserver@server=@serverSET@s
WITHCTEAS(SELECTOBJECT_NAME(a.id)astablename,a.name,b.indid,b.colid,b.keynofromsyscolumnsainnerjoinsysindexkeysbona.id=b.idanda.colid=b.colidwhereOBJECT_NAME(a.ID)='tablename')--SELECTDISTINCTCASET.in
SQLServerhasencountered1occurrence(s)ofI/Orequeststakinglongerthan15secondstocompleteonfile[D:\Data\af_shanghai_4.ndf]indatabase[af_shanghai](7).TheOSfilehandleis0x00000960.TheoffsetofthelatestlongI/O
WithTAs(SelectROW_NUMBER()over(orderbyspid)asid,spid,blockedFrom(selectdistinctspid,blockedfromsys.sysprocesseswherespidin(Selectblockedfromsys.sysprocesseswhereblocked<>0)andblocked=0)SUnionAll
SELECT'EXECmaster..sp_addsrvrolemember@loginame=N'''+loginname+''',@rolename=N'''+priv+''''FROM(SELECTloginname,priv,valueFROM(SELECTloginname,sysadmin,securityadmin,serveradmin,setupadmin,processadmi
![](http://i2.51cto.com/images/blog/201805/17/832ad7cf911036bd9b3340af72c8bfa0.png?x-oss-process=image/watermark,size_16,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_100,g_se,x_10,y_10,shadow_90,type_ZmFuZ3po
Createproceduresp_ConvProc2View(@procNamevarchar(80),@viewNamevarchar(80))as-----------------------------------------------------------------Procedurename:sp_ConvProc2View--SpAuthor:EliLeiba--Date11-2
```
DECLARE@WeekDaysTABLE(freq_intervalINT,weekdaysNVARCHAR(120))INSERTINTO@WeekDaysSELECT1,N'星期日'UNIONALLSELECT2,N'星期一'UNIONALLSELECT4,N'星期二'UNIONALLSELECT8,N'星期三'UNIONALLSELECT16,N'星期四'UNIONALLSELECT32,
Copyright © 2005-2025 51CTO.COM 版权所有 京ICP证060544号