如何在Linux上设置SQL Server日志传送

Log shipping is a high-availability configuration that perhaps most of us are familiar with. It’s one of the oldest techniques wherein we ship transaction logs from a Primary database to a Secondary database. Log Shipping is still a vital feature used in case of applications that use warm standby for Disaster Recovery. We can see many articles which discuss the process of configuring Log shipping using T-SQL or SSMS.

日志传送是我们大多数人都熟悉的高可用性配置。 这是最古老的技术之一,其中我们将事务日志从主数据库发送到辅助数据库。 对于使用热备份进行灾难恢复的应用程序,日志传送仍然是一项至关重要的功能。 我们可以看到许多文章,这些文章讨论了使用T-SQL或SSMS配置日志传送的过程。

On a high level, Log Shipping consists of preparing the secondary database (NORECOVERY or STANDBY) using a backup of the primary instance database and then applying the transaction logs from the primary database onto the secondary database using SQL Server agent Jobs and a shared file location. In other words, it’s an automated process of restoring transaction log backups from the primary database server on to the secondary database/database server. This way, the database is available for failover.

在较高的级别上,日志传送包括使用主实例数据库的备份准备辅助数据库(NORECOVERY或STANDBY),然后使用SQL Server代理作业和共享文件位置将事务日志从主数据库应用到辅助数据库上。 换句话说,这是将事务日志备份从主数据库服务器还原到辅助数据库/数据库服务器的自动化过程。 这样,数据库可用于故障转移。

We’ve seen multiple models of implementation of log shipping: log shipping on the same server, on to a different server, across domains or workgroups, or to different versions of SQL Server. SQL Server, now being available for Linux, makes us think, “Can we set up log shipping across platforms?”

我们已经看到了日志传送的多种实现模式:日志传送在同一服务器上,跨域或工作组,到不同服务器或不同版本SQL Server。 现在可用于LinuxSQL Server使我们想到:“我们可以跨平台设置日志传送吗?”

As it turns out, yes, we can. This article discusses the setup. We’ll use a network file share for the demonstration. Let’s jump right in!

事实证明,是的,我们可以。 本文讨论了安装程序。 我们将使用网络文件共享进行演示。 让我们跳进去吧!

如何在Linux上设置SQL Server日志传送_第1张图片
As shown in the above figure, log shipping is comprised of the following steps:
  • A File Share, the placeholder for the primary database transaction log files

    文件共享,主数据库事务日志文件的占位符
  • A backup job created to backup transaction log file to the share

    创建备份作业以将事务日志文件备份到共享
  • A copy job on the secondary used to copy the transaction log files from the share

    辅助服务器上的复制作业,用于从共享中复制事务日志文件
  • A restore job to perform the restoration of the transaction log backup files

    还原作业以执行事务日志备份文件的还原

先决条件 (Prerequisites)

  1. The SQL Server configuration must use the FULL or Bulk Logged database recovery model

    SQL Server配置必须使用FULL或Bulk Logged数据库恢复模型
  2. SMB protocol SMB协议的文件共享
  3. SQL Server Agent installation on the Linux instance

    在Linux实例上安装SQL Server Agent
  4. SQLCMD command reference SQLCMD命令参考
  5. sysadmin fixed server role. sysadmin固定服务器角色的成员身份。

Check the databases recovery model

检查数据库恢复模型

Use the below SQL query to check the recovery model of the database.

使用下面SQL查询来检查数据库的恢复模型。

 
SELECT name AS [Database Name], recovery_model_desc AS [Recovery Model] FROM sys.databases
 

Configure a File Share using the SAMBA protocol

使用SAMBA协议配置文件共享

We’re using CentOS for the procedure. The procedure may vary based on the Linux flavor/distribution you use.

