poniedziałek, 28 listopada 2016

[EN] Windows Server 2008R2 SP1 - How solve error "The description for Event ID from source Microsoft-Windows-EventForwarder cannot be found." when is used event subscription

If after configuring Event subscription, you see  in Event Viever  event with description "The description for Event ID XXX from source Microsoft-Windows-EventForwarder cannot be found. Either the component that raises this event is not installed on your local computer or the installation is corrupted. You can install or repair the component on the local computer." to solve this problem you should execute this command from Command Line (CMD) on machine who is collector:   


wecutil ss YOUR_SUBCRIPTION_NAME /l:en-US

This method was tested on Windows Server 2008 R2 x64 SP1 with English United States regional / language settings.

sobota, 26 listopada 2016

[EN] How install Red Hat VirtIO Network Ethernet Adapter on 64-bit Windows Server 2008R2 SP1?

On Windows Server 2012 R2 you should: 1) insert virtio-win ISO into optical drive, 2) browse content optical drive for find NetKVM driver for your operating system, right click on netkvm.inf and select Install.  On Windows Server 2008 R2 after select Install from right click on netkvm.inf you see  error The INF file you selected does not support this method of installation.

 Solution:
1) On virtual machine, open Device Manager 
2)  Right Click on Other Devices - Ethernet Controller and select Update Driver Software

3) On screen How do you want to search for driver software? select Browse my computer for driver software - Locate and install driver software manually
 4) On screen Browse for driver software on your computer specify path for NetKVM driver on optical drive, e.g: D:\NetKVM\2k8R2\amd64 and click Next
 5) On screen Installing driver software you agree of installation driver from Red Hat Inc. and wait for end of installation.
 6) In Device Manager you should appear Network adapters \ Red Hat VirtIO Ethernet Adapter


środa, 16 listopada 2016

[PL] PowerShell - skrypt do testowania łączności z SQL Server 2014 SP2 / [EN] PowerShell - script for test connection with SQL Server 2014 SP2

Wersja polska (Polish version, English version is below)

Poniżej zamieszczam skrypt w PowerShellu, który  - wywołany wielokrotnie z poziomu innego skryptu (patrz zdjęcie poniżej) - pozwala na przetestowanie wysokiej dostępności bazy danych na serwerze SQL Server 2014 SP2, np. po zastosowaniu AlwaysOn z opcją automatycznego trybu failover.

Skrypt wykonuje zapytanie SELECT * FROM [dbo].[TEST] na bazie danych M03 na serwerze o nazwie LAB01 na instancji nazwanej TEST01 używając uwierzytelniania na poziomie SQL Server a nie Windows authentication jako użytkownik user01 z hasłem NaszeHaslo11!.Na potrzeby działania skryptu należy utworzyć wcześniej tabelę testową, z której będziemy odczytywać dane.

$data = Get-Date

Write-Host "Run date of script: $data"

$dataSource = "LAB01\TEST01"
$user = "user01"
$pwd = "NaszeHaslo11!"
$database = "M03"

$Query = "select * from [dbo].[TEST]"

$QueryTimeout = 120
$ConnectionTimeout = 30

$conn=New-Object System.Data.SqlClient.SQLConnection

$connectionString = "Server=$dataSource;uid=$user;
pwd=$pwd;Database=$database;Integrated Security=False;"


$conn.ConnectionString=$ConnectionString
$conn.Open()
$cmd=New-Object system.Data.SqlClient.SqlCommand($Query,$conn)
$cmd.CommandTimeout=$QueryTimeout
$ds=New-Object system.Data.DataSet
$da=New-Object system.Data.SqlClient.SqlDataAdapter($cmd)
[void]$da.fill($ds)
$conn.Close()
$ds.Tables

Przykład:


Skrypt utworzyłem na podstawie skryptu Iris Classon i skryptu znalezionego na StackOverflow.

English version


I place below script in PowerShell.

