Azureの小ネタ (改)

~Azureネタを中心に、色々とその他の技術的なことなどを~

データベースのバックアップ先にBLOBを指定する

SQL Server 2012 SP1 以降から、データベースのバックアップ先にBLOBを指定することができるので、ためしてみました。

環境

試した環境は以下の通り。ちなみにSQL Serverは、Express版でも大丈夫です。

  • Windows Server 2012 R2
  • SQL Server 2014 Express

Azureのストレージアカウントは予め作成しておきましょう。

Credential

初めに、認証情報を定義しておく必要があります。以下の、CREATE CREDENTIAL で、認証情報を定義します。

CREATE CREDENTIAL mycredential WITH 
IDENTITY = 'ストレージアカウント',
SECRET = 'アカウントキー' ;

以下のテーブルをみると、情報が確認できます。

SELECT * FROM sys.credentials

バックアップ

いくつか制限がありますが、代表的な物として、

  • 1TB以上はバックアップできない
  • 追記付加、WITH FORMATオプションで上書きできる。

試しに、Hogeデータベースをバックアップする場合は以下の取りとなります。コンテナは予め作っておかないとエラーがでました。

BACKUP DATABASE Hoge
TO URL = 'https://somestorageaccount.blob.core.windows.net/mycontainer/Hoge.bak'  
      WITH FORMAT, CREDENTIAL = 'mycredential' 
     ,STATS = 5 ;
GO 

参考URL

HPC Pack 2012 R2 Update1 のバージョン番号

個人的備忘録です。

リリースノートを参照すると、 Release Notes for Microsoft HPC Pack 2012 R2 Update 1

You can confirm that the head node is upgraded to HPC Pack 2012 R2 Update 1. To view the version number in HPC Cluster Manager, on the Help menu, click About. The server version number and the client version number that appear will be 4.3.4652.0.

とのことですので、バージョン情報からサーバーバージョンを確認します。

f:id:StateMachine:20150121221104p:plain

ダイアログには、Update1の表示はありませんが、Update1ということになります。

Azure Websites 上のPowerShell バージョン

Azure Websites (← Webサイトから変わったんすね)の PowerShell バージョンは、

PS D:\home> $psversiontable
Name                           Value                                           
----                           -----                                           
PSVersion                      3.0                                             
WSManStackVersion              3.0                                             
SerializationVersion           1.1.0.1                                         
CLRVersion                     4.0.30319.36213                                 
BuildVersion                   6.2.9200.16628                                  
PSCompatibleVersions           {1.0, 2.0, 3.0}                                 
PSRemotingProtocolVersion      2.2                      

でした。

で、所用でKuduのPSコンソール上から、Invoke-WebRequest を呼び出したら、

Invoke-WebRequest : The response content cannot be parsed because the Internet Explorer engine is not available, or Internet Explorer's first-launch configuration is not complete. Specify the UseBasicParsing parameter and try again.

IE云々で使えねーておこられました。”UseBasicParsing” オプション付けろといつので、付けてみたのですが、

Invoke-WebRequest : Win32 internal error "The handle is invalid" 0x6 occurred while reading the console output buffer. Contact Microsoft Customer Support Services.

って怒られて詰みました。curl つかうか....

追記

ってなツイートがあったため試してみたところ無事うごきました。