CN112817941A - 一种解决sqlserver自动修改恢复模式的方法 - Google Patents

一种解决sqlserver自动修改恢复模式的方法 Download PDF

Info

Publication number
CN112817941A
CN112817941A CN202110205865.1A CN202110205865A CN112817941A CN 112817941 A CN112817941 A CN 112817941A CN 202110205865 A CN202110205865 A CN 202110205865A CN 112817941 A CN112817941 A CN 112817941A
Authority
CN
China
Prior art keywords
sqlserver
mode
solving
database
modify
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110205865.1A
Other languages
English (en)
Inventor
秦贞远
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Unicloud Technology Co Ltd
Original Assignee
Unicloud Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Unicloud Technology Co Ltd filed Critical Unicloud Technology Co Ltd
Priority to CN202110205865.1A priority Critical patent/CN112817941A/zh
Publication of CN112817941A publication Critical patent/CN112817941A/zh
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/21Design, administration or maintenance of databases

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

本发明提供了一种解决sqlserver自动修改恢复模式的方法,通过sqlserver的trigger调用sqlserver实例的agent http请求,agent运行在sqlserver所在机器的应用程序,用于保证在用户创建数据库时,默认在后台第一时间给修改为full模式。本发明有益效果:一种解决sqlserver自动修改恢复模式的方法能够第一时间修改模式,能够做到创建即修改;同时本方法不采用sqlserver job的方式,减少了sqlserver的内部开销,且耦合性低。

Description

一种解决sqlserver自动修改恢复模式的方法
技术领域
本发明属于信息技术领域,尤其是涉及一种解决sqlserver自动修改恢复模式的方法。
背景技术
目前现有的sqlserver always on架构下,创建数据库默认恢复模式为simple,无法加入到高可用组的问题,相似的解决方案大多采用轮询的机制进行处理,启动定时任务,检查所有数据库的恢复模式,如果为simple则进行修改,这种方式资源消耗较多,而且无法做到第一时间修改模式。
发明内容
有鉴于此,本发明旨在提出一种解决sqlserver自动修改恢复模式的方法,以解决上述问题中的不足之处。
为达到上述目的,本发明的技术方案是这样实现的:
一种解决sqlserver自动修改恢复模式的方法,通过sqlserver的trigger调用sqlserver实例的agent http请求,agent运行在sqlserver所在机器的应用程序,用于保证在用户创建数据库时,默认在后台第一时间给修改为full模式。
进一步的,一种解决sqlserver自动修改恢复模式的方法,包括以下步骤:
S1、开启sqlserver的外围访问权限;
S2、创建系统级别的DLL trigger;
S3、Agent应用接收请求,再确认database已经创建完成后,通过名字使用Alter命令修改对应数据库的模式;
S4、增加重试机制,直到修改模式成功为止。
相对于现有技术,本发明所述的一种解决sqlserver自动修改恢复模式的方法具有以下有益效果:
(1)本发明所述的一种解决sqlserver自动修改恢复模式的方法能够第一时间修改模式,能够做到创建即修改;
(2)本发明所述的一种解决sqlserver自动修改恢复模式的方法不采用sqlserverjob的方式,减少了sqlserver的内部开销;
(3)本发明所述的一种解决sqlserver自动修改恢复模式的方法耦合性低。
附图说明
构成本发明的一部分的附图用来提供对本发明的进一步理解,本发明的示意性实施例及其说明用于解释本发明,并不构成对本发明的不当限定。在附图中:
图1为本发明实施例所述的一种解决sqlserver自动修改恢复模式的方法示意图。
具体实施方式
需要说明的是,在不冲突的情况下,本发明中的实施例及实施例中的特征可以相互组合。
下面将参考附图并结合实施例来详细说明本发明。
Sqlserver的always on架构,创建的数据库默认是simple模式,这种模式是无法加入到高可用组里的,需要调为full模式,这样在云数据库中使用时,就会给用户造成困扰,本发明为了解决以上问题,在用户创建数据库时,默认在后台第一时间给修改为full模式,这样就解决了后续加入到高可用组的问题,具体实现原理是通过sqlserver的trigger实现,调用sqlserver实例的agent http请求,agent即运行在sqlserver所在机器的应用程序,具体操作如下:
1、开启sqlserver的外围访问权限。
2、创建系统级别的DLL trigger。
Figure BDA0002950555070000031
Figure BDA0002950555070000041
3、Agent应用接收请求,再确认database已经创建完成后,通过名字使用Alter命令修改对应数据库的模式,
4、增加重试机制,直到修改模式成功为止。
如图1所示,一种解决sqlserver自动修改恢复模式的方法,通过sqlserver的trigger调用sqlserver实例的agent http请求,agent运行在sqlserver所在机器的应用程序,用于保证在用户创建数据库时,默认在后台第一时间给修改为full模式。
一种解决sqlserver自动修改恢复模式的方法,包括以下步骤:
S1、开启sqlserver的外围访问权限;
S2、创建系统级别的DLL trigger;
S3、Agent应用接收请求,再确认database已经创建完成后,通过名字使用Alter命令修改对应数据库的模式;
S4、增加重试机制,直到修改模式成功为止。
以上所述仅为本发明的较佳实施例而已,并不用以限制本发明,凡在本发明的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。

