Transactions Or A Snapshot?

Jan 28, 2008

I had it all set up to take a snapshot of my OLAP as the first step in my package and restore from it on error...then I started to think.....isn't that what a transaction is supposed to do?

Does anyone have any experience of the pros and cons of either?

Thanks.

View 7 Replies


ADVERTISEMENT

Problem When Applying A Snapshot When Tables Have Been Updated During Snapshot Generation

Jun 20, 2007

Hi

I seem to have a strange problem when applying a snapshot when the tables in the publication have been updated while the snapshot was being generated.



Say for example there is a table called RMAReplacedItem in the publication. When the snapshot starts being applied to the subscriber, a stored procedure called sp_MSins_RMAReplacedItem_msrepl_css gets created that handles an insert if the row already exists (ie it updates the row rather than inserting it). However, after all the data has been loaded into the tables, instead of calling this procedure, it tries to call one called sp_MSins_RMAReplacedIte_msrepl_cssm - it takes the last letter of the table name and adds it to the end of the procedure name.



The worst part is that this causes the application of the snapshot to fail, but it doesnt report what the error is, and instead it just tries applying the snapshot again. The only way i have managed to find which call is failing is to run profiler against the subscriber while the snapshot is being applied and see what errors.



I have run sp_broswereplcmds and the data in there is what is applied to the subscriber - ie the wrong procedure name.



All the servers involved are running sql 2005 service pack 2. The publisher and subscriber were both upgraded from sql 2000, but the distribution server is a fresh install of sql 2005.

View 1 Replies View Related

Changing Connection Transactions To Database Transactions

May 22, 2005

Hi there,
I have decided to move all my transaction handling from asp.net to stored procedures in a SQL Server 2000 database. I know the database is capable of rolling back the transactions just like myTransaction.Rollback() in asp.net. But what about exceptions? In asp.net, I am used to doing the following:
<code>Try   'execute commands   myTransaction.Commit()Catch ex As Exception   Response.Write(ex.Message)   myTransaction.Rollback()End Try</code>Will the database inform me of any exceptions (and their messages)? Do I need to put anything explicit in my stored procedure other than rollback transaction?
Any help is greatly appreciated

View 3 Replies View Related

What Is A Snapshot?

Apr 17, 2007

What is a snapshot from replication point of view.

------------------------
I think, therefore I am - Rene Descartes

View 6 Replies View Related

Snapshot Is Not Available

Aug 28, 2006

Dear friends

I am a new fellow to replication.What is the problem I am getting is I am not able to create snapShot.Whenever I start Snapshot Agent it is going for half an hour and it will stuck in the case of one view saying like that 'failed to process bulk copy of data from dbo.syncobj_03x666*'.If I am publishing tables only then also I am getting same error.This view created by system.In my case publiher only working as a distributor.I created a SQL username which have access in subscriber & Publisher.Preferably I will be happy if someone suggest what and all are the primary criterias we have to keep in mind while doing Replication

Thanks in Advance

Filson














View 5 Replies View Related

Transactions

Aug 13, 2003

Hi All,
Can anybody suggest me a website where I can find articles on Managing transactions with Sql server. Also a scenario where the transactions take place in a environment involving 2 different databases, Like the bank account and credit card transactions (specifically of 2 way kind)
Thanks

View 5 Replies View Related

Transactions

Apr 6, 2005

I have a web application with a shopping cart, how do I stop all the shopping cart transaction from going into the db log? Is this possible?  These are are only transient data movements, and will never be need to to restore to, and they are cause log bloat. Or is there a better way to stop log bloat?
 
Thanks

View 2 Replies View Related

TRANSACTIONS IN DTS

Apr 17, 2000

Hi All,

How can we change connection properties in a DTS pkg with connection?
You can loop through the connection count but the connection ID is not static one.So can’t rely on that.
Is there another way of changing connection properties?

Thanks in Advance

Barath

View 4 Replies View Related

Help With DTS Transactions

Sep 5, 2000

Hi all....

I am currently designing a DTS Package to import data that is processed daily into a large database.

I have to design the package such that if any step fails when importing, I roll back the entire transaction.

I have designed the package with this in mind, checked "join transaction if present" and "rollback transaction on failure" in all of the workflows. I have also made all workflows serialized.

However, when I run the package, it fails on one of the data pumps with the error:

Transaction context in use by another session.

Any ideas?

Thank you,

