Home Microsoft SQL Server DigiMailing iRN Contact
    Keyword



sys.sp_ORAGetTablespaceInfo

  No additional text.


Syntax


-- Name:
--		sp_ORAGetTablespaceInfo

-- Description:
--		Retrieve table space info for all articles

-- Inputs:
--		@publisher			== publisher name

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

-- Security:
--		Internal

-- Notes:
--		Used by help article procedures
--		Assumes temp table #ORAtablespaceinfo exists


CREATE PROCEDURE sys.sp_ORAGetTablespaceInfo
(
	@publisher			sysname
)
AS
BEGIN
	DECLARE @retcode			int
    DECLARE @publisher_dbms		sysname
    DECLARE @publisher_version	sysname
	DECLARE	@InsColumnList		nvarchar(2000)
	DECLARE	@SelectColumnList	nvarchar(2000)
	DECLARE @pubid				int

	SET NOCOUNT ON
	
	-- 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

	-- Set publisher DBMS and version
	SELECT	@publisher_dbms	= 'ORACLE'

	EXEC @retcode = sys.sp_IHgetversion	@publisher	= @publisher,
										@version	= @publisher_version OUTPUT

	IF @retcode != 0 OR @@ERROR != 0
	BEGIN
		RETURN (1)
	END

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

	-- Get all article log tables with tablespace info
	SELECT @InsColumnList    = 'article_id, tablespace'
	SELECT @SelectColumnList = '*'
	INSERT INTO #hquery(cmd) VALUES('SELECT	HPT.PUBLISHED_ARTICLEID, UT.TABLESPACE_NAME ')
	INSERT INTO #hquery(cmd) VALUES('FROM USER_TABLES UT, HREPL_PUBLISHEDTABLES HPT ')
	INSERT INTO #hquery(cmd) VALUES('WHERE UT.TABLE_NAME = (''HREPL_ARTICLE'' || TO_CHAR(HPT.PUBLISHED_TABLEID) || ''LOG_'' || TO_CHAR(HPT.PUBLISHED_LOGINSTANCE)) ')
	INSERT INTO #hquery(cmd) VALUES('AND HPT.PUBLISHED_ARTICLEDROPPENDING = 0 AND HPT.PUBLISHED_LOGDROPPENDING = 0 ')

	EXEC @retcode = sp_ORAremotequery
					@Server				= @publisher,
					@SelectColumnList	= @SelectColumnList,
					@InsTable			= '#ORAtablespaceinfo',
					@InsColumnList		= @InsColumnList

	IF @@ERROR <> 0 OR @retcode <> 0
	BEGIN
		DROP TABLE #hquery
		
		RAISERROR (21781, 16, -1)
		RETURN (@retcode)
	END

	DROP TABLE #hquery
	
	RETURN (@retcode)
END

 
Last revision 2008RTM
See also

  sp_MSdrop_repltran (Procedure)
sp_ORAhelparticle (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