Quantcast
Channel: SQL Server Replication forum
Viewing all 4054 articles
Browse latest View live

Disabling the XP_CmdShell and What is the effect on Replication ?

$
0
0

In our company we are planning to disable "XP_CmdShell" for security reasons. I found the below stored procedures are using "XP_CmdShell" in their code and these are related to replication, but we have transactional replication for some databases. Does anyone know what will be the effect on replication if i disable the "XP_CmdShell" ?

sp_adddistpublisher
sp_adddistributiondb
sp_attachsubscription
sp_changedistpublisher
sp_copysubscription
sp_MScopysnapshot
sp_MScopyscriptfile
sp_MSget_file_existence
sp_MSremove_userscript
sp_replicationoption
sp_vupgrade_replication
sp_MSreplremoveuncdir
sp_MSdeletefoldercontents

Thanks

HYDBA


Distribution clean up: distribution / sp_MSDistribution_cleanup DEADLOCK

$
0
0

We are currently running the Distribution clean up job every 10 minutes but it has been failing with the error:

-----------------------------------------------

Message

Executed as user: ****. Transaction (Process ID 1746) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction. [SQLSTATE 40001] (Error 1205).  The step failed.

-----------------------------------------------

It runs for about 28-32 minutes and then deadlocks.

We have also noticed that it locks one of the database log readers while this occurs.  This causes a delay in replicating the transactions across.

Some other information:

SQL 2008 Enterprise (build 10.0.4000)

Publisher/Distributor on same machine

Distributor db size: 154.4 GB

MSrepl_commands:

Rows 320,776,664 

Data: 136.8 GB

MSrepl_transactions

Rows 64,378,104

Data: 3.1 GB


Can we make a merge replication between SQL server 2008 R2 64 bits (publisher) and SQL Servers 2005 Standard 32 bits?

$
0
0

Hi to all.

We have several LAN each with SQL Server. All of them replicate to the principal SQL db with merge. We want to start updating all SQL servers to 2008 R2 version and we want to start with the SQL that it is the publisher (the main office). After that we will be moving all other SQL to 2008 R2 as well.Can that be done?


José

XP_CmdShell diasble impact on replication?

$
0
0
What is impact on transactional replication if we disable the Xp_CmdShell?

The merge process could not replicate one or more INSERT statements

$
0
0

I'm hoping someone recognizes this problem or has an idea on solving it

Situration:
Having a filtered merge pull subscription running with 2 subscribers, everything works fine
Now added a 3rd subscriber and get the message when this subscriber wants to upload something to the publisher (download works fine):

"The merge process could not replicateone or more INSERT statements to the 'Publisher'. A stored procedure failed to execute
Error number: MSSQL_REPL-2147200990"

Rebuild replication, no result
Rebuild the added subscriber database from scratch,no result
Added logging (level 3) on repli job (running on subscriber), nothing more then message above
Ran a trace (all errors, TSQL and stored procedures), no clear cause (at least to me).

Anything obvious I'm overlooking?

Thanks!

Error detect nonlogged agent shutdown sql server 2008 R2 running the snapshot at step 3

$
0
0

I have configured a SQL Server 2008 R2 for merge replication with other SQL 2005 servers.Running the snapshot, I get the error: "detect nonlogged agent shutdown". Researching what aims to this issue it is read/write user permission under snapshot folder permissions. The folder has read/write permissions for the user sa and another administrator user we have tried with. What else should I consider?


José

SQl Replication monitor without Any Sproc

$
0
0

i want to monitor SQL replicetion without any Sproc becoz i am using other tool with cannt execute any Sproc it can only run any select query. can nayone please suggest me any idea how to do it??

Mirroring + Replication - Pause mirroring stop replication

$
0
0

http://social.msdn.microsoft.com/Forums/en-US/sqldatabasemirroring/thread/afbe5236-8627-41f9-b579-3bd2b6e96b49/

I have the same issue. I just wonder if I change mirroring from high safety to high performance, and it can fix the issue?

Thanks

David


Dropping article(s) from a Transactional publication

$
0
0