Brian

View 2 Replies View Related

I Want To See My Transactions

Dec 1, 2000

I am replicating (finally!!) and on my publishers agent history I can see it says xx transactions with xx commands were delivered. (xx being the number)
Where can I look to see what the transactions or commands are?

Is there a place the system stores this information?

View 1 Replies View Related

Max. Transactions

Oct 17, 2003

what is maximum limit of no. of transactions per sec. in sql server 2000

View 2 Replies View Related

Transactions

Sep 6, 2004

Is there a point to wrapping a single UPDATE or INSERT statement in an explicit TRANSACTION:


BEGIN TRANSACTION

INSERT INTO Table (...) VALUES (...)

COMMIT TRANSACTION


I understand ACID and concept of transactions. However, I thought they were only necessary for multi-statement operations. I'm maintaining code that does this and am wondering if this is necessary. Does SQL Server guarantee ACID for single statements? Are single UPDATE/INSERT statements prone to race condition like affects without using explicit transactions?

View 2 Replies View Related

Transactions

Apr 17, 2008

Are there any scenarios where an un-commited transaction would block further queries?

View 1 Replies View Related

Transactions

May 27, 2008

If you run the Begin Transaction code and then run a create such as an update query and you see that it effects the number of rows that you wanted it to effect is there a way to look at the actual data that changed before you Commit Transaction?

Thanks!

View 7 Replies View Related

Transactions/Sec

Jul 1, 2007

I have a table with around 240 columns and one of the column in the Table is the Inserttime ( DATETIME ) and I using a GETDATE() function in the stored Proc, when we insert data into the table. In the same Milli second 2007-06-27 09:32:58.303 , I have around 7600 records in the database. The Stored Proc is called for each Individual record and we don't bunch the transactions. Is this possible.

I did some bench marking on this server and I can insert only 700 - 800 records approx / sec on this particular table.

Thanks

View 6 Replies View Related

Transactions

Aug 1, 2007

I have a small database that I have been testing.I get an error about a transaction deadlock.The code is in stored procedures and I added transactions to the sp'sbut the error happened again.I wrapped the whole sp in just one transaction and I don't have anyindex on the tables.When I test just by running a program that sends 3 calls at a time itwill get a deadlocked transaction as I send 6 or 9 at a time.I am not sure how it can have a deadlocked transaction after I usedtransactions(begin and commit) in the sp's.Steve

View 4 Replies View Related

Transactions

Oct 8, 2007

I am working with transactions and use try catch to capture errors and in the event of an error i have to rollback the transaction. How can i perform this?, most of the errors which i forsee are either insertion of null values into non nullable columns or violation of Primary keys while inserting duplicates.
I started by coding the following way but it does not rollaback apparently the try catch does not work for above kind of errors..Can somebody help..



DECLARE @REPORTING_PERIOD VARCHAR(6)

BEGIN TRY

BEGIN TRANSACTION

-- SET NOCOUNT ON added to prevent extra result sets from

-- interfering with SELECT statements.

SET NOCOUNT ON;

SET @REPORTING_PERIOD =(Select REPORT_PERIOD_ID from dbo.T_REPORT_PERIOD where C_FLAG_ACTIVITY=1)


--Step 1


INSERT INTO [dbo].[T_COUNTRIES]

([C_COUNTRY]

,[LB_COUNTRY]

,[C_REGION]

,[FK_REPORTING_PERIOD])

SELECT [C_COUNTRY]

,[LB_COUNTRY]

,[C_REGION]

,@REPORTING_PERIOD

FROM [dbo].[IN_T_COUNTRIES]


--Step 2


INSERT INTO [dbo].[T_FLE]

([FK_P_FLE]

,[C_COSMOS]

,[LB_FLE]

,[C_PARETO]

,[C_OPCO_SCOPE]

,[C_LEVEL]

,[C_FLE_TYPE]

,[C_ACTIVITY]

,[F_MATERIAL]

,[C_MATERIAL_PRIORITY]

,[C_CALCULATION_METHOD]

,[F_CREDIT_RISK_MATERIALITY]

,[V_PARTICIPATION]

,[FK_REPORTING_PERIOD])

SELECT Null as [FK_P_FLE]

,[C_COSMOS]

,[LB_FLE]

,[C_PARETO]

,[C_OPCO_SCOPE]

,[C_LEVEL]

,[C_FLE_TYPE]