我们使用的是CentOS。 该过程可能会因您使用的Linux版本/发行版而异。

  1. net config workstation command in the cmd prompt on the SQL Server on Windows—the primary database server. In this case the workstation domain value is HQNT. net config station命令。 在这种情况下,工作站域值为HQNT。

    如何在Linux上设置SQL Server日志传送_第2张图片

  2.  
    #yum install samba samba-client samba-common
     
    
  3. cp command to create a new file cp命令创建一个新文件。
     
    #cp /etc/samba/smb.conf /etc/samba/smb.conf.bak
     
    

    Use any editor to edit the content of /etc/samba/smb.conf. I used VI. VIM or Nano should work, too. The entire content of the file should look like the text below.

    使用任何编辑器来编辑/etc/samba/smb.conf的内容。 我用VI。 VIM或Nano也应该起作用。 文件的全部内容应类似于以下文本。

     
    [global]
    	workgroup = HQNT
    	server string = Samba Server %v
    	netbios name = centos
    	security = user
    	map to guest = bad user
    	dns proxy = no
    #============================ Share Definitions ============================== 
    [SQLShare]
    	Comment =Sql Backup
    	path = /var/opt/SQLBAckup/
    	browsable =yes
    	writable = yes
    	guest ok = yes
    	public = yes
     
    

    The content of the Samba configuration is shown below

    Samba配置的内容如下所示

    如何在Linux上设置SQL Server日志传送_第3张图片

  4. testparm command to validate the configuration parameters of the Samba file. The testparm command parses the configuration file parameters and reports any syntactical issues, or the use of any unknown parameters of the configuration file. testparm命令以验证Samba文件的配置参数。 testparm命令解析配置文件参数,并报告任何语法问题或配置文件的任何未知参数的使用。

    如何在Linux上设置SQL Server日志传送_第4张图片

  5.  
    #mkdir –p /var/opt/SQLBackup
    #chown mssql /var/opt/sqlbackup
    # chgrp mssql /var/opt/sqlbackup
    #chmod –R 777 /var/opt/SQLBackup
     
    
  6.  
    #systemctl restart smb
     
    
  7.  
    #firewall-cmd --permanent --zone=public --add-service=samba
    # firewall-cmd --reload
     
    
  8.  
    #chcon  -R  -t samba_share_t  /var/opt/SQLBackup/
     
    
  9. smbtree. It’s the Linux version of Windows Network Neighborhood. The command prints all the nodes and shares within the domain. smbtree浏览Samba文件共享。 这是Windows网络邻居的Linux版本。 该命令将打印域中的所有节点和共享。

    如何在Linux上设置SQL Server日志传送_第5张图片

  10. 如何在Linux上设置SQL Server日志传送_第6张图片

  11. 如何在Linux上设置SQL Server日志传送_第7张图片

    Now that we have Samba set up, let’s move on to the next step.

    现在我们已经设置了Samba,让我们继续下一步。

  12. Install SQL Server Agent

    安装SQL Server代理

    The SQL Server agent jobs are the backbone of the Log Shipping architecture. The Backup Job, Copy Job, Restore Job, Alert job… all run on the Primary or the Secondary databases instances. To install the SQL Server Agent, the following commands are executed. After the installation is complete, don’t forget to restart the SQL Service.

    SQL Server 代理作业是日志传送体系结构的基础。 备份作业,复制作业,还原作业,警报作业……都在主数据库或辅助数据库实例上运行。 要安装SQL Server代理,请执行以下命令。 安装完成后,请不要忘记重新启动SQL Service。

     
    # yum install mssql-server-agent
    #systemctl restart mssql-server
     
    

    如何在Linux上设置SQL Server日志传送_第8张图片

    Setup Log Shipping

    设置日志传送

    Log shipping can be implemented using the SSMS GUI or T-SQL. I feel more comfortable using T-SQL. The sqlcmd command gives us the flexibility to execute the SQL by connecting to various versions SQL Shell with reference to the current scope of execution.

    可以使用SSMS GUI或T-SQL来实现日志传送。 使用T-SQL使我感到更舒服。 sqlcmd命令通过参考当前执行范围连接到各种版本SQL Shell,使我们能够灵活地执行SQ​​L。

    The first task is to prepare the secondary database instance to get it up and running, by initializing the secondary database. We do this by restoring a full backup of the primary database on the secondary server with no recovery option. The transaction log backup is initiated on the primary and then copied across to the secondary database. This process applies the log on the secondary instance(s) of the database.

    第一个任务是通过初始化辅助数据库来准备辅助数据库实例以使其启动并运行。 为此,我们在没有恢复选项的情况下在辅助服务器上还原了主数据库的完整备份。 事务日志备份在主数据库上启动,然后复制到辅助数据库上。 此过程将日志应用于数据库的辅助实例。

    In this demonstration, HQ6021 is the Primary Server (running on Windows) and 10.2.6.10 is a Secondary Instance (running on Linux).

    在此演示中,HQ6021是主服务器(在Windows上运行),而10.2.6.10是辅助实例(在Linux上运行)。

    Copy the below SQL and open a SQLCMD session on SSMS to execute the commands. This creates a database called SQLShackLogShipping on the Secondary instance.

    复制以下SQL并在SSMS上打开SQLCMD会话以执行命令。 这将在辅助实例上创建一个名为SQLShackLogShipping的数据库。

    The first step in configuring log shipping is to initialize the secondary database, and restore the backup of the primary database on to the secondary instance.

    配置日志传送的第一步是初始化辅助数据库,并将主数据库的备份还原到辅助实例上。

    :CONNECT HQ6021 BACKUP DATABASE SQLShackLogShipping TO DISK = ‘\\centos\SQLShare\SQLShackLogShippingFull.Bak’ WITH INIT ,FORMAT ,COMPRESSION ,STATS = 5 ; GO BACKUP LOG SQLShackLogShipping TO DISK = ‘\\centos\SQLShare\SQLShackLogShippingLogTRN’ WITH INIT ,FORMAT ,COMPRESSION ,STATS = 5 ; GO :CONNECT 10.2 .6 .10 Usa PthanVitha@2015 RESTORE DATABASE SQLShackLogShipping FROM DISK = ‘/var/opt/SQLBackup/SQLShackLogShippingFull.Bak’ WITH MOVE ‘SQLShackLogShipping’ TO ‘/var/opt/mssql/data/SQLShackLogShipping.mdf’ , MOVE ‘SQLShackLogShipping_Log’ TO ‘/var/opt/mssql/data/SQLShackLogShipping_Log.ldf’ ,NORECOVERY ,STATS = 5 , GO :CONNECT 10.2 .6 .10 Usa PthanVitha@2015 RESTORE LOG SQLShackLogShipping FROM DISK = ‘/var/opt/SQLBackup/SQLShackLogShippingLogTRN’ WITH NORECOVERY ,STATS = 5 ; GO
    :CONNECT HQ6021 BACKUP DATABASE SQLShackLogShipping TO DISK = '\\的centos \ SQLShare \ SQLShackLogShippingFull.Bak' WITH INIT,格式,压缩,STATS = 5; GO BACKUP LOG SQLShackLogShipping TO DISK = '\\的centos \ SQLShare \ SQLShackLogShippingLogTRN' WITH INIT,格式,压缩,STATS = 5; GO:CONNECT 10.2 0.6 0.10 -美国- PthanVitha @ 2015 RESTORE DATABASE SQLShackLogShipping FROM DISK = '/var/opt/SQLBackup/SQLShackLogShippingFull.Bak' WITH MOVE 'SQLShackLogShipping' TO“的/ var /选择/ MSSQL /数据/ SQLShackLogShipping。 MDF 'MOVE 'SQLShackLogShipping_Log' TO '/var/opt/mssql/data/SQLShackLogShipping_Log.ldf',NORECOVERY,STATS = 5,GO:CONNECT 10.2 0.6 0.10 -美国- PthanVitha @ 2015 RESTORE LOG SQLShackLogShipping FROM DISK ='的/ var /选择/ SQLBackup / SQLShackLogShippingLogTRN” WITH NORECOVERY,STATS = 5; 走

    On the primary server,

    在主服务器上,

    1. Add the primary database by executing sp_add_log_shipping_primary_database. This step generates the backup job ID and primary ID

      通过执行sp_add_log_shipping_primary_database添加主数据库。 此步骤生成备份作业ID和主ID
    2. Add a backup job schedule using sp_add_jobschedule

      使用sp_add_jobschedule添加备份作业计划
    3. Enable the backup job.

      启用备份作业。
    :CONNECT HQ6021 DECLARE @LSBackupJobId AS UNIQUEIDENTIFIER DECLARE @LSPrimaryId AS UNIQUEIDENTIFIER DECLARE @SPAddRetCode AS INT EXEC @SPAddRetCode = master .dbo .sp_add_log_shipping_primary_database @database = N’SQLShackLogShipping’ ,@backupdirectory = N’\\centos\SQLShare\’ ,@backupshare = N’\\centos\SQLShare\’ ,@backupjobname = N’LSBackupSQLShackLogShipping’ ,@backupretentionperiod = 4320 ,@backupcompression = 2 ,@backupthreshold = 60 ,@thresholdalertenabled = 1 ,@historyretentionperiod = 5760 ,@backupjobid = @LSBackupJobId OUTPUT ,@primaryid = @LSPrimaryId OUTPUT ,@overwrite = 1 IF ( @@ERROR = 0 AND @SPAddRetCode = 0 ) BEGIN DECLARE @LSBackUpScheduleUID AS UNIQUEIDENTIFIER DECLARE @LSBackUpScheduleID AS INT EXEC msdb .dbo .sp_add_schedule @schedulename = N’LSBackupSchedule’ ,@enabled = 1 ,@freqtype = 4 ,@freqinterval = 1 ,@freqsubdaytype = 4 ,@freqsubdayinterval = 15 ,@freqrecurrencefactor = 0 ,@activestartdate = 20170418 ,@activeenddate = 99991231 ,@activestarttime = 0 ,@activeendtime = 235900 ,@scheduleuid = @LSBackUpScheduleUID OUTPUT ,@scheduleid = @LSBackUpScheduleID OUTPUT EXEC msdb .dbo .sp_attach_schedule @jobid = @LSBackupJobId ,@scheduleid = @LSBackUpScheduleID EXEC msdb .dbo .sp_update_job @jobid = @LSBackupJobId ,@enabled = 1 END EXEC master .dbo .sp_add_log_shipping_alert_job GO EXEC master .dbo .sp_add_log_shipping_primary_secondary @primarydatabase = N’SQLShackLogShipping’ ,@secondaryserver = N’10.2.6.10′ ,@secondarydatabase = N’SQLShackLogShipping’ ,@overwrite = 1; GO
    :CONNECT HQ6021 DECLARE @LSBackupJobId AS UNIQUEIDENTIFIER DECLARE @LSPrimaryId AS UNIQUEIDENTIFIER DECLARE @SPAddRetCode AS INT EXEC @SPAddRetCode = master 。 dbo 。 sp_add_log_shipping_primary_database @database = N'SQLShackLogShipping' , @backupdirectory = N'\\ centos \ SQLShare \' , @backupshare = N'\\ centos \ SQLShare \' , @backupjobname = N'LSBackupSQLShackLogShipping' , @ backupretentionperiod = 4320 , @backupcompression = 2,@backupthreshold = 60,@thresholdalertenabled = 1,@historyretentionperiod = 5760,@backupjobid = @LSBackupJobId OUTPUT,@primaryid = @LSPrimaryId OUTPUT,@overwrite = 1 IF(@@ ERROR = 0 AND @SPAddRetCode = 0)BEGIN DECLARE @LSBackUpScheduleUID AS UNIQUEIDENTIFIER DECLARE @LSBackUpScheduleID AS INT EXEC MSDB。 dbo 。 sp_add_schedule @schedulename = N'LSBackupSchedule”,@enabled = 1,@freqtype = 4,@freqinterval = 1,@freqsubdaytype = 4,@freqsubdayinterval = 15,@freqrecurrencefactor = 0,@activestartdate = 20170418,@activeenddate = 99991231,@ activestarttime = 0 , @ activeendtime = 235900 , @ scheduleuid = @LSBackUpScheduleUID 输出 , @ scheduleid = @LSBackUpScheduleID 输出 EXEC msdb 。 dbo 。 sp_attach_schedule @jobid = @LSBackupJobId , @scheduleid = @LSBackUpScheduleID EXEC msdb 。 dbo 。 sp_update_job @jobid = @ LSBackupJobId , @ enabled = 1 END EXEC主服务器。 dbo 。 sp_add_log_shipping_alert_job GO EXEC管理员。 dbo 。 sp_add_log_shipping_primary_secondary @ primarydatabase = N'SQLShackLogShipping' , @ secondaryserver = N'10.2.6.10' , @ secondarydatabase = N'SQLShackLogShipping' , @ overwrite = 1 ; 走

    On the secondary server,

    在辅助服务器上,

    1. copy ID and 副本 ID和restore job ID. 还原作业ID。
    2. Set the copy and restore job schedule using sp_add_jobschedule

      使用sp_add_jobschedule设置复制和还原作业计划
    3. Add the secondary database to the instance by executing sp_add_log_shipping_secondary_database.

      通过执行sp_add_log_shipping_secondary_database将辅助数据库添加到实例。
    4. add the required information about the new secondary database to the primary server. 有关新辅助数据库的所需信息添加到主服务器。
    5. Enable the copy and restore jobs

      启用复制和还原作业
    :CONNECT 10.2 .6 .10 Usa PthanVitha@2015 DECLARE @LSSecondaryCopyJobId AS UNIQUEIDENTIFIER DECLARE @LSSecondaryRestoreJobId AS UNIQUEIDENTIFIER DECLARE @LSSecondarySecondaryId AS UNIQUEIDENTIFIER DECLARE @LSAddRetCode AS INT EXEC @LSAddRetCode = master .dbo .sp_add_log_shipping_secondary_primary @primaryserver = N’HQ6021′ ,@primarydatabase = N’SQLShackLogShipping’ ,@backupsourcedirectory = N’/var/opt/SQLbackup/’ ,@backupdestinationdirectory = N’/var/opt/SQLbackup/’ ,@copyjobname = N’LSCopySQLShackLogShipping’ ,@restorejobname = N’LSRestoreSQLShackLogShipping’ ,@fileretentionperiod = 4320 ,@overwrite = 1 ,@copyjobid = @LSSecondaryCopyJobId OUTPUT ,@restorejobid = @LSSecondaryRestoreJobId OUTPUT ,@secondaryid = @LSSecondarySecondaryId OUTPUT IF ( @@ERROR = 0 AND @LSAddRetCode = 0 ) BEGIN DECLARE @LSSecondaryCopyJobScheduleUID AS UNIQUEIDENTIFIER DECLARE @LSSecondaryCopyJobScheduleID AS INT EXEC msdb .dbo .sp_add_schedule @schedulename = N’DefaultCopyJobSchedule’ ,@enabled = 1 ,@freqtype = 4 ,@freqinterval = 1 ,@freqsubdaytype = 4 ,@freqsubdayinterval = 15 ,@freqrecurrencefactor = 0 ,@activestartdate = 20171108 ,@activeenddate = 99991231 ,@activestarttime = 0 ,@activeendtime = 235900 ,@scheduleuid = @LSSecondaryCopyJobScheduleUID OUTPUT ,@scheduleid = @LSSecondaryCopyJobScheduleID OUTPUT EXEC msdb .dbo .sp_attach_schedule @jobid = @LSSecondaryCopyJobId ,@scheduleid = @LSSecondaryCopyJobScheduleID DECLARE @LSSecondaryRestoreJobScheduleUID AS UNIQUEIDENTIFIER DECLARE @LSSecondaryRestoreJobScheduleID AS INT EXEC msdb .dbo .sp_add_schedule @schedulename = N’DefaultRestoreJobSchedule’ ,@enabled = 1 ,@freqtype = 4 ,@freqinterval = 1 ,@freqsubdaytype = 4 ,@freqsubdayinterval = 15 ,@freqrecurrencefactor = 0 ,@activestartdate = 20171108 ,@activeenddate = 99991231 ,@activestarttime = 0 ,@activeendtime = 235900 ,@scheduleuid = @LSSecondaryRestoreJobScheduleUID OUTPUT ,@scheduleid = @LSSecondaryRestoreJobScheduleID OUTPUT EXEC msdb .dbo .sp_attach_schedule @jobid = @LSSecondaryRestoreJobId ,@scheduleid = @LSSecondaryRestoreJobScheduleID END DECLARE @LSAddRetCode2 AS INT IF ( @@ERROR = 0 AND @LSAddRetCode2 = 0 ) BEGIN EXEC @LSAddRetCode2 = master .dbo .sp_add_log_shipping_secondary_database @secondarydatabase = N’SQLShackLogShipping’ ,@primaryserver = N’HQ6021′ ,@primarydatabase = N’SQLShackLogShipping’ ,@restoredelay = 0 ,@restoremode = 0 ,@disconnectusers = 0 ,@restorethreshold = 45 ,@thresholdalertenabled = 1 ,@historyretentionperiod = 5760 ,@overwrite = 1 END IF ( @@error = 0 AND @LSAddRetCode = 0 ) BEGIN EXEC msdb .dbo .sp_update_job @jobid = @LSSecondaryCopyJobId ,@enabled = 1 EXEC msdb .dbo .sp_update_job @jobid = @LSSecondaryRestoreJobId ,@enabled = 1 END
    :CONNECT 10.2 0.6 0.10 -美国- PthanVitha @ 2015 DECLARE @LSSecondaryCopyJobId AS UNIQUEIDENTIFIER DECLARE @LSSecondaryRestoreJobId AS UNIQUEIDENTIFIER DECLARE @LSSecondarySecondaryId AS UNIQUEIDENTIFIER DECLARE @LSAddRetCode AS INT EXEC @LSAddRetCode =主人。 dbo 。 sp_add_log_shipping_secondary_primary @primaryserver = N'HQ6021' , @primarydatabase = N'SQLShackLogShipping' , @backupsourcedirectory = N'/ var / opt / SQLbackup /' , @backupdestinationdirectory = N'/ var / opt / SQLbackup /' , @copyjobname = N'LSCopySQLShackLogShipping '@restorejobname = N'LSRestoreSQLShackLogShipping',@fileretentionperiod = 4320,@overwrite = 1,@copyjobid = @LSSecondaryCopyJobId OUTPUT,@restorejobid = @LSSecondaryRestoreJobId OUTPUT,@secondaryid = @LSSecondarySecondaryId 输出 IF(@@ ERROR = 0 AND @LSAddRetCode = 0)BEGIN DECLARE @LSSecondaryCopyJobScheduleUID AS UNIQUEIDENTIFIER DECLARE @LSSecondaryCopyJobScheduleID AS INT EXEC msdb中。 dbo 。 sp_add_schedule @schedulename = N'DefaultCopyJobSchedule”,@enabled = 1,@freqtype = 4,@freqinterval = 1,@freqsubdaytype = 4,@freqsubdayinterval = 15,@freqrecurrencefactor = 0,@activestartdate = 20171108,@activeenddate = 99991231,@ activestarttime = 0 , @ activeendtime = 235900 , @ scheduleuid = @LSSecondaryCopyJobScheduleUID 输出 , @ scheduleid = @LSSecondaryCopyJobScheduleID 输出 EXEC msdb 。 dbo 。 sp_attach_schedule @jobid = @LSSecondaryCopyJobId,@scheduleid = @LSSecondaryCopyJobScheduleID DECLARE @LSSecondaryRestoreJobScheduleUID AS UNIQUEIDENTIFIER DECLARE @LSSecondaryRestoreJobScheduleID AS INT EXEC msdb中。 dbo 。 sp_add_schedule @schedulename = N'DefaultRestoreJobSchedule”,@enabled = 1,@freqtype = 4,@freqinterval = 1,@freqsubdaytype = 4,@freqsubdayinterval = 15,@freqrecurrencefactor = 0,@activestartdate = 20171108,@activeenddate = 99991231,@ activestarttime = 0 , @ activeendtime = 235900 , @ scheduleuid = @LSSecondaryRestoreJobScheduleUID 输出 , @ scheduleid = @LSSecondaryRestoreJobScheduleID 输出 EXEC msdb 。 dbo 。 sp_attach_schedule @jobid = @LSSecondaryRestoreJobId,@scheduleid = @LSSecondaryRestoreJobScheduleID END DECLARE @ LSAddRetCode2 AS INT IF(@@ ERROR = 0 AND @ LSAddRetCode2 = 0)BEGIN EXEC @ LSAddRetCode2 =主人。 dbo 。 sp_add_log_shipping_secondary_database @secondarydatabase = N'SQLShackLogShipping '@primaryserver = N'HQ6021',@primarydatabase = N'SQLShackLogShipping',@restoredelay = 0,@restoremode = 0,@disconnectusers = 0,@restorethreshold = 45,@thresholdalertenabled = 1,@ historyretentionperiod = 5760,@overwrite = 1 END IF(@@误差 = 0 AND @LSAddRetCode = 0)BEGIN EXEC msdb中。 dbo 。 sp_update_job @jobid = @LSSecondaryCopyJobId , @enabled = 1 EXEC msdb 。 dbo 。 sp_update_job @jobid = @LSSecondaryRestoreJobId , @enabled = 1 END

    SSMS报告 (SSMS Report)

    The standard Log Shipping Status report can be generated by right clicking on the Server Name in the SQL Server Management Studio Reports Standard Reports Transaction Log Shipping Status. This report should give us details which should tell us whether our setup was successful.

    可以通过在SQL Server Management Studio报表标准报表事务日志传输状态中的服务器名称上单击鼠标右键来生成标准的日志传输状态报告 。 此报告应向我们提供详细信息,这些详细信息应告诉我们设置是否成功。

    如何在Linux上设置SQL Server日志传送_第9张图片

    如何在Linux上设置SQL Server日志传送_第10张图片

    结语 (Wrapping Up)

    As we saw in this article, the high availability feature, Log Shipping, can now be configured across platforms. This article provides step by step details of the configuration to implement Log Shipping from the primary SQL Server running on Windows to the secondary SQL Server running on CentOS. The steps are not very different from configuring Log Shipping across Windows instances, except that the interface (and so some of the commands) varies. You may get a few errors, but all the errors are going to be self-explanatory. If you can fix the Log Shipping setup on Windows, you should be able to troubleshoot configuration issues on Linux as well, as the steps should be straightforward. It is also evident that SQL Administrators have to quickly adapt to the changing needs of technology.

    正如我们在本文中看到的,现在可以跨平台配置高可用性功能,即日志传送。 本文提供了配置的逐步详细信息,以实现从Windows上运行的主SQL Server到CentOS上运行的辅助SQL Server的日志传送。 这些步骤与跨Windows实例配置日志传送没有太大区别,只是接口(以及某些命令)有所不同。 您可能会遇到一些错误,但是所有错误都是不言而喻的。 如果您可以在Windows上修复“日志传送”设置,那么您也应该能够在Linux上解决配置问题,因为这些步骤应该很简单。 同样显而易见的是,SQL管理员必须快速适应不断变化的技术需求。

翻译自: https://www.sqlshack.com/set-sql-server-log-shipping-linux/

你可能感兴趣的:(数据库,java,linux,大数据,mysql)