Posts

Showing posts from July, 2010

Indice corrupto en la tabla sysjobhistory de la bd MSDB

Image
Si se está presentando el siguiente error en SQL Server Data row does not have a matching index row in the index 'nc1' Unable to find index entry in index ID 1, of table 149575571, in database 'msdb'. The indicated index is corrupt or there is a problem with the current update plan. Run DBCC CHECKDB or DBCC CHECKTABLE. If the problem persists, contact product support. Una solución es restaurar utilizando un respaldo o recrear el índice nuevamente por medio del siguiente script   USE [msdb] GO CREATE NONCLUSTERED INDEX [nc1] ON [dbo].[sysjobhistory] (     [job_id] ASC )WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY] GO   Saludos, Ing. Eduardo Castro Martínez, PhD – Microsoft SQL Server MVP http://mswindowscr.org http://comunidadwindows.org Costa Rica Technorati Tags: SQL Server LiveJournal Tags: SQL Server

Index corrupted in MSDB sysjobhistory table

Image
If you are getting the following error Data row does not have a matching index row in the index 'nc1' Unable to find index entry in index ID 1, of table 149575571, in database 'msdb'. The indicated index is corrupt or there is a problem with the current update plan. Run DBCC CHECKDB or DBCC CHECKTABLE. If the problem persists, contact product support. One possible solution is to restore from a backup or to create the index again using the following script   USE [msdb] GO CREATE NONCLUSTERED INDEX [nc1] ON [dbo].[sysjobhistory] (     [job_id] ASC )WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY] GO   Regards, Ing. Eduardo Castro Martínez, PhD – Microsoft SQL Server MVP http://mswindowscr.org http://comunidadwindows.org Costa Rica Technorati Tags: SQL Server LiveJournal Tags: SQL Server del.icio.us Tags: SQL

Optimización de consultas en SQL Azure

Image
Si desea optimizar consultas en SQL Azure, el siguiente artículo provee guías generales de cómo utilizar los Dynamic Management Views que están disponibles en SQL Azure, y cómo éstas pueden ser utilizadas para optimizar las consultas o para detectar las consultas con bajo rendimiento.   http://www.microsoft.com/downloads/details.aspx?FamilyID=0CEB6317-0E52-4A25-8AF2-2702C9C21358&displayLang=en   Las siguientes son una serie de consultas sobre rendimiento en SQL Azure:   -- IDentificar las recompilaciones excesivas select top 25 sql_text.text, sql_handle, plan_generation_num, execution_count, dbid, objectid from sys.dm_exec_query_stats a cross apply sys.dm_exec_sql_text(sql_handle) as sql_text where plan_generation_num >1 order by plan_generation_num desc -- Planes de ejecución ineficientes: select highest_cpu_queries.plan_handle, highest_cpu_queries.total_worker_time, q.dbid, q.objectid, q.number, q.e

Troubleshooting and Optimizing Queries with SQL Azure

Image
In you want to troubleshoot queries performance in SQL Azure, the following paper provides guidelines on the Dynamic Management Views that are available in SQL Azure, and how they can be used for troubleshooting purposes.   http://www.microsoft.com/downloads/details.aspx?FamilyID=0CEB6317-0E52-4A25-8AF2-2702C9C21358&displayLang=en   The following are some examples taken from the paper:   -- Identity excessive recompiles select top 25 sql_text.text, sql_handle, plan_generation_num, execution_count, dbid, objectid from sys.dm_exec_query_stats a cross apply sys.dm_exec_sql_text(sql_handle) as sql_text where plan_generation_num >1 order by plan_generation_num desc -- Inefficient query plans: select highest_cpu_queries.plan_handle, highest_cpu_queries.total_worker_time, q.dbid, q.objectid, q.number, q.encrypted, q.[text] from ( select top 50 qs.plan_handle, qs.total_worker_tim

Comparación entre SQL Server y SQL Azure