I read in SQL Books that dropping an article requires re-creating a Snapshot which took me for a loop.  Rebuild snapshot on a delete?  Seems to me this is a simple adjustment to the snapshot not requiring much read activity on the publisher at all.

I am always concerned about the blocking that re-creating a Snapshot will have on our Production DB (publisher)

Will snapshot process be smart and only affect the delta (as it is when Articles are Added). 

We are dropping articles for Tables who are being renamed in our system (SELECT * INTO new Table ... Drop old table )

If this is going to cause hours of blocking then I suppose I have no choice but to re-initialize using a backup (which I have not done before).  Is there an easy way to remove all Un-subscribed objects from the Subscriber side since I only subscribe to say 40 or our 400 tables in the publisher DB.  What is the process for synching up a DB using the Backup?

Thanks all

...Ray



...Ray

replicating from noncompressed table to compressed table

$
0
0

Hello

I would like to replicate some databases from a production server (with 2008 r2 Standard version) to a backup server (with 2008 r2 Enterprise Version). The backup server is somewhat limited in disk capacity, so i was thinking of using compression on some of the replicated tables.

But the compression is lost each time my snapshot replication is run. Is there a way to achieve what i'm trying to do or does it even  make sense with snapshot replication ?

thanks

Oracle to SQL Replication Data Type Issue, can someone help?

$
0
0

We encountered the following error when we tried to add a new table to replication 'Invalid date format...Error executing a batch of commands.  Retrying individual commands'.  After looking at the update statement replication was trying to execute, we noticed that a value for one of the date columns was '00-00-0000'.  On the Oracle table the value as 1/1/0001 so I'm assuming SQL cast it to '00-00-0000'.  We tried changing the data type in the subscriber table to nvarchar(19) and datetime2(7) as well as the update stored procedure but it did not work.  Any help will be appreciated.  Thanks.

Tae


tae yang

Will updating a column size on the Oracle publisher table require a publication drop and recreate?

$
0
0

Hello,

There's a column on the oracle publisher side that needs to be change to a char(50) from a char(2).  Do I need to drop the publication and re-create it?  I'm know I will need to update the current size on the SQL table as well.  I looked at this article http://msdn.microsoft.com/en-us/library/ms152499.aspx and it doesn't say anything about modifying datatypes.  Under 'Making Changes to a published object', it states the following:   

The following actions require you to drop the publication, perform the operation, and then recreate the publication:

  • Truncating a published table.

  • Renaming a published table.

  • Adding a column to a published table.

  • Dropping or modifying a column that is published for replication.

  • Performing non-logged operations.

 It says nothing about modifying datatypes.  Anyone comes across this before?

Tae


tae yang

Why is Replication Throwing Error 3930 When Insert, and Update Triggers are added to the Subscriber Tables? Help Please!

$
0
0

Message Message:

