配置SQL Server on Linux(1)

来源:https://www.cnblogs.com/fishparadise/archive/2017/12/27/8125203.html
-Advertisement-
Play Games

1. 前言 SQL Server一般是在安裝過程中進行相關的配置,安裝完成之後,再去修改有一些配置就比較麻煩,比如更改SQL Server實例級別的排序規則。但在Linux下,安裝過程並沒有很多可以配置的步驟,安裝步驟變得很簡單,更多的配置可以通過/opt/mssql/bin/mssql-conf工 ...


1. 前言

SQL Server一般是在安裝過程中進行相關的配置,安裝完成之後,再去修改有一些配置就比較麻煩,比如更改SQL Server實例級別的排序規則。但在Linux下,安裝過程並沒有很多可以配置的步驟,安裝步驟變得很簡單,更多的配置可以通過/opt/mssql/bin/mssql-conf工具進行。

 

2. 環境

Linux: CentOS 7.4,SQL Server 2017 (RC2) - 14.0.900.75 (X64)

 

3. 更改SQL Server排序規則

步驟如下:
  1. 備份所有用戶資料庫。(如果是剛剛安裝好的實例沒有用戶資料庫可以跳過這一步。)
  2. 停止資料庫實例
  3. 運行/opt/mssql/bin/mssql-conf set-collation命令修改排序規則
  4. 啟動資料庫實例
  5. 還原用戶資料庫(沒有用戶資料庫可跳過)

 

 

下麵就來演示下。

查詢當前資料庫實例的排序規則

1> SELECT CONVERT(NVARCHAR(50),SERVERPROPERTY('Collation'));
2> GO
                                                  
--------------------------------------------------
SQL_Latin1_General_CP1_CI_AS  

Code-1: 更改前的資料庫實例排序規則

 

 

使用sp_detach_db存儲過程來分離資料庫。如果提示資料庫正在使用,可以設置資料庫為單用戶模式,或者乾脆就把資料庫實例重啟。

1> exec sp_detach_db db1;
2> go
1> exec sp_detach_db AdventureWorks2014;
2> go
1> exec sp_detach_db AdventureWorks2017;
2> go

Code-2:分離用戶資料庫

 

 

在shell 下:

[root@134test ~]# systemctl stop mssql-server
[root@134test ~]# /opt/mssql/bin/mssql-conf set-collation
Enter the collation: Chinese_PRC_CI_AS
Configuring SQL Server...

This is an evaluation version.  There are [27] days left in the evaluation period.
2017-12-27 10:31:21.81 Server      Microsoft SQL Server 2017 (RC2) - 14.0.900.75 (X64) 
    Jul 27 2017 08:53:49 
    Copyright (C) 2017 Microsoft Corporation
    Developer Edition (64-bit) on Linux (CentOS Linux 7 (Core))
2017-12-27 10:31:21.82 Server      UTC adjustment: 8:00
2017-12-27 10:31:21.82 Server      (c) Microsoft Corporation.
2017-12-27 10:31:21.82 Server      All rights reserved.
2017-12-27 10:31:21.82 Server      Server process ID is 4120.
2017-12-27 10:31:21.82 Server      Logging SQL Server messages in file '/var/opt/mssql/log/errorlog'.
2017-12-27 10:31:21.83 Server      Registry startup parameters: 
     -d /var/opt/mssql/data/master.mdf
     -l /var/opt/mssql/data/mastlog.ldf
     -e /var/opt/mssql/log/errorlog
2017-12-27 10:31:21.83 Server      Command Line Startup Parameters:
     -q "Chinese_PRC_CI_AS"
