SharePoint stores content, auxiliary SharePoint services' data and farm configuration in Microsoft SQL Server databases.
To find database files in SharePoint 2010 or later
Open Central Administration site.
Select Upgrade and Migration > Review database status. You will see the SQL instance and database name for all of the databases.
Use Microsoft SQL Server Management Studio to identify the files of the necessary database. For detailed instructions, refer to "SQL Server database files".
To find the content database files in SharePoint 2007
Selecta database. In the opened page you will see the database server and database name. Write them down or copy to a text file.
Repeat step 4 for other databases of the web application.
Repeat steps 3-5 for other web applications.
Use Microsoft SQL Server Management Studio to identify the database files. For detailed instructions, refer to "SQL Server database files".
To find the configuration or service database files in SharePoint 2007
Open Central Administration site.
Select Application Management > Create or configure this farm's shared services.
Right-click a shared services provider and select Edit properties. In the opened page you will see the database server and database name. Write them down or copy to a text file.
Repeat step 3 for other shared services providers.
Use Microsoft SQL Server Management Studio to identify the database files. For detailed instructions, refer to "SQL Server database files".