Jul 5, 2010

Установка Microsoft SQL Server 2008 R2 в деталях


 Настройка Slipstream
Для этого мы сначала качаем дистрибутив SQL Server 2008 R2 и распаковываем ISO-шник SQL Server-а в локальную папку, например в C:\Install\SqlServer. Затем качаем Cumulative Update package 1 for SQL Server 2008 R2 (указываем на сайте свой E-mail и качаем пакет обновлений, по присланной ссылке). Распаковываем скачанный архив и получаем exe-шник вида: SQLServer2008R2-KB981355-x64.exe. После этого распаковываем и копируем файлы пакета обновлений в локальную папку CU, которая должна находиться в C:\Install\SqlServer\:
SQLServer2008R2-KB981355-x64.exe /x:C:\Install\SqlServer\CU
После этого копируем Setup.exe из папки с обновлениями в папку инсталляции самого SQL Server:



robocopy C:\Install\SqlServer\CU C:\Install\SqlServer Setup.exe
Следующим шагом копируем все файлы кроме Microsoft.SQL.Chainer.PackageData.dll из папки с обновлениями, в папку инсталляции самого SQL Server:
robocopy C:\Install\SqlServer\CU\x64 C:\Install\SqlServer\x64
/XF Microsoft.SQL.Chainer.PackageData.dll
В данной статье я работаю только с апдэйтами для x64 архитектуры. И если вы также планируете впоследствии ставить SQL Server только на машины с одинаковой архитектурой CPU, то одного пакета обновлений достаточно. Но для создания универсального пакета установки (для x64, x86 и IA) нужно качать и проделывать то же самое для всех архитектур процессоров. Пример такой установки рассматривается здесь — http://x2u.ms/21u0
Последним шагом, завершающим настройку Slipstream, является настройка DefaultSetup.ini. Если в папке C:\Install\SqlServer\x64 есть файл DefaultSetup.ini, то добавляете в него следующую строчку: CUSOURCE=».\CU". Если файла там нет, то создаёте файл DefaultSetup.ini со следующим контентом:
;SQLSERVER2008 R2 Configuration File

[SQLSERVER2008]

CUSOURCE=".\CU"
На этом настройка Slipstream установки закончена и можно переходить непосредственно к установке.

Установка SQL Server 2008 R2

