• Auditoría de Seguridad en SQL Server 2008

    Esta semana mientras trabajaba en Bolivia escuché al personal de seguridad de un cliente discutir sobre las opciones que podían utilizar para auditar las transacciones realizadas a las tablas de una base de datos. Los interrumpí y les pregunté si habían escuchado a cerca de la configuración de auditorías en SQL Server 2008 y me dijeron que no. Así que aproveché el tema para escribir el siguiente artículo.

    La primera pregunta que nos surge es: ¿Porque auditamos?

    Revisando la literatura de auditoría de seguridad, los autores coinciden en que el tener políticas de seguridad es un factor crítico para mantener los datos seguros. La auditoría también nos ayuda a identificar lo que accedió un intruso en el evento de que un ataque sea exitoso.

    En SQL 2005 el enfoque estaba orientado a asegurarse de que el usuario no tuviera privilegio mayores a los que necesitaba y que los cambios fueran realizados por el personal autorizado. La herramienta que se promovía para auditar los cambios a la base de datos era el SQL Profiler ya que podía auditar cambios al esquema, operaciones de insertar, actualizar o eliminar registros; y eventos relacionados con cambios de permisos o la creación de nuevos Logins.

    Una de las mejoras que trajo SQL Server 2008 Enterprise es un incremento en la capacidad de auditoría a través del uso del SQL Server Audit. A través de esta funcionalidad se puede rastrear y registrar de forma automática los eventos que ocurren a nivel del servidor o a nivel de la base de datos. Esto es posible a través del uso del objeto Audit. Veamos entonces como crear una auditoría, como crear y habilitar una especificación de auditoría a nivel de Servidor o a nivel de base de datos y como visualizar los registros de auditoría.

    Crear una Auditoría

    Un objeto de auditoría es una colección de una o más acciones individuales o un grupo de acciones que podrán ser rastreadas. Por ejemplo, se puede configurar un objeto de auditoría para identificar todos los logins fallidos. Los eventos se escriben en la localización que se especifique. Se pueden almacenar en un archivo, la bitácora de eventos de aplicaciones o la bitácora de eventos de seguridad.

    El objeto de auditoría se puede crear a través del Management Studio (SSMS) o utilizando T-SQL. Desde SSMS se debe presionar el botón de la derecha del mouse sobre la opción New Audit localizada en la carpeta de auditoría bajo el árbol de Seguridad, como se muestra a continuación:

    En la pantalla Create Audit se debe ingresar el nombre del objeto de auditoría, y se debe especificar el destino. Si se indica que el destino será un archivo, hay que especificar la ruta donde será almacenado. Finalmente se debe presionar el botón OK para crear el objeto de auditoría.

    Para propósitos de este ejemplo cree un segundo objeto de auditoría e ingrese el nombre “AuditarConsultasTablaEmpleado”. Seleccione como destino un archivo e indique la ruta donde desee almacenarlo. Ambos objetos estarán localizados bajo la carpeta Audits, como se muestra a continuación. Este objeto de auditoría se utilizará para rastrear las transacciones SELECT realizadas contra la tabla HumanResources.Employee de la base de datos AdventureWorks2008R2.

    Si desea crear un objeto de auditoría a través de T-SQL lo puede hacer utilizando el comando CREATE SERVER AUDIT. La siguiente consulta crea el objeto  “AuditarConsultasTablaEmpleado”. Esta operación fue realizada anteriormente a través de SSMS.

    USE master

    CREATE SERVER AUDIT [AuditarConsultasTablaEmpleado]

    TO FILE  (FILEPATH = N'C:\TEMP');

    Crear y habilitar una especificación de auditoría a nivel de Servidor

    Una vez se ha creado los objetos de auditoría, el siguiente paso es crear las especificaciones apropiadas de auditoría. Las especificaciones de auditoría le indican al objeto de auditoría lo que debe rastrear. En el caso del objeto de auditoría llamado “AuditarLoginsFallidos”, debemos crear una especificación que busque los logins que no son exitosos. Para lograrlo debemos seleccionar el botón de la derecha del mouse sobre la carpeta “Server Audit Specifications” ubicada bajo el árbol de Seguridad.

    Asigne a la especificación de auditoría el nombre: “EspecificacionAuditoriaServidor-LoginsFallidos”. Bajo audit seleccione la opción “AuditarLoginsFallidos”. Esto asignará la especificación de auditoría “EspecificacionAuditoriaServidor-LoginsFallidos” al objeto de auditoría “AuditarLoginsFallidos”. Seleccione el tipo de acción para auditar: “FAILED_LOGIN_GROUP” y presione OK para crear y asignar el objeto de auditoría.

    Presione el botón de la derecha del mouse sobre “EspecificacionAuditoriaServidor-LoginsFallidos” para habilitar la especificación a través de la opción: “Enable Server Audit Specification”

    Finalmente debe habilitar el objeto de auditoría presionando el botón de la derecha del mouse sobre “AuditarLoginsFallidos” para habilitar la auditoria a través de la opción Enable Audit como se muestra en la siguiente figura.

    Si desea crear una especificación de auditoría a nivel de servidor, a través de T-SQL, lo puede hacer utilizando el comando CREATE SERVER AUDIT SPECITICATION. La siguiente consulta crea la especificación de auditoría  “EspecificacionAuditoriaServidor-LoginsFallidos”. Esta operación fue realizada anteriormente a través de SSMS.

    USE master

    CREATE SERVER AUDIT SPECIFICATION [EspecificacionAuditoriaServidor-LoginsFallidos]

    FOR SERVER AUDIT [AuditarLoginsFallidos]

    ADD (FAILED_LOGIN_GROUP) WITH (STATE = ON)

    GO

    Crear y habilitar una especificación de auditoría a nivel de base de datos

    Para crear y habilitar una especificación de auditoría a nivel de base de datos debe expandir la base de datos, en este ejemplo utilice AdventureWorks2008R2, y seleccione con el botón de la derecha del mouse la opción  “Audit Specifications” bajo el árbol de seguridad de la base de datos. Seleccione la opción “New Database Audit Specification” y asigne un nombre (para propósito de este ejemplo asignaremos el nombre: “EspecificacionAuditoriaDB-ConsultasTablaEmpleado”)

    Como se muestra en la siguiente figura, seleccione la opción “AuditarConsultasTablaEmpleado” Bajo audit. Esto asignará la especificación de auditoría “EspecificacionAuditoriaDB-ConsultasTablaEmpleado” al objeto de auditoría “AuditarConsultasTablaEmpleado”.

    Nota: La clase de objeto se utiliza para indicar lo que se quiere auditar. Las opciones son: Objeto, Base de datos o Esquema. Seleccione objeto para auditar Tablas, Funciones, Procedimientos Almacenados o Vistas. El nombre del Principal son entidades que pueden solicitar recursos de SQL Server.

    Para propósitos de este ejemplo, seleccione “SELECT” en el tipo de acción para auditar; en la clase del objeto seleccione “OBJECT”; en el nombre del objeto ingrese [HumanResources].[Employee]; en el nombre del Principal ingrese [public] y presione OK para crear y asignar el objeto de auditoría.

    Esto permite rastrear las consultas con SELECT que realizan todos los usuarios a la tabla [HumanResources].[Employee].

    Presione el botón de la derecha del mouse sobre “EspecificacionAuditoriaDB-ConsultasTablaEmpleado” para habilitar la especificación a través de la opción: “Enable Database Audit Specification”

    Finalmente debe habilitar el objeto de auditoría presionando el botón de la derecha del mouse sobre “AuditarConsultasTablaEmpleado” para habilitar la auditoria a través de la opción Enable Audit como se muestra en la siguiente figura.

    Si desea crear una especificación de auditoría a nivel de base de datos, a través de T-SQL, lo puede hacer utilizando el comando CREATE DATABASE AUDIT SPECITICATION. La siguiente consulta crea la especificación de auditoría  “EspecificacionAuditoriaDB-ConsultasTablaEmpleado”. Esta operación fue realizada anteriormente a través de SSMS.

    USE master

    CREATE DATABASE AUDIT SPECIFICATION [DatabaseAuditSpec-EmployeesTable]

    FOR SERVER AUDIT [Audit-EmployeeQueries]

    ADD (SELECT ON OBJECT::[HumanResources].[Employee] BY [public])

    WITH (STATE = ON)

    GO

    Visualizar los registros de auditoría

    Los registros de auditoría pueden ser accedidos a través la opción “View Audit Logs” o a través de la bitácora de eventos de aplicaciones o de seguridad, dependiendo de dónde se especificó que se almacenaría la auditoría.

    Los resultados pueden ser filtrados o inclusive hasta exportados en los siguientes formatos: log, csv y txt

    Conclusión

    La auditoría en SQL 2008 Enterprise es muy poderosa y flexible ya que permite crear auditorías a nivel de servidor o a nivel de base de datos. La configuración es sencilla ya que solo se requiere especificar donde se almacenará la auditoría (en un archivo, la bitácora de eventos de aplicaciones o la bitácora de eventos de seguridad), que objeto se desea auditar (Base de datos, Esquema, Tablas, Funciones, Procedimientos Almacenados o Vistas) y para cual Principal  (entidades que pueden solicitar recursos de SQL Server).

  • El Servicio de Sincronización de Perfiles en SharePoint 2010 no inicia

    SharePoint Server 2010 provee igualmente que en MOSS 2007 de un objeto que permite sincronizar perfiles de usuario directamente desde el Directorio Activo de Windows. Este objeto esta compuesto por 2 servicios (Servicio de Perfiles de Usuario y Servicio de Sincronización de Perfiles de usuario) siendo dependientes uno del otro para lograr el objetivo de importar perfiles de usuario desde el Directorio Activo y adicionalmente una aplicación de servicios relacionada directamente con ambos servicios.

    Importar perfiles de usuario en SharePoint 2010 además de otras cosas nos sirve para incrementar la experiencia de usuario utilizando una red social corporativa, por lo que es importante que nuestras granjas de SharePoint usen este servicio de forma regular.

    Recientemente hemos identificado un comportamiento irregular al momento de iniciar el servicio de Sincronización de Perfiles, cuando hacemos clic en iniciar el servicio se queda con un estado de Iniciando pero jamás cambia a Iniciado lo cual impide que la importación de perfiles de usuario sea exitosa.

    Para poder corregir este comportamiento es necesario realizar los siguientes pasos:

    1. Primero debemos descargar el Update Acumulativo correspondiente al mes de Febrero de 2011 (http://support.microsoft.com/hotfix/KBHotfix.aspx?kbnum=2475878&kbln=en-us)

    2. Detener los servicios "Perfiles de Usuario" y "Sincronización de Perfiles de Usuario"

    3. Borrar la aplicación de serivicios relacionada a los perfiles de usuario

    4. Aplicar el CU de Febrero y ejecutar el asistente de configuración de SharePoint

    5. Crear y configurar la aplicación de servicios para Perfiles de usuario

    6. Finalmente iniciar ambos servicios desde la Administración Central, no olviden la dependencia que existe entre ambos.

  • How to configure FBA (Forms-Based Authentication) in SharePoint Server 2010 using IIS 7 and ASP .NET Membership Database (SQL) like in MOSS 2007!!!

    After testing many times and configuring FBA in many Virtual environments, finally I think I wrote the easiest and clearest procedure and hope what I'm saying is true, please read carefully and do not skip any step.

    To configure FBA using SQL Server with Windows Integrated Authentication (recommended) we’ll follow the following steps.

    Pre-requisites        

    a)      Knowledge about SharePoint 2010, IIS 7.5 and SQL Server 2008

    b)      SQL Server configured as Windows Integrated Authentication

    c)       ASP.Net SQL Server Database (Membership database)

    d)      Windows Domain user account (Can be SharePoint Farm Administrator)

    e)      Make sure you backup web.config files for Central Administration Site, Security Token Service web service and also the Web Application you will use for FBA

    Steps to configure FBA

    1. Configure SQL Server security settings to use Windows Integrated Authentication
    2. Add the Domain User Account to SQL Logins
    3. Create SQL FBA database to store non-Windows domain users
    4. Grant SQL Login (Domain user) permissions for the new SQL FBA database
    5. Configure SharePoint Central Administration
    6. Configure  SharePoint Security Token Service
    7. Create the new Web Application to use FBA and Site Collection
    8. Configure IIS Default providers for the new web application
    9. Create IIS Site to administer ASP.NET users

    Configure SQL Server to use Windows Integrated Authentication

    Basically when you install SQL Server by default Windows Integrated Authentication is already set, in case your DBA team configured SQL Server with Mixed-Mode you have to do the following:

    1. Go into the Management Studio of the instance of your SharePoint database server
    2. Right click on SQL Server Instance name and choose properties
    3. On the left pane go to Security
    4. On the right pane choose the option Windows Authentication mode

    If you did the change you MUST restart SQL Server service or reboot the server

    Add the Domain User Account to SQL Logins

    Now we need to add the Domain user account to the SQL Logins in order to provide full access to the ASP.NET membership database we’ll create later.

    Two things are important here, you have to decide if you will use the SharePoint Farm Administrator account you are already using or create a new Windows domain user account to manage the access to the ASP.NET membership database. I recommend using SharePoint Farm administrator, whatever you decide here are the steps. (Ask for your DBA team to help you creating the new login)

    1. Once you have decided which account to use open SQL Server Management Studio
    2. On the left pane expand the SQL Server instance and choose Security folder
    3. On Logins right click and choose New Login
    4. Look for your Windows domain user account and keep Windows authentication option marked
    5. Click OK

     

    Create SQL FBA database to store non-Windows domain users

    Open the ASP.Net wizard and creating the database which will store non-Windows domain users for your extranet access:

    -          Go to the path: C:\Windows\Microsoft.NET\Framework\v2.0.50727\aspnet_regsql.exe

    -          Choose “Configure SQL Server for application services

    -          Type the SQL Server name you want. You don’t have to use the SharePoint database server

    -          Keep Windows Authentication as default

    -          Use “Default” or type the database name you will create at the end of the process

    The first time you create the ASP.NET database you have to choose Windows Authentication and create or USE an existing database*

    -          Just confirm the settings and that’s it for this part

    *You can create a new ASP.NET database to store new users or you ALSO use the one you already have in your MOSS2007, just make sure you are having the correct permissions over the migrated database to the new SQL Login you already created in steps before.

     Grant SQL Login (Domain user) permissions for the new SQL FBA database

    -          Go back to the SQL Server Management Studio

    -          Locate the ASP.NET membership database you already created or restored

    -          Right click and choose properties

    -          On the right pane click on the square with dots and look for your domain user account (Type domainname\username) and click OK

    -          Copy the name from the field Login name to the upper field named User name

    -          At the bottom of the window locate Database Role Membership section and mark db_owner and click OK


    Configure SharePoint Central Administration

    Now we have to create a Connection String, Role Provider, and Membership Provider in IIS Manager to get access to the ASP.NET membership database that we already created.

    Let’s do this once for SharePoint Central Administration site and then repeat the steps for the Security Token service web service, the SharePoint Web Application and at the end for the IIS site that we will use to mange ASP .NET Memberships.

    Do not forget to have a backup of web.config file, is very important in case you need to roll-back. Also use a test environment first

    -          Open IIS Manager and locate SharePoint Central Administration v4 site under Sites folder

    -          On the right pane double click on Connection Strings

    -          On the very right pane called Actions click on Add

    -          Type a name

    -          Type the name of the SQL Server

    -          Type the name of the database server you already created

    -          Keep selected the option Use Windows Integrated Security

    -          Click OK

    -          Go back to the IIS to create both providers

    -          Double click on Providers in IIS Features view and create Role Provider and Membership Provider

    -           On Features drop down menu click .Net Roles first to configure role provider, then click on .Net Users to configure Membership provider

     

    -          This is it for Central Administration site

                 

    Configure SharePoint Security Token Service

    Repeat the steps just before to configure Security Token service web service. Use same Connection String,  Role Provider and Membership Provider names

     

    Create the new Web Application to use FBA and Site Collection

    Open SharePoint Central Administration Site and let’s create the new Web Application that you will use to configure Forms-Based Authentication

    Remember in SharePoint 2010 the only way to configure FBA is creating web applications with Authentication option “Claims Based Authentication” otherwise you won’t be able to do it.

    -          So open Central Administration web site

    -          Go to Application Management category and click on Manage Web Application

    -          On the ribbon click on New

    -          Choose Claims Based Authentication authentication option in order to enable Forms Based Authentication options

    -          It is important for you to keep Enable Windows Authentication with NTLM check box marked for two things:

    • Crawl works for that content database
    • Active Directory users will use Authentication page to get the content

    -          Now check Enable Forms Based Authentication (FBA) and type both Membership Provider and Role Provider

    -          Now we have to create a Site Collection, you may use the one for Teams or any other, it’s up to you

    -          At this point the Site Collection Administrator MUST be the SharePoint Farm Administrator since our ASP.NET SQL database is empty

    -          Create the Connection String, Role Provider, and Membership Provider following the same steps like we did for Central Administration v4 Site

    SharePoint Server 2010 has to use “i” as default Membership Provider and “c” as default Role Provider since “I” provider is linked to: Microsoft.SharePoint.Administration.Claims.SPClaimsAuthMembershipProvider. (http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.administration.claims.spclaimsauthmembershipprovider_members.aspx)

     

    Create IIS Site to administer ASP.NET users

    Create an IIS site to manage roles and user account that will live in our ASP.NET membership database

    -          Create the IIS Site from IIS Manager

    -          Review again the steps we performed for Central Administration v4 site in order to configure:

    • Connection String
    • Role Provider
    • Membership Provider

    -          For the IIS Site you should not revert the default provider to “i” or “c”, this time default providers will be FBARoleProvider & FBAMembershipProvider

     

    -          Test time, log in to the new SharePoint site configured with FBA

    -          First use Windows Integrated Authentication, successful?

    -          Now choose sign in with a different user, successful? I’m sure not since you have not granted permissions for FBA users yet

    -          Go back to IIS Manager and create FBA roles and users


    -          Ok, now we can add FBA users to SharePoint sites, login back with SharePoint Farm Administrator

    -          Open Site Actions > Site Permissions

    -          Pick a group you want to add the new FBA user

    -          Click New

    -          Click the address book or type the name of the FBA user

     

    I wish you good luck and remember that feedback is very important for us, please let me know if this post is really useful and if it was easy to configure FBA in SharePoint 2010 as I wrote

  • Storage Area Network (SAN) for DBA's

    During a chat with friends about getting a better performance of SQL Server, the following question emerge... which other optimization apply to SQL server, apart from Best Practices at the Operating System and Application level? Optimizations at the hardware level are also necessary, especially at the Storage level.

    With this, we begin to explain the issues of SAN but focusing it to Database Administrators.

    There are many factors that affect the proper performance of I / O disks, factors such as shared or dedicated disks, RAID levels, bus speed, HBA configurations; an important point that is often overlooked is alignment in the disk partitions.

    Some of the non-disk factors which can present bottlenecks are:

    -          HBA (Host Bus Adapters) or network interface cards

    -          Processing capacity of FC (Fibre Channel) or iSCSI ports

    -          Switch

    -          Number of paths between the server and storage.

    It is important to consider and understand the limits of the components involved in the architecture, some of the limits that are established in the market are:

    Component

    Limits

     

    SAS cable

    Theoretical: 1.5 gigabytes per second (GB/s)

    Typical: 1.2 GB/s

    PCI-X v1 bus

    X4 slot: 750 MB/s

    X8 slot: 1.5 GB/s

    X16 slot: roughly 3 GB/s

    PCI-X v2 bus

    X4 slot: 1.5 – 1.8 GB/s

    X8 slot: 3 GB/s

    Note: Be aware that a PCI-X bus can be v2 compliant but still run at v1 speeds.

    Fibre Channel HBAs, switch ports and front end Fibre Channel array ports

    4 gigabits per second (Gbps): 360-400 MB/s

    8 Gbps: Double the speed of 4 Gbps

    Note: Make sure to consider the limits of the PCI bus. An 8-Gbps card requires a PCI-X4 v2 slot or faster.

    But how all this is linked with SQL Server? The fundamental unit of data storage in SQL Server is the page (8KB), the space allocated to a data file (mdf or ndf) of a database is logically divided into pages numbered continuously from 0 to n. The operation of I / O disk is provided on a page.

    The hard drives are composed of thin plates, circular disks on the surface of which are electronic media that store information. Each side of each plate has thousands of tracks, the set of tracks with the same diameter of the entire surface of the plate form a cylinder (For new devices the cylinder concept is not relevant, since they are not arranged in concentric circles, however it is helpful to understand the origin of terms). Each disk surface has a head dedicated I / O. The tracks are divided into sectors. A sector is the minimum fragment of data that can be read from or write to a hard disk. The new units can offer 1KB sectors, 3KB or 4 KB.

    With RAID technology, data is striped across an array of physical disks. This data distribution scheme complements the way that the operating system requests data. The granularity at which data is stored on one disk of the array before subsequent data is stored on the next disk of the array is called the stripe-unit size. The collection of stripe units, from the first disk of the array to the last disk of the array, is called a stripe

    But with all this that is the alignment of the partitions? That the effect on the performance of SQL Server? The diagram explains it... The vertical black dotted lines overlaying a red gradient correspond to the boundary between separate physical disks of a RAID group. Versions of Windows preceding Windows Server 2008 displayed the 63 reserved sectors reported by the disk hardware, immediately after which the remainder of the partition was exposed to the user. In these figures, the common sector size of 512 bytes is used, the stripe unit size in the example is 64 KB, And the default 4 KB NTFS cluster size, appropriate for, say, a file server. In the absence of disk alignment forces the eighth 4-KB cluster of user data to be laid across two stripe units, starting with the last empty 512-byte sector of the first stripe unit and continuing on to the second stripe unit. In this default configuration, every eighth cluster is written across two stripe units. This situation is perpetuated throughout the rest of the partition; because every nth cluster crosses stripe unit boundaries, two I/Os are required to perform a read or write.

    The file allocation unit size (cluster size) recommended for SQL Server is 64 KB; the preferred 64 KB cluster size for SQL Server combined with the default partition misalignment forces the user data to be laid across two stripe units, starting with the first available sectors of the first stripe unit and continuing on to the second stripe unit. This situation is perpetuated throughout the rest of the partition. In this configuration, every subsequent cluster is written across two tracks or two stripe units—each and every read and write is affected.

    The following is an experiment in which we examined the performance of disk, the test was Windows Server 2003 and SQL Server 2005. Executed a query to extract information from SQL Server, for each run DBCC DROPCLEANBUFFERS applied to clean the SQL Server buffer cache with this get satisfactory evidence. Performance counters that were monitored were counter Avg. Disk Transfer/sec objects LogicalDisk and PhysicalDisk objects which are used to measure the latency of the disk. The results show significant improvement compared discs alignment; metrics show improvement greater than 30% between latency and duration.

    For review of correct alignment of disks, you should be clear about several concepts:

    Starting Partition Offset: is the starting offset in the partition of the volume to ensure the default mapping n data pages in hidden sectors in the early volumes.

    Stripe Unit Size: The granularity at which data is stored on one disk of the array before subsequent data is stored on the next disk of the array. This value is provided by your SAN administrator

    File Allocation Unit Size: Also known as cluster size, represents the smallest amount of disk space which can be allocated to hold a file and is determined when the partition is formatted by the operating system.

    There are two rules, which hold for correct alignment of disks. The results of the following calculations should be an integer value.

    Partition_Offset / Stripe_Unit_Size

    Stripe_Unit_Size / File_Allocation_Unit_size

    Of the two previous rules, the first is the most important for optimal performance.

    Examples of Scenarios with misalignment on disks

    Given a partition with Partition Starting Offset 32,256 bytes (31.5 Mb) and a Stripe Unit Size size of 65,536 bytes (64 Kb), the result for Partition_Offset ÷  Stripe_Unit_Size is 0.4921875, which is not an integer, so considering that the disks are not aligned.

    Example of Scenario with alignment on disks

    Given a partition with Partition Starting Offset of 1048576 bytes (1Kb) and with a size of Stripe Unit Size of 65,536 bytes (64 Kb), the result is exactly Partition_Offset÷ Stripe_Unit_Size 8, an exact integer, so we can say that alignment is correct.

    After the above is explained, the question we need answered is ... how can I see the current status of the disks?

    To review the Starting Offset on a basic disk, we can use the command WMIC (Windows Management Instrumentation Command-line) to obtain data on the disk, the syntax is:

    wmic partition get BlockSize, BootPartition, DeviceID, DiskIndex, HiddenSectors, NumberOfBlocks,  StartingOffset, Name, Index

    The value to check with the previous command is StartingOffset, in this example is aligned to 1024 kb.

    You can also get the Starting Offset via DISKPART, selecting the drive to analyze and execute the list partition command, which will get the offset.

    To review the Starting Offset of a dynamic disk you will need to use the dmdiag utility with the –v switch

    If you want to review the File_Allocation_Unit_Size can run the command

    fsutil fsinfo ntfsinfo [drive]

    The following example shows the execution of all commands above written.

    Summary

    Many factors contribute to an optimal disk performance. For disk partitions created with Windows Server 2003, is crucial to validate the correct correlation between the Stripe Unit Size and File Allocation Unit Size as best practice. Windows Server 2008 creates partitions aligned by default. When the servers are updated Windows Server 2003 to Windows Server 2008, existing partitions are not aligned automatically, you should rebuild them for optimal performance.

     

     

  • La hora en SharePoint no corresponde con la hora de Windows?

    Saludos comunidad,

    Este post tiene la intención de ayudar a todos aquellos que en sus paises el cambio de horario ya sea horario de verano u horario normal ha tenido afectación en sus Sitios de SharePoint.

    SharePoint no tiene la capacidad de sincronizar el cambio de horario con el horario que maneja el Sistema Operativo, por lo tanto cuando el cambio de horario se adelanta o se atrasa ustedes verán una afectación directa en el registro de cada operación que realicen en SharePoint. Es mandatorio que ustedes ajusten este tiempo manualmente, ¿y cómo hacerlo? en realidad lo que debemos hacer es editar un archivo llamado TimeZone.xml que vive en Drive:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\Config.

    Ustedes pueden encontrar la información detallada en el artículo siguiente: http://support.microsoft.com/kb/888253

    En fin, no tendría ningún caso escribir un blog si éste es para dar una referencia a un documento de soporte, un servidor les dará un ejemplo de como editar el archivo utilizando el caso más reciente de cambio de horario que se dió en la hermana República de Chile

    Escenario

    Por defecto el horario de Verano en Chile debio cambiar en Octubre el segundo domingo del mes, pero el gobierno decidió adelantarlo al día 20 de Agosto (3er Domingo del Mes). Este cambio afectó el registro de horas y el equipo de soporte de Microsoft ha recibido casos de soporte relacionados a esta condición.

    No hay forma de que automáticamente SharePoint actualice el cambio así que estos son los pasos:

    - En el servidor que ejecuta la Administración Central ir a la ruta Drive:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\Config

    - Ubicar el archivo TimeZone.xml

    - HACER UN RESPALDO DEL ARCHIVO ANTES DE EDITARLO

    - Editar con Notepad

    - Buscar el ID 65

    - Las entradas se observan como sigue:

    <TimeZone ID="65" Name="(GMT-04:00) Santiago" Hidden="FALSE">
            <Bias>240</Bias>
            <StandardTime>
                <Bias>0</Bias>
                <Date>
                    <Month>3</Month>
                    <Day>2</Day>
                    <Hour>23</Hour>
                    <Minute>59</Minute>
                    <Second>59</Second>
                    <Milliseconds>999</Milliseconds>
                    <DayOfWeek>6</DayOfWeek>
                </Date>
            </StandardTime>
            <DaylightTime>
                <Bias>-60</Bias>
                <Date>
                    <Month>10</Month>
                    <Day>2</Day>
                    <Hour>23</Hour>
                    <Minute>59</Minute>
                    <Second>59</Second>
                    <Milliseconds>999</Milliseconds>
                    <DayOfWeek>6</DayOfWeek>
                </Date>
            </DaylightTime>
            <History Year="2008" Name="santiago2009">
                <Bias>240</Bias>
                <StandardTime>
                    <Bias>0</Bias>
                    <Date>
                        <Month>3</Month>
                        <Day>5</Day>
                        <Hour>23</Hour>
                        <Minute>59</Minute>
                        <Second>59</Second>
                        <Milliseconds>999</Milliseconds>
                        <DayOfWeek>6</DayOfWeek>
                    </Date>
                </StandardTime>
                <DaylightTime>
                    <Bias>-60</Bias>
                    <Date>
                        <Month>10</Month>
                        <Day>2</Day>
                        <Hour>23</Hour>
                        <Minute>59</Minute>
                        <Second>59</Second>
                        <Milliseconds>999</Milliseconds>
                        <DayOfWeek>6</DayOfWeek>
                    </Date>
                </DaylightTime>
            </History>
            <History Year="2007" Name="santiago2008">
                <Bias>240</Bias>
                <StandardTime>
                    <Bias>0</Bias>
                    <Date>
                        <Month>3</Month>
                        <Day>2</Day>
                        <Hour>23</Hour>
                        <Minute>59</Minute>
                        <DayOfWeek>6</DayOfWeek>
                    </Date>
                </StandardTime>
                <DaylightTime>
                    <Bias>-60</Bias>
                    <Date>
                        <Month>10</Month>
                        <Day>2</Day>
                        <Hour>23</Hour>
                        <Minute>59</Minute>
                        <DayOfWeek>6</DayOfWeek>
                    </Date>
                </DaylightTime>
            </History>
        </TimeZone>

    - Observen que tenemos 2 Tags que identifican al tiempo estándar y al horario de verano

     <StandardTime>
                <Bias>0</Bias>
                <Date>
                    <Month>3</Month>
                    <Day>2</Day>
                    <Hour>23</Hour>
                    <Minute>59</Minute>
                    <Second>59</Second>
                    <Milliseconds>999</Milliseconds>
                    <DayOfWeek>6</DayOfWeek>
                </Date>
            </StandardTime>
       <DaylightTime>
                <Bias>-60</Bias>
                <Date>
                    <Month>10</Month>
                    <Day>2</Day>
                    <Hour>23</Hour>
                    <Minute>59</Minute>
                    <Second>59</Second>
                    <Milliseconds>999</Milliseconds>
                    <DayOfWeek>6</DayOfWeek>
                </Date>
            </DaylightTime>

    - Lo que haremos será modificar TEMPORALMENTE  el Horario de Verano DaylightTime

    - Como se puede observar en la variable <Month> tenemos 10  que corresponde al mes de Octubre

    - En la variable <Day> que corresponde al fin de semana donde el cambio de horario debería aplicar en este caso es 2, segundo fin de semana del mes.

    - El cambio que debemos realizar de acuerdo a la fecha en la que el gobierno decidió adelantar el horario de verano = 20 de Agosto 2011

    - De acuerdo al calendario debió ocurrir el TERCER fin de semana

    - El cambio  en TIMEZONE.xml debería ser:

     <StandardTime>
                <Bias>0</Bias>
                <Date>
                    <Month>3</Month>
                    <Day>2</Day>
                    <Hour>23</Hour>
                    <Minute>59</Minute>
                    <Second>59</Second>
                    <Milliseconds>999</Milliseconds>
                    <DayOfWeek>6</DayOfWeek>
                </Date>
            </StandardTime>
      <DaylightTime>
                <Bias>-60</Bias>
                <Date>
                    <Month>8</Month>
                    <Day>3</Day>
                    <Hour>23</Hour>
                    <Minute>59</Minute>
                    <Second>59</Second>
                    <Milliseconds>999</Milliseconds>
                    <DayOfWeek>6</DayOfWeek>
                </Date>
            </DaylightTime>

    NOTA: Si hay más de 1 servidor en la granja el cambio se debe hacer en cada servidor, es necesario realizar un IISRESET al terminar de editar cada archivo. Al terminar el horario de verano por favor regresen el archivo que respaldaron.

    Saludos y buena suerte