<!--[if !supportLists]--> 第一章 <!--[endif]--> 測試 背景
SQL SERVER 日志傳送功能可自動復(fù)制數(shù)據(jù)庫的日志文件,并回存到備份服務(wù)器 (standby server) 的另外一個數(shù)據(jù)庫。因此可大幅提高 SQL Server 數(shù)據(jù)庫的可用性。因為備份數(shù)據(jù)庫完整地接收來源數(shù)據(jù)庫的變化情況,所以它就是一份來源數(shù)據(jù)庫的復(fù)本。它們之間的差別僅在于日志復(fù)制與加載過程所產(chǎn)生的時間差。然而,當(dāng)主服務(wù)器因故障停機(jī)時,您就可以將備份服務(wù)器更改為新的主服務(wù)器。如果原來的主服務(wù)器可重新上線使用,那么您可以將其設(shè)定為新的備份服務(wù)器 - 事實上就是對調(diào)兩臺服務(wù)器的角色。
<!--[if !supportLists]--> 第二章 <!--[endif]--> 測試目的
主要測試 SQL SERVER 企業(yè)版日志自動傳送、自動裝載功能、主運行服務(wù)器與備份服務(wù)器的角色切換功能及通過監(jiān)視服務(wù)器對日志傳送及備份服務(wù)器進(jìn)行維護(hù)。
<!--[if !supportLists]--> 第三章 <!--[endif]--> 測試 結(jié)果評判標(biāo)準(zhǔn)
將 SQL SERVER 主服務(wù)器上數(shù)據(jù)庫的內(nèi)容自動傳送并應(yīng)用到備份服務(wù)器的數(shù)據(jù)庫上。
<!--[if !supportLists]--> 第四章 <!--[endif]--> 測試環(huán)境
WINDOWS 2000 , <chmetcnv tcsc="0" numbertype="1" negative="False" hasspace="False" sourcevalue="512" unitname="m" w:st="on"><span lang="EN-US">512M</span></chmetcnv> Mem , 1CPU ,局域網(wǎng), IP : 172.17.8.222 以下簡稱 222
WINDOWS 2000 , <chmetcnv tcsc="0" numbertype="1" negative="False" hasspace="False" sourcevalue="512" unitname="m" w:st="on"><span lang="EN-US">512M</span></chmetcnv> Mem , 1CPU ,局域網(wǎng), IP : 172.17.8.220 以下簡稱 220
SQL SERVER2000 企業(yè)版
<!--[if !supportLists]--> 第五章 <!--[endif]--> 日志傳送和加載的測試過程
<!--[if !supportLists]--> 5.1 <!--[endif]--> 設(shè)定日志傳送的各種服務(wù)器:
主服務(wù)器 (primary server) 即是實際處理業(yè)務(wù)的主運行服務(wù)器。這里設(shè)定 222 為主服務(wù)器。備份服務(wù)器 (secondary server) 上存放日志傳送的目的數(shù)據(jù)庫,用來復(fù)制與回存來主運行數(shù)據(jù)庫的日志文件。這里設(shè)定 220 為備份服務(wù)器。監(jiān)控服務(wù)器 (monitor server) 用來監(jiān)控主服務(wù)器與備份服務(wù)器。這里設(shè)定 220 為備份服務(wù)器。 SQL Server 2000 使用 Enterprise Manager 的日志傳送監(jiān)控工具來監(jiān)控每一組傳送中的日志資料。 Microsoft 建議將監(jiān)控用服務(wù)器安裝在另一臺服務(wù)器。
<!--[if !supportLists]--> 5.2 <!--[endif]--> 日志傳送工具:
在 SQL SERVER2000 中日志傳送的配置工作只能由向?qū)瓿桑荒苁褂镁幋a實現(xiàn)。
開始前要做的一些檢查或操作:
1. 檢查所有服務(wù)器的權(quán)限設(shè)置,用來設(shè)定日志傳送的 Windows 帳號必須擁有所有服務(wù)器上 SQL Server 系統(tǒng)管理者 (sa) 的權(quán)限。
2. 在主 / 備份服務(wù)器上建立共享文件夾。首先,將來主運行數(shù)據(jù)庫日志文件所在的目錄設(shè)定為共享目錄。接著在備份服務(wù)器上,將打算回存日志文件的目錄也共享出來。并將這兩個共享目錄的權(quán)限開放給每一臺服務(wù)器上 SQL Agent 所使用的 Windows 帳號。這里采用 administrator 登錄,將 SQLAgent 服務(wù)指定給 administrator 用戶。
3. 建立并初始化備份數(shù)據(jù)庫。
在主數(shù)據(jù)庫上建立備份:
backup database pubs to disk='c:/pubs'
backup log pubs to disk='c:/pubslog'
在備份數(shù)據(jù)庫上:
alter database pubs set single_user
USE master
GO
RESTORE DATABASE pubs
FROM disk='c:/pubs'
WITH STANDBY = 'c:/undopubs.ldf'
RESTORE LOG PUB FROM disk=’c:/pubslog’
WITH STANDBY = 'c:/undopubs.ldf'
alter database pubs set multi_user
4. 在 Enterprise Manager 注冊此 222 和 220 這兩臺服務(wù)器。
<!--[if !supportLists]--> 5.3 <!--[endif]--> 測試過程:
在完成上面的準(zhǔn)備動作后,可以打開數(shù)據(jù)庫維護(hù)計劃向?qū)碓O(shè)定日志傳送。依據(jù)下列步驟完成:
歡迎畫面:
<!--[if gte vml 1]><v:shapetype id="_x0000_t75" coordsize="21600,21600" o:spt="75" o:preferrelative="t" path="m@4@5l@4@11@9@11@9@5xe" filled="f" stroked="f"> <v:stroke joinstyle="miter"/> <v:formulas> <v:f eqn="if lineDrawn pixelLineWidth 0"/> <v:f eqn="sum @0 1 0"/> <v:f eqn="sum 0 0 @1"/> <v:f eqn="prod @2 1 2"/> <v:f eqn="prod @3 21600 pixelWidth"/> <v:f eqn="prod @3 21600 pixelHeight"/> <v:f eqn="sum @0 0 1"/> <v:f eqn="prod @6 1 2"/> <v:f eqn="prod @7 21600 pixelWidth"/> <v:f eqn="sum @8 21600 0"/> <v:f eqn="prod @7 21600 pixelHeight"/> <v:f eqn="sum @10 21600 0"/> </v:formulas> <v:path o:extrusionok="f" gradientshapeok="t" o:connecttype="rect"/> <o:lock v:ext="edit" aspectratio="t"/> </v:shapetype><v:shape id="_x0000_i1028" type="#_x0000_t75" style='width:281.25pt; height:229.5pt'> <v:imagedata src="file:///C:/DOCUME~1/user/LOCALS~1/Temp/msohtml1/01/clip_image001.png" o:title="未命名"/> </v:shape><![endif]--><!--[if !vml]-->
<!--[endif]-->
在下面的對話框中選取數(shù)據(jù)庫:勾選“將事務(wù)日志傳送到。。。。。。
<!--[if gte vml 1]><v:shape id="_x0000_i1029" type="#_x0000_t75" style='width:327pt;height:279pt'> <v:imagedata src="file:///C:/DOCUME~1/user/LOCALS~1/Temp/msohtml1/01/clip_image003.png" o:title="2"/> </v:shape><![endif]--><!--[if !vml]-->
<!--[endif]-->
下列這三個步驟什么都不選:即連點三下“下一步“
在下面的存儲事務(wù)日志的對話框中選擇共享的目錄。
<!--[if gte vml 1]><v:shape id="_x0000_i1030" type="#_x0000_t75" style='width:373.5pt;height:287.25pt'> <v:imagedata src="file:///C:/DOCUME~1/user/LOCALS~1/Temp/msohtml1/01/clip_image005.gif" o:title="6"/> </v:shape><![endif]--><!--[if !vml]-->
<!--[endif]-->
選擇網(wǎng)絡(luò)共享:在主服務(wù)器上選擇。
<!--[if gte vml 1]><v:shape id="_x0000_i1031" type="#_x0000_t75" style='width:373.5pt;height:287.25pt'> <v:imagedata src="file:///C:/DOCUME~1/user/LOCALS~1/Temp/msohtml1/01/clip_image006.gif" o:title="7"/> </v:shape><![endif]--><!--[if !vml]-->
<!--[endif]-->
接下來選擇指定記錄傳送目的地:點選【 Add 】按鈕后可開啟『新增目的數(shù)據(jù)庫』對話框。
里面的信息都是關(guān)于備份服務(wù)器的信息:
【服務(wù)器名稱】下拉式選單會列出您在先前準(zhǔn)備工作中曾利用 Enterprise Manager 所注冊的 Secondary Server 名稱。在【目錄】文字字段里,請輸入 Secondary Server 的目錄名稱,用以接收來源數(shù)據(jù)庫日志文件復(fù)本。注意此名稱為本地端路徑名稱,而不是分享目錄名稱。
有關(guān)數(shù)據(jù)庫的裝載狀態(tài),您有兩種選項可以設(shè)定:無恢復(fù)模式 (No recovery mode) 與備用模式 (Standby mode) 。所謂的『無恢復(fù)模式』表示使用者將無法進(jìn)行備份數(shù)據(jù)庫的查詢,唯一可執(zhí)行的動作只有回存日志文件。而『備用模式』則是將數(shù)據(jù)庫設(shè)定成只讀狀態(tài)只要不是在回存數(shù)據(jù)庫的時候,您都可以查詢備份數(shù)據(jù)庫中的內(nèi)容。窗口內(nèi)還有一個【終止數(shù)據(jù)庫中的使用者 ( 建議選項 ) 】選項,會在回存數(shù)據(jù)庫或是回存日志文件時發(fā)生動作。在回存數(shù)據(jù)庫或是日志文件時,『回存程序』將是數(shù)據(jù)庫內(nèi)唯一的使用者。所以, Microsoft 建議您勾選此選項,否則其他使用者可能會影響回存動作的進(jìn)行。這里選擇此選項。
<!--[if gte vml 1]><v:shape id="_x0000_i1032" type="#_x0000_t75" style='width:303pt;height:363pt'> <v:imagedata src="file:///C:/DOCUME~1/user/LOCALS~1/Temp/msohtml1/01/clip_image007.gif" o:title="9"/> </v:shape><![endif]--><!--[if !vml]-->
<!--[endif]-->
接下來連按幾次“下一步“即完成設(shè)置。
注:日志傳送的設(shè)置可以在設(shè)置完成后點擊“維護(hù)計劃“的屬性中修改上述設(shè)置。
<!--[if !supportLists]-->
第六章
<!--[endif]-->
日志傳送監(jiān)視器的測試過程
<!--[if !supportLists]--> 6.1 <!--[endif]--> 設(shè)置日志傳送監(jiān)視器
在服務(wù)器上執(zhí)行下列存儲過程,監(jiān)視日志傳送。 運行 sp_add_log_shipping_primary 以通知監(jiān)視服務(wù)器哪臺計算機(jī)在日志傳送對中是主服務(wù)器。存儲過程的輸出將是 primary_id ,它將用于 sp_add_log_shipping_secondary 存儲過程。運行 sp_add_log_shipping_secondary 以通知監(jiān)視服務(wù)器哪臺計算機(jī)在日志傳送對中是輔助服務(wù)器。下例為數(shù)據(jù)庫的現(xiàn)有日志傳送對設(shè)置日志傳送監(jiān)視器。在手工設(shè)置該監(jiān)視器之前,必須已使用數(shù)據(jù)庫維護(hù)計劃向?qū)гO(shè)置了日志傳送。注意,在向?qū)гO(shè)置過程中也要創(chuàng)建監(jiān)視器。
EXEC sp_add_log_shipping_primary
@primary_server_name = 'MyPrimaryServer',
@primary_database_name = 'Northwind',
@maintenance_plan_id = '9B4E380E-11D2-41FC-9BA5-A8EB<chmetcnv tcsc="0" numbertype="1" negative="False" hasspace="False" sourcevalue="40" unitname="a" w:st="on">040A</chmetcnv>3DEF',
@backup_threshold = 15,
@threshold_alert = 14420,
@threshold_alert_enabled = 1,
@planned_outage_start_time = 0,
@planned_outage_end_time = 0,
@planned_outage_weekday_mask = 0
EXEC sp_add_log_shipping_secondary
@primary_id = 1,
@secondary_server_name = 'MySecondaryServer',
@secondary_database_name = 'Northwind',
@secondary_plan_id = 'B<chmetcnv tcsc="0" numbertype="1" negative="False" hasspace="False" sourcevalue="5" unitname="C" w:st="on">5C</chmetcnv>330FF-1081-4FCB-83D0-955DDFB56BA5',
@copy_enabled = 1,
@load_enabled = 1,
@out_of_sync_threshold = 15,
@threshold_alert = 14421,
@threshold_alert_enabled = 1,
@planned_outage_start_time = 0,
@planned_outage_end_time = 0,
@planned_outage_weekday_mask = 0,
@allow_role_change = 0
GO
<!--[if !supportLists]--> 6.2 <!--[endif]--> 日志傳送的監(jiān)視:
當(dāng)您正確設(shè)定日志傳送之后,
SQL
SERVER
會激活監(jiān)控服務(wù)器上
Enterprise Manager
的日志傳送監(jiān)控工具程序。此外,
SQL
SERVER
會建立兩個
SQL Agent
警示工作
(alert job)
:一個用來執(zhí)行工作,另一個處理同步偏離情況。使用監(jiān)控工具程序的方式是,開啟
Enterprise Manager
并連至監(jiān)控服務(wù)器,展開【
Management
】節(jié)點,然后點選【日志傳送監(jiān)視器
(Log Shipping Monitor)
】。當(dāng)您點選此工具程序時,其內(nèi)會列出日志傳送配對服務(wù)器的清單。您可在配對服務(wù)器上按下右鍵,監(jiān)視其備份、復(fù)制與回存等工作的執(zhí)行歷史紀(jì)錄。這些歷史紀(jì)錄十分有用,因為您從這里得到的錯誤訊息會比從次要服務(wù)器上
(SQL Agent
復(fù)制與回存工作
)
得到的更為詳盡。
如圖所示:當(dāng)您開啟配對服務(wù)器之屬性對話框,并進(jìn)入【狀態(tài)】設(shè)定頁時,您可監(jiān)視此配對服務(wù)器執(zhí)行備份與回存程序之狀態(tài)。日志文件名為
first_file_000000000000.trn
。這并不是實際的文件名稱,只不過是用來標(biāo)示
Agent
尚未處理任何檔案而已。在【狀態(tài)】設(shè)定頁也會顯示備份、復(fù)制以及加載
(
回存
)
等動作執(zhí)行時所耗費的時間。此設(shè)定頁之信息不會自動更新,所以您必須將此對話盒關(guān)閉后再開啟,才能更新其資料。
<!--[if gte vml 1]><v:shape id="_x0000_i1034" type="#_x0000_t75" style='width:347.25pt;height:404.25pt'> <v:imagedata src="file:///C:/DOCUME~1/user/LOCALS~1/Temp/msohtml1/01/clip_image008.gif" o:title="a"/> </v:shape><![endif]--><!--[if !vml]-->
<!--[endif]-->
在下面這兩個對話框中可以查看在主運行服務(wù)器上的事務(wù)日志備份情況和在備份服務(wù)器上日志復(fù)制和日志裝載的情況。
<!--[if gte vml 1]><v:shape id="_x0000_i1035" type="#_x0000_t75" style='width:310.5pt;height:306.75pt'> <v:imagedata src="file:///C:/DOCUME~1/user/LOCALS~1/Temp/msohtml1/01/clip_image009.png" o:title="b"/> </v:shape><![endif]--><!--[if !vml]-->
<!--[endif]-->
<!--[if gte vml 1]><v:shape id="_x0000_i1036" type="#_x0000_t75" style='width:318pt;height:321pt'> <v:imagedata src="file:///C:/DOCUME~1/user/LOCALS~1/Temp/msohtml1/01/clip_image011.png" o:title="c"/> </v:shape><![endif]--><!--[if !vml]-->
<!--[endif]-->
<!--[if !supportLists]--> 第七章 <!--[endif]--> 日志傳送角色轉(zhuǎn)變的測試過程
日志傳送支持角色轉(zhuǎn)變,而角色轉(zhuǎn)變需要下列基本步驟:
一、創(chuàng)建數(shù)據(jù)轉(zhuǎn)換服務(wù) (DTS) 包,將當(dāng)前的主服務(wù)器復(fù)制到當(dāng)前的輔助服務(wù)器。
二、創(chuàng)建作業(yè),從當(dāng)前的主服務(wù)器備份 syslogins ,并將文件復(fù)制到當(dāng)前的輔助服務(wù)器的某個目錄下,然后執(zhí)行該 DTS 包。
三、執(zhí)行角色更改,使當(dāng)前的輔助服務(wù)器成為當(dāng)前的主服務(wù)器。
在執(zhí)行日志傳送角色更改前,該日志傳送對的維護(hù)計劃必須在輔助服務(wù)器上已經(jīng)存在。可以使用數(shù)據(jù)庫維護(hù)計劃向?qū)?chuàng)建維護(hù)計劃,或者通過使用主數(shù)據(jù)庫維護(hù)計劃用戶界面上的 " 添加輔助服務(wù)器 " 對話框來添加輔助服務(wù)器。
<!--[if !supportLists]--> 7.1 <!--[endif]--> 創(chuàng)建 DTS 包
使用 DTS 設(shè)計器在當(dāng)前的主服務(wù)器上創(chuàng)建 DTS 包。將登錄從當(dāng)前的主服務(wù)器復(fù)制到當(dāng)前的輔助服務(wù)器。該包應(yīng)使用位于設(shè)計器任務(wù)列表中的 " 傳輸?shù)卿浫蝿?wù) " 。
在 " 源 " 服務(wù)器列表中的 " 源 " 選項卡上的 " 傳輸?shù)卿? " 對話框內(nèi),輸入源服務(wù)器(當(dāng)前的主服務(wù)器)。
<!--[if gte vml 1]><v:shape id="_x0000_i1037" type="#_x0000_t75" style='width:372.75pt;height:240.75pt'> <v:imagedata src="file:///C:/DOCUME~1/user/LOCALS~1/Temp/msohtml1/01/clip_image013.png" o:title="1"/> </v:shape><![endif]--><!--[if !vml]-->
<!--[endif]-->
單擊 " 使用 Windows 身份驗證 " 或 " 使用 SQL Server 身份驗證 " 。
在 " 目的服務(wù)器 " 列表的 " 目的 " 選項卡上,輸入目的服務(wù)器(當(dāng)前的輔助服務(wù)器)。
單擊 " 使用 Windows 身份驗證 " 或 " 使用 SQL Server 身份驗證 " 。
在 " 登錄 " 選項卡上,單擊 " 包運行時檢測到的所有服務(wù)器登錄 " 或 " 選定數(shù)據(jù)庫的登錄 " 。
保存該包。
<!--[if !supportLists]--> 7.2 <!--[endif]--> 創(chuàng)建作業(yè)
從當(dāng)前的主服務(wù)器備份 syslogins 文件,并將文件復(fù)制到當(dāng)前的輔助服務(wù)器的某個目錄下,然后執(zhí)行該 DTS 包。選擇 " 新建作業(yè) " 以打開 " 常規(guī) " 選項卡上的 " 新建作業(yè)屬性 " 對話框。在當(dāng)前的主服務(wù)器上,創(chuàng)建由 sa 擁有的作業(yè),或由對兩臺服務(wù)器都擁有 sysadmin 權(quán)限的登錄。
<!--[if gte vml 1]><v:shape id="_x0000_i1038" type="#_x0000_t75" style='width:449.25pt;height:240.75pt'> <v:imagedata src="file:///C:/DOCUME~1/user/LOCALS~1/Temp/msohtml1/01/clip_image015.png" o:title="1"/> </v:shape><![endif]--><!--[if !vml]-->
<!--[endif]-->
<!--[if gte vml 1]><v:shape id="_x0000_i1027" type="#_x0000_t75" style='width:449.25pt;height:240.75pt'> <v:imagedata src="file:///C:/DOCUME~1/user/LOCALS~1/Temp/msohtml1/01/clip_image017.png" o:title="2"/> </v:shape><![endif]--><!--[if !vml]-->
<!--[endif]-->
在 " 步驟 " 選項卡上單擊 " 新建 " 按鈕以打開 " 新建作業(yè)步驟 " 對話框,然后創(chuàng)建下列作業(yè)步驟:
向外大容量復(fù)制
<!--[if gte vml 1]><v:shape id="_x0000_i1025" type="#_x0000_t75" style='width:366pt;height:264pt'> <v:imagedata src="file:///C:/DOCUME~1/user/LOCALS~1/Temp/msohtml1/01/clip_image019.png" o:title="11"/> </v:shape><![endif]--><!--[if !vml]-->
<!--[endif]-->
在 " 類型 " 列表中,選擇 " 操作系統(tǒng)命令 (CmdExec)" 選項。在 " 命令 " 文本框內(nèi)輸入如下命令:
bcp master..syslogins out localpath/syslogins.dat /N /S current_primary_servername /U sa /P sa_password
單擊 " 高級 " 選項卡,然后在 " 成功時操作 " 列表中選擇 " 轉(zhuǎn)到下一步 " 。在 " 失敗時操作 " 列表中選擇 " 退出報告失敗的作業(yè) " 。
復(fù)制文件
<!--[if gte vml 1]><v:shape id="_x0000_i1026" type="#_x0000_t75" style='width:366pt;height:264pt'> <v:imagedata src="file:///C:/DOCUME~1/user/LOCALS~1/Temp/msohtml1/01/clip_image021.png" o:title="12"/> </v:shape><![endif]--><!--[if !vml]-->
<!--[endif]-->
在 " 類型 " 列表中,選擇 "Transact-SQL 腳本 (T-SQL)" 。在 " 數(shù)據(jù)庫 " 列表中,指定 master 。在 " 命令 " 文本框內(nèi)輸入如下命令:
EXEC xp_cmdshell 'copy localpath/syslogins.dat destination_share'
單擊 " 高級 " 選項卡,然后在 " 成功時操作 " 列表中選擇 " 轉(zhuǎn)到下一步 " 。在 " 失敗時操作 " 列表中選擇 " 退出報告失敗的作業(yè) " 。
傳輸?shù)卿?
<!--[if gte vml 1]><v:shape id="_x0000_i1033" type="#_x0000_t75" style='width:366pt;height:264pt'> <v:imagedata src="file:///C:/DOCUME~1/user/LOCALS~1/Temp/msohtml1/01/clip_image023.png" o:title="13"/> </v:shape><![endif]--><!--[if !vml]-->
<!--[endif]-->
在 " 類型 " 列表中,選擇 " 操作系統(tǒng)命令 (CmdExec)" 選項。在 " 命令 " 文本框內(nèi)輸入如下命令:
DTSRun /Scurrent_primary_server /Uuser_nName /Ppassword /Npackage_name /Mpackage_password
在 " 新建作業(yè)屬性 " 對話框中單擊 " 調(diào)度 " 選項卡,然后創(chuàng)建運行一次或反復(fù)運行的作業(yè)調(diào)度。
<!--[if !supportLists]--> 7.3 <!--[endif]--> 執(zhí)行角色轉(zhuǎn)變
必須由 SQL Server 管理員執(zhí)行服務(wù)器角色轉(zhuǎn)變。在標(biāo)記為當(dāng)前主服務(wù)器的 SQL Server 實例上運行 sp_change_primary_role 。下例顯示如何使主數(shù)據(jù)庫不再是主數(shù)據(jù)庫。 current_primary_dbname 是當(dāng)前主數(shù)據(jù)庫的名稱。
EXEC sp_change_primary_role
@db_name = 'current_primary_dbname',
@backup_log = 1,
@terminate = 0,
@final_state = 2,
@access_level = 1
GO
在標(biāo)記為當(dāng)前輔助服務(wù)器的 SQL Server 實例上運行 sp_change_secondary_rol 。下例顯示如何使輔助數(shù)據(jù)庫成為主數(shù)據(jù)庫。 current_secondary_dbname 是當(dāng)前輔助數(shù)據(jù)庫的名稱。
EXEC sp_change_secondary_role
@db_name = 'current_secondary_dbname',
@do_load = 1,
@force_load = 1,
@final_state = 1,
@access_level = 1,
@terminate = 1,
@stopat = NULL
GO
在標(biāo)記為監(jiān)視器的 SQL Server 實例上運行 sp_change_monitor_role 。下例顯示如何更改監(jiān)視器以反映新的主數(shù)據(jù)庫。 new_source_directory 是主服務(wù)器轉(zhuǎn)儲事務(wù)日志的位置的路徑。
EXEC sp_change_monitor_role
@primary_server = 'current_primary_server_name',
@secondary_server = 'current_secondary_server_name',
@database = 'current_secondary_dbname',
@new_source = 'new_source_directory'
GO
在現(xiàn)在標(biāo)記為主服務(wù)器(從前的輔助服務(wù)器)的 SQL Server 實例上運行 sp_resolve_logins 。必須從目標(biāo)數(shù)據(jù)庫運行存儲過程。
下例顯示如何用從前的主服務(wù)器中的登錄解析新的主服務(wù)器上的登錄。 destination_path 是在復(fù)制文件作業(yè)步驟中指定的目的共享。 filename 與 BCP 輸出作業(yè)步驟中指定的相同, dbname 為新主數(shù)據(jù)庫的名稱。
EXEC sp_resolve_logins
@dest_db = 'dbname',
@dest_path = 'destination_path',
@filename = 'filename'
GO
<!--[if !supportLists]--> 第八章 <!--[endif]--> 測試結(jié)論
根據(jù)對 SQL SERVER 日志傳送功能的測試情況,可以看出 SQL SERVER2000 企業(yè)版中大大加強(qiáng)了數(shù)據(jù)庫可用性這方面的功能。備份數(shù)據(jù)庫不但增加了數(shù)據(jù)庫的可用性,而且在主運行數(shù)據(jù)庫處于高峰時也可以分擔(dān)一些查詢方面的業(yè)務(wù)。但目前 SQL SERVER2000 企業(yè)版中的日志傳送功能還只能利用數(shù)據(jù)庫維護(hù)計劃向?qū)硗瓿桑霈F(xiàn)錯誤不容易調(diào)試。另外主服務(wù)器和備份服務(wù)器進(jìn)行角色切換的過程比較復(fù)雜,且不易成功。當(dāng)切換成功后,從前的輔助服務(wù)器現(xiàn)在是當(dāng)前的主服務(wù)器,并準(zhǔn)備承擔(dān)主服務(wù)器的功能。而從前的主服務(wù)器已不再是日志傳送對的一方了。必須將從前的主服務(wù)器作為輔助服務(wù)器添加到新的主服務(wù)器,才能在兩個數(shù)據(jù)庫之間建立日志傳送對。目前,原主服務(wù)器變化備份服務(wù)器一過程并不能自動切換。
<!--[if !supportLists]--> 第九章 <!--[endif]--> 附件
無
更多文章、技術(shù)交流、商務(wù)合作、聯(lián)系博主
微信掃碼或搜索:z360901061

微信掃一掃加我為好友
QQ號聯(lián)系: 360901061
您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點擊下面給點支持吧,站長非常感激您!手機(jī)微信長按不能支付解決辦法:請將微信支付二維碼保存到相冊,切換到微信,然后點擊微信右上角掃一掃功能,選擇支付二維碼完成支付。
【本文對您有幫助就好】元
