zondag 30 september 2012

Install Guide – SCCM 2012 SP1 + Server 2012 + SQL 2012 (CU 3)

I don't want to write the whole procedure because it has been done many times by other people. I only want to point out some issues I have encountered in setting up the environment.

I followed this great procedure from Rob Marshall, so credits for writing the guide goes to that guy ;)
http://myitforum.com/myitforumwp/2012/09/16/install-guide-configmgr-2012-sp1-beta-server-2012-sql-2012-cu-3/

Issue 1:
When installing your DC, never choose 2012 ad the domain/forest level, since the System Center products will not recognise that level, and so you will have an error when you run the prerequisite checker.

Issue 2:
After I had extended the AD Schema, and configured the "System Management" object in AD, I still had the error in the prerequisite checker that my domain level was not at the correct level + AD was not extended. Well, turns out you need to be logged in as domain admin when you run the prerequisite checker. I was logged in as local admin and that's why I wasted to many time searching for the answer :p

Issue 3:
Defining security rights on the "System Management" OU (right click - properties - security) is not enough. You need to use the delegate control, otherwise SCCM cannot populate the OU.

Issue 3:
At first, SCCM wasn't synchronizing with WSUS for software updates. Apparently, when you install and configure the software update point in SCCM, at a certain point you need to select the wsus ports. I chose default, but that will not work, since WSUS uses a custom port: 8530 for HTTP and port 8531 for HTTPS (SSL). So make sure you select the 2nd option: custom ports

zaterdag 11 februari 2012

Installing custom Rom on Samsung Galaxy S Plus I9001

As it took me a couple of days to get my phone working with a custom ROM, I decided to write down what I did and put it on my blog... There is so much documentation to be found and I followed like tens of different guides for installing a custom ROM. I tried 4 different ROMS, but the one that was finally workibng was BroodRom RC3. I found it on XDA Developers, but the way I succeeded was slightly different from the one that was described over there...


Installing Broodrom RC3:
  1. Root phone: http://forum.xda-developers.com/wiki/Samsung_Galaxy_S_Plus/GT-I9001
    Put Root-i9001-Signed.zip into internal sdcard
    1. Reboot into recovery mode by turning on the phone while pressing Volume Up and Power Button
    2. As soon as the "Android out of the Box" appears, press the Menu button
    3. Use Volume buttons to choose "apply update from sdcard" in the recovery menu.
    4. Press Home button to submit.
    5. Use Volume buttons to choose Root-i9001-Signed.zip on sdcard
    6. Press Home button to start update.
    7. Choose "reboot system now" and press Home button to reboot your phone.
  2. Backup phone with Samsung Kies
  3. Install broodrom: http://forum.xda-developers.com/showthread.php?t=1396837
1.       If you have CWM installed: format all partitions. If you don't have CWM installed do a Hard Reset (*2767*3855#) Note: A hard reset also wipes your sdcard, make sure you got it backed up
Note: A format or hard reset is not always needed, you can always try keeping your data and flashing broodROM RC3, wiping dalvik cache is still needed tho
2.       Put your phone in download mode (when off hold: vol -, home, power)
3.       Start Odin, Choose AriesVE.ops file, check "One Package", choose: "broodROMRC3.tar.md5" > Click Start
4.       Wait till the process is complete, now your phone will reboot and show you recovery mode, press the home button > press the menu button then wait for the update to complete > press the home button again
5.       Now your phone will reboot again and show you the boot screen, it will turn black after a while, don't freak out this is normal
6.       When your phone booted choose your language and turn your phone off, put it in download mode again (when off hold: vol -, home, power)
7.       Now restart Odin and do the same as step 3 but then choose "broodROMRC3_KERNEL.tar.md5" > Click Start
8.       After the installation of the kernel wait till the phone is booted
9.       Now make an usb connection to your pc and put the "broodROMRC3_Configuration.zip" file on your sdcard
10.   Now long press the power button to show the Extended Power Menu, Choose "Recovery" to reboot in CWM Recovery
NOTE: IF YOUR PHONE ISN’T BOOTING IN RECOVERY MODE AND IT ALWAYS GETS STUCK ON THE LOGO “ANDROID OUT THE BOX” THEN INSTALL FEAMOD RECOVERY 1.1 OR 1.2 first:
http://forum.xda-developers.com/showthread.php?t=1331164
11.   Once in recovery, go to "Install zip from sdcard" > "Choose zip from internal sdcard" > "broodROMRC3_Configuration.zip"
12.   Wait for the update to complete then choose "Reboot system now".
13.   Go to the Market and download "Script Manager" then follow the image



