While installing Microsoft System Center 2012 SP1 Operations Manager I got following error:

System Center 2012 SP1 Operations Manager Datawarehouse configuration failed to install

In the log I could see that Setup could not create the Datawarehouse database:

EXEC(@sql);: Threw Exception.Type: System.Data.SqlClient.SqlException, Exception Error Code: 0x80131904, Exception.Message: CREATE FILE encountered operating system error 5(Access is denied.) while attempting to open or create the physical file ‘E:\SQL\Data.mdf’.
CREATE DATABASE failed. Some file names listed could not be created. Check related errors.

I have a standalone SQL 2012 SP1 server (SQL) and a Windows Server 2012 machine where I want to install Operations Manager. The data and log files on the SQL machine reside on separated disks: D for logs, E for data. I ran setup a few times and chose different folder names but nothing worked. Then I tried to specify a filename instead, because setup always tried to create the database using [foldername].mdf – you can see this in the log.

System Center 2012 SP1 Operations Manager Configure the data warehouse database

With filenames specified for Data and Log file folder setup ran fine and completed without any further errors. But… this lead to wrongly named files on my SQL server:

System Center 2012 SP1 Operations Manager Datawarehouse database files

System Center 2012 SP1 Operations Manager Datawarehouse database log files

System Center 2012 SP1 Operations Manager Datawarehouse database files in SQL

This, in general, is not really bad. But it’s simply not nice. So I shut down the Operations Manager server and detached the OperationsManagerDW database in SQL Server Management Studio by running this query:

USE master;
GO
EXEC sp_detach_db @dbname = N'OperationsManagerDW';
GO

Then I renamed the OperationsManagerDW.mdf.mdf and OperationsManagerDW.ldf.ldf files by removing the double extension and I deleted the empty folders. After that I reattached the databases with

USE master;
GO
CREATE DATABASE OperationsManagerDW 
    ON (FILENAME = 'E:\SQL\Data\OperationsManagerDW.mdf'),
       (FILENAME = 'D:\SQL\Logs\OperationsManagerDW.ldf')
    FOR ATTACH;
GO