Showing posts with label live. Show all posts
Showing posts with label live. Show all posts

Sunday, March 11, 2012

Complicated question about update procedures

My company works with a fairly large database that needs to be kept live.
My problem is that we need a method of updating the database without messing the data, or crashing the website.
I am sure this is a common problem with a number of solutions. Couldanyone please direct me to a good article on the best practices forupdating databases like this?
What do you mean by updating the database? Just inserting records o chaging its structure?
|||Anything. Inserting records is not a problem. It is changing the structure which is.
When I am developing, I dont want to be working on the live database.
But if I copy the database and edit the copy, what happens to any new data on the live database?
Hope that is not confusing.
|||When you make updates to the structure of the database you should consider whether it affects the behaviour of the application or not. If it doesn′t you can make the update at anytime (But it will be better to schedule it when there is no heavy traffic). If it affects the application, the update should be accompanied with an update in the application. In this case you should schedule a maintainance stop (obviously the users should be adviced with anticipation), and use that time to update everything, the application, the database, configurations, etc. I also work for a huge company with a lot of servers, databases and web applications running, and this is the way we behave.
|||

I was just wondering what the best approach to this kind of thing is.

For example, lets say I have version 1.0 of an application with a db backend. Now, when I start creating version 2, the application and db will change. Do I :

1. Edit the live db making extra care that version 1.0 is not affected by the changes. This has its obvious problems - one mistake and the whole application goes down.

2. Create a copy of the db, edit that, and then link that in with version 2 when it is ready. The problem with this is that, between the time ot copying the db and releasing version 2.0, the users are still using version 1.0 of the db. I would have to then copy that over. This isnt a problem with minor changes, but it is when I start changing/creating keys and constraints (especially in sql server).
So I was wondering what the industry works around creating the next version of software without corrupting the current version.
I know there is no right answer - it depends on the situation. But any guidence would be appriciated.

|||

jagdipa wrote:

I know there is no right answer - it depends onthe situation. But any guidence would be appriciated.


I don't know that I agree with that statement. I think there is aright answer. It is called the Development, Staging, Productionmodel (DSP). The Staging database starts out as a mirror image ofthe Production database. Update scripts are run and tested on theStaging database until the consistent desiredresult is reached, with the Staging database being restored with abackup of theProduction database before each cycle of tests. This way, whenyou are ready to go live with your changes, you simple run the updatescripts that have been tested and perfected on the Staging databaseagainst your Production database.
Check out these links:
The Development, Staging, and Production Model
Setting up a DSP Environment -- look especially at the Managing Database Development section, and the Staging Environment section


|||Brilliant. Exactly what I was looking for.
I am just wondering if DSP is a standard method the industry uses, and are there other methods applied to this problem?
Again, thank you for the guidance
Jagdip
|||Just wondering if you have any more links about DSP?
|||Hi Jagdip, I was hoping someone else might chime in. I have noidea if the DSP approach is the industry standard, but it's the methodI've come to employ as a best practice for myself (in ideal situationsat least, sometimes some of the steps have been shortcut) and it is theway I've noticed some of my peers have worked. I've only recentlypicked up on the term "DSP" to be honest. When I read thedescription of the acronym I said to myself, "oh, I didn't know therewas a term appplied to this approach".
I just Googled a bit more and came up with this, which uses the DSP approach without using the term:
Migration to Production
I don't have many further resources for you, I'm afraid. The keyis to make your rollout to production consistently repeatable in yourstaging environment. This way when you go live you have minimizedyour risks as much as possible. I can't imagine an approach thatwould be better.


|||The only real problem we have is with updating the database. Writtingthe SQL scripts and saving then is a great way of keeping documentationon DB updates as well as keeping the existing data. Up until now, mycolleage has been working on the live database!!!!
I have had a word with him and he likes it. So thank you for theadvice. I'm in the process of writting and testing a procedure usingDSP, and I will have a look at the other article you gave me.
I guess the only real problem I have with DSP is that it will reallyslow down our RAD ideal. But the boss asked for something like this, sohe's going to have to live with it :-)

Sunday, February 19, 2012