maandag 2 januari 2012

UPGRADING SCOM 2007 R2 TO SCOM 2012

As of 13th of December, Microsoft released the Release Candidate version of Scom2012. I went ahead and migrated scom2007R2 in a test environment to Scom2012. I decided to write a document about it and post it on my blog. I came across some issues which are all included in this guide.


Supported configurations

http://technet.microsoft.com/nl-nl/library/hh205990%28en-us%29.aspx

Upgrade Paths

Single-server Upgrade (Simple)
Use this upgrade path when you have an Operations Manager 2007 R2 management group where all features are installed on the same server, and the hardware and software meets the minimum supported configuration for System Center 2012 – Operations Manager.

Single-server Upgrade (Complex)
Use this upgrade path when you have an Operations Manager 2007 R2 management group where all features are installed on the same server, and the hardware and software do not meet the minimum supported configuration for System Center 2012 – Operations Manager. If the operating system on the server is 32-bit, a new, 64-bit server is required.

Distributed Upgrade (Simple)
Use this path when you have an Operations Manager 2007 R2 management group where various features are installed on separate servers, all of which meet the minimum supported configurations for System Center 2012 – Operations Manager.

Distributed Upgrade (Complex)
Use this path when you have an Operations Manager 2007 R2 management group where various features are installed on separate servers, and where one or more servers do not meet the minimum supported configuration for System Center 2012 – Operations Manager. For example, if the RMS is clustered, you must follow this path. If the operating system on any of the server is 32-bit, new 64-bit replacement servers are required.

This guide will focus only on the Single-server Upgrade (Simple) path.



Checklist: Single-Server Upgrade (Simple)

Always check if everything meets the requirements described here:
Also note that the minimum cumulative update version installed must be CU4. This can be check via:
Scom 2007 R2 console
à help à about.
The version numer corresponds with a certain CU level:
http://support.microsoft.com/kb/2453149

Task list

  • Import the Upgrade Helper Management Pack
  • Review the Operations Manager 2007 R2 event logs.
  • Remove agents from Pending Management.
  • Check the Operations Manager 2007 R2 RMS for Active Connected Consoles
  • Back up the RMS encryption key (SecureStorageBackup.exe).
  • Disable all notification subscriptions.
  • Stop services or disable any connectors that are installed.
  • Verify that the Operational Database Has More than 50 Percent of Free Space
  • Verify that you have a supported SQL Server collation on all databases and instances of databases.
  • Back up the Operations Manager Databases
  • Upgrade SQL Server Reporting Services
  • Upgrade the installed agents.
  • Run the management group upgrade on the root management server.
  • Re-enable the notification subscriptions
  • Restart or re-enable the service for any connectors that are installed.
  • Distribute the Run As account.
  • Update overrides.
  • Verify the success of the upgrade.
  • Upgrade gateway servers



Import the Upgrade Helper Management Pack

The Upgrade Helper MP can be found on the Scom2012 installation media. So when importing the MP choose import from disk and select the “OperationsManager.Upgrade.mp” from the “Management Packs” directory.

Review the Operations Manager 2007 R2 event logs
Review the event logs for Operations Manager 2007 R2 on the root management server (RMS) and on the management servers to look for recurring warning or critical events. Address them and save a copy of the event logs before you perform your upgrade.

Remove agents from Pending Management

To remove agents that are in Pending Management:
-         Log on to the Operations console by using an account that is a member of the Operations Manager Administrators role for the Operations Manager 2007 management group.
-         In the Administration pane, expand Device Management, and then click Pending Management.
-         Right-click each agent, and then click Approve or Reject.