2012-10-22 15:18:07.143 Copyright (c) 2008 Microsoft Corporation
2012-10-22 15:18:07.143 Microsoft SQL Server Replication Agent: distrib
2012-10-22 15:18:07.143 
2012-10-22 15:18:07.143 The timestamps prepended to the output lines are expressed in terms of UTC time.
2012-10-22 15:18:07.143 User-specified agent parameter values:
-Subscriber WAUSQL42\WAUSQL42
-SubscriberDB PM_Warehouse
-Publisher WAUSQL42\WAUSQL42
-Distributor WAUSQL42\WAUSQL42
-DistributorSecurityMode 1
-Publication pm_warehouse_publication
-PublisherDB Oracle_Replication
-Continuous
-XJOBID 0x471EF961AB4A1E4F88CB0C4577F22CB7
-XJOBNAME WAUSQL42\WAUSQL42-Oracle_Replication-pm_warehouse_publicat-WAUSQL42\WAUSQL42-3
-XSTEPID 2
-XSUBSYSTEM Distribution
-XSERVER WAUSQL42\WAUSQL42
-XCMDLINE 0
-XCancelEventHandle 0000000000000900
-XParentProcessHandle 0000000000000B54
2012-10-22 15:18:07.143 Startup Delay: 3244 (msecs)
2012-10-22 15:18:10.393 Connecting to Distributor 'WAUSQL42\WAUSQL42'
2012-10-22 15:18:10.456 Parameter values obtained from agent profile:
-bcpbatchsize 2147473647
-commitbatchsize 100
-commitbatchthreshold 1000
-historyverboselevel 1
-keepalivemessageinterval 300
-logintimeout 15
-maxbcpthreads 1
-maxdeliveredtransactions 0
-pollinginterval 5000
-querytimeout 1800
-skiperrors 
-transactionsperhistory 100
2012-10-22 15:18:10.456 Connecting to Subscriber 'WAUSQL42\WAUSQL42'
2012-10-22 15:18:10.549 Initializing
2012-10-22 15:18:10.690 
42000 The current transaction cannot be committed and cannot support operations that write to the log file. Roll back the transaction. 3930
2012-10-22 15:18:10.690 
42000 Uncommittable transaction is detected at the end of the batch. The transaction is rolled back. 3998
2012-10-22 15:19:32.410 Disconnecting from Subscriber 'WAUSQL42\WAUSQL42'
2012-10-22 15:19:32.410 Connecting to Subscriber 'WAUSQL42\WAUSQL42'
2012-10-22 15:19:32.426 Error executing a batch of commands. Retrying individual commands.
2012-10-22 15:20:56.256 Disconnecting from Subscriber 'WAUSQL42\WAUSQL42'
2012-10-22 15:20:56.256 Connecting to Subscriber 'WAUSQL42\WAUSQL42'
2012-10-22 15:20:56.256 Error executing a batch of commands. Retrying individual commands.
2012-10-22 15:22:33.007 Disconnecting from Subscriber 'WAUSQL42\WAUSQL42'
2012-10-22 15:22:33.007 Connecting to Subscriber 'WAUSQL42\WAUSQL42'
2012-10-22 15:22:33.007 Error executing a batch of commands. Retrying individual commands.
2012-10-22 15:24:11.338 Disconnecting from Subscriber 'WAUSQL42\WAUSQL42'
2012-10-22 15:24:11.338 Connecting to Subscriber 'WAUSQL42\WAUSQL42'
2012-10-22 15:24:11.338 Error executing a batch of commands. Retrying individual commands.
2012-10-22 15:26:07.887 Disconnecting from Subscriber 'WAUSQL42\WAUSQL42'
2012-10-22 15:26:07.887 Connecting to Subscriber 'WAUSQL42\WAUSQL42'
2012-10-22 15:26:07.902 Error executing a batch of commands. Retrying individual commands.
2012-10-22 15:28:12.983 Disconnecting from Subscriber 'WAUSQL42\WAUSQL42'
2012-10-22 15:28:12.983 Connecting to Subscriber 'WAUSQL42\WAUSQL42'
2012-10-22 15:28:12.998 Error executing a batch of commands. Retrying individual commands.
2012-10-22 15:29:32.359 Agent message code 3998. Uncommittable transaction is detected at the end of the batch. The transaction is rolled back.
2012-10-22 15:29:32.391 Category:COMMAND
Source:  Failed Command
Number:  
Message: if @@trancount > 0 rollback tran
2012-10-22 15:29:32.391 Category:NULL
Source:  Microsoft SQL Server Native Client 10.0
Number:  3998
Message: Uncommittable transaction is detected at the end of the batch. The transaction is rolled back.

Sample Insert and Update Triggers

ALTER TRIGGER [dbo].[TRG_SHIP_WAVE_PARM_Insert] 
ON [dbo].[SHIP_WAVE_PARM]
AFTER INSERT
AS 
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;

DECLARE 
@SHIP_WAVE_PARM_ID decimal(5),
@REC_TYPE nvarchar(8),
@WHSE nvarchar(24),
@SHIP_WAVE_NBR nvarchar(96),
@WAVE_DESC nvarchar(320),
@WAVE_PARM_ID decimal(5),
@PERF_PICKNG_WAVE nvarchar(8),
@PICK_WAVE_NBR nvarchar(96),
@PERF_RTE nvarchar(8),
@PERF_PKT_CONSOL nvarchar(8),
@PERF_PULLDOWN_FROM_PNH nvarchar(8),
@CREATE_DATE_TIME datetime,
@MOD_DATE_TIME datetime,
@USER_ID nvarchar(120),
@STAT_CODE decimal(5),
@PNH_PARM_ID decimal(5),
@RTE_WAVE_PARM_ID decimal(5),
@SQLError_ID int,
@Action_Type char(3) = 'TIN'
 