Claims (2)

1.一种解决sqlserver自动修改恢复模式的方法,其特征在于:通过sqlserver的trigger调用sqlserver实例的agent http请求,agent运行在sqlserver所在机器的应用程序,用于保证在用户创建数据库时,默认在后台第一时间给修改为full模式。
2.根据权利要求1所述的一种解决sqlserver自动修改恢复模式的方法,其特征在于,包括以下步骤:
S1、开启sqlserver的外围访问权限;
S2、创建系统级别的DLL trigger;
S3、Agent应用接收请求,再确认database已经创建完成后,通过名字使用Alter命令修改对应数据库的模式;
S4、增加重试机制,直到修改模式成功为止。
CN202110205865.1A 2021-02-24 2021-02-24 一种解决sqlserver自动修改恢复模式的方法 Pending CN112817941A (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110205865.1A CN112817941A (zh) 2021-02-24 2021-02-24 一种解决sqlserver自动修改恢复模式的方法

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110205865.1A CN112817941A (zh) 2021-02-24 2021-02-24 一种解决sqlserver自动修改恢复模式的方法

Publications (1)

Publication Number Publication Date
CN112817941A true CN112817941A (zh) 2021-05-18

Family

ID=75865360

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110205865.1A Pending CN112817941A (zh) 2021-02-24 2021-02-24 一种解决sqlserver自动修改恢复模式的方法

Country Status (1)

Country Link
CN (1) CN112817941A (zh)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1655145A (zh) * 2004-02-11 2005-08-17 微软公司 最优化行级别数据库安全的系统和方法
CN107423638A (zh) * 2017-08-02 2017-12-01 成都安恒信息技术有限公司 一种基于命令探测式修改密码的密码管理系统及使用方法
CN111488339A (zh) * 2019-01-25 2020-08-04 上海哔哩哔哩科技有限公司 基于Node.JS的NoSQL数据库、建立及处理方法
CN112306743A (zh) * 2019-07-26 2021-02-02 阿里巴巴集团控股有限公司 数据处理方法、装置、电子设备及计算机存储介质

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1655145A (zh) * 2004-02-11 2005-08-17 微软公司 最优化行级别数据库安全的系统和方法
CN107423638A (zh) * 2017-08-02 2017-12-01 成都安恒信息技术有限公司 一种基于命令探测式修改密码的密码管理系统及使用方法
CN111488339A (zh) * 2019-01-25 2020-08-04 上海哔哩哔哩科技有限公司 基于Node.JS的NoSQL数据库、建立及处理方法
CN112306743A (zh) * 2019-07-26 2021-02-02 阿里巴巴集团控股有限公司 数据处理方法、装置、电子设备及计算机存储介质

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
WEIXIN_ 38690545: "配置SQL Server数据库恢复模式", 《CSDN》 *

Similar Documents

Publication Publication Date Title
US6567809B2 (en) Disabling and reloading enterprise java beans using database trigger programs
WO2019210758A1 (zh) 数据保护方法、装置及存储介质
US6832238B1 (en) Local transaction management
US7680762B2 (en) System and method providing inlined stub
US9235495B2 (en) Method and system that provides an interactive debugging session
US8271448B2 (en) Method for strategizing protocol presumptions in two phase commit coordinator
US6360228B1 (en) Transactional framework for executing statements involving non-native code
CN111198872B (zh) 数据库处理事务的方法及装置
JPH11327919A (ja) オブジェクト指向割込みシステム用の方法およびデバイス
CN110716936B (zh) 一种基于SpringBoot+JPA的数据库乐观锁实现方法及系统
CN102591726A (zh) 一种多进程通信方法
DE102012210420A1 (de) Verfahren für ein systemeigenes Programm für das Übernehmen desselben Transaktionskontextes, wenn durch das in einer separaten Umgebung laufende primäre Programm aufgerufen
WO2024060956A1 (zh) 一种混合数据库管理方法、装置、混合数据库及电子设备
CN107368498B (zh) 优化MySQL悲观锁的锁等待超时时间的方法及装置
Thomasian et al. A new distributed optimistic concurrency control method and a comparison of its performance with two-phase locking
JPH06337794A (ja) プログラム制御方式
CN112817941A (zh) 一种解决sqlserver自动修改恢复模式的方法
US6829575B2 (en) Enterprise javabeans container
US6725213B1 (en) Method and mechanism for providing external procedures to a database system
CN101751292B (zh) Atc系统中一种实现多机关键数据一致性功能的方法
US9984096B2 (en) System and method for reducing communications overhead in a distributed transactions environment by modifying implementation of the transaction start function
US8090943B1 (en) Preventing unauthorized access of routines in a library
CN100428151C (zh) 大规模并发联机交易中基于版本的c/c++组件热插拔方法
KR100259447B1 (ko) 객체 지향 서버에서 오브젝트 서비스를 이진 클래스에 부가하기 위한 시스템, 방법 및 제조사항
CN110909012B (zh) 数据库对象的封锁方法、装置、设备和存储介质

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20210518

RJ01 Rejection of invention patent application after publication