Image
El siguiente artículo realiza una comparación entre SQL Azure Database y SQL Server en las áreas de adminsitración lógica, administración física, aprovisionamiento, soporte de TSQL, almacenamiento, y otras capacidades. http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=86f12b41-1eba-4567-9ac8-02eaa7d12034   Feature SQL Server (On-premise) SQL Azure Mitigation Data Storage No size limits as such · Web Edition · Business Edition Exact size and pricing information can be obtained at Pricing Overview . Note: When you reach the allocated level (1 GB or 10 GB), only SELECTs and DELETEs will be supported. UPDATEs and INSERTs will throw an error. · An archival process can be created where older data can be migrated to another database in SQL Azure or on premise. · Because of above size constraints, one of the recommendations is to partition the data across databases. Creating multiple databases will allow you take maximum advantage of the computing

Comparing SQL Server and SQL Azure

Image
The following paper compares SQL Azure Database with SQL Server in terms of logical administration vs. physical administration, provisioning, Transact-SQL support, data storage, SSIS, along with other features and capabilities. http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=86f12b41-1eba-4567-9ac8-02eaa7d12034   Feature SQL Server (On-premise) SQL Azure Mitigation Data Storage No size limits as such · Web Edition · Business Edition Exact size and pricing information can be obtained at Pricing Overview . Note: When you reach the allocated level (1 GB or 10 GB), only SELECTs and DELETEs will be supported. UPDATEs and INSERTs will throw an error. · An archival process can be created where older data can be migrated to another database in SQL Azure or on premise. · Because of above size constraints, one of the recommendations is to partition the data across databases. Creating multiple databases will allow you take maximum advantage of the

SQL Azure Private Cloud is now available

Image
Great news from http://blogs.msdn.com/b/sqlazure/archive/2010/07/12/10037077.aspx and http://blogs.technet.com/b/microsoft_blog/archive/2010/07/12/realizing-the-promise-of-cloud-with-microsoft.aspx   David Robinson states “the new Windows Azure platform appliance combines Windows Azure and Microsoft SQL Azure with Microsoft-specified hardware, enabling on-demand IT capacity and faster delivery of new applications. Large enterprises and service provider partners deploying the appliance in their datacenters will have the benefits of the cloud services that Microsoft offers today, while maintaining physical control of location, regulatory compliance and data”.  Blog Muglia explains the Windows Azure appliance as “The appliance is the same Windows Azure platform we run at Microsoft, and includes Windows Azure and SQL Azure on Microsoft-specified hardware. Using it, service providers, governments and large enterprises will be able to get the control they need, while still getting the be

Aprende sobre SQL Server Master Data Services

Image
Microsoft tiene disponible un curso gratuito para aprender sobre Master Data Services, más información en:   https://www.microsoftelearning.com/eLearning/offerDetail.aspx?offerPriceId=289399   Clinic 10331: Introduction to Microsoft SQL Server 2008 R2 Master Data Services Overview SQL Server Master Data Services helps enterprises standardize the data that their people rely on to make critical business decisions. As the server and application sprawl across organizations continues, there has never been a more important time to aim for a single version of the truth and to improve both operational and reporting consistency. SQL Server Master Data Services provides a central hub for storing master data, an extensible platform for building solutions on the hub, a web-based portal for managing the master data and the core elements of a stewardship process for ongoing management of that data.   Saludos, Ing. Eduardo Castro Martínez, PhD – Microsoft SQL Server MVP http://mswindowscr.or

Maratón de SQL Server 2008 R2! by MVPs

