先感谢一下我的同事们最先发现此 问题 ,鸣谢:向飞、志刚、海云 最近在生产环境发现一个诡异的 问题 ; 环境:WINDOWS 2012+SQLSERVER 2012 SP1,双节点的故障转移群集+单节点的SQLSERVER 2012 SP1实例(镜像) 生产数据库是从SQLSERVER 2008R2迁移到2012的
先感谢一下我的同事们最先发现此问题,鸣谢:向飞、志刚、海云
最近在生产环境发现一个诡异的问题;
环境:WINDOWS 2012+SQLSERVER 2012 SP1,双节点的故障转移群集+单节点的SQLSERVER 2012 SP1实例(镜像)
生产数据库是从SQLSERVER 2008R2迁移到2012的,迁移过程很顺利,按照一般经验,可能导致数据库所有者丢失,因此在迁移后手动修改数据库所有者为sa,与此同时还有个job在做这个库的归档(定期清理历史数据到本地的历史库中,delete、insert操作);
迁移后尝试运行job均可正常执行;第二天以镜像方式做灾备,搭建完镜像环境后,归档的job报错:无法登录到服务器“(local)”。
后测试尝试重建作业也无效,再创建一个新作业,只在这个做了镜像的库上执行“select 1”,同样报错(按理说select 1是不会记录日志的,因此也就不会影响到镜像)
最后通过查询代理错误日志,发现如下错误:
确实,MultiSubnetFailover参数必须要开启AlwaysOn属性后才能使用。但为何在只建立镜像的环境下,SQL Agent仍会通过这个连接选项连接到镜像实例?
此外,我又做了两个测试:
测试A:在开启过AlwaysOn选项的单实例(非群集环境)上,先关闭AlwaysOn选项,删除并重建端点,搭建镜像环境;
测试B:在从未开启过AlwaysOn选项的单实例(非群集环境)上(新装的虚机),搭建镜像环境;
上述两次测试,JOB均可顺利执行,并未出现此前在群集环境下的问题;
由此,基本可以排除此问题受AlwaysOn选项的影响的可能,反而是对群集环境才有此类的现象;
目前的群集环境不便开启AlwaysOn选项,因此无法做进一步测试来验证上面的观点,有兴趣的童鞋可以继续测试一下;
PS:经过陈桑的提点,这个问题可以曲线解决;
创建job步骤的时候,连接数据库选为非镜像库(如master),同时修改要执行的SQL,将对象名改为database.schema.object的格式即可;

MySQLstringtypesimpactstorageandperformanceasfollows:1)CHARisfixed-length,alwaysusingthesamestoragespace,whichcanbefasterbutlessspace-efficient.2)VARCHARisvariable-length,morespace-efficientbutpotentiallyslower.3)TEXTisforlargetext,storedoutsiderows,

MySQLstringtypesincludeVARCHAR,TEXT,CHAR,ENUM,andSET.1)VARCHARisversatileforvariable-lengthstringsuptoaspecifiedlimit.2)TEXTisidealforlargetextstoragewithoutadefinedlength.3)CHARisfixed-length,suitableforconsistentdatalikecodes.4)ENUMenforcesdatainte

MySQLoffersvariousstringdatatypes:1)CHARforfixed-lengthstrings,2)VARCHARforvariable-lengthtext,3)BINARYandVARBINARYforbinarydata,4)BLOBandTEXTforlargedata,and5)ENUMandSETforcontrolledinput.Eachtypehasspecificusesandperformancecharacteristics,sochoose

TograntpermissionstonewMySQLusers,followthesesteps:1)AccessMySQLasauserwithsufficientprivileges,2)CreateanewuserwiththeCREATEUSERcommand,3)UsetheGRANTcommandtospecifypermissionslikeSELECT,INSERT,UPDATE,orALLPRIVILEGESonspecificdatabasesortables,and4)

ToaddusersinMySQLeffectivelyandsecurely,followthesesteps:1)UsetheCREATEUSERstatementtoaddanewuser,specifyingthehostandastrongpassword.2)GrantnecessaryprivilegesusingtheGRANTstatement,adheringtotheprincipleofleastprivilege.3)Implementsecuritymeasuresl

ToaddanewuserwithcomplexpermissionsinMySQL,followthesesteps:1)CreatetheuserwithCREATEUSER'newuser'@'localhost'IDENTIFIEDBY'password';.2)Grantreadaccesstoalltablesin'mydatabase'withGRANTSELECTONmydatabase.TO'newuser'@'localhost';.3)Grantwriteaccessto'

The string data types in MySQL include CHAR, VARCHAR, BINARY, VARBINARY, BLOB, and TEXT. The collations determine the comparison and sorting of strings. 1.CHAR is suitable for fixed-length strings, VARCHAR is suitable for variable-length strings. 2.BINARY and VARBINARY are used for binary data, and BLOB and TEXT are used for large object data. 3. Sorting rules such as utf8mb4_unicode_ci ignores upper and lower case and is suitable for user names; utf8mb4_bin is case sensitive and is suitable for fields that require precise comparison.

The best MySQLVARCHAR column length selection should be based on data analysis, consider future growth, evaluate performance impacts, and character set requirements. 1) Analyze the data to determine typical lengths; 2) Reserve future expansion space; 3) Pay attention to the impact of large lengths on performance; 4) Consider the impact of character sets on storage. Through these steps, the efficiency and scalability of the database can be optimized.


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

EditPlus Chinese cracked version
Small size, syntax highlighting, does not support code prompt function

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool

WebStorm Mac version
Useful JavaScript development tools