Presented script executes the query SELECT * FROM [dbo].[TEST] to  to SQL Server 2014 database named M03 on server: named LAB01 and instance named TEST01 using SQL Server authentication as user01 with password YourPassword!1. Before running the script, you should create a test table in the database from which will read the data.


$data = Get-Date

Write-Host "Run date of script: $data"

$dataSource = "LAB01\TEST01"
$user = "user01"
$pwd = "YourPassword!1"
$database = "M03"

$Query = "select * from [dbo].[TEST]"

$QueryTimeout = 120
$ConnectionTimeout = 30

$conn=New-Object System.Data.SqlClient.SQLConnection

$connectionString = "Server=$dataSource;uid=$user;
pwd=$pwd;Database=$database;Integrated Security=False;"


$conn.ConnectionString=$ConnectionString
$conn.Open()
$cmd=New-Object system.Data.SqlClient.SqlCommand($Query,$conn)
$cmd.CommandTimeout=$QueryTimeout
$ds=New-Object system.Data.DataSet
$da=New-Object system.Data.SqlClient.SqlDataAdapter($cmd)
[void]$da.fill($ds)
$conn.Close()
$ds.Tables

If you run multiple times this script from another script (see below on the screen), you can test high availbility of your SQL Server 2014 SP2 databases (for example if you use AlwaysOn solution with automatic failover option).

Example:



The script is based on a script Iris Classon and script which I found on StackOverflow.

wtorek, 8 listopada 2016

[PL] SQL Server 2014 SP2 - instalacja nienadzorowana / [EN] SQL Server 2014 SP2 - unattend installation

Wersja polska (Polish version, English version is below)

Jeżeli posiadamy do zainstalowania większą ilość instancji SQL Server możemy jednorazowo przejść proces instalacji używając graficznego instalatora do etapu "Ready to Install", na którym zwracamy uwagę na ścieżkę do pliku ConfigurationFile.ini


Wspomniany plik możemy wykorzystać na potrzeby przeprowadzania tzw. instalacji nienadzorowanych SQL Server - czyli wywoływanych z wiersza polecenia i nie wymagających interakcji użytkownika za pośrednictwem graficznego instalatora.

W tym celu kopiujemy wspomniany plik na przykład na dysk C i edytujemy usuwając linię UIMODE="Normal". Następnie z poziomu wiersza polecenia (CMD) możemy wywołać instalację korzystając z następującego polecenia:

D:\setup.exe /ConfigurationFile=C:\ConfigurationFile.ini /Q /IACCEPTSQLSERVERLICENSETERMS /SAPWD="test" /SQLSVCPASSWORD="test" /AGTSVCPASSWORD="test"

gdzie:
  • D:\setup.exe to lokalizacja instalatora SQL Server
  • /Q oznacza tzw. instalację cichą, nie wymagającą interakcji użytkownika
  •  /SAPWD - określamy hasło użytkownika SA o ile korzystamy w trybu uwierzytelniania MIXED a nie Windows
  •  /SQLSVCPASSWORD - określamy hasło dla konta usługi SQL Server Database Engine
  •  /AGTSVCPASSWORD - określamy hasło dla konta usługi SQL Server Agent
Po uruchomieniu powyższego polecenia zostanie uruchomiona instalacja SQL Server, a w przypadku wystąpienia błędów zostanie wyświetlony komunikat. Brak komunikatów z błędami i znak zachęty do wprowadzenia kolejnego polecenia w wierszu polecenia oznacza powodzenie instalacji.


Oprócz tego warto wspomnieć, że istnieją parametry:
  • /ASSVCPASSWORD - gdzie możemy określić hasło dla konta usługi Analysis Services
  • /ISSVCPASSWORD - gdzie możemy określić hasło dla konta usługi Integration Services
  • /RSSVCPASSWORD - gdzie możemy określić hasło dla konta usługi Reporting Services

Istnieje także możliwość określenia nazw kont serwisowych dla konkretnych usług bezpośrednio z wiersza polecenia. Służą do tego parametry /AGTSVCACCOUNT (dotyczy SQL Server Agent), /ASSVCACCOUNT (dotyczy Analysis Services), /SQLSVCACCOUNT (dotyczy SQL Server Database Engine), /ISSVCACCOUNT (dotyczy Integration Services), /RSSVCACCOUNT (dotyczy Reporting Services).

