Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Should test and prod use different schema names? 2

Status
Not open for further replies.

dba

MIS
Jun 1, 1999
9
US
I need some advice. Using the same schema names for test, acceptance and production would probably ease migration chores, at the risk of disaster if you slip up and do something in production when you meant to be signed onto test. <br>
<br>
However, using different schema names means changing all references, such as trigger &quot;before update of ....&quot;, view SQL, etc.<br>
<br>
Any opinions? Other risks? Thanks.
 
We normally see separate instances for dev/test/prod with the same schema names used across instances (for just the reason you sited - it makes migration a LOT easier!). However, there IS always the possibility of not being connected to the instance you THINK you are; I have a friend who could have SWORN he was connected to the dev instance when he dropped that table!<br>
<br>
One possible means of minimizing this risk is to have a different prompt for each instance. That way, when you are connected to PROD, you will see<br>
PROD&gt; <br>
for your prompt (of course, this assumes a character-based interface!).<br>
<br>
Using different schema names would be murderous during migration (IMHO). One way to ease the process if you go this route would be to use public synonyms for all of your objects. Then you only need to redefine the synonyms after you port the objects over and your code should work fine. But it's still ugly!
 
dba and carp,<br>
<br>
I think it depends on the number of developers you have - and on any procedures you have in place for object creation.<br>
<br>
I've just finished working on a project where the process worked like this:<br>
<br>
Two main schemas - dev and test - in the development and test database. Each developer has a private schema in the development and test database. One schema in the production database.<br>
<br>
Each developer had private synonyms to each dev object in the development and test database. No developer had access to the production database.<br>
<br>
1) A developer creates an object - or a new version of an existing object - in his/her own schema. Drops the synonym pointing at the dev object of the same name.<br>
<br>
2) When the developer is finished - the team leader imports those objects into his/her own private schema and tests.<br>
<br>
3) When the team leader is finished - the dba imports those objects into the test schema.<br>
<br>
All DDL scripts to change the database were saved as the work was developed. As objects were transferred to test these scripts were added to a &quot;changes&quot; script.<br>
<br>
Periodically a new release of the s/w ws made. An export of the test schema (not all the tables) and the changes script was used as the basis for an automated install procedure that was applied to each production database.<br>
<br>
All this probably seems just a tad complicated. But the development team supported thousands of users and a hundred or so production databases. Very few emergency fixes to production databases - users moaning about new features they wanted rather than about errors in the application.<br>
<br>
This was the biggest development team I've been the lead dba on and it changed the way I think about change control and the development process.<br>
<br>
The admin work for such a process is a pain and was difficult for some programmers to get used to but, once a few releases of the s/w had been made, the advantages were obvious to everyone and the complaints died away.<br>
<br>
Mike <p>Mike Lacey<br><a href=mailto:Mike_Lacey@Cargill.Com>Mike_Lacey@Cargill.Com</a><br><a href= Cargill's Corporate Web Site</a><br>
 
Mike -<br>
I like this a lot! Especially since it supports something I've always tried to pass on to new DBAs: critical code should never be in a user's schema (after it passes testing and goes to production). I've always endorsed a &quot;generic&quot; schema to hold the critical objects, and the DBA and security manager (if different than DBA) were the only people w/ the passwords. As an added layer of security, connect privileges could be revoked from the schema to preclude unauthorized connections.<br>
<br>

 
Mike and carp;<br>
<br>
Thanks for your replies. When you speak of a test or production schema, are you using one schema for all test tables, and one for all production tables? We did that on the mainframe and it worked well, but I'm not sure I want to deal with such long lists of objects with the tools I have in the Oracle world.<br>
<br>
Also, I am wondering what is the best way to change internal text of objects like triggers and views when migrating to different schemas. We are hoping to be able to use unqualified table names in such cases, as our change tool cannot handle making that sort of text change. I don't know enough yet to know if we are going to get into trouble doing that. Are you relying on manually maintained and edited scripts? <br>
<br>
<br>
Mike, when you have programmers changing synonyms to point to their own versions of objects, do these tables have RI on them? If seems that would be difficult to handle?<br>
<br>
We are planning to not allow programmers to create objects, accepting the task overhead up front in the DBA group to attempt uniformity of names, triggers, etc.. Are we being too mean?<br>
<br>
Thanks again for your help. Please forgive me in advance if I pile on too many questions. <br>
<br>
---- John Weil<br>
---- Crowley Maritime Corp. <br>
<br>
<br>

 
John. Don't worry about asking questions - that's pretty much the idea. I'll get my own back another day by asking something myself....<br>
<br>
The two schemas, dev and test. Both these schemas reside on the Development and Test database.<br>
<br>
dev - contains completed development work.<br>
<br>
test - contains the next version of the application that will be released, it is generated by taking a copy of a production database and running the release routine on it (the Changes sql script etc.)<br>
<br>
Developers each have their own private schema and a private synonym for each object in it - so that that developer (and only that one) picks up the object from the private schema.<br>
<br>
The changes scripts are generated by the programmers (with help from DBA's) when applying their changes to the dev schema for testing by their team leader.<br>
<br>
Unqualifed names - presume you mean &quot;products&quot; rayher than &quot;dev.products&quot; - yes applications should not refer to schema names - if they do it breaks the whole thing.<br>
<br>
Change tool &lt;smile&gt; we wrote our own... Was written before I started - horrible inelegant thing written over several years that worked perfectly. Trick is to apply change scripts (written by your programmers with assistance from you) in the right order. You can do this manually and, if I had to develop the tool to do it automatically that's what I would do for a while, so that I understood exactly what i needed to do.<br>
<br>
Some programmers (IMVHO) are quite capable of creating their own create/update/install scripts and others - not. You know best here I think. In any case the point at which they create objects in their private schemas is when you need to be involved as after that the design will be set in stone.<br>
<br>
All this more than a bit time consuming. It needs time to set up and time to administer. Time=Management Commitment here, time pressures will kill the process quite quickly unless every suggestion to circumvent the change control process (due to lack of time, urgency) is met with a certain firmness.<br>
<br>
Regards<br>
<br>
Mike <p>Mike Lacey<br><a href=mailto:Mike_Lacey@Cargill.Com>Mike_Lacey@Cargill.Com</a><br><a href= Cargill's Corporate Web Site</a><br>
 
Mike,<br>
<br>
Thanks again. Hopefully there will be a migration tool to buy when the need gets bigger. -- John
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top