Итак, приступаем! Запускаем Setup.exe и в приветственном диалоге выбираем Installation –> New installation or add features to an existing installation:
image_thumb_5C9DC8E0
image_thumb_5646CC85
При запуске инсталляции в первую очередь производятся проверки совместимости операционной системы, хватает ли прав у пользователя для установки SQL Server и т.п. Если у вас уже стоит экземпляр SQL Server 2008, то вы увидите предупреждение о том, что общие компоненты (SQL Server Management Studio, Integration Services, Books Online и т.п.) будут обновлены до версии до SQL Server 2008 R2. Если все проверки пройдены, можно переходить к следующему шагу. И после распаковки файлов, необходимых для инсталляции и ещё одного этапа проверок, начнётся самое интересное – конфигурация установки:
image_thumb_604B47E3
Первым этапом которой будет ввод лицензионного ключа продукта, либо выбора бесплатной редакции (Evaluation, Express, Express with Advanced Services). И если вы ставите редакцию SQL Server, где ключ уже вбит в поле «Enter the product key» (например Developer Edition), то советую сохранить его где-то. Он впоследствии пригодится при установке других компонент SQL Server 2008 R2:
image_thumb_4ADD6CAE
Затем подтверждаем, что мы принимаем условия лицензионного соглашения. И по желанию выбираем опцию отправлять отчёт в Майкрософт, содержащий информацию о вашем оборудовании:
image_thumb_3BE617C7
Следующим шагом будет выбор формата установки, где предлагается 3 варианта:
— SQL Server Feature Installation – здесь все настройки придётся делать самому (его выбираем мы).
— SQL Server PowerPivot for SharePoint – кроме самого SQL Server, будет поставлен и сконфигурирован PowerPivot плагин к SharePoint.
— All Features With Defaults – для установки будут выбраны все фичи (с возможностью убрать то, что не нужно) и проставлены аккаунты по умолчанию для сервисов
image_thumb_69A3BABF
На следующем экране выбираем те компоненты SQL Server, которые хотим установить. Здесь я предлагаю выбрать всё, и вкратце расскажу про каждый элемент, который можно выбрать для установки (более детальное описание компонентов можно получить нажав F1 на текущем шаге):
— Database Engine Services – собственно сам SQL Server
— SQL Server Replication – компоненты репликации SQL Server используются для синхронизации баз данных
— Full-Text Search – компонент полнотекстового поиска позволяет организовать эффективный поиск по текстовым полям базы с учётов различных языков и различных форм слова
— Analysis Services – позволяет строить многомерные (OLAP) хранилища данных и DataMining модели для проведения анализа и постороения прогнозов
— Reporting Services – сервисы и инструменты для построения и управления отчётами
— Shared Features (они ставятся 1 раз, и будут доступны всем экземплярам, которые установлены на машине)
— Business Intelligence Development Studio – если стоит Visual Studio, то к ней добавляются новые типы проектов для разработки решений Analysis Services, Reporting Services и Integration Services. Если Visual Studio нет, то ставится «мини» Visual Studio, в которой доступны только эти, вышеперечисленные типы проектов
— Client Tools Connectivity – провайдеры для соединения клиентов с сервером
— Integration Services – сервисы, позволяющие организовать получение, преобразование и перенос данных из различных источников
— Client Tools Backwards Compatibility — SQL Distributed Management Objects (SQL-DMO), Decision Support Objects (DSO), Data Transformation Services (DTS)
— Client Tools SDK — SDK для разработчиков
— SQL Server Books Online – документация по SQL Server
— Management Tools – Basic – базовый вариант Management Studio, SQLCMD и SQL Server PowerShell provider
— Management Tools – Complete – полноценная Management Studio (поддержка Analysis Serveices, Integration Services, Reporting Services), Profiler, Database Engine Tuning Advisor, SQL Server Utility
— SQL Client Tools Connectivity SDK – на Microsoft Connect есть баг насчёт описания этого элемента :)  — SQL Client Connectivity SDK and Client Tools SDK DOCUMENTATION
— Microsoft Sync Framework – многофункциональная платформа синхронизации, позволяющая интегрировать любое приложение с любыми данными из любого хранилища, по любому протоколу и в любой сети.
image_thumb_2C52E02B image_thumb_40A87FE9
И после прохождения очередного этапа проверок, переходим к настройке экземпляра SQL Server. Здесь мы выбираем какой тип экземпляра мы хотим ставить: Default Instance или Named Instance. Отличаются они тем, что экземпляр по умолчанию на машине может быть только один и что к экземпляру по умолчанию мы можем обращаться по имени машины. Например если имя машины WORK, то при подключении к экземпляру по умолчанию этой машины мы укажем имя сервера WORK, а для именованного экземпляра WORK\<имя_экземпляра>. Но это не всё. Ещё одним отличием является то, что экземпляр по умолчанию висит на статическом порту (по умолчанию 1433) и мы не указываем имя порта при подключении, в то время как именованный экземпляр использует динамический порт и подключение к нему происходит при помощи службы SQL Browser. На этом шаге я выбираю Default Instance:
image_thumb_3B961C6D
После проверки места на жёстком диске открывается следующий шаг «Server Configuration». Здесь мы задаём учётные записи, под которыми будут запускаться службы SQL Server и тип запуска службы (автоматом, вручную либо вообще не запускать). Общая рекомендация Майкрософт создавать под каждую службу свою учётную запись, и давать ей необходимые права по мере необходимости. Например надо снимать бэкап базы данных в папку C:\Backup, даёте право учётной записи, под которой запущен SQL Server на запись в эту папку. Но в принципе… если это домашний компьютер, то можно запускать все сервисы под админом и не думать о правах :)
image_thumb_1D1BB5B7
И Collation для Database Engine и Analysis Services. Collation определяет кодовую страницу для не Unicode типов данных (char, varchar, text) и порядок сортировки текстовых данных.
image_thumb_2DD33A98
На следующем шаге мы конфигурируем доступ к SQL Server: задаём тип аутентификации и административные учётные записи (обязательно должны указать хотя бы одну). Windows аутентификация включена всегда, а SQL Server аутентификацию вы можете включить выбрав Mixed Mode. Пароль который вы при этом задаёте будет паролем учётной записи sa.
image_thumb_2854A427
На этом же шаге вы можете задать размещение пользовательских баз данных, tempdb и бэкапов.
image_thumb_3BD1DDFB
И включить FILESTREAM на уровне экземпляра. FILESTREAM позволяет хранить файлы в БД, сохраняя скорость потокового доступа к файлу и возможность сохранения ссылочной целостности БД. В принципе включить FILESTREAM вы можете потом, после установки, используя Configuration Manager.
image_thumb_3EB71CE1
Затем следует выбор административной учётной записи и папок для хранилища Analysis Services.
image_thumb_7EBD869B
И выбор конфигурации Reporting Services:
— Native mode – установка и конфигурация по умолчанию
— SharePoint integrated mode – установка ReportServer в SharePoint integrated mode и конфигурация по умолчанию
— Install but do not configure the report server – сконфигурировать его можно уже после установки при помощи Reporting Sevices Configuration tool
image_thumb_20E56C55
На предпоследнем шаге можно выбрать отсылать или нет отчёты об ошибках в Майкрософт.
image_thumb_0DB419DC
И, наконец, в завершение всего, можно увидеть список того, что сейчас будет устанавливаться. В том числе можно проверить что это действительно Slipstream установка. Но перед тем как нажимать Install, скопируйте путь к конфигурационному файлу, который вы видите на экране. Зачем, я расскажу позже. Ну а теперь всё. Запускаем и включаем футбол, процесс это не быстрый :)
image_thumb_4BF991F5
Ну вот и всё :) Установка завершена.
image_thumb_6E8DAAA3
И теперь, в завершение статьи я хочу рассказать о том, зачем нам понадобился файл конфигурации, путь к которому мы скопировали на последнем шаге установки. При помощи инструкций, сохранённых в этом файле, вы можете устанавливать SQL Server Server в одинаковой конфигурации на нескольких компьютерах. Файл конфигурации можно использовать только при установке из командной строки. Поэтому для такого способа установки необходимо запустить Setup.exe c указанием файла конфигурации, путь в которому мы сохранили на предпоследнем шаге мастера установки:

