在 SharePoint Server 中利用 FILESTREAM 設定內容資料庫以使用 RBSSet a content database to use RBS with FILESTREAM in SharePoint Server

摘要: 了解如何使用 FILESTREAM 來設定 SharePoint Server 2016 和 SharePoint 2013 內容資料庫以使用遠端 BLOB 儲存 (RBS)。Summary: Learn how to set a SharePoint Server 2016 and SharePoint 2013 content database to use Remote BLOB Storage (RBS) with FILESTREAM.

本文描述如何設定內容資料庫以使用 FILESTREAM 提供者的遠端 BLOB 儲存 (RBS)。如果您使用協力廠商提供者,這些指示可能就不適用。如需詳細資訊,請連絡提供者製造商。這些指示假設您已經安裝 RBS 以便與 SharePoint Server 搭配使用。若要安裝和設定 RBS,請參閱在 SharePoint Server 伺服器陣列中使用 FILESTREAM 來安裝和設定 RBSThis article describes how to set a content database to use Remote BLOB Storage (RBS) that uses the FILESTREAM provider. If you are using a third-party provider, these instructions might not apply. For more information, contact the manufacturer of the provider. These instructions assume that you have already installed RBS for use with SharePoint Server. To install and configure RBS, see Install and configure RBS with FILESTREAM in a SharePoint Server farm.

開始之前Before you begin

您必須在想要設定使用 RBS 的每個內容資料庫上執行此程序。You must perform this procedure on every content database that you want to set to use RBS.

開始這項作業之前,請先檢閱下列先決條件的相關資訊:Before you begin this operation, review the following information about prerequisites:

  • 用來執行此程序的使用者帳戶是網頁伺服器上 Administrators 群組的成員。The user account that you use to perform this procedure is a member of the Administrators group on the Web.

  • 用來執行此程式的使用者帳戶是執行 SQL Server 2014 Service Pack 1 (SP1)、SQL Server 2008 R2 Service Pack 1 (SP1)、SQL Server 2012 或 SQL Server 2014 之電腦上 SQL Server dbcreatorsecurityadmin 固定伺服器角色的成員。The user account that you use to perform this procedure is a member of the SQL Server dbcreator and securityadmin fixed server roles on the computer that is running SQL Server 2014 Service Pack 1 (SP1), SQL Server 2008 R2 with Service Pack 1 (SP1), SQL Server 2012, or SQL Server 2014.

設定內容資料庫以使用 RBSSet a content database to use RBS

若要設定內容資料庫以使用 RBS,您必須在 SQL Server 中佈建二進位大型物件 (BLOB) 儲存、將內容資料庫資訊新增至前端或應用程式伺服器上的 RBS 設定中,然後測試「RBS 資料儲存」。To set a content database to use RBS, you must provision a binary large object (BLOB) store in SQL Server, add the content database information to the RBS configuration on a front-end or application server, and then test the RBS data store.

這些指示假設您已在資料庫伺服器上安裝 SQL Server Management Studio。您可以在任何前端或應用程式伺服器上,或是伺服器陣列中的應用程式伺服器上執行下列程序。These instructions assume that you have installed SQL Server Management Studio on the database server. You can perform the following procedures on any front-end or application server in the farm.

注意

這些指示假設您使用 FILESTREAM RBS 提供者。若使用不同的 RBS 提供者,請參照提供者的指示執行這些作業。These instructions assume that you are using the FILESTREAM RBS provider. If you are using a different RBS provider, refer to that provider's instructions to perform these operations.

