Quantcast
Channel: SQL Server High Availability and Disaster Recovery forum
Viewing all articles
Browse latest Browse all 4532

SQL DB Attach Detach error

$
0
0

Hi All,

We have DC (ABC) and DR (XYZ) setup with SQL Server 2012 on both server. Veritas is configured to replicated data from DC to DR. Veritas is file/block level replication.
SQL Server services are using Local System account on both machine. On both server we have local adminstrator account i.e on DC (ABC\Administrator) and DR (XYZ\Administrator).

Before starting replication via VERITAS from DC to DR we are connecting to DR(XYZ server) SQL Server via windows authentication 'XYZ\Administrator' and dettaching the databases at DR (XYZ server). Then replication is started via VERITAS from DC to DR. Once replication is 100% synched we do siwtchover via VERTIAS . But before swithover we dettach the DB at DC(ABC) via windows authentication 'ABC\Administrator' of SQL Server, then do siwtch over and attach the Databases at DR to SQL Server via windows authentication 'XYZ\Administrator'. 

While attaching the databases at DR we are getting error cannot create file 'access denied' . Then we go to drive where databases files are present mdf and ldf.  Right click on mdf and ldf file--> security--> change owner to 'XYZ\Administrator'. Then again right click on mdf and ldf files-->security--> remove orphanuser--> Add login--> 'XYZ\Administrator' and give all permission i.e FUll control, Read and Write

Is there any way to avoid this access denied error, changing ownership, removing orphan windows user i.e. attach the database without any manual configuration.

Regards,

Nikhil Desai


Viewing all articles
Browse latest Browse all 4532

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>