Check the Operations Manager 2007 R2 RMS for Active Connected Consoles

Consoles that are connected to the Operations Manager 2007 R2 RMS might lose connectivity during the upgrade of the management group. Before you perform the upgrade of the management group, you should notify anyone who has a connected console to close the connection.

Back up the RMS encryption key

The Operations Manager 2007 R2 root management server (RMS) encryption key is necessary to decrypt secure data in the operational database. When you have a backup of the RMS encryption key, you can import the key on a new management server when you upgrade the management group from an Operations Manager 2007 R2 secondary management server.
To back up the encryption key by using the Encryption Key Backup or Restore Wizard
-         Log on to the computer hosting the secondary management server with an account that is a member of the Administrators group.
-         Open “SecureStorageBackup” from the original Scom 2007 installation folder
-         In the Encryption Key Backup or Restore Wizard, on the Backup or Restore page, select the Backup the Encryption Key option, and then complete the wizard, providing a location and password for the key.
-         Store the encryption key in a location that can be easily accessed, such as a file share. You have to restore this encryption key on all management servers in your management group before you upgrade.


Disable all notification subscriptions.

You should disable notification subscription before you upgrade the management group to ensure that notifications are not sent during the upgrade process.
To disable subscriptions:
-         Log on to the Operations console account that is a member of the Operations Manager Administrators role for the Operations Manager management group.
-         In the Operations console, select the Administration view.
-         In the navigation pane, expand Administration, expand the Notifications container, and then click Subscriptions.
-         Select each subscription, and then click Disable in the Actions pane.

Stop services or disable any connectors

By default, no connectors are installed. But if you have: Refer to the non-Microsoft connector documentation for any installed Connectors to determine the services used for each Connector, and whether it is supported for System Center 2012 – Operations Manager.
To stop a service for Connectors:
-         On the Start menu, point to Administrative Tools, and then click Services.
-         In the Name column, right-click the Connector that you want to control, and then click Stop.

Verify that free space of the Operational Database

You must verify that the operational database has more than 50 percent of free space before you upgrade the management group because the upgrade might fail if there is not enough space. You should also ensure that the transactions logs are 50 percent of the total size of the operational database.
To check how much free space the Operational Database has:
-         On the computer that hosts the operational database, open SQL Server Management Studio.
-         In the Object Explorer, expand Databases.
-         Right-click the operational database, point to Reports, Standard Reports, and then click Disk Usage.
-         View the Disk Usage report to determine the percentage of free space.
To increase the free space for the operational database and log files:
-         On the computer that hosts the operational database, open SQL Server Management Studio.
-         In the Connect to Server dialog box, in the Server Type list, select Database Engine.
-         In the Server Name list, select the server and instance for your operational database (for example, computer\INSTANCE1).
-         In the Authentication list, select Windows Authentication, and then click Connect.
-         In the Object Explorer pane, expand Databases, right-click the operational database, and then click Properties.
-         In the Database Properties dialog box, under Select a page, click Files.
-         In the results pane, increase the Initial Size value for the MOM_DATA database by 50 percent.



Verify SQL Server collation

SQL Server collation for all databases and database instances must be SQL_Latin1_General_CP1_CI_AS; no other collation configurations are supported. You must ensure that all databases and database instances have the correct collation before you run upgrade on the management group.
To determine the SQL Server collation of a database, you can check the database properties. In SQL Server Management Studio, right-click the database you want to check, and then click Properties. The collation is listed under Maintenance.

Back up the Operations Manager Databases

Obtain verified recent backups of the operational database and of the data warehouse database before you upgrade the secondary management server. You should also create backups of databases for optional features, such as the Reporting and the Audit Collection Services database before you upgrade them. For more information, see How to: Back up a Database and How to Schedule Backups of Operations Manager Databases.

Upgrade SQL server reporting services

System Center 2012 – Operations Manager requires either SQL Server 2008 R2 or SQL Server 2008 R2 Sp1 on the SQL Server Reporting Services database (SSRS). For information about upgrading to SQL Server, see Upgrading to SQL Server 2008 R2.

Upgrading agents

Upgrading Push-Installed Agents
To upgrade push-installed Windows agents by using the Operations console
  1. If you are upgrading agents in a distributed management group or if you have added a secondary management server, log on to the computer hosting the Operations Manager 2007 R2 Operations console. Use an account that is a member of the Operations Manager Administrators role for the Operations Manager 2007 R2 management group.
If you are upgrading agents in a single-server management group, log on to the computer hosting the Operations Manager Operations console by using an account that is a member of the Operations Manager Administrators role.
  1. In the Operations console, click Administration.
  2. In the Administration workspace, in the navigation pane under Device Management, click Pending Management.
  3. In the Pending Management pane, under Type: Agent Requires Update, right-click each agent-managed computer listed, and then click Approve.
  4. In the Update Agents dialog box, enter the administrator account credentials, and then click Update. The upgrade status is displayed in the Agent Management Task Status dialog box.
  5. When the upgrade is completed, click Close.

Upgrading Manually Installed Agents
To upgrade a manually installed Windows agent by using the Setup Wizard
  1. Log on to the computer that hosts the agent with an Operations Manager Administrators role account for your Operations Manager 2007 R2 management group.
  2. Run Setup.exe from the System Center 2012 – Operations Manager installation media.
  3. On the first page of the Setup Wizard, click Local agent. When the Welcome to the Operations Manager for System Center 2012 Agent Upgrade Wizard page opens, click Next.
  4. In the Operations Manager for System Center 2012 Agent Setup dialog box, click Upgrade. The status page displays the progress of the upgrade.
  5. When the Completing the Operations Manager for System Center 2012 Agent Setup Wizard page appears, click Finish.
To upgrade a manually installed Windows agent by using the Command Prompt window
  1. Log on to the computer hosting the agent with an Operations Manager Administrators role account for your Operations Manager 2007 R2 management group.
  2. Open a Command Prompt window by using the Run as Administrator option.
  3. Run the following command, where D:\ is the location for the upgrade log file.
msiexec /i MOMAgent.msi /qn /l*v D:\logs\AgentUpgrade.log

Management group update on RMS

To upgrade a single-server management group
  1. Log on to the computer that is hosting a root management server (RMS) with an account that is a member of the Operations Manager Administrators role for your Operations Manager 2007 R2 management group and a local administrator on the computer.
  2. On the System Center 2012 – Operations Manager media, run Setup.exe, and then click Install.
  3. On the Getting Started, Please read this license agreement page, read the Microsoft Software License Terms, click I have read, understood, and agree with the terms of the license agreement, and then click Next.
  4. On the Select installation location page, accept the default value of C:\Program Files\System Center Operations Manager 2012, or type in a new location or browse to one. Then click Next.
  5. On the Prerequisites page, review and address any warnings or errors that the Prerequisites checker returns, and then click Verify prerequisites again to recheck the system.
Note
-         Microsoft SQL Server Full Text Search must be enabled. For more information, see Full-text Search Overview. This is a feature you have to add via “all programs à Microsoft SQL server 2008 R2 à configuration tools à SQL Server Installation Center (64-bit)”. It will ask for the sql 2008 R2 installation medium.
-         If you receive the error "The operational database has not been upgraded to the latest Cumulative Upgrade requirement" even though SQL has been upgraded with latest CU, you might need to run 2 sql scripts on the operational database and the operational database respectively. Those 2 scripts come with SQL CU5 for sql server 2008R2. More info:
http://support.microsoft.com/kb/2495674
Scroll down until: “Manual operations that must be performed after you update the root management server and Data Warehouse”. First check if the 2 scripts aren’t already on the local disk in folder: “C:\Program Files (x86)\System Center 2007 R2 Hotfix Utility\KB2495674\SQLUpdate”
The Agent Upgrade Check warning can be ignored if you plan to upgrade the agents after the single-server management group has been upgraded.
  1. If the Prerequisites checker does not return any other errors or warnings that have to be addressed, click Next.
  2. If the single-server management group does not already have a data warehouse installed, a data warehouse is created, and you must configure it as follows:
    1. On the Configure the data warehouse database page, in the Server name and instance name box, type the server name of the SQL Server database and instance for the database server that will host the data warehouse database.
    2. After you have typed in the correct values for the server name of the SQL Server database, Setup attempts to validate the values that you have typed as the SQL Server name and the port number. In the Database name, Database size (MB) Data file folder, and Log file folder boxes, we recommend that you accept the default values. Click Next.
    3. On the Configuration, Specify a web site for use with the Web console page, select the Default Web Site, or the name of an existing website. Select Enable SSL only if the website has been configured to use Secure Sockets Layer (SSL), and then click Next.
    4. On the Configuration, Select an authentication mode for use with the Web console page, select your options, and then click Next.
  3. On the Configuration, Configure Operations Manager accounts page, we recommend that you use the Domain Account option for the System Center Configuration service and System Center Data Access service accounts. Enter the credentials for a domain account in each box, and then click Next.