2017-12-27 10:31:21.83 Server      SQL Server detected 1 sockets with 4 cores per socket and 4 logical processors per socket, 
4 total logical processors; using 4 logical processors based on SQL Server licensing. This is an informational message; no user action is required. 2017-12-27 10:31:21.84 Server SQL Server is starting at normal priority base (=7). This is an informational message only. No user action is required. 2017-12-27 10:31:21.84 Server Detected 3027 MB of RAM. This is an informational message; no user action is required. 2017-12-27 10:31:21.84 Server Using conventional memory in the memory manager. 2017-12-27 10:31:22.36 Server Buffer pool extension is already disabled. No action is necessary. 2017-12-27 10:31:22.63 Server Perfmon counters for resource governor pools and groups failed to initialize and are disabled. 2017-12-27 10:31:22.67 Server InitializeExternalUserGroupSid failed. Implied authentication will be disabled. 2017-12-27 10:31:22.67 Server Implied authentication manager initialization failed. Implied authentication will be disabled. 2017-12-27 10:31:22.69 Server Successfully initialized the TLS configuration. Allowed TLS protocol versions are ['1.0 1.1 1.2'].
Allowed TLS ciphers are ['ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:
ECDHE-ECDSA-AES128-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-ECDSA-AES128-SHA:AES256-GCM-SHA384:AES128-GCM-SHA256:AES256-SHA256:
AES128-SHA256:AES256-SHA:AES128-SHA:!DHE-RSA-AES256-GCM-SHA384:!DHE-RSA-AES128-GCM-SHA256:!DHE-RSA-AES256-SHA:!DHE-RSA-AES128-SHA'
]. 2017-12-27 10:31:22.76 Server The maximum number of dedicated administrator connections for this instance is '1' 2017-12-27 10:31:22.76 Server Node configuration: node 0: CPU mask: 0x000000000000000f:0 Active CPU mask: 0x000000000000000f:0.
This message provides a description of the NUMA configuration for this computer. This is an informational message only. No user action is required. 2017-12-27 10:31:22.77 Server Using dynamic lock allocation. Initial allocation of 2500 Lock blocks and 5000 Lock Owner blocks per node.
This is an informational message only. No user action is required. 2017-12-27 10:31:22.79 Server In-Memory OLTP initialized on lowend machine. 2017-12-27 10:31:22.84 Server Database Instant File Initialization: enabled. For security and performance considerations see the topic
'Database Instant File Initialization' in SQL Server Books Online. This is an informational message only. No user action is required. 2017-12-27 10:31:22.85 Server Database Mirroring Transport is disabled in the endpoint configuration. 2017-12-27 10:31:22.85 spid5s Warning ****************** 2017-12-27 10:31:22.86 spid5s SQL Server started in single-user mode. This an informational message only. No user action is required. 2017-12-27 10:31:22.86 Server Query Store settings initialized with enabled = 1, 2017-12-27 10:31:22.86 spid5s Starting up database 'master'. 2017-12-27 10:31:22.87 Server Software Usage Metrics is disabled. 2017-12-27 10:31:23.47 spid5s Buffer pool extension is already disabled. No action is necessary. 2017-12-27 10:31:23.47 spid5s SQL Server Audit is starting the audits. This is an informational message. No user action is required. 2017-12-27 10:31:23.49 spid5s SQL Server Audit has started the audits. This is an informational message. No user action is required. 2017-12-27 10:31:23.68 spid5s SQL Trace ID 1 was started by login "sa". 2017-12-27 10:31:23.68 spid5s Server name is '134test'. This is an informational message only. No user action is required. 2017-12-27 10:31:23.70 spid5s Always On Availability Groups was not started because the SQL Server instance is running in single-user mode.
This is an informational message. No user action is required. 2017-12-27 10:31:23.71 spid5s Starting up database 'msdb'. 2017-12-27 10:31:23.72 spid9s Starting up database 'mssqlsystemresource'. 2017-12-27 10:31:23.75 spid9s The resource database build version is 14.00.900. This is an informational message only. No user action is required. 2017-12-27 10:31:23.79 spid9s Starting up database 'model'. 2017-12-27 10:31:24.04 spid5s Recovery is writing a checkpoint in database 'msdb' (4). This is an informational message only. No user action is required. 2017-12-27 10:31:24.12 spid9s Polybase feature disabled. 2017-12-27 10:31:24.12 spid9s Clearing tempdb database. 2017-12-27 10:31:24.33 spid17s A self-generated certificate was successfully loaded for encryption. 2017-12-27 10:31:24.34 spid17s Server is listening on [ 'any' <ipv6> 1433]. 2017-12-27 10:31:24.35 spid17s Server is listening on [ 'any' <ipv4> 1433]. 2017-12-27 10:31:24.35 Server Server is listening on [ ::1 <ipv6> 1434]. 2017-12-27 10:31:24.36 Server Server is listening on [ 127.0.0.1 <ipv4> 1434]. 2017-12-27 10:31:24.36 Server Dedicated admin connection support was established for listening locally on port 1434. 2017-12-27 10:31:24.39 spid17s SQL Server is now ready for client connections. This is an informational message; no user action is required. 2017-12-27 10:31:24.99 spid9s Starting up database 'tempdb'. 2017-12-27 10:31:25.12 spid9s The tempdb database has 1 data file(s). 2017-12-27 10:31:25.18 spid5s Warning ****************** 2017-12-27 10:31:25.18 spid5s Attempting to change default collation to Chinese_PRC_CI_AS. 2017-12-27 10:31:25.22 spid5s index restored for master.syspriorities. 2017-12-27 10:31:25.23 spid5s index restored for master.sysbrickfiles. 2017-12-27 10:31:25.23 spid5s index restored for master.sysprufiles. 2017-12-27 10:31:25.23 spid5s index restored for master.sysowners. 2017-12-27 10:31:25.23 spid5s index restored for master.sysdbreg. 2017-12-27 10:31:25.24 spid5s index restored for master.sysschobjs. 2017-12-27 10:31:25.25 spid5s index restored for master.sysextsources. 2017-12-27 10:31:25.25 spid5s index restored for master.sysextfileformats. 2017-12-27 10:31:25.25 spid5s index restored for master.syscolpars. 2017-12-27 10:31:25.25 spid5s index restored for master.sysxlgns. 2017-12-27 10:31:25.25 spid5s index restored for master.sysxsrvs. 2017-12-27 10:31:25.26 spid5s index restored for master.sysnsobjs. 2017-12-27 10:31:25.26 spid5s index restored for master.syscerts. 2017-12-27 10:31:25.26 spid5s index restored for master.sysrmtlgns. 2017-12-27 10:31:25.26 spid5s index restored for master.sysxprops. 2017-12-27 10:31:25.26 spid5s index restored for master.sysscalartypes. 2017-12-27 10:31:25.26 spid5s index restored for master.sysidxstats. 2017-12-27 10:31:25.27 spid5s index restored for master.sysendpts. 2017-12-27 10:31:25.27 spid5s index restored for master.sysclsobjs. 2017-12-27 10:31:25.27 spid5s index restored for master.sysremsvcbinds. 2017-12-27 10:31:25.27 spid5s index restored for master.sysrts. 2017-12-27 10:31:25.27 spid5s index restored for master.sysasymkeys. 2017-12-27 10:31:25.27 spid5s index restored for master.syssqlguides. 2017-12-27 10:31:25.27 spid5s index restored for master.syssoftobjrefs. 2017-12-27 10:31:25.28 spid5s index restored for master.MSreplication_options. 2017-12-27 10:31:25.31 spid5s index restored for tempdb.syspriorities. 2017-12-27 10:31:25.32 spid5s index restored for tempdb.sysowners. 2017-12-27 10:31:25.32 spid5s index restored for tempdb.sysdbreg. 2017-12-27 10:31:25.33 spid5s index restored for tempdb.sysschobjs. 2017-12-27 10:31:25.33 spid5s index restored for tempdb.sysextsources. 2017-12-27 10:31:25.33 spid5s index restored for tempdb.sysextfileformats. 2017-12-27 10:31:25.33 spid5s index restored for tempdb.syscolpars. 2017-12-27 10:31:25.33 spid5s index restored for tempdb.sysxlgns. 2017-12-27 10:31:25.33 spid5s index restored for tempdb.sysxsrvs. 2017-12-27 10:31:25.33 spid5s index restored for tempdb.sysnsobjs. 2017-12-27 10:31:25.34 spid5s index restored for tempdb.syscerts. 2017-12-27 10:31:25.34 spid5s index restored for tempdb.sysrmtlgns. 2017-12-27 10:31:
您的分享是我們最大的動力!

