Posts

Showing posts with the label Database

Cannot connect to database master at SQL Server at server_name. The database might not exist, or the current user does not have permission to connect to it Error SharePoint 2016

Image
Cannot connect to database master at SQL Server at server_name. The database might not exist, or the current user does not have permission to connect to Error : "Cannot connect to database master at SQL Server at server_name. The database might not exist, or the current user does not have permission to connect to it"  Solution : Open the Windows Firewall with Advanced Services and add an inbound rule to allow traffic over port 1433. https://youtu.be/GIwcnNZWui4

Migrate SharePoint Databases

To Migrate SharePoint DBs from SQL Server to another either same version or to a new version (2008 to 2008 or 2008 to 2012) you can follow the following steps: Stop all SharePoint and IIS Related Services. Stop IIS. Detach all related SQL Server databases. Configuration database Central Administration content database Content databases Service application databases   Move all database files (.mdf, .ldf, and .ndf) to the new server. Set up same user permissions on the new SQL server. Attach your databases to the new SQL Server. Verify ports in your new SQL server. Go to your SharePoint server and create your SQL Server Alias. Start all your SharePoint services.

Configure SQL Mirroring

Image
There are 3 different types of SQL Mirroring options available for use: 1. High Performance – Asynchronous (this requires the Enterprise Edition) 2. High Safety without Automatic Failover 3. High Safety with Automatic Failover (this requires a witness server running the same SQL version) All three require roughly the same steps: * Ensure the same login accounts are present on the Principal and the Mirror * Backup the Principal DB and Logs * Restore on the Mirror * Configure the Mirroring Endpoints * Set the partner on the Mirror * Set the partner on the Principal (and the witness if necessary) So lets work through the steps above…… Get our login’s in order To get our accounts in order between our two servers we can run the following SQL script to give us an output to run on our mirror. SELECT ‘create login [‘ + p.name + ‘] ‘ + case when p.type in(‘U’,’G’) then ‘from windows ‘ else ” end + ‘with ‘ + case when p.type = ‘S’ then ‘password = ‘ + master.sys.fn_varbintohe...

Get Database Size for all SharePoint Data Bases using PowerShell

Add-PSSnapin microsoft.sharepoint.powershell $size = 0 foreach ($db in Get-SPContentDatabase) {     $size = $size + $db.DiskSizeRequired } $cdbs = "{0:N2}" -f($size/1gb) $ssa = Get-SPEnterpriseSearchServiceApplication $topo = $ssa | Get-SPEnterpriseSearchTopology  -Active $indexcomponent = (Get-SPEnterpriseSearchComponent -SearchTopology $topo | ?{$_.name -like "*index*"})[0] $folder = $indexcomponent.RootDirectory $indexsize = "{0:N2}" -f ((Get-ChildItem $folder -Recurse | Measure-Object -sum  Length).sum/1GB) $dbs = Get-SPDatabase cls write-host "--------------------------------------------------------------------------------------" -fore green Get-Date write-host "" write-host "--------------------------------------------------------------------------------------" -fore green write-host "SUM: Content DB Size in GB: " -NoNewline -fore White write-host $cdbs -fore Yellow write-host "-------...