Fetch Database Name From Database Id In SharePoint Farm
When working
with SharePoint Databases oftentimes the only way SharePoint identifies the
database is via a GUID. Sometimes this can be frustrating because you want to
know exactly what database you are working with. As far as i know there is no STSADM
command available to easily translate GUID to Database name.
Word of
warning, the following script directly queries a SharePoint database; this is
never a good idea. Therefore I recommend you restore the database to a restore
or test server where you can execute the query as to prevent any potential
issues with your production environment.
Luckily
there is a way to get this information from SQL Server, to do this you must run
a query against the Configuration database (See warning above).
First you
need to open Management Studio
1. Select New Query.
2. Select the Configuration Database from the
Available Databases dropdown list.
3. Copy the script below and paste it into the
Query window and press Execute.
This will
output the Database GUID and Database Name in a nice list, giving you the data
you need to identify what database SharePoint is talking about when it is
talking GUID’s to you.
As stated
There is some risk involved in running queries against SharePoint databases,
Microsoft advises not to run any query against a SharePoint database as it
might interfere with any SharePoint processes running against the databases.
When this happens the database will lose support status and if you need to
contact Microsoft for support with issues in the future you might be asked to
replace the database with a fresh copy. I usually restore a recent backup of
the configuration database to a restore server or a test server and run the
query there. This allows me to get the data but still comply with the “No query
for you!” rule that SharePoint databases have.
b)Choose ‘Configure SQL Server for Application Services’ and click Next.
c)Click Next and enter the name of the SQL Server, in this case the server name will be FBAServer.
d)Confirm that we have our Database (aspnetdb) created in SQL Management Studio on the SQL server.
2.Create Users in IIS 7.X
Using IIS to Populate Data for Database (aspnetdb) We Created in Step Before.
a.Open IIS Manger on Server
b.Select Default Web Site and Make Sure you are in Features View
c.Open Connection Strings Option under ASP.NET Section.
d.Click on LocalSqlServer Connection Sting & Provide SQL Server Name where you created aspnetdb in Earlier Step also Provide name of Database Created.
Click ok
e.Once again Select Default Web Site & from Features View Click on .NET Users
f.Click on Add and Create New user in aspnetdb
Click Finish
g.Create more users by repeating “steps f and g”.
3.Login to the SharePoint server.
a.Create a Claims Based Authentication Mode web application from Central Administration and assign a port number, application pool, and database name. The settings around Claims are below.
4.Open up IIS (inetmgr).
a.Select the SharePoint web application that you created and right-click. Click Explore and open the web.config in Notepad.
b.Find the line <system.web> in the web.config. Add the code below between the </SharePoint> and <system.web> tags.
Note : “Make sure that the Data Source name is changed.”
6.In IIS Manager, expand the SharePoint Web Services entry and right-click the SecurityTokenServiceApplication. Click Explore. Open the web.config in Notepad.
a.Scroll to the bottom of the file and find the </system.net> tag, and add: