note: I'd urge you to read all the comments other users have posted before renaming your database.
During the installation and subsequent configuration of SharePoint you are provided the option of naming every database in your farm with the exception of one: The SharePoint Central Administration Database. SharePoint has a nasty habit of always naming the Central Administration database as: SharePoint_AdminContent_87c08891-c3ca-4510-963a-ca70368f37ab where that big long string of numbers and letters represents a GUID. For some, the GUID in the database name is never a concern. For others, such as myself who can be rather anal about naming conventions shiver at the thought of having a GUID in a database name.
If you have enough foresight, you can actually preempt the name SharePoint gives the Central Administration database during installation using the PSCONFIG command. Well, at least that's what I've read.
In my case, SharePoint is already installed. And I'm willing to go out on limb and say your installation is up-and-running as well.
Changing the Central Administration Database Name
Before following any of the steps outlined below, be sure to back up your databases for obvious reasons.
- Log on to your SQL Server with an account having full access; ideally, this is the same account you used for your SharePoint installation.
- Open up SQL Server Management and locate the SharePoint_AdminContent_<GUID> database and copy the name of the database for reference later. You can also find the name of the database by logging into Central Administration > Application Management > Content Databases > change the web application to SharePoint Central Administration and the database name should be the same as what you discovered in SQL Server.
- In SQL Server, back up the SharePoint_AdminContent_<GUID> database.
- Restore the database you just backed up with a human readable name such as: SharePoint_AdminContent
-
Log into SharePoint Central Administration > Application Management > Content Databases
- Change the web application to SharePoint Central Administration
- Click on the database name, which should be: SharePoint_AdminContent_<GUID>
- Select the database status: Offline
- Do Not select to delete the content database
- Click OK
-
Open up a command prompt by right clicking the command prompt icon and selecting "run as…" and the run the command prompt as the user that provisioned the database. The "run as…" user is typically a service user account that you configured SharePoint to provision the content databases when you initially installed SharePoint.
- If you usually open a command prompt using Start > Run… > cmd, then here's how you find the command prompt icon: Start > All Programs > Accessories > Command Prompt.
- It is very important to use the correct user for this step, otherwise you'll end up with an error and likely some access denied messages.
-
Once you have the command prompt open:
- Change the directory to the 12-hive bin where you can run the STSADM commands from:
C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN\
- Delete the original content database with the following STSADM command using the database with the GUID you looked up previously (be sure to change UrlOfYourCentralAdministration and NamedInstanceOfYourSqlServer to your names):
stsadm -o deletecontentdb -url http://UrlOfYourCentralAdministration -databasename SharePoint_AdminContent_<GUID> -databaseserver NamedInstanceOfYourSqlServer
- Re-Associate the backed up database with your Central Administration with the following STSADM command (be sure to change UrlOfCentralYourAdministration and NamedInstanceOfYourSqlServer to your names):
stsadm -o addcontentdb -url http:// UrlOfYourCentralAdministration -databasename SharePoint_AdminContent -databaseserver NamedInstanceOfYourSqlServer
- Open up Central Administration > Application Management > Content Databases: verify that your Central Administration database has been updated.
-
If everything is OK, then you can delete the original database with the GUID from your SQL Server. And since you have a DBA who follows best practices then you already have a backup of the database you are about to delete which you can reference in the future if you ever need to restore it later.
- Note: If you attempt to delete the original SharePoint_AdminContent_<GUID> database and encounter an error saying there are connections to the database, then you did not properly un-associate the database from SharePoint. Go back to Step 1 and start all over.
That is all!