,@REPORTING_PERIOD

FROM [dbo].[IN_T_FLE]

COMMIT TRANSACTION


END TRY


BEGIN CATCH


SELECT

ERROR_NUMBER() as ErrorNumber,

ERROR_LINE() as ErrorLine,

ERROR_MESSAGE() as ErrorMessage;

-- Test XACT_STATE for 1 or -1.

-- XACT_STATE = 0 means there is no transaction and

-- a commit or rollback operation would generate an error.

-- Test whether the transaction is uncommittable.

IF (XACT_STATE()) = -1

BEGIN

PRINT

N'The transaction is in an uncommittable state. ' +

'Rolling back transaction.'

ROLLBACK TRANSACTION;

END;

-- Test whether the transaction is active and valid.

IF (XACT_STATE()) = 1

BEGIN

PRINT

N'The transaction is committable. ' +

'Committing transaction.'

COMMIT TRANSACTION;

END;





END CATCH;


View 3 Replies View Related

Sql Transactions

Nov 8, 2006

Hello All,

When i am working with Transactions i got one doubt.

If i am inserting any records into a table with primary key if a transaction is rolled back i am finding one primary ID is missing. Is it so.

View 3 Replies View Related

Transactions

Apr 2, 2007

I've been searching around and haven't found anything that simply states what I want to know.



I want to use a transaction within my CLR Stored Proc, to do so I've got System.Transactions referenced and I can access the current transaction via Transaction.Current.



My questions are

Will there always be a current transaction?

Do I need to create a new transaction if one doesn't already exist?

View 3 Replies View Related

Transactions In SQL CE 2.0 And CF1.1

Sep 4, 2006

Hi world:

I have this issue:

I need to push rows from CE to SQL Server 2000 and after delete these rows of CE database only if all rows have been sent to SQL Server 2000.

I think the best is work with transactions. Since I know I can use transactions for this purpose, can anybody give me a link with push transaction examples ?

View 4 Replies View Related

Transactions/sec

Dec 17, 2007

Hi all,

What does "Transactions/sec" counter in SQL 2005 under databases do in terms of performance. My counter shows almost 100% all the time in 4 terrbyte DB in superdome with many CPUs.


Which is the optimal value for this counter?

thanks in advance

Priw

View 1 Replies View Related

Using Transactions

Mar 31, 2008

Hi,

I am using C#.NET 2005, SQL Server 2000.

I have a few questions to ask. Firstly, can anybody help me by telling the difference between the code below and the same code with comments removed:

string localquery = "select bla bla"; SqlDataAdapter _sda; DataTable _dt; SqlCommand _cmd; bool isErrCatched = false; Exception ExcToThrow = new Exception(); using (SqlConnection _cn = NewConnection) // NewConnection returns a static SQLConnection object { _cn.Open(); _cmd = new SqlCommand(localquery, _cn); //SqlTransaction myTrans; //myTrans = _cn.BeginTransaction(); //_cmd.Transaction = myTrans; _dt = new DataTable(); _sda = new SqlDataAdapter(_cmd); try { _sda.Fill(_dt); _sda.Dispose(); //myTrans.Commit(); } catch (Exception exc) { //try { myTrans.Rollback(); } catch {} isErrCatched = true; ExcToThrow = exc; } finally { _cn.Close(); } _cmd.Dispose(); } _cmd = null; if (isErrCatched) throw ExcToThrow; return _dt;


My first question: Can there be a performance loss if I uncomment the lines about transaction usage? I mean, when I do this I start to get more timeouts.

My problem goes on. When I comment those lines and run a stress tool, I am getting "column X does not belong to table Y" errors. If those lines are not commented i am not getting this error, but I get timeout errors frequently. So, my second question: is there something wrong in my query or is there a bad coding practice I am following? Could someone offer a better and more robust sample for this code block?

By the way, connection pooling is on. And these errors are observed under high loads.

Thanks everybody.

View 3 Replies View Related

Transactions

Jun 7, 2006

I have transaction that will run on an hourly bases. I need to make sure that no one will start this transaction while it is running. I just need to know the system table that has all the transaction names in them and check to see if the transaction is running or not. what i am trying to do is not to have locks....just wanting to make sure that no one would run the same transaction twice. does anyone have any idea on how we can do this?

View 7 Replies View Related

Transactions

Mar 11, 2008


