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)

Microsoft Premier Support (PFE) Latin America

  • How to create a Private Cloud with System Center 2012 R2 by Manuel Puron

    A very nice set of articles from Manuel Puron, System Center Premier Field Engineer (PFE) from Mexico City, have been released.

    If you are visiting us from Latin America you might be doing this kind of searchs:

    • ¿Cómo crear una nube privada con System Center?
    • ¿Cómo configurar System Center para crear una nube privada?

    Well here you have the links to the different articlespart f this series

    For more information around System Center Virtual Machine Manager please visit Manuel’s Blog at http://blogs.technet.com/manuelpuron

    Technorati Tags: ,
  • SQL Server 2014 para ITPros.

    Duración: 50 min.  

    Tema: SQL Server 2014 para ITPros. 

    Descripción del tema: En esta tema hablaremos de las nuevas ventajas que nos ofrece SQL Server 2014. 

    Objetivo: Dar a conocer cómo funcionan las nuevas característica de SQL Server 2014 en el área de ITPro, lo que permitirá usar estas características para mejorar la disponibilidad de sus aplicación, tener un plan de recuperación rápido y efectivo y hacer decisiones informadas de porque ir a esta nueva versión de SQL Server. 

    Presentador: Edinson Medina

    Idioma: Español

  • SQL Server 2014 para Desarrolladores

    Duración: 50 min.  

    Tema: SQL Server 2014 para Desarrolladores. 

    Descripción del tema: En esta tema hablaremos de las nuevas ventajas que nos ofrece SQL Server 2014. 

    Objetivo: Dar a conocer cómo funcionan las nuevas característica de SQL Server 2014 lo que permitirá usar estas características para mejorar el rendimiento de sus consultas y hacer decisiones informadas de porque ir a esta nueva versión de SQL Server..  

    Presentador: Edinson Medina

    Idioma: Español

  • Use of BI capabilities in SharePoint 2013 with SQL Server 2012

    A couple of weeks ago, a customer asked me how to setup BI capabilities in SharePoint and what were the different options they have available.

    Is really cool to start seeing customers moving forward with SharePoint capabilities, from basic sharing and collaboration, to more complex scenarios like Business Intelligence.

    For a complete guide around the different opptions and resources on how to enable BI features with SQL Server 2012 on SharePoint 2013 I invite you to read my new blog post here.

    Happy SharePointing!

  • Microsoft Technical Day

    Microsoft Technical Day

    http://news.mx.ontwice.net/microsoft-boletines/TechnicalDay/images/TechnicalDay-1.jpg

    http://news.mx.ontwice.net/microsoft-boletines/TechnicalDay/images/horizontal.gif

    http://news.mx.ontwice.net/microsoft-boletines/TechnicalDay/images/vertical.gif

    El mundo de los negocios es cada vez más demandante y requiere de profesionales con conocimientos sólidos sobre las tecnologías actuales y muy informados sobre las que están surgiendo.

    Microsoft te invita este 17 de junio al "Microsoft Technical Day" en donde podrás seleccionar de entre 32 conferencias técnicas las que mayor interés tengan para ti o mayor impacto en el desarrollo de tu trabajo profesional.

    Asiste el martes 17 de junio y convive con los 32 especialistas de Microsoft de diversas tecnologías, al tiempo que compartes, con 200 profesionales exitosos como tú, sus experiencias.

    http://news.mx.ontwice.net/microsoft-boletines/TechnicalDay/images/vertical.gif

     

     

     

    http://news.mx.ontwice.net/microsoft-boletines/TechnicalDay/images/TechnicalDay-3.jpg

    http://news.mx.ontwice.net/microsoft-boletines/TechnicalDay/images/TechnicalDay-4.jpg

     

    http://news.mx.ontwice.net/microsoft-boletines/TechnicalDay/images/TechnicalDay-5.jpg

  • SQL Server Hyper-V Virtual Machines, Where do I put the Cluster?

    I remember the old days, when I wasn’t a fan of Installing SQL Server on Virtual Machines, but in todays world thanks to Hyper-V 2012 (and I guess VMWARE too), a lot of the resource bottlenecks for virtual machines has disappear. However still it’s not for every workload.

    Recently I was on one of my clients that has a kind of big Virtual Shop on Hyper-V 2012R2, and he ask me. Well I’m planning the Installation of Multiple SQL Server for some management applications on a few VMs, how should I provide the High Availability for this?

    That was a good question, we had many options, but we rapidly decided to have some kind of a Cluster, now we had two options, Clustering the Hyper-V Virtual Machines or doing a SQL Guest Failover Cluster between Virtual Machines.  

    The first one is a good option to mitigate downtime when the hardware failed, if one of the Hyper-V Virtual Machines Node failed, the Virtual Machines will just failover to another node, but what would happen just when the SQL Services failed? It wouldn’t trigger a failover, at least not by default, I guess we could create some kind of script to monitor the SQL Services and then trigger a VM Failover, but It doesn’t sound right. Now in the other hand we have Live Migration on this configuration, that allows us to move virtual machines with 0 downtime.

    The second one is a great option, and have all the usual benefits of a SQL Server Failover Cluster, just use the 2 Virtual Machines, and create a SQL Cluster between this 2, this is called a SQL Guest Failover Cluster.

                        

    One of the question was could I combine the 2 options, and yes you could, but take into consideration the following:

    • Your could Use a lot more resources than necessary
    • In a physical failure you could lose your High Availability

    Why? Lets suppose this scenario, We have 2 physical nodes were we create a Windows Cluster, and we configure 2 VMs as resources on this Windows Cluster (The First Option), you configure one VM to run in node1 and the other VM to run in node2, now you create a SQL Guest Failover Cluster between the to VMs (The Second Option). What will happen when Node1 crash (ex: Mother Board Failure), the 2 VMs will be running on Node2 consuming a lot of resources, and you will also not have real High Availability as your workload is running only in one physical server.

    In conclusion, should I combine the two options, depend on you resource availability, and also how critical is the workload you are running against SQL. However what you should ALWAYS do is follow the best practices for configuring SQL on a Hyper-V environment.

    Running SQL Server 2008 in Hyper-V Environment 

    Running SQL Server with Hyper-V Dynamic Memory - Best Practices and Considerations

    Consolidating Databases Using Virtualization Planning Guide

    Hope you like the post, you can follow me on twitter @SQLDixitox and on facebook https://www.facebook.com/SQLbyEdinsonMedina 

  • SQL Server Hyper-V Virtual Machines, Donde coloco el Cluster?

    Recuerdo los viejos días cuando no era un fanático de colocar a SQL Server en Máquinas Virtuales, pero hoy en día gracias a Hyper-V 2012 (y VMWARE), muchos de los cuellos de botella en recursos que existían en las máquinas virtuales han desparecido. Sin embargo aunque ha mejorado en gran medida no es para todas las cargas de trabajo.

    Recientemente estaba en uno de mis clientes que tiene un Virtual Shop en Hyper-V 2012, y me pregunto: Estoy planificando la instalación de múltiples Instancias de SQL Server para algunas aplicaciones de administración en máquinas virtuales, como debo proveer la Alta Disponibilidad?

    Esto es una Buena pregunta, tenemos varias opciones, pero rápidamente decidimos usar alguna forma de Cluster, entonces tenemos solo 2 opciones, Clusterizar la Máquinas Virtuales de Hyper-V o hacer un Guest Failover Cluster de SQL Server entre las máquinas virtuales.

    La primera opciones es Buena para mitigar el downtime cuando el hardware falla, si uno de los Nodos de las Máquinas Virtuales de Hyper-V, las máquinas virtuales simplemente harán un failover a otro nodo, pero que pasaría cuando solo falle el servicio de SQL? Esto no iniciaría un failover, por lo menos no por defecto, supongo que se puede crear algún tipo de script que monitorea el servicio de SQL y luego disparar una falla a nivel de la VM, pero no suena muy adecuado. . Ahora por el otro lado, en esta configuracion tenemos Live Migration que nos permite mover maquinas virtuales con 0 downtime.

    La segunda opción, es una excelente, y tiene todos los beneficios de SQL Server Failover Cluster, simplemente se usan las 2 máquinas virtuales, y se crea un SQL Cluster entre las mismas, esto es llamado un SQL Guest Failover Cluster.

                                      

    Una de las preguntas fue, puedo combinar las 2 opciones? y Si se podría, pero tengan en consideración lo siguiente:

    • Puede que usen muchos más recursos de los necesarios
    • En caso de la falla de un servidor físico, podrían perder la Alta Disponibilidad

    Porque? Supongamos un escenario, Tenemos 2 nodos físicos donde creamos un Windows Cluster, y luego configuramos 2 Máquinas Virtuales como recursos del Windows Cluster (La primera opción), se configure que una de las máquinas virtuales se ejecute sobre el nodo1 y la otra máquina virtual se ejecute en la nodo2, ahora se crea un SQL Guest Failover Cluster entre las máquinas virtuales (La segunda opción). Que pasaría cuando el nodo1 falle (ejm: Falla de la tarjeta madre), las 2 máquinas virtuales se ejecutaran en el nodo2 consumiendo una gran cantidad de recursos, y adicionalmente no tendrán verdadera alta disponibilidad ya que tu carga de trabajo esta ejecutándose en un único servidor físico.

    En conclusión, debería combinar las opciones?, depende en la disponibilidad de recursos que tengas, también que tan crítica es la carga de trabajo que ejecutas contra SQL Server. Sin embargo, lo que SIEMPRE debes hacer es usar las mejores prácticas de configuración para SQL Server en un ambiente Hyper-V.

    Running SQL Server 2008 in Hyper-V Environment

    Running SQL Server with Hyper-V Dynamic Memory - Best Practices and Considerations

    Consolidating Databases Using Virtualization Planning Guide

    Espero que les haya gustado el contenido, me pueden seguir en twitter @SQLDixitox y en facebook https://www.facebook.com/SQLbyEdinsonMedina

  • Sysprep and SQL Server

    Duración: 30 min.  

    Tema: SQL Server Sysprep. 

    Descripción del tema: En este tea tocaremos los pasos que debemos seguir para crear una imagen de SQL Server y Windows Server. 

    Objetivo: Dar a conocer cómo funcionan la caracteristica de sysprep en SQL Server y como la podemos usar para automatizar a creacion de maquinas con una Instancia de SQL Server.  

    Presentador: Edinson Medina

    Idioma: Ingles

  • Error al cargar la página de Centro de Proyectos en SP 2010 con CU Abril 2013 o SP2

    En Junio y Octubre 2013 estuve apoyando a dos clientes en la actualización de sus plataformas productivas de Project Server 2010. Dado que en ambos casos no se disponía de procesos formales para actualizar de SharePoint 2010 o Project Server 2010, las actualizaciones se aplicaron en Producción:

    • Cliente 1 requirió aplicar el paquete de actualizaciones acumulativas de Abril 2013 para su Plataforma Project Server 2010 SP 1 en inglés (con paquetes de lenguaje en español). 
      • El error: la página “Centro de Proyectos” no cargaba, se mantenía en el mensaje “Cargando”.

      • La revisión arrojó que la actualización no reconocía la zona horaria “-04:30 GMT” (Venezuela) que utilizaba la colección de sitios “PWA”.

      • La solución: luego de aplicar el Service Pack 2 en un ambiente de pruebas, la página “Centro de Proyecto” volvió a mostrarse satisfactoriamente, al establecer la zona horaria “-04:30 GMT”.

         

    • Cliente 2 requirió aplicar el Service Pack 2 para su Plataforma Project Server 2010 SP 1 en español
      • El error: la página “Centro de Proyectos” tampoco se mostraba, como ocurrió en el ambiente del cliente 1.

      • La revisión arrojó que la actualización a Service Pack 2 no reconoce la zona horaria “-04:30 GMT”.

      • La solución no he encontrado hasta este momento una actualización acumulada que solvente este error. Tan pronto conozca de la actualización que lo corrija, estaré refrescando esta publicación.

    Mientras tanto, es importante recordar que Microsoft publica actualizaciones (parches) para todos sus productos, con el objeto de mejorar su funcionalidad en el transcurso del ciclo de vida de cada versión de los mismos. Microsoft publica cada  actualización periódicamente (como un Service Pack o Actualización Acumulada) o de acuerdo a los errores descubiertos en el tiempo (como hotfixes). Para los productos y tecnologías SharePoint 2010, se debe considerar la actualización de todos sus componentes internos (Sistema Operativo, Base de Datos, Pre requisitos de SharePoint a nivel fundacional, Servidor y paquetes de lenguaje) y complementarios (Project Server, SQL Server Reporting Services en modo integrado con SharePoint, FAST entre otros).

     

    Al aplicar actualizaciones a SharePoint 2010, considere:

    • Definir, implementar y mantener actualizada la estrategia de actualización, de acuerdo a las políticas de TI, Seguridad, continuidad de negocios de su organización.

    • Microsoft recomienda:
      • Mantener las tecnologías y Productos SharePoint 2010 actualizados al menos con el Service Pack más reciente.

      • Aplicar actualizaciones acumuladas (CU por sus siglas en Inglés) solo cuando su Plataforma presente algún problema que sea solventado por el CU.

      • Revisar las secciones “Resumen” y “Resolución” de los artículos que describen los CU’s que usted prevé aplicar:

        • Resumen: describe la actualización y en algunos casos, los problemas que se pueden presentar luego de aplicar la actualización, así como pueden ser solventados.

        • Resolución:  resume los problemas que se corrigen, los pre requisitos para la instalación, reinicio y archivo de información.

     

    Artículos recomendados:

     Software updates overview (SharePoint Server 2010) http://technet.microsoft.com/en-us/library/ff806329(v=office.14).aspx

     Updates for SharePoint 2010 Products (http://technet.microsoft.com/en-us/sharepoint/ff800847.aspx )

     Deploy Project Server 2010 updates (http://technet.microsoft.com/en-us/library/gg598486(v=office.14).aspx  )

  • Error loading Project Center page in SP 2010 CU April 2013 or SP2

    During June and October 2013, I was supporting two customers in Venezuela, in order to update their SharePoint 2010 and Project Server 2010 production environments. Customers did not have testing environments, neither a formal patch management strategy, therefore, they decided update directly in Production:

    • Customer 1 required apply Cumulative Update April 2013 for its SharePoint 2010 SP1 and Project Server 2010 SP1 English environment (with Language Pack for Spanish)

    The error: “Project Center” page, of PWA site only show the message “loading” and did not display the Project center info.

    The troubleshooting raised that these updates does not consider time zones with a half hour, like “-04:30 GMT” Venezuela’s time zone.

    The workaround was change the time zone of the PWA’s site collection. Customer needs to consider the impact of this change for its contents, workflows and any customization that use the time zone. Microsoft Support has delivered a private Hot Fix for the environment of this customer.

    The solution was found by applying SharePoint Server 2010 and Project Server Service Pack 2 in a QA environment, the “Project Center” page was rendered successfully, using the “-04:30 GMT” Venezuela’s time zone.

     

    • Customer 2 required apply Service Pack 2 for its SharePoint Server 2010 SP1 and Project Server 2010 SP1 Spanish environment.

    The error: It was the same like Cutomer 1: “Project Center” page, of PWA site only show the message “loading” and did not display the Project center info.

    The troubleshooting raised a similiar situation like Cutomer 1. The Service Pack 2 (Spanish) does not consider time zones with a half hour, like “-04:30 GMT” Venezuela’s time zone.

    The workaround set the "PWA" site collection's time zone  to a value different to “-04:30 GMT” (or any time zone with 30 minutes).

    The solution I don't found a solution at this momento. I will be updating this post as soon I find a Cumulative Update that fixes this issue.

     

    Meanwhile, it’s important remind that all Microsoft platforms are subject of updates (patches) in order to correct / improve its functionality, during the life cycle of their inner versions. Such updates are published periodically (like Service Packs or Cumulative Updates) or according to issues discovered at any time (like hot fixes). For SharePoint Server 2010 products and technologies, the update must consider all inner components (Operating System, SQL, SharePoint Prerequisites, Foundation, Server, and Language Packs) and dependent components (Project Server, SQL Server Reporting Services integrated mode, FAST and so on).

    When applying updates for SharePoint 2010 Products and Technologies, it’s important to consider:

    • Define, implement and keep an updated documentation of the patch management strategy, according to your IT, Security, Business Continuity policies.

      Microsoft recommends:

      • Keep SharePoint 2010 Products and Technologies updated with the last Service Pack released.

      • Apply Cumulative Updates (CU’s) only when your platform have issues that are fixed with a CU.

    • Review Summary and Resolution sections of any Cumulative Update that you plan to apply. Each CU has a Knowledge Base (KB) description page, with key sections:
      • Summary: In this section, you can find a short description about the update, and in some cases, describe known issues that must be addressed after apply the update.

      • Resolution: This section summarize the issues fixed in this CU, the prerequisites to install, restart requirement and file information.

     

    Recommended reading:

    Software updates overview (SharePoint Server 2010) http://technet.microsoft.com/en-us/library/ff806329(v=office.14).aspx

    Updates for SharePoint 2010 Products (http://technet.microsoft.com/en-us/sharepoint/ff800847.aspx )

    Deploy Project Server 2010 updates (http://technet.microsoft.com/en-us/library/gg598486(v=office.14).aspx )

  • Tips and Tricks from the Field on the new Distributed Cache Service in SharePoint 2013

    Originally posted at http://blogs.technet.com/b/mspfe/archive/2013/12/11/tips-and-tricks-from-the-field-on-the-new-distributed-cache-service-in-sharepoint-2013.aspx

     Author:  Vladimir Medina , SharePoint PFE, LATAM

     

    If you, like me, are playing with SharePoint 2013 or if you have plans to migrate/deploy SharePoint 2013, you may have already heard about Distributed Cache (a.k.a. Velocity or AppFabric).  In this post, I’d like to make you aware of some tips from the field that may help you avoid some serious issues in your production Farm.

    First things first, see the following articles to learn about planning and managing Distributed Cache on SharePoint 2013:

    Plan for feeds and the Distributed Cache service in SharePoint Server 2013

    Manage the Distributed Cache service in SharePoint Server 2013

    As you know, real world scenarios are always different and more challenging than TechNet “ideal world” and some tips that we noted from Premier support cases are really valuable:

    • When you run Configuration Wizard on SharePoint 2013 (a.k.a. psconfig), Distributed Cache service is enabled by default on that server.  If you run the wizard on all SharePoint servers in the Farm, the service will be running on all those servers which is not the ideal configuration for your production environment.  To avoid this problem, configure your servers via PowerShell instead of the wizard.  After the first Farm server is configured, you can use connect-spconfigurationdatabase with –skipregisterasdistributedcachehost parameter.
    • Plan to have a dedicated server or servers run only the Distributed Cache service.  Avoid sharing that server(s) with any other service, even Central Administration, because Distributed Cache needs special considerations with respect to resources and maintenance activities.
    • Recommended resources for dedicated servers are:
      • 4 cores processor
      • 24 GB RAM (8-16 GB dedicated for Distributed Cache)
      • 1 Gbps network interface
      • Physical and Virtual environments are supported, however on virtual environments dynamic memory is not supported
    • Distributed Cache must be configured manually to use dedicated resources, so please run the following actions during the Farm Configuration process before starting the User Profile Service:
      1. Stop Distributed Cache service on all servers running it, wait on each one until the service stops       
        Stop-SPDistributedCacheServiceInstance –Graceful         
        (the graceful parameter helps to move cache on that server to another available server)
      2. Then run cmdlet: 
        Update-SPDistributedCacheSize –CacheSizeinMB <size in MB>         
        Remember to use between 8 GB and 16 GB (16 GB used on real world scenarios with 24 GB RAM on server).
      3. Restart the service on all dedicated servers from Central Administration –> Services on the server
    • If you need to run a maintenance window or remove a server from the Cache Cluster (name used to identify all dedicated servers to Distributed Cache service) then you need stop and remove the service as follows:
      1. Stop the service using the following cmdlet       
        Stop-SPDistributedCacheServiceInstance –Graceful 
        on the server to be removed or on all dedicated servers (a.k.a. Cache Hosts)        
        TIP: If you need Distributed Cache to always be available then leave the service running on one server.
      2. Run the following cmdlet on all the servers except the one left running for availability:       
        Remove-SPDistributedCacheServiceInstance         
        If all servers have the service stopped then leave one without running this cmdlet, which will be your first server to restart.
      3. When your maintenance is over, go to Central Administration and start Distributed Cache service from Services on Server page, then wait until service is listed as “started.”
      4. Finally go to each Cache Host and run cmdlet:       
        Add-SPDistributedCacheServiceInstance
      5. To verify everything is ok, run the following cmdlets from any Cache Host to see if all Cache Hosts are listed and service status is “UP”:       
        Use-CacheCluster        
        Get-CacheHost
    • Never stop the AppFabric service from the Services applet in Windows or restart servers running AppFabric without gracefully stopping the Distributed Cache service.
    • The Distributed Cache service is based on AppFabric, which is a prerequisite when you install SharePoint 2013.  AppFabric has its own administration via PowerShell and developers can use it to deploy new features, however direct management and development on AppFabric in a SharePoint Farm is not supported.  If you have issues with AppFabric or Distributed Cache then get support from Microsoft, do not use the AppFabric management directly.  If you want to develop new features, use a dedicated AppFabric environment outside the SharePoint Farm.
    • AppFabric has his own updates, so SharePoint Administrators must be aware of those updates and their interaction with SharePoint Farm.  Follow the AppFabric Team Blog to learn more about it.     

    If you’d like to sleep well before and after your new SharePoint 2013 deployment/migration process, I encourage you to bookmark this article Smile.  I’m also really interested in your experience and comments, so please share your stories with us and help us learn and share more tips about SharePoint – all will be welcomed!

  • Aplicando AlwaysOn Availability Groups en escenarios reales

    En esta sesión hablaremos de la nueva caracteristica de SQL Server 2012, AlwaysON Availability Group y como usarlo en un ambientes de Alta Disponibilidad y Recuperacion de Desastres.

    Format: wmv
    Duration:

  • Identifying Cell by Cell Computation Mode in MDX queries

    Some weeks ago I was asked to help with a performance issue with some MDX Queries.

    I was shown what the customer wanted to achieve, they needed to calculate some metrics including sampling errors using the method of “Conglomerados Últimos” (This can be translated to “Conglomerates Last” Method), this method was created by a Spanish Researcher and publish in a Spain Publication to calculate sampling errors a posteriori when the sample is stratified. This method is described in Spanish (Sorry I don’t an English version of this document) here http://dialnet.unirioja.es/descarga/articulo/250808.pdf

    Just trying to understand the method and formulas was hard, but the customer had already an elegant solution using an MDX Script and the SCOPE statement. So I focused on the performance issue instead of trying to understand the formulas.

    After a couple of hours I found out that the formula was using cell by cell calculation instead of block calculation, then found the operator in fault (the “^” operator) and after a small change (multiply the measure by itself) the query improved from around 30 seconds to 1 second.

    You can find some details about the operators that support block computation in “Identifying and Resolving MDX Query Performance Bottlenecks in SQL Server 2005 Analysis Services” found in http://www.microsoft.com/en-us/download/details.aspx?id=661, you can also find some guidelines to improve query performance in http://msdn.microsoft.com/en-us/library/bb934106.aspx

    What I want to focus in this blog is how you can detect that the issue is Cell by Cell Calculations.

    We have two main tools to troubleshoot this kind of problems, SQL Server Profiler and Performance Monitor, the recommended order is to identify that the problem is Formula Engine using the profiler and then use the Performance monitor to confirm that the query is using Cell By Cell Calculation instead of block calculation (or computation).

    Here is the recommended methodology, this is not new, but I haven’t found a good reference that goes through this steps.

    Step 1. Identify if bottleneck is Formula engine

    Use the profiler to capture the execution of your query, it is easiest if you do this in an isolated environment but if not possible you can still filter the events from your query using the ConnectionId or some other column.

    You need to add the duration for each QuerySubcube, and then subtract that total from the duration shown in the QueryEnd Event. In this example you can see that most subcubes take 0 ms, some of them 16 ms and some other that is not shown in the image was 110 ms. You can also see that the total for the query was 3,953 ms, that means that, in the Storage Engine, Analysis Services spent 142 ms and the difference 3811 ms were spent in the Formula Engine.

    In conclusion, we have a Formula Engine Bottleneck, let’s check is that bottleneck is caused by cell by calculation.

    The previous procedure may not scale well when you have hundreds of subcubes events or many potential queries using Cell by Cell in the same trace, in that situation you can use a procedure like this one:

    1. 1.       Save the profiler trace to a SQL Server table
    2. 2.       Execute the following SQL Query to obtain a list of the longest running queries
      SELECT ROWNUMBER, EVENTCLASS, EVENTSUBCLASS, TEXTDATA, DURATION, CONNECTIONID FROM <TABLE_NAME> WHERE EVENTCLASS=10
    3. 3.       Execute the following SQL Query to get the beginning and ending points of the query in the trace
      SELECT TOP 2 ROWNUMBER, EVENTCLASS, EVENTSUBCLASS, TEXTDATA, DURATION, CONNECTIONID FROM <TABLE_NAME> WHERE EVENTCLASS IN (9,10) AND CONNECTIONID=<TARGET_CONNECTIONID> AND ROWNUMBER <= <ROWNUMBER_OF_TARGET_QUERY> ORDER BY ROWNUMBER DESC
    4. 4.       Execute the following SQL Query to determine the amount of time spent in storage engine
      SELECT SUM(DURATION) FROM <TABLE_NAME> WHERE EVENTCLASS=11 AND CONNECTIONID=<TARGET_CONNECTIONID> AND ROWNUMBER BETWEEN <QUERY_BEGIN_ROWNUMBER> AND <QUERY_END_ROWNUMBER>

    Step 2. Identify if the issue is Cell by Cell Calculation

    You can use Performance Monitor to identify if the issue is that the calculations is being done Cell By Cell. To be successful in this task is necessary that you run your query in an isolated environment because we have a single counter for all queries and to be sure that our query is the one causing the problems you need to execute it alone, without other concurrent queries. If your query is using Cell By Cell calculation you will see something like the following image in your query.

    In the image you can see that the counter being used is “MSOLAP&InstanceName:MDX \ Total Cells Calculated” and the initial value is 0 and the value after you execute the query is a little above 1 million.

    After restarting the instance we can see that a single execution of the query had to calculate more than 1 million rows. If this is the first time you do this, you don’t know if 1 million is too much or too low. I can tell you that is very high for this specific query.

    Step 3. Modify your query

    Modify the query using the guidelines in the links references until you stop seeing the big increments in cell calculated for your query.

    In this particular case the Script was using a couple of expressions like:

    Measures.Measure1 ^ 2

    We changed the formula to something like:

    Measures.Measure1 * Measures.Measure1

    After the formula was changed in this particular case we got the following results.

    You can see that the total for the query is 156 ms now, considering that the Storage Engine must have used the same time, 132 ms, it means that now the Formula Engine is taking only 24 ms.

    In the performance Monitor we can see that the total number of cell calculated was 41. The query was executed after another restart of the instance.

    Final Comments

    This is just a basic procedure to find out what is causing the problem on your query. Modifying the query to avoid cell by cell calculation will be easy sometimes, like in this real case, and will be hard in other scenarios.

    I hope this is helpful to start troubleshooting your own cases.

  • Identificando cálculos en modo Cell by Cell en consultas MDX

    Hace algunas semanas me pidieron apoyo con un problema de desempeño en algunas consultas MDX.

    Me mostraron lo que el cliente quería lograr, ellos necesitaban calcular algunas métricas incluyendo errores de muestra utilizando el método “Conglomerados Últimos” para calcular el error en la muestra a posteriores para muestras estratificadas. Éste método fue creado por un investigador español y fue publicado en España. Pueden encontrar la referencia aquí, http://dialnet.unirioja.es/descarga/articulo/250808.pdf

    Tratar de entender el método y las fórmulas que se usan es difícil, afortunadamente el cliente ya tenía una implementación elegante de dichas fórmulas en el Script MDX usando la sentencia SCOPE y en solo unas líneas implementaron la parte más compleja de las fórmulas. Por lo tanto me enfoqué en el tema de performance en lugar de la implementación de las fórmulas.

    Después de un par de horas encontré que la fórmula estaba usando calculas cell by cell en logar de cálculos por bloque, la causa era un operador (el operador “^”) y después de un pequeño cambio (multiplicar la métrica por si misma) el query mejoró de aproximadamente 30 segundos a 1 segundo.

    Puedes encontrar el detalle acerca de operadores que soportan cálculos basados en bloque en el documento “Identifying and Resolving MDX Query Performance Bottlenecks in SQL Server 2005 Analysis Services” encontrado en http://www.microsoft.com/en-us/download/details.aspx?id=661, también puedes encontrar algunas recomendaciones para mejorar performance de queries en http://msdn.microsoft.com/en-us/library/bb934106.aspx

    El enfoque de éste blog es en cómo podemos detectar los casos en donde el problema es cálculos Cell by Cell.

    Tenemos 2 herramientas que usaremos para éste propósito, una es el SQL Server Profiler y la otra es el Performance Monitor, el orden recomendado es identificar primero que el problema está en el Formula Engine y después confirmar con el Performance Monitor que la causa de que el Formula Engine esté lento son cálculos Cell By Cell.

    Aquí está la metodología recomendada, esto no es nuevo, pero no he encontrado una buena referencia que cubra éstos pasos.

    Paso 1. Identificar si el cuello de botella está en el Formula Engine.

    Utilizar el profiler para capturar la ejecución de tu query, es más fácil si haces esto en un ambiente aislado pero si no es posible, puedes filtrar los eventos en tu query por el ConnectionId o alguna otra columna que identifique todos los eventos de tu query.

    Necesitas sumar la duración de cada evento QuerySubcube y restar ese total de la duración mostrada en el evento QueryEnd. En éste ejemplo puedes ver que la mayoría de los subcubos tomó 0 ms, algunos tomaron 16ms y otro que no se ve en la imagen tomó alrededor de 110 ms. El total del query fue 3,953 ms, eso significa que Analysis Services utilizó 142 en el Storage Engine y la diferencia de 3811 se utilizó en el Formula Engine.

    En conclusión, en el caso anterior tenemos un cuello de botella en el Formula Engine Bottleneck, revisemos si en éste caso es causado por cálculos cell by cell.

     

    El procedimiento anterior puede no escalar tan bien cuando tienes cientos de subcubos o muchos queries utilizando cálculos Cell by Cell en el mismo trace, en esos casos el siguiente procedimiento puede ser más apropiado:

    1. Guarda el profiler a una table de SQL Server.
    2. Ejecutar el siguiente Query de T-SQL para obtener los queries de mayor duración
      SELECT ROWNUMBER, EVENTCLASS, EVENTSUBCLASS, TEXTDATA, DURATION, CONNECTIONID FROM <TABLE_NAME> WHERE EVENTCLASS=10
    3. Ejecutar el siguiente Query de T-SQL para obtener el inicio y finalización del query en el trace.
      SELECT TOP 2 ROWNUMBER, EVENTCLASS, EVENTSUBCLASS, TEXTDATA, DURATION, CONNECTIONID FROM <TABLE_NAME> WHERE EVENTCLASS IN (9,10) AND CONNECTIONID=<TARGET_CONNECTIONID> AND ROWNUMBER <= <ROWNUMBER_OF_TARGET_QUERY> ORDER BY ROWNUMBER DESC
    4. Ejecutar el siguiente query de T-SQL para determinar la cantidad de tiempo que se gastó en el Storage Engine y en el Fórmula Engine.
      SELECT SUM(DURATION) FROM <TABLE_NAME> WHERE EVENTCLASS=11 AND CONNECTIONID=<TARGET_CONNECTIONID> AND ROWNUMBER BETWEEN <QUERY_BEGIN_ROWNUMBER> AND <QUERY_END_ROWNUMBER>

    Paso 2. Identificar si el problema es causado por cálculos Cell by Cell

    Puedes utilizar el Performance Monitor para identificar si el problema son cálculos Cell By Cell. Para ser exitoso en ésta tarea es mucho mejor que ejecutes el query en un ambiente aislado porque tenemos un contador con el total de cálculos de celdas para toda la instancia y no hay forma de separarlo por query en el Performance Monitor. La imagen de abajo muestra cómo se ve el ejemplo nuestro.

    En la imagen puedes ver que el contador usado es “MSOLAP&InstanceName:MDX \ Total Cells Calculated” y el valor inicial es 0 y el valor después de ejecutar el query es superior a 1 millón.

     

    Los resultados anteriores fueron después de reiniciar la instancia y una sola ejecución del query generó más de un millón de celdas calculadas. Si ésta es la primera vez que haces esto no sabes si 1 millón es muy alto o es bajo. Puedo asegurarte que para éste query es un número bastante alto.

    Paso 3. Modificar tu query

    Modificar el query utilizando las recomendaciones en los links mencionados anteriormente hasta que dejes de ver el gran incremento en número de celdas calculadas para tu query.

    En éste caso particular el Script MDX estaba usando algunas expresiones del tipo:

    Measures.Measure1 ^ 2

    Cambiamos la formula a algo como:

    Measures.Measure1 * Measures.Measure1

    Después de que la formula fue cambiada obtuvimos los siguientes resultados.

     

    Puedes ver que el total del query es 156 ms, considerando que el Storage Engine debió usar el mismo tiempo, 132 ms, significa que el Formula Engine tomó aproximadamente 24 ms.

     

    En el Performance Monitor podemos ver que el total de celdas calculadas fue 41. El query fue ejecutado después de que se reinició la instancia.

    Comentarios Finales

    Esto es solo el procedimiento básico para encontrar si los cálculos cell by cell están causando problemas en tu ambiente. Las modificaciones al query para evitar cálculos cell by cell puede ser fácil algunas veces, como en éste caso real, o muy difícil en otros escenarios.

    Espero esto sea útil para que puedan empezar a solucionar sus propios casos.

     

  • “Rule Microsoft Cluster Service (MSCS) cluster verification errors” Failed

    In one of my regular customers, they are begging the SQL Server 2012 Migration, at the installation process for a SQL Server 2012 Instance on a Windows Server 2008R2 Cluster, they found an error while adding a node to de SQL Instance.

     

    This error didn’t allow them to go forward to add the node on the SQL Instance, there are a few posible causes to check.

    • First, check if there are failed test son the Cluster Validation Report. TO solve this problem execute the Cluster Validation Wizard and ensure there’s no failed test or with  an error state (test with a warning state are not a problem)
    • The validation process may fail under various conditions. When this issue occurs, you must perform a manual validation to make sure that the hardware configuration is correct before you try any workaround that is mentioned in this article, http://support.microsoft.com/kb/953748
    • There’s another cause not so known, for SQL Server to make the cluster verification, it needs to locate the validation reports from all the nodes of the cluster using the fully qualified domain name (FQDN). SO you need to check that when you do a ping between the servers the IP it’s resolved to the FQDN, if is not the case check the DNS and host file.
    • Another cause can be the Windows Firewall blocking the validation, in case it’s active.

    In this case we checked the first and second probable causes, but the error still appear.

     

    After that we checked the third probable cause and we observed that the IP was been resolved to the NETBIOS name and not to the FQDN name, so we fix that problem, and we retried the add node process to the SQL Instance, this time was successful.

  • Error: “Rule Microsoft Cluster Service (MSCS) cluster verification errors”

    En uno de mis clientes regulares, están iniciando la migración hacia SQL Server 2012, al momento de la Instalación de una Instancia de SQL Server 2012 sobre un Windows Cluster de Windows Server 2008R2, se presentó el siguiente error durante el proceso de añadir un nodo a la Instancia de SQL. 

    Este error no permite seguir con el procedimiento de añadir un nodo a la Instancia de SQL en el Cluster, hay un par de motivos por el cual este error puede aparecer:

    • El primer motivo es que existan pruebas fallidas en el reporte de Validación del Cluster, para resolver este problema ejecute el Wizard de Validación del Cluster y en el reporte se muestre que no existe ninguna prueba fallida o con estatus de error (pruebas en estado de warning no representan un problema).
    • También existe un problema donde por diferentes circunstancias el proceso de validación puede fallar, y cuando esto ocurre se deberá hacer una revisión manual para asegurar que la configuración del hardware es correcta y luego intentar el workaround mencionado en el siguiente artículo, http://support.microsoft.com/kb/953748
    • Sin embargo existe otro motivo que no es muy conocido, para que SQL Server pueda hacer la verificación del cluster debe poder localizar los reportes de validación de todos los nodos del cluster a través del FQDN (nombreservidor.nombrededominio), se deberá verificar que al hacer ping entre los servidores la IP se resuelve al FQDN, en caso que no sea así deberán revisar el DNS y el host file.
    • Otra razón también puede ser que el Windows Firewall este bloqueando el acceso en caso de estar activo.

    En este caso se revisó la primera y segunda posible causa, sin embargo el error todavía seguía apareciendo.

    Por tanto se revisó la tercera causa y se pudo observar que las respuestas de la resolución de nombre devolvían el nombre NETBIOS y no el nombre FQDN, luego de resolver este problema, se reintento el proceso de añadir nodo a la Instancia de SQL en el cluster de forma satisfactoria.

  • Erro MissingAssembly no Health Analyzer

    Em ambientes que temos soluções customizadas para o SharePoint 2010, é muito comum aparecer no Heath Analyzer a mensagem de erro a seguir:

    Assembly [My.Assembly, Version=1.0.0.0, Culture=neutral, PublicKeyToken=cfc9a4dcd383ae1e] is referenced in the database [WSS_Content], but is not installed on the current farm. Please install any feature/solution which contains this assembly.

    Na maioria dos casos esse erro é gerado por algum Event Receiver problemático, ou seja, que tenha sido esquecido de remover da solução customizada, ou outro problema relacionado com a desativação ou retração da solução.

    Neste post eu quero compartilhar com vocês um script Power Shell que pode ajudá-los a remover esse event receiver problemático.

    Leia o resto deste post

  • Power Pivot y Power View – Personal BI

    Duración: 1hr.  

    Tema: Power Pivot y Power View – Personal BI. 

    Descripción del tema: En ésta sesión se presentarán las funcionalidades y escenarios en los que éstas dos (2) componentes de Office y SQL encajan en una solución de BI y brindan al usuario final la libertad de explotar la información disponible en la empresa de una manera más eficiente. 

    Objetivo: Dar a conocer cómo funcionan Power Pivot y Power View, que nuevas funcionalidades se esperan y como pueden empezar a utilizarlos.  

    Presentador: Rubén González

     

    Format: wmv
    Duration:

  • Optimización de aplicaciones de bases de datos OLTP

    En esta sesión hablaremos de algunas de las Mejores Practicas en diferentes niveles de SQL Server para obtener un buen rendimiento en SQL Server.

     

    Format: wmv
    Duration:

  • Error Missing Assembly en el Health Analyzer

    Uno de los hallazgos más comunes en el Health Analyzer, cuando se desarrollan soluciones a la medida en SharePoint 2010 es el siguiente:

     

    Assembly [My.Assembly, Version=1.0.0.0, Culture=neutral, PublicKeyToken=cfc9a4dcd383ae1e] is referenced in the database [WSS_Content], but is not installed on the current farm. Please install any feature/solution which contains this assembly.

     

    La mayoría de las veces el hallazgo es acerca de Recibidores de Eventos que no han sido correctamente desinstalados, ya sea en la desactvación o eliminación de la solución.

     

    En esta entrada de blog pretendo compartir con ustedes un script de Power Shell con el don de ayudar a identificar y remover estos Recibidores de Eventos corruptos.

     

    El script contiene las siguientes funciones:

     

    Delete-MissingAssembly: Esta es la función principal que recorre cada posible contenedor en la base de datos que pueda tener Recibidores de Eventos, esto quiere decir Colección de listas, Sitios o Listas.

     

    Remove-EventReceiver: Esta función revisa si un contenedor de Recibidores de Eventos tiene alguno con el nombre de assembly que se le pase como parámetro, y trata de eliminarlo.

     

    Las 2 funciones tienen un parámetro (ReportOnly) que permite definir si se quiere eliminar o no el Recibidor de Evento encontrado.

     

    function Delete-MissingAssembly($ContentDb, $Assembly, [switch]$ReportOnly)

    {

           [bool]$report = $false

           if ($ReportOnly) { $report = $true }

           $database = Get-SPContentDatabase | ?{$_.Name -eq $ContentDb}

        foreach($site in $database.Sites)

        {

            Remove-EventReceiver -ERContainer $site -Assembly $Assembly -ReportOnly $report

            foreach($web in $site.AllWebs)

            {

                Remove-EventReceiver -ERContainer $web -Assembly $Assembly -ReportOnly $report

                foreach($list in $web.Lists)

                {

                    Remove-EventReceiver -ERContainer $list -Assembly $Assembly -ReportOnly $report

                }

            }

        }

    }

     

    function Remove-EventReceiver($ERContainer, $Assembly, $ReportOnly)

    {

        foreach($er in $ERContainer.EventReceivers)

           {

                 if($er.Assembly -eq $Assembly)

                 {

                        Write-Host "Event Receiver with Id[" $er.Id "], Name[" $er.Name "] and Type [" $er.Type "] found in [" $ERContainer.Url $ERContainer.DefaultViewUrl "]."

                        if($ReportOnly -eq $false)

                        {

                    Write-Host "Try to delete the receiver:"   

                    $er.Delete()

                    Write-Host "ER deleted."

                        }

                 }

           }

    }

     

     

    Después de que usted guarde este script en un archivo PS1 y lo importe en Power Shell (Ejemplo: Import-Module .\MissingEV.PS1), usted puede ejecutar el script de esta forma:

     

    Delete-MissingAssembly -ContentDb WSS_Content -Assembly "My.Assembly, Version=1.0.0.0, Culture=neutral, PublicKeyToken=cfc9a4dcd383ae1e" -ReportOnly

     

    La salida de ejecución del comando puede ser:

     

    Como se puede ver en la salida de Power Shell, muestra el Id, Nombre, Tipo y ubicación del Recibidor de Eventos, donde usted puede decidir si borrar o no este, por lo contrario debería utilizar otra herramienta o directamente con PS.

     

    Espero que esta entrada sirva para resolver los típicos problemas del hallazgo “Missing server dependencies” en el Health Analyzer.

     

  • MissingAssembly Error in Health Analyzer

    One of the most common issues in the Health Analyzer when you deploy custom solutions in your SharePoint 2010 environment, is this one:

     

    Assembly [My.Assembly, Version=1.0.0.0, Culture=neutral, PublicKeyToken=cfc9a4dcd383ae1e] is referenced in the database [WSS_Content], but is not installed on the current farm. Please install any feature/solution which contains this assembly.

     

    Most of the times this issue is regarding some bad Event Receivers that you forgot to remove before you delete the custom solution, or another problem related with the feature deactivation and solution retraction.

     

    In this post I want to share with you a Power Shell script that can help you to remove this kind of bad Event Receivers.

     

    The following script contains 2 functions:

     

    Delete-MissingAssembly: This is the main function that goes through every possible container in the specific database that can host an Event Receiver, it means Site, Web or List.

     

    Remove-EventReceiver: This function check if the event receiver container has any event receiver with the specific assembly name, shows his information and try to delete it.

     

    Also the 2 functions has a parameter to allow directly delete the event receiver or only shows in the screen the information regarding the ER.

     

     

    function Delete-MissingAssembly($ContentDb, $Assembly, [switch]$ReportOnly)

    {

           [bool]$report = $false

           if ($ReportOnly) { $report = $true }

           $database = Get-SPContentDatabase | ?{$_.Name -eq $ContentDb}

        foreach($site in $database.Sites)

        {

            Remove-EventReceiver -ERContainer $site -Assembly $Assembly -ReportOnly $report

            foreach($web in $site.AllWebs)

            {

                Remove-EventReceiver -ERContainer $web -Assembly $Assembly -ReportOnly $report

                foreach($list in $web.Lists)

                {

                    Remove-EventReceiver -ERContainer $list -Assembly $Assembly -ReportOnly $report

                }

            }

        }

    }

     

    function Remove-EventReceiver($ERContainer, $Assembly, $ReportOnly)

    {

        foreach($er in $ERContainer.EventReceivers)

           {

                 if($er.Assembly -eq $Assembly)

                 {

                        Write-Host "Event Receiver with Id[" $er.Id "], Name[" $er.Name "] and Type [" $er.Type "] found in [" $ERContainer.Url $ERContainer.DefaultViewUrl "]."

                        if($ReportOnly -eq $false)

                        {

                    Write-Host "Try to delete the receiver:"   

                    $er.Delete()

                    Write-Host "ER deleted."

                        }

                 }

           }

    }

     

     

    After you save this script in a PS1 file and import it (Example: Import-Module .\MissingEV.PS1), you can use the function in the following way:

     

    Delete-MissingAssembly -ContentDb WSS_Content -Assembly "My.Assembly, Version=1.0.0.0, Culture=neutral, PublicKeyToken=cfc9a4dcd383ae1e" -ReportOnly

     

    And the output could be:

     

     

    As you can see the output of the Power Shell shows the Id, Name, Type and location of the specific event Receiver, you can decide if remove it with this script or access through PS or a 3rd tool to remove it.

     

    Hope this helped you in the typically Missing server side dependencies issue in the Health Analyzer.

  • Obtendo Pastas Utilizando o WebService Lists.ASMX do SharePoint 2010

    Lendo um post no fórum do MSDN com o título Recuperar ID de pasta na Biblioteca usando Web Services fiquei curioso com o problema reportado, que era conseguir consultar uma pasta do SharePoint passando o nome dela e retornando o ID, utilizando o webservice Lists.ASMX.

    Este post tem um exemplo de como implementar esta necessidade.

    Leia o resto deste post »

  • Editando o E-mail da Tarefa Atribuída do Processo de Aprovação do Workflow do SharePoint 2010

    O workflow do SharePoint 2010 é muito rico em detalhes que muitas vezes são inexplorados. Um deles é o processo de aprovação, que nos permite customizar a interação do usuário com as tarefas de workflow de uma forma mais rica.

    Neste post vou mostrar como editar o e-mail de tarefa atribuída que o workflow envia, mas o conteúdo deste post pode ser utilizado em outras customizações desta atividade.

    Leia o resto deste post »

  • Crear una Topología de Búsqueda en SharePoint 2013

    Como ustedes deben recordar en SharePoint 2010 usted podía utilizar la interfaz gráfica para crear o  re configurar su topología de Búsqueda empresarial, utilizando la administración de la aplicación de servicio de Búsqueda.  En dicha interfaz gráfica usted puede crear, editar o remover cualquiera de los siguientes componentes:

    • Componente de Administración
    • Componente de Rastreo (Crawl)
    • Bases de datos de rastreo
    • Componente de Consultas (Query)
    • Particiones del índice.

    Y era muy fácil para los administradores utilizar cualquiera de los servidores de la graja y de esta forma configurar la mejor topología de Búsqueda empresarial basados en sus requerimientos de negocio.

    Una de las cosas que las personas más me comentan es que utilizar la interfaz gráfica para configurar la topología es realmente fácil, pero si uno comete algún error configurando algún parámetro o tiene algún otro problema en la granja, y al finalizar de configurar la topología empresarial de Búsqueda, y hacer clic en el botón de aplicar los cambios, luego de un buen rato aparece un error y las mayoría de los cambios realizados no se mantienen.

    El anterior problema es una buena razón para configurar su topología empresarial de Búsqueda con Power Shell, porque usted tiene toda la flexibilidad de crear y re configurar los componentes,  y esto puede ayudar a identificar problemas en su granja o topología antes de que finalice de configurar en su totalidad esta.

    También es importante mencionar que algunos administradores de SharePoint le temen administrar SharePoint con Power Shell, por qué piensas que están pasándose al lado de desarrollo y ellos solo quieren ser profesionales de infraestructura.  Pero lo que deben saber es que Microsoft está invirtiendo en utilizar Power Shell en la mayoría de sus productos con el fin de ofrecer una sola forma de administrarlos a todos y facilitar y flexibilizar las tareas de infraestructura.  Yo espero que este blog ayude a aquellos administradores a quitarse ese concepto de la mente.

    Es de saber para las personas que ya están trabajando con SharePoint 2013, que la única vía para configurar la topología de búsqueda es atreves de Power Shell y sus cmdlets disponibles para crear los nuevo y poderosos componentes del nuevo servicio empresarial de Búsqueda de SharePoint 2013.

    El propósito de esta entrada de blog es mostrar algunos ejemplos de cómo crear una topología de Búsqueda empresarial en SharePoint 2013, obviamente utilizando Power Shell, pero no solo mencionando que cmdlets utilizar, sino también como podrían automatizar esta labor y así poder repetir estos pasos las veces que sean necesarias y utilizarlos en otras implementaciones de SharePoint 2013, y adicionalmente ayudar a los administradores de SharePoint a perder ese miedo en utilizar Power Shell para administrar SharePoint.

    Todos los cmdlets utilizados en esta entrada de blog están basados en el siguiente documento de TechNet:

    Manage search components in SharePoint Server 2013

    http://technet.microsoft.com/en-us/library/jj862354.aspx

    Si usted no ha leído el anterior documento, yo recomiendo que lo haga o lo tome como referencia para la lectura de esta entrada.

    A continuación voy a resumir los pasos para crea una nueva topología de Búsqueda en SharePoint 2013, y los cuales son mencionados en el anterior documento:

    1. Iniciar la instancia de servicio de búsqueda: Recuerde que si quiere habilitar un servidor para que sea utilizado en la topología de Búsqueda debe antes iniciar el servicio de búsqueda en dicho servidor.
    2. Obtener la referencia de la topología de búsqueda activa: Existen 2 opciones, la primera es crear una topología de búsqueda vacía, o la segunda es clonar la actual topología de búsqueda y modificarla, en este caso vamos a asumir que vamos a utilizar la actual topología para modificarla.
    3. Clonar la topología de búsqueda activa: Como se mencionó anteriormente vamos a clonar la topología para después modificarla.
    4. Adicionar o remover componentes de búsqueda: Cuando clonamos la topología podemos modificarla adicionándole o removiéndole componentes de tal forma que creemos la nueva deseada.
    5. Activar la nueva topología de búsqueda: Finalmente después de terminar de modificar la topología debemos definir esta como activa.

    Como se puede ver existen varios pasos a realizar y por lo tanto varios comandos de Power Shell deben ser ejecutados, por esta razón he creado las siguientes funciones que nos permitirán facilitar la creación de la topología de búsqueda.

     

    GetOrStartSearchServiceInstance

    La siguiente función permite identificar si un servidor tiene el servicio de búsqueda indicado, si no es así lo inicia.

    function GetOrStartSearchServiceInstance($Server)

    {

        $startInstance = $false

        $serverIns = Get-SPEnterpriseSearchServiceInstance -Identity $Server

        if($serverIns -ne $null)

        {

            if($serverIns.Status -ne "Online")

            {

                $startInstance = $true

            }

        }

        else

        {

            $startInstance = $true

        }

        if($startInstance)

        {

            $serverIns = Start-SPEnterpriseSearchServiceInstance -Identity $serverIns

        }

        return $serverIns

    }

     

    En este caso la forma de llamar esta función será:

    GetOrStartSearchServiceInstance -Server “<server name>”

     

    Como pudo ver en el documento de TechNet, para adicionar y remover un componente de búsqueda se utilizan los siguientes cmdlets:

    • Remove-SPEnterpriseSearchComponent: Remueve un componente especifico de la topología de búsqueda.
    • New-SPEnterpriseSearch<SearchComponent>Component: Donde <SerachComponente> puede ser Admin, AnalyticsProcessing, ContentProcessing, Crawl and QueryProcessing.  Y sirven para crear un componente de la topología de búsqueda.

    En el caso de New-SPEnterpriseSearch<SearchComponent>Component, si usted entra en detalle a ver que parámetros acepta, es posible para todos los cmdlets proveer 2 parámetros básicos los cuales son la topología y la instancia de servicio (es decir el servidor), es por esto que he creado la siguiente función la cual permite crear cualquiera de los componentes anteriormente mencionados en la cantidad de servidores necesarios.

     

    Set-SPSearchComponents

    Esta función necesita los siguientes parámetros:

    • ServerType: Es una cadena de caracteres que define el tipo de componente a crear, el cual puede ser: Admin, AnalyticsProcessing, ContentProcessing, Crawl or QueryProcessing.
    • ServersStringArray: Es una cadena de caracteres que contenga el nombre de los servidores donde se desea habilitar el tipo de componente de búsqueda, estos deben estar separados por coma.
    • Topology: Debe ser una variable de referencia a la topología de búsqueda que se quiera modificar.

     

    function Set-SPSearchComponents($ServerType, $ServersStringArray, $Topology)

    {

        #Check if is a valid type of search component

        $validTypes = ("Admin", "AnalyticsProcessing", "ContentProcessing", "Crawl", "QueryProcessing")

        if($validTypes.Contains($ServerType) -ne $true)

        {

            throw "ServerType is not valid."

        }

        #Check server by server is need to Remove or Add

        $ServerType += "Component"

        $currentServers = Get-SPEnterpriseSearchComponent -SearchTopology $Topology | ?{$_.GetType().Name -eq $ServerType}

        #Remove components

        foreach($component in $currentServers)

        {       

            Remove-SPEnterpriseSearchComponent -Identity $component -SearchTopology $Topology #-Confirm $true    

        }

        #Add Components

        foreach($server in $ServersStringArray.Split(","))

        {

            #Check in search service instance is started, otherwise start it

            $serIns = GetOrStartSearchServiceInstance -Server $server       

            switch($ServerType)

            {

                "AdminComponent" {New-SPEnterpriseSearchAdminComponent -SearchTopology $newTop -SearchServiceInstance $serIns}

                "AnalyticsProcessingComponent" {New-SPEnterpriseSearchAnalyticsProcessingComponent -SearchTopology $newTop -SearchServiceInstance $serIns}

                "ContentProcessingComponent" {New-SPEnterpriseSearchContentProcessingComponent -SearchTopology $newTop -SearchServiceInstance $serIns}

                "CrawlComponent" {New-SPEnterpriseSearchCrawlComponent -SearchTopology $newTop -SearchServiceInstance $serIns}

                "QueryProcessingComponent" {New-SPEnterpriseSearchQueryProcessingComponent -SearchTopology $newTop -SearchServiceInstance $serIns}

            }

        }

        #Show in the output the search components of the topology to see the modificatios made on.

        Get-SPEnterpriseSearchComponent -SearchTopology $Topology

    }

     

    Un ejemplo para invocar esta función podria ser el siguiente:

    Set-SPSearchComponents -ServerType "AnalyticsProcessing" -ServersStringArray “server1,server3” -Topology $newTop

     

    Finalmente para dar un gran ejemplo de cómo crear totalmente una topología empresarial de Búsqueda en SharePoint 2013, he creado la siguiente función, la cual hace uso de las anteriores.

     

    New-SPSearchTopology

    Para usar esta función se deben proveer los siguientes parámetros:

    • AdminServers: Los servidores que desea utilizar que provean el componente de Admin.  Estos servidores deben estar en una cadena de caracteres separados por coma: “server1,server2,server3”.
    • AnalyticsServers: Los servidores que desea utilizar que provean el componente de AnalyticsServers.  Estos servidores deben estar en una cadena de caracteres separados por coma: “server1,server2,server3”.
    • ContentServers: Los servidores que desea utilizar que provean el componente de ContentServers.  Estos servidores deben estar en una cadena de caracteres separados por coma: “server1,server2,server3”.
    • CrawlServers: Los servidores que desea utilizar que provean el componente de CrawlServers.  Estos servidores deben estar en una cadena de caracteres separados por coma: “server1,server2,server3”.
    • QueryServers: Los servidores que desea utilizar que provean el componente de QueryServers.  Estos servidores deben estar en una cadena de caracteres separados por coma: “server1,server2,server3”.

     

    function New-SPSearchTopology($AdminServers, $AnalyticsServers, $ContentServers, $CrawlServers, $QueryServers)

    {

        $servers = $AdminServers + "," + $AnalyticsServers + "," + $ContentServers + "," + $CrawlServers + "," + $QueryServers

        #Check the existence of the servers

        foreach($server in $servers.Split(","))

        {

            Get-SPServer $server -ErrorAction Stop

        }

        #Initialize variables

        $ssa = Get-SPEnterpriseSearchServiceApplication

        #Clone search topology

        $activeTop = Get-SPEnterpriseSearchTopology -SearchApplication $ssa -Active

        $newTop = New-SPEnterpriseSearchTopology -SearchApplication $ssa -Clone –SearchTopology $activeTop

        #Admin component

        Set-SPSearchComponents -ServerType "Admin" -ServersStringArray $AdminServers -Topology $newTop

        #Analytics servers

        Set-SPSearchComponents -ServerType "AnalyticsProcessing" -ServersStringArray $AnalyticsServers -Topology $newTop

        #Content

        Set-SPSearchComponents -ServerType "ContentProcessing" -ServersStringArray $AnalyticsServers -Topology $newTop

        #Crawl

        Set-SPSearchComponents -ServerType "Crawl" -ServersStringArray $AnalyticsServers -Topology $newTop

        #Query

        Set-SPSearchComponents -ServerType "QueryProcessing" -ServersStringArray $AnalyticsServers -Topology $newTop

        #Active Topology

        Set-SPEnterpriseSearchTopology -Identity $newTop

    }

     

    Un ejemplo para invocar esta función podria ser el siguiente:

    New-SPSearchTopology –AdminServers “server1,server2” –AnalyticsServers “server1,server3” –ContentServers “server2,server4” –CrawlServers “server5,server6” –QueryServers “server7,server8,server9”

     

    Espero que esta entrada haya sido de ayuda para crear su nueva topología empresarial de Búsqueda en SharePoint 2013, y recuerde que no todas las consideraciones acerca del servicio empresarial de Búsqueda de SharePoint 2013 han sido tomadas en cuenta en este artículo, en el futuro espero escribirles acerca de:

    • Como detener el servicio de búsqueda en los servidores no requeridos.
    • Mover la ubicación de los archivos de índice.
    • Particiones del índice.
    • Bases de datos de búsqueda.

     

  • Create a Search Topology in SharePoint 2013

    As you may remember in SharePoint 2010 you had a specific user interface to create and reconfigure your enterprise Search topology, in the Search Service applications management.  There you can create, edit and remove the following components:

    • Admin component
    • Crawl components
    • Crawl databases
    • Query components
    • Partitions

    And it was very easy by the administrator to use any server in their farm to configure the best enterprise Search topology for their business requirements.

    One thing than many people said to me was that the configuration was very easy with the UI, but if you put something wrong or your farm have any issue, when you finished to reconfigure your enterprise search topology, and you click in the button to apply all the changes, it takes a while and gives you an error and also you lose the majority of the changes that you made before.

    The above problem was a good reason to configure your enterprise search topology with Power Shell, because you have the flexibility to create and reconfigure the components one by one, it help you to identify issues in your farm regarding the search service before finish to define your enterprise search topology. 

    Also some Share Points administrators have afraid to manage SharePoint with Power Shell, because are thinking that are writing scripts so are developing things, and they may be don’t want to be a developers, only IT infrastructure guys.  But you must to know that the reason that Microsoft are integrating Power Shell in all our products is to try to standardize the way that you can manage the different services.  I hope this blog could help to those SharePoint administrators that have this concept in mind.

    Now, for the people that are working with SharePoint 2013, knows that the only way to create or reconfigure your enterprise Search Topology is using the Power Shell cmdlets created for the new and powerful components of the SharePoint 2013 Enterprise Search Service Application.

    The propose of this blog entry is to show you some examples to create an enterprise Search topology in SharePoint 2013, also with Power Shell, but not only to tell you the specific cmdlets that you must or can use to do this job, my objective is to try to automatize this work creating scripts that you can use in your different implementations of SharePoint 2013, also this can help the SharePoint administrators to lose their afraid when are using Power Shell to manage SharePoint.

    All the cmdlets that I use in this entry are based in the following TechNet document:

    Manage search components in SharePoint Server 2013

    http://technet.microsoft.com/en-us/library/jj862354.aspx

    If you didn’t read the above document, I recommend to you to do it or take as a reference for the cmdlets that you are going to see here.

    I’m going to start to summarize the basics steps that you must to do when you want to create a new Enterprise search topology:

    1. Start the search server instance: Remember that you must to start the server instance in all servers that you want to use for a specific service application, in this case to create a new Search topology you must to start the service instance in the servers than you want to use in your topology.
    2. Retrieve the active Search topology: You have 2 options, first to create a new empty search topology or second to clone the active topology and modify them, in this case I assuming that we are creating a Search topology using some of the same components that the current topology have, so for this reason we are going to clone the active topology instead to create a new one, to do this you must to retrieve the current active Search topology.
    3. Clone the active Search topology: As I explained in the above step, we are going to clone the active Search topology.
    4. Add or remove search components: When we have a cloned Search topology we can remove or add components without affecting the active Search topology.  In this steps we are going to redistribute and use all the servers we defined in the first step.
    5. Active the new Search topology: Finally we need to set the modified Search topology as the active topology to begin to work whit it.

    As  you can see there are some steps that you must to do and in some cases you must to repeat them, for this reason I created the following power shell functions to help to create our Search topology.

     

    GetOrStartSearchServiceInstance

    The following function help us to check if the search service instance is started in a specific sever and retrieve the reference to it, or start the service instances in the case that is wasn’t started.

     

    function GetOrStartSearchServiceInstance($Server)

    {

        $startInstance = $false

        $serverIns = Get-SPEnterpriseSearchServiceInstance -Identity $Server

        if($serverIns -ne $null)

        {

            if($serverIns.Status -ne "Online")

            {

                $startInstance = $true

            }

        }

        else

        {

            $startInstance = $true

        }

        if($startInstance)

        {

            $serverIns = Start-SPEnterpriseSearchServiceInstance -Identity $serverIns

        }

        return $serverIns

    }

     

    In this case you provide to the function a server name and the function retrieve a search service instance, you must to call it in the following way:

    GetOrStartSearchServiceInstance -Server “<server name>”

     

    As you can saw in the TechNet document, to add and remove the search component we use the following functions:

    • Remove-SPEnterpriseSearchComponent: To remove a specific Search topology component.
    • New-SPEnterpriseSearch<SearchComponent>Component: Where <SearchComponent> could be Admin, AnalyticsProcessing, ContentProcessing, Crawl and QueryProcessing.  To create a new Search topology component.

    In the case of New-SPEnterpriseSearch<SearchComponent>Component, you can dig in deep and see that you can use the same basic parameters: the Search topology and the search service instance, for that reason I created the following function to help create and remove the specific components on a the specific servers.

     

    Set-SPSearchComponents

    This functions needs the following parameters:

    • ServerType: Is a string that define the component to add or remove, can be: Admin, AnalyticsProcessing, ContentProcessing, Crawl or QueryProcessing.
    • ServersStringArray: The servers that you want to use to host the specific search component.  This servers must be separated by coma, for example: “server1,server2,server3”.
    • Topology: The reference to the Search topology that you want to modify to add or remove the componets.

     

    function Set-SPSearchComponents($ServerType, $ServersStringArray, $Topology)

    {

        #Check if is a valid type of search component

        $validTypes = ("Admin", "AnalyticsProcessing", "ContentProcessing", "Crawl", "QueryProcessing")

        if($validTypes.Contains($ServerType) -ne $true)

        {

            throw "ServerType is not valid."

        }

        #Check server by server is need to Remove or Add

        $ServerType += "Component"

        $currentServers = Get-SPEnterpriseSearchComponent -SearchTopology $Topology | ?{$_.GetType().Name -eq $ServerType}

        #Remove components

        foreach($component in $currentServers)

        {       

            Remove-SPEnterpriseSearchComponent -Identity $component -SearchTopology $Topology #-Confirm $true    

        }

        #Add Components

        foreach($server in $ServersStringArray.Split(","))

        {

            #Check in search service instance is started, otherwise start it

            $serIns = GetOrStartSearchServiceInstance -Server $server       

            switch($ServerType)

            {

                "AdminComponent" {New-SPEnterpriseSearchAdminComponent -SearchTopology $newTop -SearchServiceInstance $serIns}

                "AnalyticsProcessingComponent" {New-SPEnterpriseSearchAnalyticsProcessingComponent -SearchTopology $newTop -SearchServiceInstance $serIns}

                "ContentProcessingComponent" {New-SPEnterpriseSearchContentProcessingComponent -SearchTopology $newTop -SearchServiceInstance $serIns}

                "CrawlComponent" {New-SPEnterpriseSearchCrawlComponent -SearchTopology $newTop -SearchServiceInstance $serIns}

                "QueryProcessingComponent" {New-SPEnterpriseSearchQueryProcessingComponent -SearchTopology $newTop -SearchServiceInstance $serIns}

            }

        }

        #Show in the output the search components of the topology to see the modificatios made on.

        Get-SPEnterpriseSearchComponent -SearchTopology $Topology

    }

    An example to use this function could be:

    Set-SPSearchComponents -ServerType "AnalyticsProcessing" -ServersStringArray “server1,server3” -Topology $newTop

     

    Finally to give you a mainly example to create a SharePoint 2013 Enterprise Search Topology, I written the following function using the functions mentioned above.

     

    New-SPSearchTopology

    To use this function must to pass the following parameters:

    • AdminServers: The servers that you want to use to host the Admin search component.  This servers must be separated by coma, for example: “server1,server2,server3”.
    • AnalyticsServers: The servers that you want to use to host the Analytics Processing search component.  This servers must be separated by coma, for example: “server1,server2,server3”.
    • ContentServers: The servers that you want to use to host the Content Processing search component.  This servers must be separated by coma, for example: “server1,server2,server3”.
    • CrawlServers: The servers that you want to use to host the Crawl search component.  This servers must be separated by coma, for example: “server1,server2,server3”.
    • QueryServers: The servers that you want to use to host the Query search component.  This servers must be separated by coma, for example: “server1,server2,server3”.

     

    function New-SPSearchTopology($AdminServers, $AnalyticsServers, $ContentServers, $CrawlServers, $QueryServers)

    {

        $servers = $AdminServers + "," + $AnalyticsServers + "," + $ContentServers + "," + $CrawlServers + "," + $QueryServers

        #Check the existence of the servers

        foreach($server in $servers.Split(","))

        {

            Get-SPServer $server -ErrorAction Stop

        }

        #Initialize variables

        $ssa = Get-SPEnterpriseSearchServiceApplication

        #Clone search topology

        $activeTop = Get-SPEnterpriseSearchTopology -SearchApplication $ssa -Active

        $newTop = New-SPEnterpriseSearchTopology -SearchApplication $ssa -Clone –SearchTopology $activeTop

        #Admin component

        Set-SPSearchComponents -ServerType "Admin" -ServersStringArray $AdminServers -Topology $newTop

        #Analytics servers

        Set-SPSearchComponents -ServerType "AnalyticsProcessing" -ServersStringArray $AnalyticsServers -Topology $newTop

        #Content

        Set-SPSearchComponents -ServerType "ContentProcessing" -ServersStringArray $AnalyticsServers -Topology $newTop

        #Crawl

        Set-SPSearchComponents -ServerType "Crawl" -ServersStringArray $AnalyticsServers -Topology $newTop

        #Query

        Set-SPSearchComponents -ServerType "QueryProcessing" -ServersStringArray $AnalyticsServers -Topology $newTop

        #Active Topology

        Set-SPEnterpriseSearchTopology -Identity $newTop

    }

     

    An example to use this function could be:

    New-SPSearchTopology –AdminServers “server1,server2” –AnalyticsServers “server1,server3” –ContentServers “server2,server4” –CrawlServers “server5,server6” –QueryServers “server7,server8,server9”

    I hope this post could help you to create your new SharePoint 2013 Enterprise Search Topology, and remember that not all the Enterprise Search considerations are taken on this scripts, in the future I going to write about how to change the following characteristics:

    • Stop the search service instance.
    • Move the index location.
    • Move the search component.
    • Index partitions.
    • Search databases.