Home Microsoft SQL Server DigiMailing iRN Contact
    Keyword



sys.sp_ORAhelpXactSetJob

  No additional text.


Syntax


-- Name:
--		sp_ORAhelpXactSetJob

-- Description:
--		Return attributes of the Oracle XactSet Job

-- Inputs:
--		@publisher		== name of Oracle publisher
--      @enabled        == Xactsetjob flag
--      @interval		== interval

-- Returns:
--		Return code (0 for success, 1 for failure)

-- Security:
--		internal stored procedure
-- Requires Certificate signature for catalog access


CREATE PROCEDURE sys.sp_ORAhelpXactSetJob
(
	@publisher		sysname,
	@enabled		bit = NULL OUTPUT,
	@interval		int = NULL OUTPUT
)
AS
BEGIN
	DECLARE @retcode	int
	DECLARE @pubid		int
	DECLARE @cmd			nvarchar(400)
	DECLARE	@InsColumnList		nvarchar(200)
	DECLARE	@SelectColumnList	nvarchar(200)

	
	-- Security Check: require sysadmin
	
	IF (ISNULL(IS_SRVROLEMEMBER('sysadmin'),0) = 0)
	BEGIN
		RAISERROR(21089,16,-1)
		RETURN (1)
	END

	-- Get publisher ID
	SELECT @pubid = srvid
	FROM	master.dbo.sysservers
	WHERE	UPPER(srvname collate database_default) = UPPER(@publisher)
	
	IF @pubid IS NULL
	BEGIN
		RAISERROR(21600, 16, -1, @publisher)
		RETURN (1)
	END

	-- Define sp_ORAremotequery support table
	create table #hquery
	(
		seq	int identity(2,1),
		cmd	nvarchar(4000)
	)

	-- Process help
	CREATE TABLE #XactSetJob
	(
		jobnumber		int,
		lastdate		varchar(22),
		thisdate		varchar(22),
		nextdate		varchar(22),
		broken			varchar(1),
		interval		varchar(200),
		failures		int,
		xactsetjobwhat		varchar(200),
		xactsetjob		varchar(1),
		xactsetlonginterval	int,
		xactsetlongthreshold	int,
		xactsetshortinterval	int,
		xactsetshortthreshold	int
	)
	
	
	-- populate a temp table with the result of a query of HREPL_XactSetJob and USER_JOBS
	
	SELECT @InsColumnList    = 'jobnumber, lastdate, thisdate, nextdate, broken, interval, failures, xactsetjobwhat, xactsetjob, xactsetlonginterval, xactsetlongthreshold, xactsetshortinterval, xactsetshortthreshold'
	SELECT @SelectColumnList = 'JOB, LASTDATE, THISDATE, NEXTDATE, BROKEN, INTERVAL, FAILURES, XACTSETJOB_WHAT, XACTSETJOB_ENABLED, XACTSETJOB_INTERVAL, XACTSETJOB_THRESHOLD, XACTSETJOB_LRINTERVAL, XACTSETJOB_LRTHRESHOLD'

	INSERT INTO #hquery(cmd) VALUES (N'SELECT u.JOB,');
	INSERT INTO #hquery(cmd) VALUES (N' TO_CHAR(u.LAST_DATE, ''MM-DD-YYYY HH24:MI:SS'') AS "LASTDATE",');
	INSERT INTO #hquery(cmd) VALUES (N' TO_CHAR(u.THIS_DATE, ''MM-DD-YYYY HH24:MI:SS'') AS "THISDATE",');
	INSERT INTO #hquery(cmd) VALUES (N' TO_CHAR(u.NEXT_DATE, ''MM-DD-YYYY HH24:MI:SS'') AS "NEXTDATE",');
	INSERT INTO #hquery(cmd) VALUES (N' u.BROKEN, u.INTERVAL,');
	INSERT INTO #hquery(cmd) VALUES (N' u.FAILURES, p.XACTSETJOB_WHAT,');
	INSERT INTO #hquery(cmd) VALUES (N' XACTSETJOB_ENABLED, XACTSETJOB_INTERVAL, XACTSETJOB_THRESHOLD,');
	INSERT INTO #hquery(cmd) VALUES (N' XACTSETJOB_LRINTERVAL, XACTSETJOB_LRTHRESHOLD FROM HREPL_XACTSETJOB p, USER_JOBS u');
	INSERT INTO #hquery(cmd) VALUES (N' WHERE p.XACTSETJOB_WHAT = ''HREPL.XactSetJob;'' AND u.WHAT(+) = p.XACTSETJOB_WHAT');
	
	EXEC @retcode = sp_ORAremotequery
					@Server			= @publisher,
					@SelectColumnList	= @SelectColumnList,
					@InsTable		= '#XactSetJob',
					@InsColumnList		= @InsColumnList

	IF  (@@error <> 0 OR @retcode <> 0)
	BEGIN
		RAISERROR (21785, 16, -1, @publisher)
		RETURN (1)
	END

	-- If no output parameters have been specified, return the result set
	IF @enabled IS NULL and @interval IS NULL
	BEGIN
		SELECT * FROM #XactSetJob
		RETURN(0)
	END

	-- If @enabled is passed as a parameter, return the flag as an output
	-- parameter.
	IF @enabled IS NOT NULL
		SET @enabled = (SELECT CONVERT(bit,xactsetjob) from #XactSetJob)
	
	-- If @interval is passed as a parameter, return interval value as an output
	-- parameter.
	IF @interval IS NOT NULL
		SET @interval = (SELECT xactsetlonginterval from #XactSetJob)	

	RETURN (0)
END

 
Last revision 2008RTM
See also

  sp_helpxactsetjob (Procedure)
sp_MSdrop_repltran (Procedure)
sp_publisherproperty (Procedure)
       



News

  Query a named instance
Sybase+ASE+silent+install
SQL 2008 R2
Deprecated procedures in SQL2008
Reporting Services item-level role definitions
Create all your missing indexes
Converting datetime field
Start MSSQL Server Profiler at time
Replicating MSSQL Server views
Exploring Microsoft Sharepoint
The OLE DB provider "SQLNCLI10" for linked server indicates.
Mobile solar charger
Oracle to SQL Server replication
Cannot insert the value NULL into column
Undocumented Microsoft SQL Server 2008
VMware
Zoekmachine optimalisatie
SQL Servers hidden objects
FckEditor
Flash in Ajax
De hype die AJAX heet
Barcode scannen
MySQL; Gratis, makkelijk en snel!
PHP
sIFR; de combinatie tussen HTML en Flash