設定內容資料庫以使用 RBSTo set a content database to use RBS

  1. 請確認您用以執行此程序的使用者帳戶是網頁伺服器上管理員群組的成員,也是 SQL Server 2014 SP1、SQL Server 2008 R2 Service Pack 1 (SP1)、SQL Server 2012 或 SQL Server 2014 執行所在電腦上 SQL Server dbcreatorsecurityadmin 固定伺服器角色的成員。Verify that the user account that you use to perform this procedure is a member of the Administrators group on the Web server, and is a member of the SQL Server dbcreator and securityadmin fixed server roles on the computer that is running SQL Server 2014 SP1, SQL Server 2008 R2 with Service Pack 1 (SP1), SQL Server 2012, or SQL Server 2014.

  2. 啟動 SQL Server Management Studio。Open SQL Server Management Studio.

  3. 在 [連接至伺服器]**** 對話方塊中,指定您想要連接之資料庫伺服器的伺服器類型、伺服器名稱,以及驗證方法,然後按一下 [連接]*In the *Connect to Server dialog box, specify the server type, server name, and authentication method of the database server that you want to connect to, and then click Connect.

  4. 展開 [資料庫]*Expand *Databases.

  5. 在要建立「BLOB 儲存」的內容資料庫上按一下滑鼠右鍵,然後按一下 [新增查詢]*Right-click the content database for which you want to create a BLOB store, and then click *New Query.

  6. 在 [查詢]**** 窗格中,依指定順序複製並執行下列 SQL 查詢。In the Query pane, copy and execute the following SQL queries in the sequence that is provided.

    use [ContentDbName]
    if not exists (select * from sys.symmetric_keys where name = N'##MS_DatabaseMasterKey##')
    create master key encryption by password = N'Admin Key Password !2#4'
    
    use [ContentDbName]
    if not exists (select groupname from sysfilegroups where groupname=N'RBSFilestreamProvider')
    alter database [ContentDbName] add filegroup RBSFilestreamProvider contains filestream
    
    use [ContentDbName]
    alter database [ContentDbName] add file (name = RBSFilestreamFile, filename = 'c:\RBSStore') to filegroup RBSFilestreamProvider
    

    其中 [ContentDbName] 是內容資料庫的名稱,而 c:\RBSStore 是包含「RBS 資料儲存」的磁碟區\目錄名稱。請注意「RBS 儲存」只能佈建一次。如果您嘗試多次佈建相同的「RBS 資料儲存」,將會收到錯誤。Where [ContentDbName] is the content database name and c:\RBSStore is the volume\directory that will contain the RBS data store. Be aware that you can provision a RBS store only one time. If you attempt to provision the same RBS data store multiple times, you will receive an error.

    提示

    建議將「RBS 資料儲存」建立在不含作業系統、分頁檔案、資料庫檔案、記錄檔案或 tempdb 檔案的磁碟區,這是獲致最佳效能、降低疑難排解困難度的最佳作法。For best performance, simplified troubleshooting, and as a general best practice, we recommend that you create the RBS data store on a volume that does not contain the operating system, paging files, database data, log files, or the tempdb file.

  7. 在 [開始]**** 上按一下滑鼠右鍵、按一下 [執行]*、在 [執行]* 文字方塊中輸入 cmd,然後按一下 [確定]*Right-click *Start, click Run, type cmd into the Run text box, and then click OK.

  8. 在命令提示字元處,複製並貼上下列命令:Copy and paste the following command at the command prompt:

    msiexec /qn /i rbs.msi REMOTEBLOBENABLE=1 FILESTREAMPROVIDERENABLE=1 DBNAME=<ContentDbName> FILESTREAMSTORENAME=FilestreamProvider_1 ADDLOCAL=EnableRBS,FilestreamRunScript DBINSTANCE=<DBInstanceName>>
    

    其中 <ContentDbName> 是內容資料庫的名稱,而 <DBInstanceName> 是 SQL Server 的名稱。作業約一分鐘內完成。Where <ContentDbName> is the name of the content database, and <DBInstanceName> is the name of the SQL Server. The operation should finish within approximately one minute.

測試 RBS 資料存放區To test the RBS data store

  1. 連線到任何前端或應用程式伺服器上的文件庫。Connect to a document library on any front-end or application server.

  2. 上傳至少 100 KB 的檔案至文件庫。Upload a file that is at least 100 kilobytes (KB) to the document library.

  3. 在包含「RBS 資料儲存」的電腦上按一下 [開始]*,再按一下 [電腦]On the computer that contains the RBS data store, click **Start, and then click **Computer*.

  4. 瀏覽至「RBS 資料儲存」目錄。Navigate to the RBS data store directory.

  5. 找出具有最新修改日期的資料夾,而非 $FSLOG 資料夾。開啟這個資料夾,並找出具有最近修改日期的檔案。確定這個檔案具有與您上傳檔案相同的大小及內容。若非如此,請確定已經安裝並正確啟用 RBS。Locate the folder that has the most recent modification date, other than the $FSLOG folder. Open this folder and locate the file that has the most recent modification date. Verify that this file has the same size and contents as the file that you uploaded. If does not, make sure that RBS is installed and enabled correctly.

請參閱See also

概念Concepts

SharePoint Server 中的 RBS 概觀Overview of RBS in SharePoint Server

在 SharePoint Server 中將內容移入或移出 RBSMigrate content into or out of RBS in SharePoint Server

其他資源Other Resources

使用 SharePoint 2013 和 SQL Server 2012 安裝及設定 RBSInstall and configure RBS with SharePoint 2013 and SQL Server 2012