Remote Restart


Have you ever needed to remotely restart a Windows XP or Windows 2003 machine? Several scripted options exist (e.g., in the Microsoft Windows 2003 Server Resource Kit). However, you can accomplish the same task from the Microsoft Management Console (MMC).
  1. Open a computer management console for the machine you want to restart. I usually right-click the My Computer desktop icon and select Manage, then right-click Computer Management and select Connect to another computer. From the list, select the remote system you want to restart. Click OK.
  2. In the new window, right-click Computer Management and select Properties.
  3. In the dialog box that opens, select the Advanced tab.
  4. Click the Startup and recovery Settings button.
  5. Click Shut Down. The dialog box that opens will give you some shutdown options (e.g., Restart, Power down). Select the option you want and click OK.

Jul 1, 2010

SCCM Create a collection of computers that need a restart after patches

Sometimes after you patch the machine should restart during it's maintanence window.  There are always times with the client it told to restart but it never does.
This will create a collection of such computers.  From here I normally set an advertisment to run the "shutdown -r -f -c Patch restart -t 300"
This way the computer restarts during the normal MW.








select SMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name,
SMS_R_SYSTEM.SMSUniqueIdentifier,SMS_R_SYSTEM.ResourceDomainORWorkgroup,
SMS_R_SYSTEM.Client
from SMS_R_System
inner join SMS_G_System_PatchStatusEx on SMS_G_System_PatchStatusEx.ResourceID = SMS_R_System.ResourceId where SMS_G_System_PatchStatusEx.LastStateName = "reboot pending"

