SQL Server 2012(Denali)をServer Coreにインストールしてみた | Server OS Cafe

Server OS Cafe

Server OSの紹介等

さてSQL Server Code Name "Denali"ではWindows Server 2008 Server Coreへのインストールがサポートされています。ということで試してみました。
[参照] MSDN:Server Core への SQL Server "Denali" のインストール


We can install SQL Server Code-Named "Denali" on Windows Server 2008 Server Core.Let's try.
MSDN:Installing SQL SErver "Denali" on Server Core

当然、GUIがない為、インストールはコマンドラインで実行することになります。
When installing on Server Core, SQL Server Setup supports from Command Prompt.

[今回実行したコマンド(Sample)]
Setup.exe /ACTION=INSTALL /Q /IACCEPTSQLSERVERLICENSETERMS /ERRORREPORTING=0 /FEATURES=SQLEngine,Replication,Conn /INSTANCENAME=MSSQLSERVER /SQLSVCACCOUNT="NT AUTHORITY¥SYSTEM" /AGTSVCACCOUNT="NT AUTHORITY¥SYSTEM" /SQLCOLLATION=Japanese_CI_AS /SQLSYSADMINACCOUNTS="BUILTIN¥ADMINISTRATOR" /SECURITYMODE=SQL /SAPWD=[sa's password] /TCPENABLED=1

[インストールパラメータについて(Installation Parameters)]
Configureファイルを準備して、/CONFIGURATIONFILEで指定する方法もあるのですが、今回は全てパラメータでインストール条件を指定してみました。
I use following parameters this time,and I don't use configuration file.

/ACTION
 今回は新規インストールの為、”INSTALL”を指定
 Specifies "INSTALL".

/Q
 サイレントインストールを指定
 Specifies that Setup runs in a quiet mode.

/IACCEPTSQLSERVERLICENSETERMS
 SQL Serverの使用許諾契約に合意することを指定
 Required to acknowledge acceptance of the license terms.

/ERRORREPORTING
 SQL Serverのエラー報告の有効(1)、無効(0)を指定
 Specifies the error reporting for SQL Server.1:Enabled,0:Disabled.

/FEATURES
 インストールする機能の指定。
 GUIが必要な機能はインストールできません。
 今回はデータベースエンジン(SQLEngine)、レプリケーション(Replication)、接続ツール(Conn)を指定
 Specifies the components to install.
 Choose /FEATURES to specify individual SQL Server components to install.
 I chose SQLEngine,Replication,Conn this time.

/INSTANCENAME
 SQL Serverのインスタンス名を指定。
 MSSQLSERVERを指定すると既定のインスタンスになります。
 Specifies a SQL Server instance name.
 If we specify MSSQLServer for the instance name, a default instance will be created.

/SQLSVCAOOUNT
 SQL Serverサービスのアカウントを指定。
 今回はシステムアカウントを指定。
 アカウントによっては/SQLSVCPASSWORDでパスワードを指定します。
 Specifies the startup account for the SQL Server service.
 I specified System Account this time.
 If you specify account that you must specify password,you must specify /SQLSVCPASSOWORD.

/AGTSVCACCOUNT
 SQL Server Agentのアカウントを指定。
 今回はシステムアカウントを指定。
 アカウントによっては/AGTSVCPASSWORDでパスワードを指定します。
 Specifies the startup account for the SQL Server Agent.
 I specified System Account this time.
 If you specify account that you must specify password,you must specify /AGTSVCPASSOWORD.

/SQLCOLLATION
 SQL Serverの照合順序を指定。
 Specifies the collation settings for SQL Server.

/SQLSYSADMINACCOUNTS
 sysadminロールに追加するユーザーを指定。
 Specifiles provision logins to be members of the sysadmin role.

/SECURITYMODE
 SQL Server認証を使用する場合は"SQL"を指定。
 Windows統合認証のみを使用する場合はこのオプションは不要。
 If we use the security mode for SQL Server,we choose "SQL".
 If this parameter is not supplied, then Windows-only authentication mode is supported.

/SAPWD
 /SECURITYMODE=SQLの場合のみsaアカウントのパスワードを指定。
 When we choose /SECURITYMODE=SQL, we specify the password for the SQL Server sa account.

/TCPENABLED
 1を指定してTCP/IPを有効にします。
 Server CoreではSQL Server構成(GUI)が使用できないのでインストール時に指定しておきます。
 We choose 1 and enable the TCP protocol.
 We must choose this parameter because we can't use SQL Server Configuration Manager(GUI) on Server Core

でもって実行。
I run SQL Server Installer.

$Server OS Cafe-Denli_ServerCore1

この時、SQL Serverが必要とする.NET Frameworkも自動的にインストールされます。
そして、うんともすんとも言わずインストールは完了。
SQL Server Installer setup enables .NET Framework by default.
And SQL Server Installer is finished without any user interface.

念の為、タスクマネージャーと既定のインストール先である"C:¥Program Files¥Microsoft SQL Server"を確認。
うん、ちゃんと入っとりますなドキドキ
I watch Windows Task Manager and "C:¥Program Files¥Microsoft SQL Server".
I validate that Installing SQL Server is completed.ドキドキ

$Server OS Cafe-Denali_ServerCore2

管理方法としては他マシンからSQL Server Management Studio等のGUIツールで接続して管理するか、コマンドが使用できる機能はコマンドで管理することになります。
SQL Server Code Name "Denali"では次のコマンドがサポートされています。
We can use command prompt utility and Management Tool from remote machine when we use SQL Server on Server Core.
The following Link contains a list of command prompt utilities that ship with SQL Server.

MSDN:Command Prompt Utility Reference (Database Engine)

ただこの全てがServer Coreで使用できる訳ではないようです。
"C:¥Program Files¥Microsoft SQL Server¥110¥Tools¥Binn"を覗いてみると、以下のコマンドが使用できそうです。
But we cannot use all command prompt utilities.
I exam "C:¥Program Files¥Microsoft SQL Server¥110¥Tools¥Binn" and I think that we can use the following command on Server Core.

bcp,osql,sqlcmd,sqldiag,dtexec,dtutil,sqlps

SQL Server Code Name "Denali"ではSQL Server Management Sutdioをコマンドで操作するSSMSコマンドと、SQL Server Profilerをコマンドで操作するPROFILERコマンドが追加されています。
これらはServer Coreでの使用を目指したものだと推測しているのですが、現状、/FEATURESにSSMSもしくはADV_SSMSを指定すると、GUIツールも含まれている為でしょう、「インストールできません」と返ってきます。
ここは今後のバージョンアップでコマンドラインツールのみが入る様になるのかな~と考えているのですがにひひ

SQL Server Code-Named "Denali" Adds new command prompt utility SSMS and POWERSHELL.
SSMS opens SQL Server Management Studio.
PROFILER launches the SQL Server Profiler tool.
I think these commands are used SQL Server "Denali" on Windows Server 2008 Server Core, but I cannot installed when I specify SSMS or ADV_SSMS to /FEATURE now.
I think that SQL Server "Denali" will install only command prompt utility when I specify SSMS to install on Server Coreにひひ

$Server OS Cafe-Denali_ServerCore3

最後に以下のコマンドを実行してリモートアクセスができるようにしておきます。
Finally,I executed following statements to remote access of SQL Server Code-Named "Denali".

1. SQL Serverのリモート接続を有効にします
Enable remote connections on the instance of SQL Server

sqlcmd /dmaster /Q"EXEC sys.sp_configure N'remote access', N'1' RECONFIGURE WITH OVERRIDE" /E

2. ファイアウォールでSQL Serverへの接続に使用するポートを開けます。
Create exceptions to allow SQL Server access in Windows Firewall

netsh advfirewall firewall add rule name="TCP1433" dir=in action=allow protocol=tcp localport=1433

$Server OS Cafe-Denali_ServerCore4