Image
From http://blogs.msdn.com/b/mvplead/archive/2010/07/13/marat-243-n-de-sql-server-2008-r2-by-mvps.aspx   El 22 de julio, en el Maratón de SQL Server 2008 R2 MVPs de Latam brindan una serie de webcasts para desarrolladores y profesionales de TI, que les permitirán capacitarse en las nuevas características de SQL, como también conocer la mejor manera de aprovechar sus capacidades. Ingresa aquí ahora, y regístrate a esta gran Maratón! Maratón SQL Server 2008 R2 1 7 am StreamInsight: Una nueva forma de trabajar con notificaciones MSDN Aquí 2 8 am Implementando MDM Usando SQL Server 2008 R2 Master Data Services MSDN Aquí 3 9 am Minería de Datos con Excel 2010 y SQL Server 2008 R2 TechNet Aquí 4 10 am Bodegas de Datos y cubos con SQL Server 2008 R2 Analysis Services TechNet Aquí 5 11 am Reportes autoservicio con SQL Server 2008 R2 Reporting Services TechNet Aquí 6 12 pm Data Tier Applications MSDN Aquí 7 1 pm Novedades en SQL Server 2008 R2 MSDN, TechNet Aquí 8 2 pm Lo q

Como crear un respaldo sin afectar la secuencia LSN en SQL Server

Si tiene calendarizada una secuencia de respaldos en SQL Server, para cada respaldo creado existe un número de secuencia o LSN, entonces si usted crea un backup completo sin utilizar la opción copy only entonces esa secuencia se ve afectada y podría tener problemas para recuperar un respaldo diferencial realizado posteriormente ya que si usted no cuenta con el respaldo completo que se realizó en medio de la secuencia entonces no podrá recuperar la información. Por lo tanto crear respaldo con la opción copy only es recomendado para no romper la secuencia, el siguiente script es un ejemplo de este mecanismo de respaldo.   -- Crear el respaldo sin afectar la secuenc BACKUP DATABASE AdventureWorks2008R2 TO DISK = 'C:\AdventureWorks.bak' WITH COPY_ONLY GO   Si quiere encontar el número de secuencia puede utilizar el siguiente script:   SELECT database_name, backup_start_date, is_copy_only, first_lsn FROM msdb..backupset WHERE database_name = 'AdventureWorks2008R2'

How to create a copy only backup in SQL Server

If you have scheduled regular backups in SQL Server, there is sequence LSN for every backup you made, if you perform a temporal full backup without the copy only option that sequence will affected and you may face problems during a recover, because during a recovery you may be asked for the temporal full backup you made and if you don’t have it you will face problems during recovery. The following script creates a backup with the copy only option.   -- Create full backup with Copy only option enabled BACKUP DATABASE AdventureWorks2008R2 TO DISK = 'C:\AdventureWorks.bak' WITH COPY_ONLY GO   You can use the following script to find out the LSN backup sequence number:   SELECT database_name, backup_start_date, is_copy_only, first_lsn FROM msdb..backupset WHERE database_name = 'AdventureWorks2008R2' ORDER BY backup_start_date DESC GO   Regards, Ing. Eduardo Castro Martínez, PhD – Microsoft SQL Server MVP http://mswindowscr.org http://comunidadwindows.org Costa

Tareas del SQL Server Agent, cómo obtengo su estado?

Si necesitan saber cuál es el estado de los trabajos calendarizados con el SQL Server Agent pueden utilizar el siguiente script   select name, description,start_execution_date, stop_execution_date, msdb.dbo.sysjobs.Job_ID, job_status = CASE WHEN start_execution_date IS NULL AND stop_execution_date IS NULL THEN 0 WHEN start_execution_date IS NOT NULL AND stop_execution_date IS NULL THEN 1 WHEN start_execution_date IS NOT NULL AND stop_execution_date IS NOT NULL THEN 2 ELSE 3 END FROM msdb.dbo.sysjobactivity JA inner join msdb.dbo.sysjobs ON JA.Job_ID = msdb.dbo.sysjobs.Job_ID   Saludos, Ing. Eduardo Castro Martínez, PhD – Microsoft SQL Server MVP http://mswindowscr.org http://comunidadwindows.org Costa Rica Technorati Tags: SQL Server LiveJournal Tags: SQL Server del.icio.us Tags: SQL Server http://ecastrom.blogspot.com http://ecastrom.wordpress.com http://ecastrom.spaces.live.com http://universosql.blogspot.com http://todosobr

SQL Server Agent Jobs, how do I query the status?

