Showing posts with label knowthe. Show all posts
Showing posts with label knowthe. Show all posts

Friday, March 9, 2012

How to get queue handle by queue name

Hi
I have a trace in SQL Server 7 that starts with the server start up. I know
the queue definition name, but i don't the queue_handle.
I need the queue_handle to stop the trace if required in between.
Thanks in advance.
Pushkar
Pushkar wrote:
> Hi
> I have a trace in SQL Server 7 that starts with the server start up.
> I know the queue definition name, but i don't the queue_handle.
> I need the queue_handle to stop the trace if required in between.
> Thanks in advance.
> Pushkar
xp_trace_enumqueuehandles - to enum queue handles
xp_trace_enumqueuedefname
xp_trace_getqueueautostart
xp_trace_getqueuedestination - or any of the get* functions to return
info about the queue
David Gugick
Quest Software
www.imceda.com
www.quest.com

Friday, February 24, 2012

How to get last lsn for my DB

I need to restore multiple set file from a transaction log backup.
To know from which position of this file starting my restore, i need to know
the last lsn point restored on my DB.
while @.id_start < @.id_stop
begin
set @.id_start = @.id_start + 1
RESTORE LOG [MYDB]
FROM DISK = N'Y:\MYDB_LOG'
WITH STANDBY = 'C:\Programmi\Microsoft SQL Server\MSSQL\UNDO_MYDB.ldf',
FILE = @.id_start
if @.@.error > 0
begin
set @.id_stop = 0
BREAK
end
end
I need to know the @.id_start to begin the restore for all backup set missing
.
ThanksHi
RESTORE DATABASE test FROM disk = 'd:\db.bak' WITH FILE = 1, norecovery
RESTORE LOG test FROM disk = 'd:\log.bak' WITH FILE = 1, norecovery
RESTORE LOG test FROM disk = 'd:\log.bak' WITH FILE = 2, norecovery
RESTORE LOG test FROM disk = 'd:\log.bak' WITH FILE = 3, recovery
"checcouno" <checcouno@.discussions.microsoft.com> wrote in message
news:7BF739FD-E00E-4C13-ABDF-75CC564F31CD@.microsoft.com...
> I need to restore multiple set file from a transaction log backup.
> To know from which position of this file starting my restore, i need to
know
> the last lsn point restored on my DB.
>
> while @.id_start < @.id_stop
> begin
> set @.id_start = @.id_start + 1
> RESTORE LOG [MYDB]
> FROM DISK = N'Y:\MYDB_LOG'
> WITH STANDBY = 'C:\Programmi\Microsoft SQL
Server\MSSQL\UNDO_MYDB.ldf',
> FILE = @.id_start
> if @.@.error > 0
> begin
> set @.id_stop = 0
> BREAK
> end
> end
> I need to know the @.id_start to begin the restore for all backup set
missing.
> Thanks