Prezentowana metoda została przetestowana w środowisku: Windows Server 2012 R2 Standard x64 i SQL Server 2014 SP2.
Więcej informacji na temat możliwości przeprowadzania instalacji nienadzorowanych znajdziemy w dokumentacji SQL Server w artykule Install SQL Server 2014 from the Command Prompt.

English version

In order to prepare unattend installtion when you want install SQL Server many times, you can run the graphical installer and proceed to "Ready to install" page on which the is "Configuration file path".



ConfigurationFile.ini can be used to prepare unattend installation SQL Server - made of from command line (CMD) and not requiring answers to questions in graphical installer. To do this:
1. Copy ConfigurationFile.ini to - for example - local disk C.
2. Edit ConfigurationFile.ini - remove UIMODE="Normal" and save it
3. Open Command Line (CMD.EXE) and run follow command:


D:\setup.exe /ConfigurationFile=C:\ConfigurationFile.ini /Q /IACCEPTSQLSERVERLICENSETERMS /SAPWD="test" /SQLSVCPASSWORD="test" /AGTSVCPASSWORD="test"

where:
  • D:\setup.exe - means the location of the installer SQL Server
  • /Q - means quiet type of installation, without interaction from user
  •  /SAPWD - specify password for SA user (if you use Mixed mode authentication  instead Windows)
  •  /SQLSVCPASSWORD - specify password for  service account of SQL Server Database Engine
  •  /AGTSVCPASSWORD - specify password for  service account of SQL Server Agent
No information about the error and the possibility of introducing the next command in the CMD means that the installation was successful.

Except that, also exist command-line parameters listed below:
  • /ASSVCPASSWORD - where we can specify password for  service account of Analysis Services
  • /ISSVCPASSWORD - where we can specify password for  service account of Integration Services
  • /RSSVCPASSWORD - where we can specify password for  service account of Reporting Services
We can also specify service account name from command line parameters. To do this we can use follow parameters: /AGTSVCACCOUNT (for SQL Server Agent), /ASSVCACCOUNT (for Analysis Services), /SQLSVCACCOUNT (for SQL Server Database Engine), /ISSVCACCOUNT (forIntegration Services), /RSSVCACCOUNT (for Reporting Services).

The presented method was tested on: Windows Server 2012 R2 Standard x64 and SQL Server 2014 SP2.

Additional information about unattend installations of SQL Server we find at documentation of SQL Server in article: Install SQL Server 2014 from the Command Prompt.

wtorek, 1 listopada 2016

[PL] Windows Server 2012R2 - problem z walidacją i utworzeniem klastra failover / [EN] Windows Server 2012R2 - problems with validate / create failover cluster

Wersja polska:
Jeżeli podczas walidacji konfiguracji klastra Failover pod Windows Server 2012R2 pojawi się błąd "validate Active Directory Configuration - It cold not be determined whether node XXXXXX is a read-only domain controller because of this error: the object does not exists" bądź podczas tworzenia klastra failover wyświetla się błąd "There was an error cleaning up the cluster nodes. Use Clear-ClusterNode to manually clean up the nodes." oznacza to, że należy zaktualizować serwer używając Windows Update oraz nie należy wskazywać kontrolera domeny jako jednego z węzłów klastra.

English version:
If during the validation of the failover cluster on Windows Server 2012R2 you see an error:
"validate Active Directory Configuration - It cold not be determined whether node XXXXXX is a read-only domain controller because of this error: the object does not exists"
 
or during the create failover cluster you see an error:
"There was an error cleaning up the cluster nodes. Use Clear-ClusterNode to manually clean up the nodes."
This means that you should update your server with Windows Update and you should not  install failover cluster node on server who is domain controller.

Source: KB281662 - "It is not supported to combine the Active Directory Domain Services role and the Failover Cluster feature on Windows Server 2012"