If you need to find the current status of the SQL Server Agent Jobs the following query is usefull   select name, description,start_execution_date, stop_execution_date, msdb.dbo.sysjobs.Job_ID, job_status = CASE WHEN start_execution_date IS NULL AND stop_execution_date IS NULL THEN 0 WHEN start_execution_date IS NOT NULL AND stop_execution_date IS NULL THEN 1 WHEN start_execution_date IS NOT NULL AND stop_execution_date IS NOT NULL THEN 2 ELSE 3 END FROM msdb.dbo.sysjobactivity JA inner join msdb.dbo.sysjobs ON JA.Job_ID = msdb.dbo.sysjobs.Job_ID   Regards, Ing. Eduardo Castro Martínez, PhD – Microsoft SQL Server MVP http://mswindowscr.org http://comunidadwindows.org Costa Rica Technorati Tags: SQL Server LiveJournal Tags: SQL Server del.icio.us Tags: SQL Server http://ecastrom.blogspot.com http://ecastrom.wordpress.com http://ecastrom.spaces.live.com http://universosql.blogspot.com http://todosobresql.blogspot.com http://tod

Ganese una Subscripcion MSDN Ultimate

Image
Participen en este concurso organizado por el MVP Juan Alvarado. Quieren ganarse una subscripcion de MSDN ultimate con un valor comercial de $12000 (nada mal!!), unicamente debe escribir un articulo de alguno de los nuevos features de SQL 2008 R2 o bien un articulo  sobre alguna sugerencia que le gustaria ver incorporada en el SQL 11 – Denali.  La fecha limite sera hasta el 20 de Julio. En esa fecha se escogera el articulo  mas original o de mas valor para la comunidad de SQL.  El articulo debera ser escrito en idioma español y el ganador residir en cualquier pais de latinoamerica. solo deben  enviarme el link del articulo en caso de tener un blog propio o el documento para que lo  postee en mi Blog (Claro dando el credito necesario al autor). Animense escriban y ganen esta subscripcion que podran bajar el software necesario para desarrollar y probar sus aplicaciones con software y licencias originales.  Esto incluye Visual Studio 2010 Utimate, Windows 2008 server , Windows 7 ,Office

Tablas y Colas en Cloud Computing

En la siguiente presentación vemos los conceptos de tablas y mejores prácticas dentro de Windows Azure Cloud Computing.   Tablas y almacenamiento en windows azure View more presentations from Eduardo Castro . Saludos, Ing. Eduardo Castro Martínez, PhD – Microsoft SQL Server MVP http://mswindowscr.org http://comunidadwindows.org Costa Rica Technorati Tags: SQL Server LiveJournal Tags: SQL Server del.icio.us Tags: SQL Server http://ecastrom.blogspot.com http://ecastrom.wordpress.com http://ecastrom.spaces.live.com http://universosql.blogspot.com http://todosobresql.blogspot.com http://todosobresqlserver.wordpress.com http://mswindowscr.org/blogs/sql/default.aspx http://citicr.org/blogs/noticias/default.aspx http://sqlserverpedia.blogspot.com/ Note: Cross posted from Eduardo Castro . Permalink

Un año más como MVP

Image
Hoy recibí el correo de confirmación de MVP un año más!!   Estimado/a Eduardo Castro, Enhorabuena. Nos complace presentarle el programa de nombramiento MVP de Microsoft® de 2010. Este nombramiento se concede a los líderes excepcionales de la comunidad técnica que comparten de forma activa su experiencia de alta calidad y de la vida real con otras personas. Le agradecemos especialmente la contribución que ha realizado en las comunidades técnicas en el área de SQL Server a lo largo del pasado año. El programa de nombramiento de MVP de Microsoft nos proporciona una oportunidad única de celebrar y reconocer sus aportaciones importantes, así como de decir “Gracias por su liderazgo técnico”. Toby Richards Director general Soporte En-línea Comunidad Note: Cross posted from Eduardo Castro . Permalink