completed successfully, but not sending and no error.

hi, i have a message queue system using sql 2005 service broker.

the code and setup is the same on both dev and live database. but

soon after i restored a live backup to dev. the queue stopped

working on dev, live is ok thou. after some trouble shooting, i

found that the server is not sending the message at all, but it says

"Command(s) completed successfully" without any error messages.

setup:

--

create message type TestQueryMessage validation = none

create contract TestQueryContract (TestQueryMessage sent by initiator)

create queue TestSenderQueue

create service TestSenderService on queue TestSenderQueue

create queue TestQueueReceiver

create service TestServiceReceiver on queue TestQueueReceiver (TestQueryContract)

send message:

-

declare @.conversationhandle uniqueidentifier;

begin dialog @.conversationhandle

from service [TestSenderService]

to service 'TestServiceReceiver'

on contract [TestQueryContract]

with encryption = off;

send on conversation @.conversationhandle

message type [TestQueryMessage] ('blah blah blah');

result:

-

Command(s) completed successfully.

but when i do "select * from TestQueueReceiver", there's nothing. and i sure nothing else had picked up the messages.

please advise. thanks a lot.

Look in sys.transmission_queue on the sender's database. The transmission_status column should indicate the problem. Most likely the broker was not enabled back after the restore operation.

HTH,
~ Remus

Sunday, February 12, 2012

Compatibility between installation of MSDE 2000 and SQLServer 7

I want to install MSDE 2000 rel A on a Windows Server 2000 where SQLServer 7
is installed.
CAn I do it? Can MSDE and SQLServer live together?
Must I do any action before to install MSDE?
Thank you in advance
enzo giurleo
hi Enzo,
Enzo Giurleo wrote:
> I want to install MSDE 2000 rel A on a Windows Server 2000 where
> SQLServer 7 is installed.
> CAn I do it? Can MSDE and SQLServer live together?
> Must I do any action before to install MSDE?
> Thank you in advance
> enzo giurleo
you can install MSDE 2000 on a pc already hosting SQL Server 7.0..
SQL Server 7.0 will be the default instance, as it does not support multiple
instances, while MSDE will become a named instance you have to connect to
using the <computername>\<instancename> syntax but...
but...
MSDE 2000 will install and register it's own part of the shared component,
such as SQL-DMO and so on, and it does not contain the full client tools
like Enterprise Manager, Query Analyzer, Profiler and so on, so you loose
the possibility to administer your SQL Server 7.0 with your original 7.0
tools...
Andrea Montanari (Microsoft MVP - SQL Server)
http://www.asql.biz/DbaMgr.shtmhttp://italy.mvps.org
DbaMgr2k ver 0.9.1 - DbaMgr ver 0.55.1
(my vb6+sql-dmo little try to provide MS MSDE 1.0 and MSDE 2000 a visual
interface)
-- remove DMO to reply

Compat. w\ Sybase SQL Anywhere and Pervasive SQL

Can all three apps live on the same server? Is there any
documentation one way or another?
MS SQL 2000
Sybase SQL Anywhere 5.5.05
Pervasive SQL 8.0Since they are from different vendors, I would say "yes, they will =probably work." Although if this is a production server, you will =probably want to make sure that there are enough hardware resources on =the box so that each one performs well.
-- Keith, SQL Server MVP
"Mark Davison" <mark_davison@.xtoenergy.com> wrote in message =news:0a3901c34b05$a7249ca0$a001280a@.phx.gbl...
> Can all three apps live on the same server? Is there any > documentation one way or another?
> > MS SQL 2000
> Sybase SQL Anywhere 5.5.05
> Pervasive SQL 8.0

Friday, February 10, 2012

Comparing two tables in two different databases

I want to compare the records in a table on my live database server with the same table that is my test database server. How can I do this?

Note that both databases are mirrors of each other but contain slightly different data and are on different servers.

There a couple of tools on the market like RedGate Data Compare.

The SQL Server 2005 program directory also contains a commandline utility called tablediff.exe which does just what you want.

WesleyB

Visit my SQL Server weblog @. http://dis4ea.blogspot.com