jueves, 29 de julio de 2010

Indice corrupto en la tabla sysjobhistory de la bd MSDB

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

image image image image

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

Index corrupted in MSDB sysjobhistory table

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

image image image image

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

martes, 27 de julio de 2010

Optimización de consultas en SQL Azure

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.encrypted,
q.[text]
from
(select top 50
qs.plan_handle,
qs.total_worker_time
from
sys.dm_exec_query_stats qs
order by qs.total_worker_time desc) as highest_cpu_queries
cross apply sys.dm_exec_sql_text(plan_handle) as q
order by highest_cpu_queries.total_worker_time desc



-- Identificar cuellos de botella de I/O
select top 25  
(total_logical_reads/execution_count) as avg_logical_reads,
(total_logical_writes/execution_count) as avg_logical_writes,
(total_physical_reads/execution_count) as avg_phys_reads,
Execution_count,
statement_start_offset as stmt_start_offset,
sql_handle,
plan_handle
from sys.dm_exec_query_stats
order by
(total_logical_reads + total_logical_writes) Desc




Regards,

Ing. Eduardo Castro Martínez, PhD – Microsoft SQL Server MVP

 image image image image



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

Troubleshooting and Optimizing Queries with SQL Azure

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_time
from
sys.dm_exec_query_stats qs
order by qs.total_worker_time desc) as highest_cpu_queries
cross apply sys.dm_exec_sql_text(plan_handle) as q
order by highest_cpu_queries.total_worker_time desc



-- I/O Bottlenecks
select top 25
(total_logical_reads/execution_count) as avg_logical_reads,
(total_logical_writes/execution_count) as avg_logical_writes,
(total_physical_reads/execution_count) as avg_phys_reads,
Execution_count,
statement_start_offset as stmt_start_offset,
sql_handle,
plan_handle
from sys.dm_exec_query_stats
order by
(total_logical_reads + total_logical_writes) Desc




Regards,

Ing. Eduardo Castro Martínez, PhD – Microsoft SQL Server MVP

 image image image image



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

sábado, 24 de julio de 2010

Comparación entre SQL Server y SQL Azure

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 power of multiple nodes. The biggest value in the Azure model is the elasticity of being able to create as many databases as you need, when your demand peaks and delete/drop the databases as your demand subsides. The biggest challenge is writing the application to scale across multiple databases. Once this is achieved, the logic can be extended to scale across N number of databases.

Edition

· Express

· Workgroup

· Standard

· Enterprise

· Enterprise Edition

 

Connectivity

· SQL Server Management Studio

· SQLCMD

· SQL Server 2008 R2 Management Studio provides complete connectivity to SQL azure. Prior versions have limited support.

· SQLCMD

 

Data Migration

· SQL Server Integration Services, BCP and SqlBulkCopyAPI are supported

Authentication

· SQL Authentication

· Windows Authentication

· SQL Server Authentication only

Use SQL Server authentication

Schema

No such limitation

SQL Azure does not support heaps. ALL tables must have a clustered index before data can be inserted.

Check all scripts to make sure all table creation scripts include clustered index.

TSQL Supportability

 

Certain TSQL commands are fully supported; some are partially supported while others are unsupported.

· Supported TSQL: http://msdn.microsoft.com/en-us/library/ee336270.aspx

· Partially Supported TSQL: http://msdn.microsoft.com/en-us/library/ee336267.aspx

· Unsupported TSQL: http://msdn.microsoft.com/en-us/library/ee336253.aspx

 

“USE” command

Supported

Not supported

USE command is not supported because each of the databases created by the user may not be on the same physical server. So the application has to retrieve data separately from multiple databases and consolidate at the application level.

Transactional Replication

Supported

Not supported

You can use BCP or SSIS to get the data out on-demand into an on premise SQL Server. You can also use the SQL Data Sync tool to keep on-premise SQL Server and SQL Azure in sync.

Log Shipping

Supported

Not supported

 

Database Mirroring

Supported

Not supported

 

SQL Agent

Supported

Cannot run SQL agent/jobs on SQL Azure

You can run SQL agent on on-premise SQL Server and connect to SQL Azure

Server options

Supported

