Welcome to plsql4all.blogspot.com SQL, MYSQL, ORACLE, TERADATA, MONGODB, MARIADB, GREENPLUM, DB2, POSTGRESQL.

Tuesday 4 August 2015

How to restore SQL database



Restoring a DB is as simple, simply enter the following command on the destination SQL server (if not the same one).  In this example we’re assuming the DB is called “daytona” on the local server where the SQL DB needs to be restored to.  The “WITH REPLACE” option over-writes the existing “daytona” database:

sqlcmd -E -S localhost\RFCASSETMGR –Q “RESTORE DATABASE [daytona] FROM DISK=’c:\sqlbak.bak’ WITH REPLACE"

 If during the Backup or Restore process an “Operating system error 5(Access is denied.)” error occurs, you need to modify the Windows Service (SQL Server (RFCASSETMGR)) to run as a “Local System account.”

No comments:

Post a Comment

Please provide your feedback in the comments section above. Please don't forget to follow.