If you ask a .net developer he would likely say that he uses System.Transactions to manage transactions, a DBA on the other hand places transactions within the T-SQL of stored procedures.

What rules do architects and others, use when determining if the transactions should be placed in:


.net Middle Tier Components using System.Transactions for example.

T-SQL Stored Procedures.

Both .net Middle Tier Components and T-SQL Stored Procedures.
Thanks in advance,

Doug Holland

View 1 Replies View Related

Snapshot Error

Apr 9, 2002

I get the following error message in the job history for
synchronization between two SQL 7 machines across the
network.

The process could not read file 'acct.sch' due to OS error
1231.

Is there something to fix this? It has been running fine
for almost 2 years and suddenly quit. There is a firewall
on both sides, if that helps.

TIA,
Cami

View 3 Replies View Related

Snapshot Replication - Help!!

May 7, 2002

The database will grow to 40GB in a short while and I intend to schedule replication every hour. Can this not be done using snapshot replication??

Subject:
From:
Date: Snapshot Replication - Help!! (reply)
MAk (mak_999@yahoo.com)
5/7/2002 12:02:08 PM

Create jobs to copy database and restore database in destination servers


------------
Robert at 5/7/2002 11:00:30 AM

Yes and I would rather not use dts to accomplish this task.

------------
Ray Miao at 5/7/2002 10:02:15 AM

Do you have direct network connection to remote server? Did you try dts?


------------
Robert at 5/7/2002 9:08:06 AM

I've been trying to replicate a database to an off site server using snapshot replication. It is scheduled to run every hour but I've noticed when data is changed at the source it never gets replicated to the destination. Does anyone know why?? I can't use transactional replication beause not all the tables have primary keys and they can't be added due to code. Some tables have id colunms and have been created with the Not for Replication option on the subscriber. Any help will be appreciated.

Thanks


Robert

View 1 Replies View Related

Snapshot Replication

Aug 27, 2001

I can set up snapshot replication for those tables without foreign key constraints. But if there are foreign keys in the table, there will be error
message indicating that this object can not be dropped because it is referenced by ....

Do you have any remedy for that? Thanks

View 1 Replies View Related

Snapshot - Dependency

Dec 29, 2000

Hi,

I've problem in replicating data thru SNAPSHOT as I've the tables with Foreign Keys at subscriber end. The Truncate table is not working because these tables
were referenced by a FK. Even for recreating table during snapshot is also same problem. Any suggestions?

Thanks

TT

View 1 Replies View Related

Snapshot Replication

Dec 28, 2000

2 questions:

1) In snapshot replication, can the subsciber send info back to the publisher (even in a manual process)

2) In snapshot replication, do we need a distributor set up between the publisher and subscriber if there will only be a single subscriber, or can we write directly to it?

Thanks so much for any and all help!

View 1 Replies View Related

PK,FK,IDentity - Snapshot,

Jan 11, 2001

Hi,

I am replicating all tables in the DB. the tables have PKs,FKs and identity columns. While truncating the data from the tables in subscriber getting
the constraint errors. Please suggest how to get rid of this error.

Thanks

Sam

View 1 Replies View Related

PK,FK,IDentity - Snapshot,

Jan 11, 2001

Hi,

I am replicating all tables in the DB. the tables have PKs,FKs and identity columns. While truncating the data from the tables in subscriber getting
the constraint errors. Please suggest how to get rid of this error.

Thanks

Sam

View 1 Replies View Related

Obsolete Snapshot

Oct 17, 2002

Hi everybody,

We have merge replication between two servers with Sql Server 2000 Service Pack 2, and the Merge agent display the follow message :

The snapshot for this publication has become obsolete. The snapshot agent needs to be run again before the subscription can be synchronized.

But i have changes at the suscriber, How can I do to Merge the last changes if the merge agentes is stopped.

I appreciate any help.

thanks

View 1 Replies View Related

Replication Through Wan Without Snapshot

Jan 13, 2003

Hi Guys,

We have a production server in East Coast (SQL Server 2000 SP2 - Database size is around 30 Gig). We have a reporting server is the West Coast. We need to replicate (transactional replication every one hour) from East coast to West coast. Is there any way that I can take a backup and restore upto the last transaction backup and then start replication agent on the production (by saying schema and data already exist). Basically we don't wan't to snapshot using FTP or bcp through WAN because it is going to be very slow.

If this is possible, will there be any validation problem.


Please help.

Thanks,
Anu

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved