sqlserver 2017 linux还原windows备份时的路径问题解决
windows的备份由于路径问题,在Linux上会报错
File 'YourDB_Product' cannot be restored to 'Z:\Microsoft SQL Server\MSSQL11.GLOBAL\MSSQL\Data\YourDB\YourDB_Product.ndf'. Use WITH MOVE to identify a valid location for the file.
Msg 5133, Level 16, State 1, Server servername, Line 1
Directory lookup for the file "Z:\Microsoft SQL Server\MSSQL11.GLOBAL\MSSQL\Data\YourDB\YourDB_Product.ndf" failed with the operating system error 2(The system cannot find the file specified.).
此时需要设置还原后的文件存储路径,如下:
RESTORE FILELISTONLY FROM DISK = '/var/opt/mssql/backup/YourDB.bak'
GO LogicalName PhysicalName ..............
----------------------------------------------------------------------------------------------------------------------
YourDB Z:\Microsoft SQL Server\MSSQL11.GLOBAL\MSSQL\Data\YourDB\YourDB.mdf ..............
YourDB_Product Z:\Microsoft SQL Server\MSSQL11.GLOBAL\MSSQL\Data\YourDB\YourDB_Product.ndf ..............
YourDB_Customer Z:\Microsoft SQL Server\MSSQL11.GLOBAL\MSSQL\Data\YourDB\YourDB_Customer.ndf ..............
YourDB_log Z:\Microsoft SQL Server\MSSQL11.GLOBAL\MSSQL\Data\YourDB\YourDB_Log.ldf .............. You can use this list to create MOVE clauses for the additional files. In this example, the RESTORE DATABASE is: RESTORE DATABASE YourDB
FROM DISK = '/var/opt/mssql/backup/YourDB.bak'
WITH MOVE 'YourDB' TO '/var/opt/mssql/data/YourDB.mdf',
MOVE 'YourDB_Product' TO '/var/opt/mssql/data/YourDB_Product.ndf',
MOVE 'YourDB_Customer' TO '/var/opt/mssql/data/YourDB_Customer.ndf',
MOVE 'YourDB_Log' TO '/var/opt/mssql/data/YourDB_Log.ldf'
GO
参考:https://docs.microsoft.com/zh-cn/sql/linux/sql-server-linux-migrate-restore-database?view=sql-server-2017
sqlserver 2017 linux还原windows备份时的路径问题解决的更多相关文章
- Linux、Windows中的相对路径和绝对路径
获取系统的分隔符的方式:System.getProperty("file.separator") Windows为 \ Linux为/ Windows绝对路径: 以盘符开始 ...
- java中构建同时兼容linux和windows程序时遇到的文件路径分割符问题解决方案
最近在做一个自动上传文件的客户端,因为 file.getAbsolutePath() 在Mac和linux下的分割符是“/”,而在windows操作系统下的分割符则是“\”,我们程序中固然可以通过调 ...
- 在linux和windows下自动备份数据库
摘要: 详细介绍在windows和linux下自动备份数据库的过程,希望可以让新手立即上手吧! 本文档内容共分为2大部分:linux和windows Linux和windows都分为:准备工作和操作阶 ...
- 用rsync从Linux到Windows远程备份
论 rsync是Linux系统下的数据镜像备份工具,从软件的命名上就可以看出来 了——remote sync.rsync支持大多数的类Unix系统,无论是Linux.Solaris还是BSD上都经过了 ...
- 还原数据库“XXX”时失败。System.Data.SqlClient.SqlError: 无法执行 BACKUP LOG,因为当前没有数据库备份。
标题: Microsoft SQL Server Management Studio------------------------------ 还原数据库“GoldBellXZDepot”时失败. ...
- Linux svn仓库备份到Windows机器上
Linux svn仓库备份到Windows机器上 1,需求说明,Linux作为主库(A),Windows作为本地备份库(B),要求每天将Linux库中的代码备份到本地 2,B机器上安装svn服务端 3 ...
- Linux下手动备份还原硬盘主引导记录MBR跟硬盘分区表DPT教程
Linux下手动备份还原硬盘主引导记录MBR跟硬盘分区表DPT教程 二 18 奶牛 Linux, Ubuntu, Windows 1,885 views查看评论 最近奶牛一直在折腾linux下的gru ...
- sqlserver还原差异备份
因为之前遇到还原差异备份,最开始遇到SQLServer报错:"无法还原日志备份或差异备份,因为没有文件可用于前滚".查阅很多资料后,终于得到解决.收集整理成这篇随笔. 问题原因:出 ...
- linux和sqlserver 2017的安装
这两天一直在弄linux的安装过程.中间也遇到了不少的坑,主要是网络上的坑人的文章太多.都是坑,最后从redhat官网下载了iso文件,顺便看到官网推荐了一个fedora media writer的烤 ...
随机推荐
- Plus and Square Root
ZS the Coder is playing a game. There is a number displayed on the screen and there are two buttons, ...
- jenkins初始化配置完后设置了管理员账号密码 网页停留时间长了刷新登录不了了
好像陆陆续续在几台机子安装到最后正式使用的这台机器都是这样.难道是它自己本身的问题吗?只能网上帖子凑了. 找到.jenkins/config.xml文件:(windows环境就是和initialsec ...
- 【转】为什么要用GIT而不是SVN
原文网址:http://www.cnblogs.com/perseus/archive/2012/11/22/2782051.html 使用了近一年的git之后,再使用svn,发现自己svn这种版本管 ...
- linux下nginx安装、配置实战
1什么是Nginx Nginx("enginex")是一个高性能的HTTP和反向代理服务器,也是一个IMAP/POP3/SMTP代理服务器,在高连接并发的情况下Nginx是Apac ...
- php 自定义函数大全
1. call_user_func和call_user_func_array 以上两个函数以不同的参数形式调用函数.见如下示例: <?php class demo{ public static ...
- 【c#】设置Socket连接、接收超时(转)
用到Socket,发现如果连接错误,比如Connect的端口不对,会造成很长时间的延时,程序就僵在那里,效果很不好: 在网上找到很方便的设置办法,分享如下: Socket.SetSocketOptio ...
- malloc/free与new/delete的不同及注意点
#include<iostream> using namespace std; class Obj{ public : Obj(){cout<<"Initializa ...
- Python VIL Service Bin
#!/usr/bin/python #coding:UTF-8 import sys import re import getopt import md5 import os import subpr ...
- python + docker, 实现天气数据 从FTP获取以及持久化(二)-- python操作MySQL数据库
前言 在这一节中,我们主要介绍如何使用python操作MySQL数据库. 准备 MySQL数据库使用的是上一节中的docker容器 “test-mysql”. Python 操作 MySQL 我们使用 ...
- Maven 创建java Web项目,配置Spring,CXF
1.搭建Maven环境 参考文章 Maven3路程(一)环境搭建 http://www.cnblogs.com/leiOOlei/p/3359561.html Maven3路程(二)Eclipse集成 ...