· Some system views are supported (http://msdn.microsoft.com/en-us/library/ee336238.aspx)

The idea is most system level metadata is disabled as it does not make sense in a cloud model to expose server level information

Connection Limitations

N/A

To provide fair usage experience to all tenants on the nodes, connections to service may be closed due to one of the following situations:

· Excessive resource usage

· Long running queries – (over 5 minutes)

· Long running single transactions between BEGIN TRAN and END TRAN – (over 5 minutes)

· Idle Connections – (over 30 minutes)

 

SSIS

Can run SSIS on-premise

Cannot run SSIS in SQL Azure

Run SSIS on site and connect to SQL Azure with ADO.NET provider

 

Saludos,

Ing. Eduardo Castro Martínez, PhD – Microsoft SQL Server MVP

image image image image

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

Comparing SQL Server and SQL Azure

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 computing power of multiple nodes. The biggest value in the Azure model is the elasticity of being able to create as many databases as you need, when your demand peaks and delete/drop the databases as your demand subsides. The biggest challenge is writing the application to scale across multiple databases. Once this is achieved, the logic can be extended to scale across N number of databases.

Edition

· Express

· Workgroup

· Standard

· Enterprise

· Enterprise Edition

 

Connectivity

· SQL Server Management Studio

· SQLCMD

· SQL Server 2008 R2 Management Studio provides complete connectivity to SQL azure. Prior versions have limited support.

· SQLCMD

 

Data Migration

· SQL Server Integration Services, BCP and SqlBulkCopyAPI are supported

Authentication

· SQL Authentication

· Windows Authentication

· SQL Server Authentication only

Use SQL Server authentication

Schema

No such limitation

SQL Azure does not support heaps. ALL tables must have a clustered index before data can be inserted.

Check all scripts to make sure all table creation scripts include clustered index.

TSQL Supportability

 

Certain TSQL commands are fully supported; some are partially supported while others are unsupported.

· Supported TSQL: http://msdn.microsoft.com/en-us/library/ee336270.aspx

· Partially Supported TSQL: http://msdn.microsoft.com/en-us/library/ee336267.aspx

· Unsupported TSQL: http://msdn.microsoft.com/en-us/library/ee336253.aspx

 

“USE” command

Supported

Not supported

USE command is not supported because each of the databases created by the user may not be on the same physical server. So the application has to retrieve data separately from multiple databases and consolidate at the application level.

Transactional Replication

Supported

Not supported

You can use BCP or SSIS to get the data out on-demand into an on premise SQL Server. You can also use the SQL Data Sync tool to keep on-premise SQL Server and SQL Azure in sync.

Log Shipping

Supported

Not supported

 

Database Mirroring

Supported

Not supported

 

SQL Agent

Supported

Cannot run SQL agent/jobs on SQL Azure

You can run SQL agent on on-premise SQL Server and connect to SQL Azure

Server options

Supported

· Some system views are supported (http://msdn.microsoft.com/en-us/library/ee336238.aspx)

The idea is most system level metadata is disabled as it does not make sense in a cloud model to expose server level information

Connection Limitations

N/A

To provide fair usage experience to all tenants on the nodes, connections to service may be closed due to one of the following situations:

· Excessive resource usage

· Long running queries – (over 5 minutes)

· Long running single transactions between BEGIN TRAN and END TRAN – (over 5 minutes)

· Idle Connections – (over 30 minutes)

 

SSIS

Can run SSIS on-premise

Cannot run SSIS in SQL Azure

Run SSIS on site and connect to SQL Azure with ADO.NET provider

 

Regards,

Ing. Eduardo Castro Martínez, PhD – Microsoft SQL Server MVP

image image image image

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

viernes, 16 de julio de 2010

SQL Azure Private Cloud is now available

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 benefits of scale, multi–tenancy, and low operational costs.”

 

With this offering big companies can know built their own private clouds based on Azure.

 

Saludos,

Ing. Eduardo Castro Martínez, PhD – Microsoft SQL Server MVP

image image image image

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

jueves, 15 de julio de 2010

Aprende sobre SQL Server Master Data Services

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

clip_image001 clip_image002 clip_image003 clip_image004

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

Maratón de SQL Server 2008 R2! by MVPs

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

clip_image001

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 que usted aún no sabe sobre FILESTREAM MSDN Aquí

9

3 pm Introducción a PowerPivot TechNet Aquí

10

4 pm Administración multiservidor con SQL Server 2008 R2 TechNet Aquí

11

5 pm Produciendo Dashboards con PerformancePoint Services TechNet Aquí

12

6 pm Creando bases de datos Geoespaciales de alto rendimiendo MSDN Aquí

 

Saludos,

Ing. Eduardo Castro Martínez, PhD – Microsoft SQL Server MVP

clip_image001 clip_image002 clip_image003 clip_image004

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

miércoles, 14 de julio de 2010

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'
ORDER BY backup_start_date DESC
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

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

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 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

miércoles, 7 de julio de 2010

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://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

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://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

lunes, 5 de julio de 2010

Ganese una Subscripcion MSDN Ultimate

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 2010 y mucho mas software.

Asi que animense y suerte.  Pueden participar de cualquier lugar de Latinoamerica.

Solo como ultimo dato que no sean RD o MVP .. nosotros ya tenemos estos beneficios .. Winking smile

lo pueden enviar a mi email juangyssa@hotmail.com

Juan Alvarado

MVP SQL SERVERNote: Cross posted from Eduardo Castro.

Permalink

jueves, 1 de julio de 2010

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.

 

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

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