SharePoint 2016 Content Database

Delroy Canton 1 Reputation point
2021-10-06T15:00:38.92+00:00

I'm currently running a SharePoint 2016 Site Collecting with one SharePoint server and two SQL Server 2014. Additionally, running the cmdlet Get-SPContentDatabase show two content databases. One show CurrentSiteCount = 1, the other -1. What does -1 mean? I am unable to use/access the content database with the CurrentSiteCount = 1. How do I correct this issue. Any help will be sorely grateful.

SQL Server Analysis Services
SQL Server Analysis Services
A Microsoft online analytical data engine used in decision support and business analytics, providing the analytical data for business reports and client applications such as Power BI, Excel, Reporting Services reports, and other data visualization tools.
1,258 questions
SharePoint Development
SharePoint Development
SharePoint: A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.Development: The process of researching, productizing, and refining new or existing technologies.
2,789 questions
{count} votes

3 answers

Sort by: Most helpful
  1. CaseyYang-MSFT 10,341 Reputation points
    2021-10-07T03:07:53.553+00:00

    Hi @Delroy Canton ,

    Did you get any error message when access the content database with the CurrentSiteCount = 1? Is there anything has been changed before the issue occurs?

    1.Take a full SQL backup of the Administration Application content database.
    2.Run stsadm –o deletecontentdatabase –url http://myurl:myport –databasename olddatabasename
    3.Run SQL Management Studio and Detach the old content database. Either delete it, or move it to a new location. Don’t forget to do the same with the transaction logs
    4.Restore the content database backed up in 1 to a new name (preferably without GUIDS). Watch the filenames (under the options tab) and use the overwrite option
    5.Run stsadm –o addcontentdatabase –url http://myurl:myport –databasename newdatabasename

    For Reference: SharePoint Loses Access to Central Admin Content Database
    Note: Microsoft is providing this information as a convenience to you. The sites are not controlled by Microsoft. Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. Please make sure that you completely understand the risk before retrieving any suggestions from the above link.


    If an Answer is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


  2. Delroy Canton 1 Reputation point
    2021-10-12T15:23:42.357+00:00

    Dear CaseyYangMSFT-4714, thank you very much for your comments and suggestions. Interestingly enough, I did a little more digging and discovered that the named instance in SQL had some how reverted to the default instance of MSSQLSERVER. I then ran the following query in SQL

    sp_helpserver
    select @@servername

    and got

    Msg 15205, Level 16, State 1, Procedure sp_helpserver , line 17
    There are no servers defined.

    I then ran the SQL server setup again and created a new named instance but I'm still getting the above error "There are no servers defined." Next I ran the following query

    sp_addserver 'new_name','local'
    go

    net stop mssqlserver

    net start mssqlserver

    This time when I re-run the query
    sp_helpserver
    select @@servername

    I get the correct name server without the \ instance_name.

    So, I then tried running the following:

    sp_dropserver 'server_name'
    GO
    sp_addserver 'servername\instance_name
    GO

    However, the return says "Msg 102, Level 15 State 1, Line 5
    Incorrect syntax near '\'.

    The '\' is required to denote the instance but SQL throughs a syntax error. I have other server\instances with the '\'. Any help in resolving this issue will be very grateful.

    V/r,

    Delroy

    0 comments No comments

  3. Delroy Canton 1 Reputation point
    2021-10-12T17:37:16.887+00:00

    Dear CaseyYangMSFT-4714, here is an updated status with regards to my issue. In the process of attempting to correct the instance name issue in SQL, I now have two SQL server instances. The new server_name\server_instance shows correctly but only contains the default database structure. The old server_name is also listed in the tree and still contains all my data. So, what is the best course of action to get all of the old data over to the new server_name\server_instance and connecting to SharePoint?