Posts Tagged ‘database’
Access SQL server database of any version of SharePoint Standalone farm
I assume you know if we want to install SharePoint in a Workgroup environment, the only recommended Microsoft solution is to install SharePoint standalone server. Here SQL server embedded edition is installed with SharePoint server and SharePoint databases are created on this Embedded SQL server.
Normally we don’t perform any task on these SQL databases but incase if you want to access sharepoint databases for backup, troubleshoot, etc, you need to install SQL server management studio to achieve the same.
- Install SQL server Management studio. You can download the management studio from below link:
http://www.microsoft.com/en-in/download/confirmation.aspx?id=29062
-
Once installation is completed, open SQL Studio management studio
Once We have management studio installed, you can either use below registry value or servername\sharepoint to access database. Make sure you use SharePoint farm account when you connect to SQL server.
- Go to below registry path:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL10_50.SHAREPOINT\MSSQLServer\SuperSocketNetLib\Np
2. Use the value in key “PipeName” to connect to SharePoint database server. As discussed above you can also use servername\sharepoint to connect to SQL instance
Note: You need to install SQL server management studio on SharePoint server. You cannot remote connect to this SQL instance. Do not manually modify any SharePoint database, if modified, your farm\database would be unsupported
Applies to all version of SharePoint servers
Steps to configure RBS on multiple content database in SharePoint 2013 with SQL server 2012 or 2014
Hi Friends,
Today we will try to understand how to configure RBS(Remote Blob Service) on single or multiple content databases in SharePoint 2013 with SQL server 2012 or 2014. Steps are nearly same with both SQL server but make sure you use the correct msi file. For SQL serve 2012 size of msi file would be 5120 kb which can be downloaded from here . For SQL serve 2014 size of msi file would be 4380 kb which can be downloaded from SQL server 2014 feature pack here
Once you have downloaded the file save it on empty folder on c: or d: drive
- Once database is created from SharePoint server, execute below command on SQL server
EXEC sp_configure filestream_access_level, 2
RECONFIGURE
- Then we need to select the content database from top and execute below command(password can be changed)
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′
- Now you need to execute below command on content database(wss_content5 database name needs to be changed)
if not exists (select groupname from sysfilegroups where groupname=N’RBSFilestreamProvider’)alter database [WSS_Content5] add filegroup RBSFilestreamProvider contains filestream
- Now we will add the physical path of RBS datafiles to content database. You can change the database name and filepath
alter database [WSS_Content5] add file (name = RBSFilestreamFile, filename = ‘C:\Blobstore5’) to filegroup RBSFilestreamProvider
- Now you need to run below command on Windows Powershell (run as admin). Go to folder which has the rbs.msi file we downloaded.(Make note of FilestreamProvider name. Change SQL servaer and content databasename)
msiexec /qn /lvx* rbs_install_log_db5.txt /i RBS.msi TRUSTSERVERCERTIFICATE=true FILEGROUP=PRIMARY DBNAME=”WSS_Content5″ DBINSTANCE=”SQLservername” FILESTREAMFILEGROUP=RBSFilestreamProvider FILESTREAMSTORENAME=FilestreamProvider
If you see the rbs_install_log_db5.txt file to be less then 1000 kb, e.g. 482 kb, it means it didn’t work. If this has worked fine you will see above 1000 kb e.g. 1218 kb.
You can also validate that rbs related tables are added to database as shown below.
Note: if you face issues while running command, try to reboot both SQL and SharePoint server. I know this is not a solution but a workaround to the known issue you might get. You can also try SQL service restart and iisreset on sharepoint server. You may also check eventviewer log to find symptoms of the issue.
6. On SharePoint server run below command on windows powershell:
msiexec /qn /lvx* rbs_install_log.txt /x RBS.msi DBNAME=”WSS_Content5″ DBINSTANCE=”SQLservername” ADDLOCAL=”Client,Docs,Maintainer,ServerScript,FilestreamClient,FilestreamServer”
Note: if you face issues while running command, try to reboot both SQL and SharePoint server. I know this is not a solution but a workaround to the known issue you might get. You can also try SQL service restart and iisreset on sharepoint server. You may also check eventviewer log to find symptoms of the issue.
- Now run below command 1 by 1 in SharePoint powershell and update the active providername and enable the RBS on content DB.
$cdb = Get-SPContentDatabase –WebApplication http://testspimgweb01
$rbss = $cdb.RemoteBlobStorageSettings
$rbss.Installed()
$rbss.Enable()
$rbss.SetActiveProviderName($rbss.GetProviderNames()[0])
To migrate existing content (Make sure you run this even if you don’t have any existing data.)
$rbss.Migrate()
Note: Also every database in web application needs RBS to be enabled or above command will fail.
- Now if you create site collection and upload a file, you will observe it is moved to this folder you created with SQL command in step 4.
Note: You need to run these command for every content database you want enable RBS on.
Troubleshooting: When you run these command, you might face permission issues. To resolve these issue make sure you have full access on C:\Program Files\Common Files\microsoft shared and registry. When you run these command, you may not find the error in the log file so run the rbs.msi file and make sure you find all the permission issue in GUI. Many a time when you assign permission on root folder on drive or key in registry, it will not be inherit to subfolder. Make sure you go to the folder shown in error and assign owner permission.
Hope this was helpful.