Jun 29, 2010

Video TechDays 2010: WMI for the SCCM Admin




Since its first debut System Center Configuration manager and its predecessors have been relying heavily on the Windows Management Instrumentation (WMI) architecture. WMI is omni-present is System Center Configuration Manager, from queries over dynamic collections, through hardware inventory and storing client and Management Point settings and policies, under the hood you will find WMI just about anywhere. Given this omni-presence it should come as no surprise that the stability of WMI at your Site Systems and clients is crucial to a stable System Center Configuration Manager implementation. Knowing WMI, by consequence, is a great asset to any System Center Configuration Administrator. In this session you will learn the ins-and-outs of the WMI architecture in general and how it applies to System Center Configuration Manager. You’ll learn about the available namespaces and classes and the extended WMI Query language (WQL) that is specific to System Center Configuration Manager. This session will cover the tools available to have a peak at WMI yourself as well as to the WMI-related tool called policy spy that comes with the System Center Configuration Manager toolkit. By the end of this session you’ll know what the WMI architecture looks like, how System Center Configuration Manager uses it, and how you can use that knowledge to your advantage, be it to be able to better troubleshoot System Center Configuration Manager issues, better understand the product, or to automate tasks through scripting or programming. In the end this session will make you a better System Center Configuration Manager administrator.

OpsMgr - Cross Platform Discovery Errors

The key to being able to monitor a server is being able to discover that server :), until you can get the server into Operations Manager you aren't going to be able to do much with it.  While the discovery process for Unix and Linux servers seems simple enough, there is a lot going on behind the scenes that is hidden by the wizard.  In a previous entry I went over a successful discovery path (OpsMg and Cross Plat-Getting Started), for this post I'm going to go over some of the errors that can occur and how to resolve them.
The first one I'll talk about is Not Enough Entropy, this one required a little digging to figure out what was wrong.  The exact error is Failed to allocate resource of type random data: Failed to get random data - not enough entropy.


Entropy
I've had this issue when discovering both RHEL and SLES servers and it is related to certificate generation. 
There are two ways to solve this problem, you can recreate the /dev/random file or do a manual agent install.
For both fixes, clean off the partially installed agent using the commands





  1. rpm -e scx
  2. rm -rf /etc/opt/microsoft/scx
Then if you want to make it so that discovery will work from the wizard use the commands
  1. rm /dev/random
  2. mknod -m 644 /dev/random c 1 9
  3. chown root:root /dev/random
A manual install requires copying the appropriate package from %Program Files%\System Center Operations Manager 2007\AgentManagement\UnixAgents to the Unix\Linux machine and installing it directly.
After fixing the install issue, switch the /dev/random file back to a signed random file using the commands:
  1. rm /dev/random
  2. mknod -m 644 /dev/random c 1 8
  3. chown root:root /dev/random
Next, let's look at Unspecified Problem, this is one where I am sure there is a whole gamut of reasons why it occurs.  The text is Starting Microsoft SCX CIM Server:  Unspecified Problem. 
Unspecified 
The key here is that we can see that the certificate was generated by the statement "Generating certificate with hostname..." so we know we need to look at things after the certificate creation.  The only reason I have found for this error is the firewall, after installation and certificate generation there is a validation step.  If you watch the steps through the wizard, the error pops up almost immediately so the wizard is unable to verify the agent suggesting a communication issue.  Ensure that port 1270 has been opened on the firewall and try to discover again.
Some of the other errors I've run into over time are:
Access is Denied, this one pops up from time to time when an agent installation failed for some reason, you fixed the underlying reason and tried again. The problem is the partially installed agent is blocking the re-install, the fix is to clean off the agent and do a fresh install the same way we  did for Not Enough Entropy.
Cannot connect to port 1270, this one typically occurs when there is a library path issue on the monitored server.  If you go to the server, you'll likely see that the service failed to start. Trying to restart the service will give you the name of the library that cannot be found.  
The typical resolution path for linux is:
  1. scxadmin -restart all
  2. See what library is missing 
  3. find / -name   
  4. vi /etc/ld.so.conf 
  5. add path to missing library  
  6. ldconfig to reload dynamic loader  
  7. scxadmin -restart all   

