如何在Docker上备份MSSQL数据库

时间:2018-07-11 14:07:53

标签: sql-server docker

我正在docker上运行mssql服务器Windows开发人员editon,我想备份我的数据库,这样,每次启动容器时,都不必重新创建数据库和Re-Bootstrap。我尝试将卷安装到物理系统上,但不断出现错误

  

容器aa8b9 ..在CreateProcess期间遇到错误:Windows系统调用失败:系统找不到指定的文件。

我使用的命令是

var items = [
  { name: "c", value: "" },
  { name: "b", value: "" },
  { name: "a", value: "" },
  { name: "д", value: "" },
  { name: "в", value: "" },
  { name: "41", value: "" },
  { name: "а", value: "" },
  { name: "б", value: "" },
  { name: "0", value: "" },
  { name: "31", value: "" },
  { name: "4", value: "" },
  { name: "г", value: "" }
];

function sortFunctionMaker(ascending) {
  function isNumber(str) {
    return Number.isNaN(Number(str)) === false;
  }

  function isEnglish(str) {
    return /^[a-zA-Z]+$/.test(str);
  }

  return function(a, b) {
    var aw, bw;

    if (isNumber(a.name)) {
      aw = 1;
    } else if (isEnglish(a.name)) {
      aw = 2;
    } else {
      aw = 3;
    }
    if (isNumber(b.name)) {
      bw = 1;
    } else if (isEnglish(b.name)) {
      bw = 2;
    } else {
      bw = 3;
    }

    if (aw !== bw) {
      // a and b belong to different categories
      // no further comparison is needed
      return aw - bw;
    } else if (aw === 1) {
      // both are numbers
      // sort mathematically
      return (ascending ? 1 : -1) * (a.name - b.name);
    } else {
      // both are english or otherwise
      // sort using localeCompare
      return (ascending ? 1 : -1) * a.name.localeCompare(b.name);
    }
  }
}

items.sort(sortFunctionMaker(true));
console.log("Ascending");
items.forEach(function(item) {
  console.log(item.name);
});

items.sort(sortFunctionMaker(false));
console.log("Descending");
items.forEach(function(item) {
  console.log(item.name);
});
console.groupEnd();

0 个答案:

没有答案