2

I am trying to create a site collection with its dedicated content database in SharePoint 2010. To that end, I am trying to use powershell with New-SPContentDatabase command. Here is the command I run:

PS C:\> New-SPContentDatabase -Name "WSS_Content_DB_Custom" -DatabaseServer "DBServer_" -WebApplication "https://SPWebApplicationUrl.com" | out-null

When I run this command, this is the error I get:

New-SPContentDatabase : Directory lookup for the file "E:\Databases\WSS_Content_DB_Custom.mdf" failed with the operating system error 3(The system cannot find the path specified.).

CREATE DATABASE failed. Some file names listed could not be created. Check rela ted errors.

At line:1 char:22

+New-SPContentDatabase <<<< -Name "WSS_Content_DB_Custom" -DatabaseServer "DBServer_" -WebApplication "https://SPWebApplicationUrl.com" | out-null

+CategoryInfo : InvalidData: (Microsoft.Share...ContentDatabase: SPCmdletNewContentDatabase) [New-SPContentDatabase], SqlException

+FullyQualifiedErrorId : Microsoft.SharePoint.PowerShell.SPCmdletNewConte ntDatabase

I have checked online for any possible resolution, but no hint avail. I just dont understand why the command is looking on the E: for the mdf file.

Edit: Additional details:
My db server is responding to ping request and my other mdf files in the db server is stored in F:/

  • Did you check the default path for creation of new DBs in sql server? See msdn.microsoft.com/en-us/library/dd206993.aspx – Akhoy Aug 27 '15 at 21:32
  • yes, that is the first thing i checked and it is set to F: for the mdf files. – Tom Aug 27 '15 at 21:48
  • You could try to create a database manually in SQL-Server Management Studio to isolate the error to SQL-Server or to SharePoint. Does Drive E: even exist on your SQL-Server? Another Idea: Look at the MDF-File in your "model" database, as this is the template for new databases. – MHeld Aug 28 '15 at 8:09
  • E;/ does not even exist in the server. But, the solution was to restart the sql server service. Looks like initially the files were stored in E:/ and then moved to F:/ But during that transition the services were not restarted. – Tom Aug 28 '15 at 19:26
1

The only explanation to this issue falls along the line of what @Akhoy has suggested. You may have the DB path set to F:/ but, perhaps you need to restart your SQL Server/ Agent Service.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.