Skip to content

Instantly share code, notes, and snippets.

@JwanKhalaf
Created January 22, 2020 15:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JwanKhalaf/146d9ec38601e57984c4cba99fb5aa40 to your computer and use it in GitHub Desktop.
Save JwanKhalaf/146d9ec38601e57984c4cba99fb5aa40 to your computer and use it in GitHub Desktop.
➜ ~ sqlcmd -S localhost -U SA -Q "RESTORE DATABASE [bejebeje] FROM DISK = N'/opt/mssql/BejebejeDb2018-04-13.bak' WITH FILE = 1, MOVE '2J8fz00d6chl' TO '/opt/mssql/2J8fz00d6chl.mdf', MOVE '2J8fz00d6chl_Log' TO '/opt/mssql/2J8fz00d6chl_log.ldf', NOUNLOAD, REPLACE, NORECOVERY, STATS =5"
Password:
Msg 3634, Level 16, State 1, Server jwan-pc, Line 1
The operating system returned the error '2(The system cannot find the file specified.)' while attempting 'RestoreContainer::ValidateTargetForCreation' on '/opt/mssql/2J8fz00d6chl.mdf'.
Msg 3156, Level 16, State 5, Server jwan-pc, Line 1
File '2J8fz00d6chl' cannot be restored to '/opt/mssql/2J8fz00d6chl.mdf'. Use WITH MOVE to identify a valid location for the file.
Msg 3634, Level 16, State 1, Server jwan-pc, Line 1
The operating system returned the error '2(The system cannot find the file specified.)' while attempting 'RestoreContainer::ValidateTargetForCreation' on '/opt/mssql/2J8fz00d6chl_log.ldf'.
Msg 3156, Level 16, State 5, Server jwan-pc, Line 1
File '2J8fz00d6chl_log' cannot be restored to '/opt/mssql/2J8fz00d6chl_log.ldf'. Use WITH MOVE to identify a valid location for the file.
Msg 3119, Level 16, State 1, Server jwan-pc, Line 1
Problems were identified while planning for the RESTORE statement. Previous messages provide details.
Msg 3013, Level 16, State 1, Server jwan-pc, Line 1
RESTORE DATABASE is terminating abnormally.
➜ ~
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment