Microsoft Premier Support (PFE) Latin America

Este Blog está dedicado a todo aquel interesado en tecnología Microsoft, y con deseos de aprender de la experiencia y vivencias de los PFES de Latinoamerica y del grupo de Incubation Support & Services (ISS)

August, 2011

  • SQL Performance Counters are Missing

    There was one time when I was delivering a Service using a tool that gathers performance data through the SQL Server Counters on Performance Monitor, I got surprised when I tried to review the data and there were no information. Them I checked the SQL Server counter directly on Performance Monitor and the counters were not on the list. That’s why I decided to write this blog, to know what to do if the SQL Server counters on Performance Monitor disappears.

    The right and easiest way to recover the SQL counters is to repair the SQL Server binaries, trough add/remove programs. However this will require downtime on the SQL instance (If you’re using a cluster you could do a switch-over to another node)

    Therefore there’s another option, you could recover this counter executing the following steps:

    First you need to open a command prompt console with administrative rights.

    Go to the directory BINN on the SQL Instance you want to fix (Ex: C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\Binn)

    Now to avoid any inconsistency eliminate any leftovers of the SQL Counters using unlodctr MSSQLSERVER, for named instances use the format MSSQL$NombreInstancia

    Now to load the counters you should use the following command lodctr perf-MSSQLSERVERsqlctr.ini, if you’re using a named instance you should use this format perf- MSSQL$NombreInstanciasqlctr.ini, you could execute the command twice to check that the counters have been added.

    Now you should restart the services Remote Registry and Performance Logs & Alerts, using the followings commands:

    net stop "Remote Registry"  &&  net start "Remote Registry"  

    net stop "Performance Logs & Alerts"  &&  net start " Performance Logs & Alerts " 

    If you are using the previous procedure to recover the SQL counters on a SQL Server Cluster, you should rebuild the clusters on both nodes, when you are rebuilding the counters an Active SQL Instance must be on the node.

    If after you have executed the above steps the SQL Counters have not appear, you will need to review the registry hives and keys (it’s not recommended to do any changes at the registry level, doing so could lead to instability on the operating system. If you chose to do these changes you should have a backup of the Operating System and Registry, to recover it if necessary), the following registry keys should exist and have a valid configuration.

    [HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\<<service name>>\Performance]

    Library
    Open
    Collect
    Close
    PerfIniFile

    You should also check if there’s a key named Disable Performance Counters inside HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Perflib, if it is configure with the value 1, it should be configure with 0. This should allow you to rebuild the registry counters and help files. 

    Now it may or not be necessary to rebuild the SQL and/or Operating System counters, look for the SQL Counters on perfmon, if they aren’t there use the previous steps to rebuild then, with the following command you can rebuild all the operating system counters.

    cd %systemroot%\system32

    lodctr /R

    Another consideration that you should have is when you are executing SQL Server 32 bits on an Windows Server 64 bits environment

    I hope this post is helpful, remember there’s a ton of good post on our blog that can help you on many SQL Server topics and how to Troubleshoot some problems. See you on the next post!

     

    “The opinions and views expressed in this blog are those of the author and do not necessarily state or reflect those of Microsoft”

  • SQL Server en ambientes virtuales

    ¡Qué tal! recientemente se nos ha estado cuestionando mucho al equipo de PFE’s de SQL Server, respecto a las ventajas de virtualizar, consolidar y claro actualizar a una nueva versión de SQL Server,

    Si bien es cierto, el contar con las nuevas versiones de los productos nos van dan una gran gama de facilidades y control desde el punto de vista administración y desde luego en el rendimiento y nuevas características que los desarrolladores aprovechan.

    Orientemos nuestra plática en particular a la parte de la virtualización, ¿qué beneficio tiene?, ¿está plenamente soportado por Microsoft?, ¿se requiere alguna certificación para los proveedores de ambientes virtuales de terceros?, ¿es necesario considerar el término de consolidar?

    Cuando pensemos en virtualizar nuestro ambiente de SQL Server debemos de tener las siguientes consideraciones:

    • Primero empecemos con ambientes de baja carga
    • Tengamos en mente que las aplicaciones no van a requerir más de 4 procesadores lógicos
    • A nivel de memoria que cada máquina virtual no va a requerir más de 64 Gb.

    El siguiente paso es contar con el inventario de SQL Server y otras bases de datos que tengan en el ambiente, si hay aún servidores con SQL Server 2000, pongámoslos en la lista de prioridades a migrar

    En esta fase hay herramientas como Microsoft Assessment and Planning (MAP)Toolkit 6.0, el Upgrade Advisor y el SQL Server Migration Assistant (SSMA).

    Armar nuestro capacity planning mediante la identificación de los requerimientos de aislamiento, seguridad, alta disponibilidad, edición de SQL, versión y requerimientos de Hardware.

    Los beneficios que podremos encontrar serán

    • Reducir nuestros costos de operación
    • Estandarización y consolidación
    • Reducir espacio y ahorro de energía ( Green Grid)

    Continuando con nuestra breve plática, a nivel de soporte de Microsoft para SQL Server en ambientes virtuales tomemos en cuenta que las versiones 2005, 2008 y 2008 R2, están técnicamente soportadas para los siguientes ambientes:

    Existen algunas restricciones que puede afectar las políticas de soporte de las configuraciones anteriormente mencionadas, las mismas las puedes observar en http://support.microsoft.com/?id=956893 , también existen algunas consideraciones especificas al usar VMWARE las cuales podemos observar en el siguiente articulo http://blogs.msdn.com/b/clustering/archive/2010/07/27/10042799.aspx.

    En el último punto agrego algunas de los participantes del programa

    • CA Technologies
    • Cisco Systems, Inc.
    • Citrix Systems, Inc.
    • Hitachi, Ltd.
    • Novell, Inc.
    • Oracle, USA Inc.
    • Parallels Software International, Inc.
    • Red Hat, Inc.
    • Riverbed Technology, Inc.
    • Sun Microsystems
    • Unisys Corp.
    • Virtual Iron Software
    • VMware, Inc.

    Cuando hablamos de “Virtualizar” es necesario también pensar en consolidar, de otra forma no cumpliríamos con el hecho de reducción de costos de operación y energía, así mismo vayamos teniendo en mente un tema importante que nos ofrece Windows 2008 R2, con Hyper-V, que es la migración en vivo o “Live Migration” por su término en Inglés, pero que este tema lo comentaremos más a detalle en nuestro próximo Post.

     

      

    “Las opiniones e ideas expresadas en este blog son las de los Autores y no necesariamente declaran o reflejan la opinión de Microsoft”

    Este material tambien lo podras acceder en http://blogs.technet.com/b/sql_pfe_latam/

                                    

     

  • Contadores de SQL en Performance Monitor Perdido

    Una vez en un cliente estaba entregando un servicio usando una herramienta que tomaba registros de rendimiento a través de los contadores de SQL de Performance Monitor, para mi sorpresa cuando fui a revisar la información no había nada. Entonces fui a revisar los contadores directamente en perfmon, los contadores para SQL Server no aparecían en la lista. Por eso decidí escribí este post para saber qué hacer cuando los contadores de SQL Server en el Performance Monitor desaparecen.

    La manera más correcta y sencilla de recuperar dichos contadores seria haciendo una reparación de los binarios de SQL Server, a través de añadir y remover programas. Sin embargo esto requerirá downtime en la Instancia de SQL (si tienes un Clúster puedes hacer un swith-over al otro nodo).

    Sin embargo existe otra opción, logre recuperar dichos contadores ejecutando los siguientes pasos:

    Primero que nada abre la consola de línea de comandos con derechos administrativos.

    Entra en el directorio BINN de la instancia de SQL Server que deseas corregir (Ejm: C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\Binn)

    Ahora para evitar cualquier inconsistencia vamos a eliminar cualquier rastro de los contadores con unlodctr MSSQLSERVER, para instancia nombradas use el formato MSSQL$NombreInstancia

     Ahora para cargar los contadores deberán usar el siguiente comando  lodctr perf-MSSQLSERVERsqlctr.ini, si estas usando una instancia nombrada el nombre tendrá el siguiente formato perf- MSSQL$NombreInstanciasqlctr.ini, deberás ejecutar el comando dos veces si quieres verificar que los contadores han sido añadidos

    Luego deberán reiniciar los servicios de Remote Registry y Performance Logs & Alerts, usando los siguientes comandos:

    net stop "Remote Registry"  &&  net start "Remote Registry"  

    net stop "Performance Logs & Alerts"  &&  net start " Performance Logs & Alerts " 

    Si estas usando el anterior procedimiento para recuperar los contadores en un Clúster de SQL Server, deberán reconstruir los contadores en ambos nodos físicos, y deberá existir una instancia activa de SQL este en ese nodo al momento de hacer la reconstrucción.

    Si luego de esto no han aparecido los contadores de SQL en perfmon, deberán de revisar las llaves del registro (no es recomendable hacer ningún cambio a nivel del registro, ya que esto podría ocasionar inestabilidad en el sistema operativo. Si decide realizar dichos cambios debe de tener un respaldo del registro y Sistema operativo para recuperar en casos de algún problema), las siguientes llaves de registros deben existir y contener data una configuración valida.

     [HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\<<service name>>\Performance]

    Library
    Open
    Collect
    Close
    PerfIniFile

    También deberán de revisar si existe un llave llamada Disable Performance Counters dentro de la ruta HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Perflib, y si su valor de configuración es 1, de ser así deberá configurarlo en 0. Esto te debería permitir la re-construcción de los artículos en el registro para los contadores y archivos de ayuda.

    Ahora podría ser necesario o no el reconstruir lo contadores de SQL y/o sistema operativo, busca los contadores en el performance monitor, si no aparecen usa los pasos expuestos anteriormente para recrear los contadores de SQL, y el siguiente comando para reconstruir todos los contadores del sistema operativo.

    cd %systemroot%\system32

    lodctr /R

    Otra Consideración que deben tomar en cuenta es el caso donde están ejecutando SQL 32 bits en un Ambiente Windows de 64 bits

    Espero que este post te allá ayudado, recuerda que hay muchos otros post en nuestro blog que te pueden ayudar a tener una mejor visión de las características de SQL Server y como hacer troubleshooting de diferentes problemas. Hasta un próximo blog!

     “Las opiniones e ideas expresadas en este blog son las de los Autores y no necesariamente declaran o reflejan la opinión de Microsoft”

    Este material tambien lo podras acceder en http://blogs.technet.com/b/sql_pfe_latam/

  • SQL Server on a Virtualized environment

    Hello! Recently there has been a lot of question about Virtualization to the SQL Server PFE Team, about the Virtualization advantages, consolidation and of course about updating SQL Server to the latest version.

    As you can imagine, having the latest version of the product will give us a lot of new features for administration, performance and options that Database Administrator and Developers can take advantage of.

    Our post is going to be orientated to SQL Server Virtualization, ¿What benefit does it have?, ¿Its supported by Microsoft?, ¿Do you require an specific certification when virtualizing on third party products?, ¿is necessary to consolidate when virtualizing?

    If you are thinking about virtualizing your SQL Server Environment we need to have the following considerations:

    • Begin your virtualizations on Server that have a low load
    • Have in mind that applications are not likely to need more than 4 logical processors
    • And each virtual machine it’s not likely to need more than 64 Gb of RAM.

    The next step is to have an inventory of SQL Server and other DBRMS on your environment, if you have SQL Server 2000, put them on the priority list to be migrated.

    When migrating there are a few tools that come in Handy like Microsoft Assessment and Planning (MAP)Toolkit 6.0, Upgrade Advisor and SQL Server Migration Assistant (SSMA).

    Now create your capacity planning by identifying the requirements of isolation, security, high availability, SQL Server Edition, version and hardware requirements.

    The benefits that we could have are:

    • Reducing our operational cost
    • Standardization and consolidation
    • Reducing space and energy (Green Grid)

    So moving with our post, on the support side Microsoft will support SQL Server on virtualized environments for the versions SQL Server 2005, 2008, 2008 R2 on the following escenarios:

    There are a few restrictions that might affect the support policies for the previous configurations, you can read about them here http://support.microsoft.com/?id=956833, and also there are a few considerations specific to VMWARE that you need to be aware of http://blogs.msdn.com/b/clustering/archive/2010/07/27/10042799.aspx.

    A few of the participants on this program are:

    • CA Technologies
    • Cisco Systems, Inc.
    • Citrix Systems, Inc.
    • Hitachi, Ltd.
    • Novell, Inc.
    • Oracle, USA Inc.
    • Parallels Software International, Inc.
    • Red Hat, Inc.
    • Riverbed Technology, Inc.
    • Sun Microsystems
    • Unisys Corp.
    • Virtual Iron Software
    • VMware, Inc.

    When we talk about Virtualizing is necessary to talk also about consolidation, if not we are not meeting the requirements for operational cost reduction and power saving. Another big advantage that Windows 2008 R2 with Hyper V will provide us is Live Migration; we will talk about this topic on a future post.

     

    “The opinions and views expressed in this blog are those of the author and do not necessarily state or reflect those of Microsoft”