Important
If you receive a message about using the wrong version of SQL Server, or experience a problem with the SQL Server Windows Management Instrumentation (WMI) provider, you can resolve this. Open a Command Prompt window by using the Run as administrator option. Then run the following command, where <path> is the location of Microsoft SQL Server:
mofcomp.exe “<path>\Microsoft SQL Server\100\Shared\sqlmgmproviderxpsp2up.mof”.
  1. When the Ready to Upgrade page appears, review the upgrade summary, and then click Upgrade.
To upgrade a single-server management group by using the Command Prompt window
  1. Log on to the computer that is hosting a RMS with an account that is a member of the Operations Manager Administrators role for your Operations Manager 2007 R2 management group and a local administrator on the computer.
  2. Open a Command Prompt window by using the Run as Administrator option.
  3. Change the path to where the System Center 2012 – Operations Manager Setup.exe file is located.
Important
Use the /WebConsoleUseSSL parameter only if your website has Secure Sockets Layer (SSL) activated. For a default web installation, specify Default Web Site for the /WebSiteName parameter.
Important
The following commands assume that you specified the Local System for the Data Access service (/UseLocalSystemDASAccount). To specify a domain\user name for these accounts, you must provide the following parameters instead:
/DASAccountUser: <domain\username> /DASAccountPassword: <password>
  1. If you installed a data warehouse in your Operations Manager 2007 R2 management group, use the following command.
  2. setup.exe /silent /upgrade /UseLocalSystemDASAccount
  3. /ManagementServer: <ManagementServerName>
  4. /WebsiteName: "<WebSiteName>" [/WebConsoleUseSSL]
  5. /WebConsoleAuthorizationMode: [Mixed|Network]
  6. If you did not install a data warehouse in your Operations Manager 2007 R2 management group, use the following command.
  7. Setup.exe /silent /upgrade /UseLocalSystemDASAccount
  8. /AcceptEndUserLicenseAgreement
  9. /ManagementServer: <ManagementServerName>
  10. /WebsiteName: "<WebSiteName>" [/WebConsoleUseSSL]
  11. /WebConsoleAuthorizationMode: [Mixed|Network]
  12. /DWSqlServerInstance: <server\instance>
  13. /DWDatabaseName: <DW name>
  14. /DataReaderUser: <domain\username>
  15. /DataReaderPassword: <password>
  16. /DataWriterUser: <domain\username>
  17. /DataWriterPassword: <password>

Re-enable the notification subscriptions

After the upgrade has finished, use the following procedure to re-enable subscriptions.
To re-enable the subscriptions
  1. Open the Operations console by using an account that is a member of the Operations Manager Administrators role for the System Center 2012 – Operations Manager management group.
  2. In the Operations console, in the navigation pane, click the Administration button.
  3. In the Administration pane, under Notifications, click Subscriptions.
  4. In the Actions pane, click Enable for each subscription listed.
Restart or re-enable the service for any connectors that are installed

Refer to the third-party documentation for any installed connectors to determine if the connectors are supported for System Center 2012 – Operations Manager.
To restart a connector service
  1. On the taskbar, click Start, click Administrative Tools, and then click Services.
  2. In the Name column, right-click the connector that you want to restart, and then click Start.

Distribute the runas account

1.      In the Operations console, select the Administration workspace.
2.      Under Run As Configuration, select Profiles.
3.      In the results pane, double-click Data Warehouse Account.
4.      In the Run As Profile Wizard, click Next twice, or click Run As Accounts in the left pane.
5.      Select Data Warehouse Action Account, and click Remove. Then click Add to add a new Run As account.
6.      In the Add a Run As Account dialog box, under Run As account, select Data Warehouse Action Account and then select A selected class, group, or object.
7.      Click Select, and then click Class.
8.      In the Class Search dialog box, under Filter by (optional) type Operations Manager APM Data Transfer Service, and then click Search
9.      Select the result and click OK, then click OK in the Add a Run As Account dialog box to associate that item with the Run As account.
10.   Add three more Run As accounts for the Data Warehouse Action Account. This time search for and add the following classes:
1.      Data Warehouse Synchronization Server
2.      Data Set
3.      Collection Server
11.   Click Save to create the Run As Profile.
12.   Click Close.
13.   In the Profiles list, double-click Data Warehouse Report Deployment Account.
14.   In the Run As Profile Wizard, click Next twice, or click Run As Accounts in the left pane.
15.   Select Data Warehouse Report Deployment Account, and click Remove. Then click Add to add a new Run As Account
16.   In the Add a Run As Account dialog box, under Run As account, select Data Warehouse Report Deployment Account and select A selected class, group, or object.
17.   Click Select, and then click Class.
18.   In the Class Search dialog box, type Data Warehouse Synchronization Server, then click Search.
19.   Select the result and click OK, then click OK in the Add a Run As Account dialog box to associate that item with the Run As account.
20.   Add another Run As account for the Data Warehouse Report Deployment Account. This time search for and add Collection Server to associate that item with the Run As account.
21.   Click Save to create the Run As Profile.
22.   Click Close.

Update overrides

If you created any overrides for the Active Directory Integration rules, you must recreate them after the management group upgrade is complete. Delete the old override, and then create a new, matching override that targets the Active Directory Assignment Resource Pools.


Verify the success of the upgrade

Perform the following tasks to verify that the upgrade was successful.
  • Check the health state of the management servers and agents in the Health Service Watcher state view. In the Administration workspace of the Operations console, ensure that the management servers and agents are healthy. In the Monitoring workspace, check if there are any alerts related to the management group health.
  • Review the event logs of all the management servers for new errors.
  • Sort alerts by the last-modified column to review the new alerts.
  • Check the CPU utilization and disk I/O on your database servers to ensure that they are functioning normally.
  • If the Reporting feature is installed, click Reporting, and then run a generic performance report to ensure that Reporting is functioning correctly.
  • Re-deploy any agents that you uninstalled during the upgrade process.

Run SQL query on each management group

Run the following SQL query on the Operational database in each management group to clean up the Localizedtext table and the Publishmessage table.

-- Create a temporary table to quickly find a PublisherId when you know the MessageId.
BEGIN TRY
CREATE TABLE #PublisherMessageReverseIndex(MessageStringId UNIQUEIDENTIFIER, 
   MessageId INT)
CREATE CLUSTERED INDEX #PublisherMessageReverseIndex_CI ON #PublisherMessageReverseIndex(MessageStringId)
INSERT INTO #PublisherMessageReverseIndex (MessageStringId, MessageId)
SELECT MessageStringId, MessageId
FROM dbo.PublisherMessages
 
-- Create a temporary table of message lengths, message IDs, and message hashes with the
-- MessageStringId to quickly determine whether a message is duplicated. Index the table. 
 
CREATE TABLE #LTHashStrings (MessageStringId UNIQUEIDENTIFIER, 
 LTValueLen INT, 
 LTValueHash VARBINARY(32),
 MessageId INT NULL)
CREATE CLUSTERED INDEX #LTHashStrings_CI ON #LTHashStrings(MessageStringId)
CREATE NONCLUSTERED INDEX #LTHashStrings_NCI1 ON #LTHashStrings(LTValueLen, MessageId, LTValueHash)
 