-Advertisement-
Play Games
更多相關文章
  • PL/SQL Developer使用技巧(部分) 關鍵字自動大寫 在sql命令視窗中輸入SQL語句時,想要關鍵字自動大寫,引人註目該怎麼辦呢? 一步設置就可以達成了。點擊Tools->Preference->Editor,看到截圖中這個Keyword case,一般預設是Unchanged,在下拉框 ...
  • 上一篇《MapReduce多種join實現實例分析(一)》,大家可以點擊回顧該篇文章。本文是MapReduce系列第二篇。 一、在Map端進行連接使用場景:一張表十分小、一張表很大。用法:在提交作業的時候先將小表文件放到該作業的DistributedCache中,然後從DistributeCache ...
  • 1.1 存儲引擎的介紹 1.1.1 文件系統存儲 文件系統:操作系統組織和存取數據的一種機制。文件系統是一種軟體。 類型:ext2 3 4 ,xfs 數據。 不管使用什麼文件系統,數據內容不會變化,不同的是,存儲空間、大小、速度。 1.1.2 mysql資料庫存儲 MySQL引擎: 可以理解為,My ...
  • 新用戶一天內不准提問...Sql Server Configuration Manager 網路配置為空,沒有實例無法設置ip和埠進行連接.。 ...
  • 表名tb_school(學校表:存儲學校的基本信息) 欄位 類型 介紹 屬性 其他 schoolid Int 學校id 主鍵 SchoolName Varchar(20) 學校名稱 非空 SchoolPrincipal Varchar(20) 學校校長 非空 SchoolAdd Varchar(20 ...
  • Tableau支持大量的文件類型數據的連接和資料庫連接 但是Tableau不能直接連接MongoDB資料庫,需要藉助MongoDB Connector for BI 官方解釋 下載安裝完成之後,會在安裝目錄的bin目錄下出現兩個可執行文件mongodrdl.exe和mongosqld.exe 官方文 ...
  • 一些mongodb學習的相關知識,記錄下來以便下次查看使用 參考:https://docs.mongodb.com/manual/reference/operator/ http://www.runoob.com/mongodb/mongodb-tutorial.html https://code. ...
  • 1.下載mysql版本 下載最新版本:https://www.mysql.com/downloads/ 下載歷史版本:https://downloads.mysql.com/archives/community/ 2.上傳下載的mysql軟體到/usr/local/src 3.解壓mysql軟體到/ ...
一周排行
    -Advertisement-
    Play Games
  • 移動開發(一):使用.NET MAUI開發第一個安卓APP 對於工作多年的C#程式員來說,近來想嘗試開發一款安卓APP,考慮了很久最終選擇使用.NET MAUI這個微軟官方的框架來嘗試體驗開發安卓APP,畢竟是使用Visual Studio開發工具,使用起來也比較的順手,結合微軟官方的教程進行了安卓 ...
  • 前言 QuestPDF 是一個開源 .NET 庫,用於生成 PDF 文檔。使用了C# Fluent API方式可簡化開發、減少錯誤並提高工作效率。利用它可以輕鬆生成 PDF 報告、發票、導出文件等。 項目介紹 QuestPDF 是一個革命性的開源 .NET 庫,它徹底改變了我們生成 PDF 文檔的方 ...
  • 項目地址 項目後端地址: https://github.com/ZyPLJ/ZYTteeHole 項目前端頁面地址: ZyPLJ/TreeHoleVue (github.com) https://github.com/ZyPLJ/TreeHoleVue 目前項目測試訪問地址: http://tree ...
  • 話不多說,直接開乾 一.下載 1.官方鏈接下載: https://www.microsoft.com/zh-cn/sql-server/sql-server-downloads 2.在下載目錄中找到下麵這個小的安裝包 SQL2022-SSEI-Dev.exe,運行開始下載SQL server; 二. ...
  • 前言 隨著物聯網(IoT)技術的迅猛發展,MQTT(消息隊列遙測傳輸)協議憑藉其輕量級和高效性,已成為眾多物聯網應用的首選通信標準。 MQTTnet 作為一個高性能的 .NET 開源庫,為 .NET 平臺上的 MQTT 客戶端與伺服器開發提供了強大的支持。 本文將全面介紹 MQTTnet 的核心功能 ...
  • Serilog支持多種接收器用於日誌存儲,增強器用於添加屬性,LogContext管理動態屬性,支持多種輸出格式包括純文本、JSON及ExpressionTemplate。還提供了自定義格式化選項,適用於不同需求。 ...
  • 目錄簡介獲取 HTML 文檔解析 HTML 文檔測試參考文章 簡介 動態內容網站使用 JavaScript 腳本動態檢索和渲染數據,爬取信息時需要模擬瀏覽器行為,否則獲取到的源碼基本是空的。 本文使用的爬取步驟如下: 使用 Selenium 獲取渲染後的 HTML 文檔 使用 HtmlAgility ...
  • 1.前言 什麼是熱更新 游戲或者軟體更新時,無需重新下載客戶端進行安裝,而是在應用程式啟動的情況下,在內部進行資源或者代碼更新 Unity目前常用熱更新解決方案 HybridCLR,Xlua,ILRuntime等 Unity目前常用資源管理解決方案 AssetBundles,Addressable, ...
  • 本文章主要是在C# ASP.NET Core Web API框架實現向手機發送驗證碼簡訊功能。這裡我選擇是一個互億無線簡訊驗證碼平臺,其實像阿裡雲,騰訊雲上面也可以。 首先我們先去 互億無線 https://www.ihuyi.com/api/sms.html 去註冊一個賬號 註冊完成賬號後,它會送 ...
  • 通過以下方式可以高效,並保證數據同步的可靠性 1.API設計 使用RESTful設計,確保API端點明確,並使用適當的HTTP方法(如POST用於創建,PUT用於更新)。 設計清晰的請求和響應模型,以確保客戶端能夠理解預期格式。 2.數據驗證 在伺服器端進行嚴格的數據驗證,確保接收到的數據符合預期格 ...