SET @SQLError_ID = error_number()

--assign inserted values to local variables
SELECT 
@SHIP_WAVE_PARM_ID = i.SHIP_WAVE_PARM_ID,
@REC_TYPE = i.REC_TYPE,
@WHSE = i.WHSE,
@SHIP_WAVE_NBR = i.SHIP_WAVE_NBR,
@WAVE_DESC = i.WAVE_DESC,
@WAVE_PARM_ID = i.WAVE_PARM_ID,
@PERF_PICKNG_WAVE = i.PERF_PICKNG_WAVE,
@PICK_WAVE_NBR = i.PICK_WAVE_NBR,
@PERF_RTE = i.PERF_RTE,
@PERF_PKT_CONSOL = i.PERF_PKT_CONSOL,
@PERF_PULLDOWN_FROM_PNH = i.PERF_PULLDOWN_FROM_PNH,
@CREATE_DATE_TIME = i.CREATE_DATE_TIME,
@MOD_DATE_TIME = i.MOD_DATE_TIME,
@USER_ID = i.[USER_ID],
@STAT_CODE = i.STAT_CODE,
@PNH_PARM_ID = i.PNH_PARM_ID,
@RTE_WAVE_PARM_ID = i.RTE_WAVE_PARM_ID
FROM inserted i;

--delete record based on primary key value
DELETE 
FROM PM_Warehouse_Reporting.dbo.SHIP_WAVE_PARM
WHERE [SHIP_WAVE_PARM_ID] = @SHIP_WAVE_PARM_ID