-- Create a temporary table for the orphaned PublisherStrings that you find. Orphaned PublisherStrings 
-- are rows in PublisherMessages whose corresponding events have already been groomed. They still
-- have corresponding rows in LocalizedText.  Do not add rows for PublisherMessages; they are not
-- for duplicated messages.
 
CREATE TABLE #OrphanedPublisherStrings (PublisherId UNIQUEIDENTIFIER, 
MessageStringId UNIQUEIDENTIFIER)
CREATE CLUSTERED INDEX #OrphanedPublisherStrings_CI ON #OrphanedPublisherStrings(MessageStringId)
 
-- Create a temporary table so that you can determine whether a PublisherMessages row still
-- has a corresponding event. These events do not have an index on the PublisherId, so do 
-- not query the EventAllView. If a PublisherId occurs multiple times in the event tables,
-- it is only needed one time in the temp table; therefore, the unique clustered index
-- must contain IGNORE_DUP_KEY. This keeps the temporary table relatively small and saves
-- time when you want to see the orphaned PublisherMessages.
 
CREATE TABLE #EventAllPublishers (PublisherId UNIQUEIDENTIFIER)
CREATE UNIQUE CLUSTERED INDEX #EventAllPublishers_CI ON #EventAllPublishers (PublisherId)
WITH (IGNORE_DUP_KEY = ON)
 
-- Populate the temporary table by scanning EventAllView one time.
INSERT INTO #EventAllPublishers(PublisherId) 
SELECT PublisherId 
FROM EventAllView
 
-- Populate the first temporary table to determine which messages are duplicated.
INSERT INTO #LTHashStrings (MessageStringId, LTValueLen, LTValueHash, MessageId)
SELECT LTStringId, len(LTValue), HashBytes('SHA1', LTValue), MessageId
FROM dbo.LocalizedText LT 
JOIN #PublisherMessageReverseIndex PM ON PM.MessageStringId = LTStringId
 
-- Create the second table to determine which messages are duplicated.  
CREATE TABLE #LTCountByMessage( LTValueLen INT, 
MessageId INT, 
LTValueHash VARBINARY(32), 
MsgCount INT)
CREATE CLUSTERED INDEX #LTCountByMessage_CI ON #LTCountByMessage(LTValueLen, MessageId, LTValueHash)
 
-- Populate second message for duplicate message detection by scanning the INDEX of
-- the first one and by doing a grouped count.
INSERT INTO #LTCountByMessage (LTValueLen, MessageId, LTValueHash, MsgCount)
SELECT LTValueLen, MessageId, LTValueHash, COUNT(1) 
FROM #LTHashStrings
GROUP BY LTValueLen, MessageId, LTValueHash
 
-- You are now set up to detect both orphaned PublisherStrings and duplicated messages
-- by joining to our relatively small (and correctly indexed) temporary tables.
-- Determine the OrphanedPublisherStrings that have duplicate messages.
INSERT INTO #OrphanedPublisherStrings (PublisherId, MessageStringId)
SELECT PM.PublisherId, PM.MessageStringId 
FROM dbo.PublisherMessages PM 
JOIN #LTHashStrings LTS ON (LTS.MessageStringId = PM.MessageStringId AND LTS.MessageId = PM.MessageId)
JOIN #LTCountByMessage LTC ON (LTC.LTValueLen = LTS.LTValueLen AND
LTC.MessageId = LTS.MessageId AND LTC.LTValueHash = LTS.LTValueHash)
WHERE PM.PublisherId NOT IN (SELECT PublisherId FROM #EventAllPublishers) AND
LTC.MsgCount > 1
 
-- Deleting all the OrphanedPublisherStrings and all the corresponding LocalizedText rows
-- at one time may be too large for the transaction log to handle.  Create a numbered
-- or ordered table so that you can delete them in relatively small batches and not
-- overtax the transaction log.
CREATE TABLE #NumberOrphanPublisherStrings(OrphanNum INT IDENTITY,
   PublisherId UNIQUEIDENTIFIER, 
   MessageStringId UNIQUEIDENTIFIER)
