Link to home
Start Free TrialLog in
Avatar of Jordan_WM
Jordan_WM

asked on

Creating DB on NAS location, DB created but not listed on Server

Hello,

I have been searching other posts on here and came across about creating a DB on NAS location.

I was able to create the DB in the NAS location using the following statement but I am not able to see the DB on the server from SQL Server Management Studio even when I try to delete the DB it tells me it's in use.

I am suspecting it is a permisson issue.


CREATE DATABASE [Test] ON  PRIMARY
( NAME = N'TEST', FILENAME = N'\\NAS_LOCATION\TEST.mdf' , SIZE = 3072KB , MAXSIZE = UNLIMITED, FILEGROWTH = 1024KB )
LOG ON
( NAME = N'TEST_log', FILENAME = N'\\NAS_LOCATION\TEST_log.ldf' , SIZE = 1024KB , MAXSIZE = 2048GB , FILEGROWTH = 10%)
GO
Avatar of didnthaveaname
didnthaveaname

Did the datafiles find their way to the NAS?
Avatar of EvilPostIt
Here is a guide how to create the database on a network path.

http://www.brentozar.com/archive/2012/01/sql-server-databases-on-network-shares-nas/
better map this network path and then create a database
Avatar of Jordan_WM

ASKER

This is the following error message that I recevied from Create Database script. So the MDF and LDF files were created on the location by SQL

Msg 5120, Level 16, State 101, Line 1
Unable to open the physical file "\\NAS_Location\Test_DB.mdf". Operating system error 5: "5(Access is denied.)".
Msg 1802, Level 16, State 4, Line 1
CREATE DATABASE failed. Some file names listed could not be created. Check related errors
It looks like the SQL Server service doesnt have the correct level of permissions to that storage area. Probably best to check and make sure they are right.
I changed the permissons under Sql Server Configuration Manager to my account as my account as permissons to the NAS and created the DB with my account on the server
So has it been created successfully now then?
It was created successfully but the its not listed under the server, which I am guessing relates to the error 'unable to open the physical file'.  Which seems strange it was created but then its not able to read it, I might have to look for an alternative solution.
Is the server still using your credentials? Could you post the error too please.
Do you still require assistance on this?
ASKER CERTIFIED SOLUTION
Avatar of Jordan_WM
Jordan_WM

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
The issue seemed to be with the data file log locations, once those were changed to the location on the NAS it worked