Wednesday, March 28, 2012
Print blank pages after change server
I have a Seagate Info 7 server on NT4, recently I migrate the it to a new server running on NT4. I install a new SI7 in the new server and then copy the old SI7 database and reports to the new server. After that I change the APS name to a new name using the utility in SI7.
All work well, except the printing. A blank page come out after each print for all the old report that I have created. But new report is OK.
Can some please help me! Thanks a lotOpen the Old Reports and Do verify Database
Friday, March 23, 2012
Primary key violation
I have got a very peculier kind of problem. My package is running on SQL 2000. There is a identity primary key in a table. Now when I submit the data from 2 different computer at the same time. Only one data is storing. The reason behind this is the primary key violation. as both the data are sending the request to the database at the same time.............n as the primary key is th identity column, it is storing one that value which is able to store the data at the forst hand.
Now plz help me out in this regard............. :confused:Help you do what?
Eliminate the dups, Or remove the constraint?|||The target table should have the original IDENTITY field and a LOCATION field as primary key. Make sure that the field does not have IDENTITY property on the target column. The process should be modified to change data retrieval from a table to a view where an artificial LOCATION column is added. That's at least how I'd do it. Give us more details maybe someone will come up with something better.|||The target table should have the original IDENTITY field and a LOCATION field as primary key. Make sure that the field does not have IDENTITY property on the target column. The process should be modified to change data retrieval from a table to a view where an artificial LOCATION column is added. That's at least how I'd do it. Give us more details maybe someone will come up with something better.
Really...man I hate surrogates....|||rdajabarov's solution is the cleanest, but tsk, tsk,... should'a used GUIDs... ;)
Gotta love those surrogate (GUID) keys!|||I'm confused, are you inserting the values into the identity column on the target table or letting target table generate the identity value?
Blindman what's the storage size for a GUID?|||binary(16)|||bm - you're right, GUID would be perfect for this implementation. 2 things that I have against it as far as the original posting goes:
1. Will have to completely redesign the db, and what's most painful, - redesign the app.
2. As I posted before, it's easier to type a number in the search by key field, than a GUID value.|||CREATE TABLE [dbo].[vfar_Bact_phylum_tb] (
[Bact_sr_phylum] [int] IDENTITY (1, 1) NOT NULL ,
[Bact_phylum] [varchar] (30) NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[vfar_Bact_phylum_tb] WITH NOCHECK ADD
CONSTRAINT [PK_vfar_Bact_phylum_tb] PRIMARY KEY CLUSTERED
(
[Bact_sr_phylum]
) ON [PRIMARY]
GO
This is my table structure. Now from two different computers i'm sending the data to be submitted to this table at the same time. But unfortunately only single data is being saved.
All i want is to save both the data, no matter.........how many simultaneous request is going to the DB.
No, not at all.........its not at all possible to change the table design at this point of time.|||Then get rid of the constraint|||...and of IDENTITY property.|||bm - you're right, GUID would be perfect for this implementation. 2 things that I have against it as far as the original posting goes:
1. Will have to completely redesign the db, and what's most painful, - redesign the app.
2. As I posted before, it's easier to type a number in the search by key field, than a GUID value.
1) Even worse, will have to redesign source apps.
2) GUIDS are a bitch to type, but users shouldn't be entering them anyway. I think surrogate keys should be absolutely invisible to the users.
But yeah, it's too late for this guy's purpose.sql
Tuesday, March 20, 2012
Primary Key Conflict Resolution
I'm running into problems with my replication where I get the following error:
Violation of PRIMARY KEY constraint
I know what the error means, and I know what is causing it. In my case, a property is being added to an inventory item independently at the publisher and subscriber end. Each available property has a particular ID, each inventory item has its own unique ID, and of course the properties per inventory item are stored in a linking table. I am using UUIDs for the inventory items, to avoid collisions in that aspect, but the list of properties is fixed (currently only 15 - 20 available properties), so it doesn't make sense to me to have managed ranges, UUIDs, or other such things for the properties. Of course, I could apply a "source ID" to each added property to avoid these collisions, but I'd prefer not having to redesign the database, not to mention deal with the extraneous copies of properties.
My preference would be to simply have the server delete the copy on the server and take the subscriber row. I would have thought that using the "subscriber always wins" conflict resolver would have this effect, but it doesn't work for me. Is there a straightforward way of dealing with this problem? Am I missing something obvious? I've looked into a custom conflict resolver, but that seems like overkill for what must be a fairly common scenario.
For the record, the publisher in my case is SQL Server 2005, and the subscribers are SQL Server Mobile clients.
Any advice would be greatly appreciated!
Thanks,
Adrien.
Adrien,
In your case, "subscriber always wins" conflict resolver won't work for you because although you have inserted at both publisher and subscriber, they are treated as different rows with different rowguid. I think what you can do is just ignore that failure since your subscriber row will be rolled back if you set @.compensate_for_errors='true'. Or you need to make sure only one side insert into property table, and make sure the other side gets it, then both side can insert into the linking table which refers to the property table.
Hope it helps
Wanwen
|||Wanwen,
This "compensate_for_errors" property does exactly what I needed. I've tested causing PK collisions on purpose, and it seems to do more or less what I'd expect, and gets rid of the errors.
Thanks!
Adrien.
Wednesday, March 7, 2012
Primary & Secondary Server
Hello,
I would like to know how do I carry out this two cases in efficient way:
1. I have two SQL 2005 servers running. One as primary, one as secondary. I would like to synchronize or replicate the transactions at real-time.
2. When primary goes down, I would like my secondary server to take place in needless of IP changes and application settings.
If you have a good architecture on this, please share with me. I am not sure whether my questions are clear enough or not. I also will be reading some articles about these. Thank you in advance.
Regards,
Paing
Hi,
First of all this is not an easy question. You need to ask few questions to yourself
(a) What is the level of availability you want for data
(b) what is the down time you have
(c) what is the budget you have ; can you buy new hardware for cluster
(d) what is the SQL Server Edition u have
(e) what is the disaster recovery method you want to have
From your scenarion what i understand is , u want such an architecture that do not demand any DBA intervention when primary fails.
In this case what i feel is you may go for Database mirroring or SQL Clustering. But the later one needs extra hardware and windows licensing etc. If you have that it is well and good. Otherwise you can go for Database Mirroring Highavailability and Synchronus Mode. As you said replication can be real- time(transaction replicaiton) but when the primary fail , the secondary will not up automatically. Replication Need DBA intervention.
Before going for implimention you need to read a lot. there are many article available in net. Search for "High Availablity and Disaster Recovery in SQL 2005.
I hope this could lead to your goal. Keep posting your observation....
All the best
Madhu
|||Hi,
Thank you for your reply.
a). I would like to have as far as possible. Means, I would like to have up to the last transactions that made just before primary went down.
b). My customer will not be able to afford even a minute downtime as they're having at least 3 or 4 transactions per minute.
c). Currently have two Windows 2003 Servers running. Servers' hardware are at their standards (I don't remember the spec tho).
d). Using SQL Standard Edition 2005.
e). This is the plan for DR and am not sure which method to go. If you have any recommendation, I'd much appreciate.
I would like to know a recommendation which is well known plan and best practice. We're still at gathering information on how-to. But my customer said they do not want to go for clustering. I do not know why. I will need to talk to their DBA later on if it is recommended here. I am hoping to hear more from you experts on this topic. I will do research on my own as well. And thanks for the topic tip.
Paing
|||
For Clustering your OS should be either Windows EE or Windows Datacenter. So first you should confirm this. If you want a High availability system which has server wide failure support and better performance and you have enough budget and your Operating system is EE or Windows Datacenter the first choice should be Clustering. The problem in database mirroring is it does not support Server wide failure. It supports only the database failure. So it is a good point for debate.
Database mirroring on SQL Server 2005 Standard Edition does not have all the features in Database mirroring. Feature like Database Snapshot, Parellel Redo, safety=off are not supported in Standard Edition. It is again is a new feature in SQL 2005 . For automatated failover in database mirroring you may need 3 servers.
So , what I would say is , you read these two option in detail and need to take a dicision very carefuly according to the avialable OS and Sql Server resource.
All the best and happy new year
Madhu
Price performance
Running 6 or 7 customer service web applications that will operate as asp.net apps w/vb.net. These are database intensive applications but run a relatively light load with only 20 or so users accessing.
Running the 'customer service' portion of our web site that customers will use to access their account info, historical orders, order status, etc. These are also asp.net pages and are modestly database intesive. If I had to make a WAG, I would say that maybe 50 users on average to say 100 peak using these pages.
I plan on buying a single Xeon with say 2 GB of RAM, I'm not sure about the hard drives but something with suds.
So my question after that long tome is what's the tradeoff between RAM and extra processor. Given a fixed budget for the server, if I were to ask for additional funds I'm not sure if I should invest in additional processor or more RAM.
And also, I'm not sure about running the server for both internal and external applications. Obviously the internal apps could take a hit if things got busy externally. Is there any kind of best practice that advises against this.
Any ideas?aleviating contention is the driving force behind most server tuning processes. two disks better than one, two memory sticks instead of one, and multiple processors instead of one.
i've always thought that if all basic requirements have been met on the server and i have some money left over, that more processors are better money spent than memory.|||aleviating contention is the driving force behind most server tuning processes. two disks better than one, two memory sticks instead of one, and multiple processors instead of one.
i've always thought that if all basic requirements have been met on the server and i have some money left over, that more processors are better money spent than memory.Wow, I almost never see database servers that are "processor bound", mine are always constrained by either RAM or bandwidth (either backplane or network). Even when the application server resides on the same box as the database server, I rarely see the machine starving for CPU before it runs out of RAM!
I always find it interesting to hear other points of view, but that one really surprises me.
-PatP
Monday, February 20, 2012
preventing second instance of SP
at the same time on SQL Server?
I'll appreciate a SQL example how-to define if the SP
already running.
Thank youAbout the only way you can do that is by exclusively locking something so
the second instance waits...
--
Wayne Snyder MCDBA, SQL Server MVP
Computer Education Services Corporation (CESC), Charlotte, NC
(Please respond only to the newsgroups.)
I support the Professional Association for SQL Server
(www.sqlpass.org)
"vitaliyk" <vitaliykrasner@.hotmail.com> wrote in message
news:075a01c3c315$d1d5b8c0$a101280a@.phx.gbl...
> Is it possible to prevent second instance of my SP running
> at the same time on SQL Server?
> I'll appreciate a SQL example how-to define if the SP
> already running.
> Thank you