CREATE CLUSTERED INDEX #NumberOrphanPublisherStrings_CI on #NumberOrphanPublisherStrings(OrphanNum)
 
-- Populate the numbered table.
INSERT INTO #NumberOrphanPublisherStrings (PublisherId, MessageStringId)
SELECT PublisherId, MessageStringId FROM #OrphanedPublisherStrings
END TRY
BEGIN CATCH
GOTO Error
END CATCH
 
-- Set up variables so that you can delete the orphaned rows.
-- If the transaction log fills up, try to reduce the @OrphanIncrement value,
-- which controls the number of rows that are delete at the same time.
DECLARE @OrphanNum INT
DECLARE @OrphanIncrement INT
DECLARE @OrphanLimit INT
SET @OrphanNum = 0
SET @OrphanIncrement = 10000
SELECT @OrphanLimit = MAX(OrphanNum) FROM #NumberOrphanPublisherStrings
BEGIN TRY
WHILE @OrphanNum < @OrphanLimit
BEGIN
DELETE dbo.LocalizedText FROM
#NumberOrphanPublisherStrings OPS JOIN dbo.LocalizedText LT
ON LT.LTStringId = OPS.MessageStringId
WHERE OPS.OrphanNum >= @OrphanNum AND OPS.OrphanNum < @OrphanNum + @OrphanIncrement
DELETE dbo.PublisherMessages FROM
#NumberOrphanPublisherStrings OPS JOIN dbo.PublisherMessages PM
ON PM.PublisherId = OPS.PublisherId
WHERE OPS.OrphanNum >= @OrphanNum AND OPS.OrphanNum < @OrphanNum + @OrphanIncrement
SET @OrphanNum = @OrphanNum + @OrphanIncrement
END
END TRY
BEGIN CATCH
GOTO Error
END CATCH
 
Error:
IF @@ERROR <> 0
   SELECT 
        ERROR_NUMBER() AS ErrorNumber,
        ERROR_MESSAGE() AS ErrorMessage;
 
-- Try to drop all the temporary tables
BEGIN TRY
IF EXISTS (SELECT 1 FROM tempdb.INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME LIKE '#PublisherMessage%')
DROP TABLE #PublisherMessageReverseIndex
IF EXISTS (SELECT 1 FROM tempdb.INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME LIKE '#OrphanedPublisherStrings%')
DROP TABLE #OrphanedPublisherStrings
IF EXISTS (SELECT 1 FROM tempdb.INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME LIKE '#LTHashStrings%')
DROP TABLE #LTHashStrings
IF EXISTS (SELECT 1 FROM tempdb.INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME LIKE '#EventAllPublishers%')
DROP TABLE #EventAllPublishers
IF EXISTS (SELECT 1 FROM tempdb.INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME LIKE '#LTCountByMessage%')
DROP TABLE #LTCountByMessage
IF EXISTS (SELECT 1 FROM tempdb.INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME LIKE '#NumberOrphanPublisherStrings%')
DROP TABLE #NumberOrphanPublisherStrings
END TRY
BEGIN CATCH
   SELECT 
        ERROR_NUMBER() AS ErrorNumber,
        ERROR_MESSAGE() AS ErrorMessage;
END CATCH

Upgrade gateway servers

The upgrade of the gateway server should be relatively simple. It is done in the setup screen of the Scom2012 install media. Just click on “Gateway server” and it should detetect and upgrade the gateway server automatically.
Unfortunately, I ran into the issue that after the update, The gateway server was unable to communicate with the management server anymore. After a long time of troubleshooting and verifying the certificates on bot side, I decided to uninstall the gateway server and re-install it from scratch. After doing that, don’t forget to approve the manual installation in the Operations Manager console (administration à pending management”). After a minute or two, the gateway server was able to communicate with the Management Server and it came up under “Agent Managed” in Administration of the operations console.



sources:
http://technet.microsoft.com/nl-nl/library/hh476934(en-us).aspx