--insert new record to the reporting table
INSERT INTO PM_Warehouse_Reporting.dbo.SHIP_WAVE_PARM(
[SHIP_WAVE_PARM_ID],
[REC_TYPE],
[WHSE],
[SHIP_WAVE_NBR],
[WAVE_DESC],
[WAVE_PARM_ID],
[PERF_PICKNG_WAVE],
[PICK_WAVE_NBR],
[PERF_RTE],
[PERF_PKT_CONSOL],
[PERF_PULLDOWN_FROM_PNH],
[CREATE_DATE_TIME],
[MOD_DATE_TIME],
[USER_ID],
[STAT_CODE],
[PNH_PARM_ID],
[RTE_WAVE_PARM_ID]

VALUES (
@SHIP_WAVE_PARM_ID,
@REC_TYPE,
@WHSE,
@SHIP_WAVE_NBR,
@WAVE_DESC,
@WAVE_PARM_ID,
@PERF_PICKNG_WAVE,
@PICK_WAVE_NBR,
@PERF_RTE,
@PERF_PKT_CONSOL,
@PERF_PULLDOWN_FROM_PNH,
@CREATE_DATE_TIME,
@MOD_DATE_TIME,
@USER_ID,
@STAT_CODE,
@PNH_PARM_ID,
@RTE_WAVE_PARM_ID
)

--update the duplicate date in the PM_Warehouse_Reporting table
IF NOT EXISTS (SELECT 1 FROM PM_Warehouse.del.DELETES_SHIP_WAVE_PARM WHERE [SHIP_WAVE_PARM_ID] = @SHIP_WAVE_PARM_ID)
BEGIN
UPDATE PM_Warehouse_Reporting.dbo.SHIP_WAVE_PARM
SET [DUPLICATE_DATE] = GETDATE()
WHERE [SHIP_WAVE_PARM_ID] = @SHIP_WAVE_PARM_ID
END
ELSE
BEGIN
UPDATE PM_Warehouse.del.DELETES_SHIP_WAVE_PARM
SET [ACTION] = 'UPD'
WHERE [SHIP_WAVE_PARM_ID] = @SHIP_WAVE_PARM_ID
UPDATE PM_Warehouse.err.ERROR_SHIP_WAVE_PARM
SET [ACTION] = 'UPD'
WHERE [SHIP_WAVE_PARM_ID] = @SHIP_WAVE_PARM_ID
END
END

ALTER TRIGGER [dbo].[TRG_SHIP_WAVE_PARM_Update]
   ON [dbo].[SHIP_WAVE_PARM]
   AFTER UPDATE
AS 
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;

    -- Insert statements for trigger here
DECLARE 
@SHIP_WAVE_PARM_ID decimal(5),
@REC_TYPE nvarchar(8),
@WHSE nvarchar(24),
@SHIP_WAVE_NBR nvarchar(96),
@WAVE_DESC nvarchar(320),
@WAVE_PARM_ID decimal(5),
@PERF_PICKNG_WAVE nvarchar(8),
@PICK_WAVE_NBR nvarchar(96),
@PERF_RTE nvarchar(8),
@PERF_PKT_CONSOL nvarchar(8),
@PERF_PULLDOWN_FROM_PNH nvarchar(8),
@CREATE_DATE_TIME datetime,
@MOD_DATE_TIME datetime,
@USER_ID nvarchar(120),
@STAT_CODE decimal(5),
@PNH_PARM_ID decimal(5),
@RTE_WAVE_PARM_ID decimal(5),
@Error_ID int,
@Action_Type char(3) = 'TUP'

SET @Error_ID = error_number()

SELECT 
@SHIP_WAVE_PARM_ID = i.SHIP_WAVE_PARM_ID,
@REC_TYPE = i.REC_TYPE,
@WHSE = i.WHSE,
@SHIP_WAVE_NBR = i.SHIP_WAVE_NBR,
@WAVE_DESC = i.WAVE_DESC,
@WAVE_PARM_ID = i.WAVE_PARM_ID,
@PERF_PICKNG_WAVE = i.PERF_PICKNG_WAVE,
@PICK_WAVE_NBR = i.PICK_WAVE_NBR,
@PERF_RTE = i.PERF_RTE,
@PERF_PKT_CONSOL = i.PERF_PKT_CONSOL,
@PERF_PULLDOWN_FROM_PNH = i.PERF_PULLDOWN_FROM_PNH,
@CREATE_DATE_TIME = i.CREATE_DATE_TIME,
@MOD_DATE_TIME = i.MOD_DATE_TIME,
@USER_ID = i.[USER_ID],
@STAT_CODE = i.STAT_CODE,
@PNH_PARM_ID = i.PNH_PARM_ID,
@RTE_WAVE_PARM_ID = i.RTE_WAVE_PARM_ID
FROM inserted i;

UPDATE  PM_Warehouse_Reporting.dbo.SHIP_WAVE_PARM
SET [SHIP_WAVE_PARM_ID]=@SHIP_WAVE_PARM_ID,
[REC_TYPE]=@REC_TYPE,
[WHSE]=@WHSE,
[SHIP_WAVE_NBR]=@SHIP_WAVE_NBR,
[WAVE_DESC]=@WAVE_DESC,
[WAVE_PARM_ID]=@WAVE_PARM_ID,
[PERF_PICKNG_WAVE]=@PERF_PICKNG_WAVE,
[PICK_WAVE_NBR]=@PICK_WAVE_NBR,
[PERF_RTE]=@PERF_RTE,
[PERF_PKT_CONSOL]=@PERF_PKT_CONSOL,
[PERF_PULLDOWN_FROM_PNH]=@PERF_PULLDOWN_FROM_PNH,
[CREATE_DATE_TIME]=@CREATE_DATE_TIME,
[MOD_DATE_TIME]=@MOD_DATE_TIME,
[USER_ID]=@USER_ID,
[STAT_CODE]=@STAT_CODE,
[PNH_PARM_ID]=@PNH_PARM_ID,
[RTE_WAVE_PARM_ID]=@RTE_WAVE_PARM_ID
WHERE [SHIP_WAVE_PARM_ID] = @SHIP_WAVE_PARM_ID
END


tae yang

Different ways of Synchronizing data

$
0
0

Could you please help me in providing the below information,

1. Different ways of Synchronizing data between SQL servers

2. Different ways of transferring data frequently from many SQL servers to centralized Oracle server.

Reason: We have more than 1300 SQL servers each one for Retail stores and we need to update the centralized oracle database frequently from all the SQL servers. Please let us know the best way to do it.

Regards,

Md.Ismail Shariff

Changed Articles seem to include FKs and defaults despite settings

$
0
0

I was just reviewing the Differences in our reporting database (subscriber) and it seems like the changes that I have made to the publisher (over several releases)  have resulted in some Defaults and FKs being added despite the @schema_option settings. 

My @schema_option = 0x00000004080350DF  so has no Defaults or FKs since neither 0x200 (FKs) or 0x800 (Default) are set.  Right?
Looks like despite the settings for the Publication that new columns are propagated with FKs and default constraints.  A feature?

Q: Is there another setting somewhere to suppress FK, DF to match my selected Schema_Options (no FK, no DF), while still allowing wanted DDL changes like new columns to make it through?  This is how I hoped it would have worked.  

Is this or is it a known bug/limitation in transactional replication?  

Is there a good reason behind this or is it just a limitation/bug?  

Is it addressed in 2012?

SQL Server 2008R2

Thanks for your help.

...Ray


...Ray



Making Idempotent calls to sp_droparticle

$
0
0

I'm working on a migration Script and trying to make the exec sp_droparticle @Publication=...

calls Idempotent (capable of running over again without error or doing harm)

Typically we'd do something like this:

IF EXISTS (SELECT Object ) 

BEGIN

exec sp_droparticle @Publication= 

END

Q: Is there a nice way to check for Article existence?  Tried Scripting from Replication wizard but no luck.  Tried Searching internet but no luck.

Thanks


...Ray


Troubles with replcation for special characters to Oracle

$
0
0

Hello,

We are replicating some tables to our websitedatabase. Al our internally DB are SQL Server, our webapp is build on a oracle.

Wgen replication tables that contain varchar's with special charaters such as é ö it goes 100% correct with the initial snapshot (and then bulk insert i supose), but when we update a record (even on a other field) the varchar contains wrong characters ....

Any ideas on how to work arround this ?

MSDTC

$
0
0

Hi,

 is MSDTC service  need for log shipping,replication,database mirroring and clustering  when move the transaction one server to other server

Replication

$
0
0

Hi all,

Thanks for you replay.

i have one more doubt in replication.

when we configure replication based on replication some files are created in snapshot folder.

like .BCP,.SCH,.IDX,.PRC,.TRG and .CFT,.PRE,.DRI.

in that files  what is the use of this three files  ....."CFT,.PRE,.DRI"  in snapshot folder.


pull replication error

$
0
0

hi,

one of my coworker setup a bunch of pull transactional replication.  The snaps for this publication is compressed and is stored on the publisher+distributor.  There are 30GBs of disk space atm. all the publication are working fine except for one.  I keep getting the following error

Replication-Replication Distribution Subsystem: agent ABCDE39-pubname-subscribername-104 failed. The process encountered operating system error '՝'.

When i look at the replication, I see:

Command attempted:

if @@trancount > 0 rollback tran (Transaction sequence number: 0x0001A1AD000337A201D700000000, Command ID: 3275)

Error messages:

  • The process encountered operating system error 'ؓ'. (Source: MSSQL_REPL, Error number: MSSQL_REPL20034) Get help: http://help/MSSQL_REPL20034
  • There is not enough disk space on the disk.  (Source: MSSQL_REPL, Error number: MSSQL_REPL112) Get help:http://help/MSSQL_REPL112
  • The process encountered operating system error 'ؓ'. (Source: MSSQL_REPL, Error number: MSSQL_REPL1779) Get help: http://help/MSSQL_REPL1779

at first I thought that the compressed cab file would be stored in the temp directory on the subscriber and that doesn't have a lot of space so I changed the system environment variable from c:\windows\temp to v:\temp.  This shut it up for a while but then the message started to show up again.

I have been monitoring the drive where repldata is stored but i don't see it reducing in size.  Does replication not even bother with using the disk space if the size isn't big enough, like the restore function?

if this has to do with the amount of free space where repldata reside, if I change its location, do i need to stop replication first or will it pick up that info automatically?

any help would be greatly appreciated.

thx

Viewing all 4054 articles
Browse latest View live




Latest Images