The path for Solaris is the same for steps 1 - 3 but differs when it comes to setting the library path:
  1. crle to see the current path
  2. crle -l to update the path (include the old path plus the new path because the command is a replacement, not an append) 
  3. scxadmin -restart all  

Can not resign certificate, /etc/opt/microsoft/ssl/scx-host-.pem already exists,in this situation the re-creation of a certificate was attempted but failed because there was a previously generated certificate on the target host.  If you want to generate a new certificate, simply delete the contents of the /etc/opt/microsoft/ssl directory.  Alternatively you can export the certificate and trust it on the management server.

winrm failed to connect in a timely manner, this can happen if the target server is over loaded. OpenPegasus will time out after 20 seconds or so and this can result in a failure to validate the agent was properly installed.  The fix here is to ensure the agent was in fact installed using scxcimcli ei -n root/scx CIM_ManageElement on the target server and then retrying the discovery.
 
There are  many other things that couild go wrong during discovery but in most cases the error message you receive should help you determine how to fix the problem. One thing to watch is at what phase the error occurred: Initial discovery (name resolution issues), Installation (user account issues), Signing (certificate issues), Validation (configuration issues), knowing where to start looking is half the battle to getting our servers successfully discovered.

Jun 8, 2010

How to: Import a Microsoft Update into ConfigMgr

Many of us try to enable as few categories as possible in ConfigMgr for software updates synchronization.  You may encounter a need to deploy an update from a classification or product you don’t normally synchronize.  To accomplish this task, you could choose one of the following:


  1. Create a standard Package/Program/Advertisement, which means you will have to take care of proper targeting
  2. Modify the Software Update Component on your central site to allow synchronization of the new classification and/or product, but then you may end up synchronizing a lot more than you did previously.
  3. Use System Center Updates Publisher (SCUP) to create deployment rules.  This would work great, but requires additional effort on your part also.
  4. Use the Windows Update Catalog to import the update. This works great for many reasons: 1) it requires the least effort, 2) has the least database bloat, 3) will handle the detection rules for you, and 3) deploy like a ‘normal’ Microsoft Update, giving you the best end-user experience possible.
What is the Microsoft Update Catalog? “It's a service from Microsoft that provides a listing of updates that can be distributed over a corporate network. You can use it as a one-stop location for finding Microsoft software updates, drivers, and hotfixes.” It allows you to search the catalog (kind of like a shopping experience), add updates to the basket, then import them to WSUS. After importing, you then launch the “Run Synchronization” action on the ConfigMgr Update Repository to make the updates visible in the ConfigMgr console.
Follow these steps to import an update from the Windows Update Catalog:
  1. From your ConfigMgr Central Site server, launch the Windows Server Update Services console.
  2. Expand the tree to “Updates”, then select “Import Updates” from the action pane. This launches the Microsoft Update Catalog in your web browser (internet access required).
  3. Search by keyword, KB number, or even plug-and-play ID!
  4. Click “Add” on desired updates:
  5. image
  6. Click “View basket”
  7. Click “Import” – this action imports the update into your top WSUS Server for ConfigMgr.
  8. From ConfigMgr, launch the “Run Synchronization” action on the ConfigMgr Update Repository node.
  9. Select and deploy updates as you normally do.
As you can see, the Microsoft Update Catalog can be a very handy tool, and it’s there to make your job easier, so take advantage of it!

Remote Desktop Services Management Pack

Version: 6.1.7600.0
Date Published: 5/27/2010
Feature Summary This management pack provides monitoring of the following Remote Desktop Services role services:
  • RD Session Host
  • RD Virtualization Host
  • RD Licensing
  • RD Gateway
  • RD Connection Broker
  • RD Web Access
http://www.microsoft.com/downloads/details.aspx?FamilyID=bd5710af-7218-4162-9b94-23396625e3b3&displaylang=en