SQL Editor Issue

Hi Timothy,

Stephen already pointed out a lack of a scripting feature in Team
Coding, however, if you have the DBA option you can do a Schema Compare
between your QA database schema and your production one.

The differences can be written to a script that you then run on the
production schema to bring it up to the same state as the QA one.

Beware of the option to "drop objects before (re)creation though! I
always turn that off. :slight_smile:

HTH


Cheers,
Norm. [TeamT]

Stephen,

Thanks for the reply. What is the typical way development teams keep track of
the changes in order to promote them to QA or then to Production? We enabled
Team Coding and integration with Subversion to protect us against the many
forgotten changes that do not make it to QA resulting in secondary deployments
to fix it. Occasionally they do not make it to production either. With Team
Coding, we should no longer see one developer script over writing another
because they changed the same thing, however that will only be valid if we have
a way to create our script automatically or manually based on changed objects in
the database schema.

Best Regards

Timothy Bryan

We are what we repeatedly do. Excellence, therefore, is not an act but a habit.

Aristotle

Hi Timothy,

I would like to hear some other Team Coding users chime in with a response to
your first question, I can’t speak to what a typical way might look like J

Team coding will help prevent developers over writing each other, as you
suggest. You can create your script manually, as Norm suggests.

A scripting Tool from Team Coding sounds like an good idea for the Toad Pond.

Stephen

Hi Norm,

When you say “DBA Option”, what are you referring to? We do not have the ability to run anything against QA or Production, only dev. It is our responsibility to manage the change in Dev and then schedule a deployment along with an appropriate script to execute in QA or Production via the DBA team. What I need to be able to do is find all changes within the Dev database since a given version / revision in the repository and create a script to give the DBA’s for execution to QA and later to Production.

Best Regards

Timothy Bryan
We are what we repeatedly do. Excellence, therefore, is not an act but a habit.
Aristotle

Hi Timothy,

When you say "DBA Option", what are you referring to?
Help->About. That lists all the add-ons that your license for Toad
covers. The DBA option has the ability in it to create a script from the
output of Schama Compare. Without the DBA option all you can do is look
at the differences and try to manually resolve them.

Mine says "Add-ons: DB Admin Module, SQL Optimizer".

We do not have the ability to run anything against QA or Production,
only dev.
That makes sense to be honest. But it will make running the schema
compare difficult if you are not able to access production. :frowning:

It is our
responsibility to manage the change in Dev and then schedule a
deployment along with an appropriate script to execute in QA or
Production via the DBA team. What I need to be able to do is find all
changes within the Dev database since a given version / revision in the
repository and create a script to give the DBA's for execution to QA and
later to Production.
I understand. You mentioned that you use Subversion as well as team
Coding (or are you using Subversion as your Legacy team Coding system?).

I would think about looking at your Subversion logs to see what changed
"recently" and maybe, the "svn diff" command will enable you to do some
scripting work?

It's a bit difficult to find out exactly what has changed between fixes
if you don't have a schema still at the base level to compare it with.

--
Cheers,
Norm. [TeamT]

It is our
responsibility to manage the change in Dev and then schedule a
deployment along with an appropriate script to execute in QA or
Production via the DBA team. What I need to be able to do is find all
changes within the Dev database since a given version / revision in
the repository and create a script to give the DBA's for execution

My solution to this is that I build my implementation script as I am doing
development. Any DDL changes I do get put into this implementation script.
If I back changes out, I back them out of the implementation script. I use
the project manager to show the files I am working on, broken out by schema,
and one of those files is the implementation script. I also have an
implementation plan that references what I (or someone else) has to do in
order to implement my changes, and at least one of those items is to run the
implementation script.

At the top of my script I usually always contains the following SQL at the
top:-

SET TERMOUT OFF
COLUMN FNAME NEW_VALUE _SPOOL_FILE

SELECT 'ttpa_impl_&CONNECT_IDENTIFIER'
|| '
'
|| TO_CHAR (SYSDATE, 'yyyymmdd_hh24miss')
|| '.log'
FNAME
FROM DUAL;

SET TERMOUT ON;
set verify off
set echo on
spool &_SPOOL_FILE
prompt $Header: tpc_er_ttpa_impl.sql, 4, 8/23/2010 9:22:08 AM, Michael
McAllister$

The first part of the SELECT statement (in this case 'ttpa_impl') changes
from implementation script to implementation script. Running this at the
start of my script makes sure that my instance name and the date/time of the
script being run becomes a part of the log filename that SQL*Plus (or TOAD)
outputs to. I also make sure I have $Header$ at the top of the script
(explanded in the example above) so that I can see what version of my
implementation script was run. The log file gets checked into our version
control system so that we have a record of what was run where, and the
results of that implementation.

Executing the implementation plan, and running the implementation script in
the test instance becomes a test of my implementation. If there are any
problems with it, we restore the DB back to the point prior to running the
implementation, fix the problems with the implementation in dev, and then
run in test again. The implementation CANNOT be run in production until it
has run successfully in test.

Regards,

Mike McAllister
Principal Systems Engineer
Decypher
DSN: 487-3751
Commercial: (210) 652-3751
Cell: (512) 423-7447
Email: michael.mcallister.2.ctr.au@us.af.mil
smime.p7s (5.59 KB)

Hi Norman,

Thanks for this information. I do not have the DBA option, so will look into
getting this. It would appear this would make things much easier. I may be able
to get DBA access to QA for the compare only rights so will check into that. We
use subversion for our source control here with our non-database code projects.
When I setup Team Coding recently, I integrated it with Subversion so the
objects are checked into subversion and I can do comparisons there. It seems to
be a big task at the end of a development cycle to verify any script for changes
before promoting to QA. I am sure if I figure out a best way and get in the
groove, it will not be so bad.

Thanks for your help.

Best Regards

Timothy Bryan

We are what we repeatedly do. Excellence, therefore, is not an act but a habit.

Aristotle

Hi Mike,

Thanks for the ideas you presented. Currently, all the developers keep track of their own changes in a script and submit them at the deployment time to one person. That one person then manages combining them and checking for any conflicting changes. Problem has been that things get missed occasionally and requires a subsequent deployment to QA to fix it after figured out. We are trying to fix that process.

Best Regards

Timothy Bryan
We are what we repeatedly do. Excellence, therefore, is not an act but a habit.
Aristotle

I recently setup Team Coding with integration to Subversion. I was under the
impression this prevented anyone from changes to objects without first checking
the object out. Today, a co-worker changed a package and compiled it without
checking it out. He is not running the same version of TOAD as his is 10.1 and I
am using 11 and he has not setup his local repository. It was done for the
purpose of a test, but now we ask how to control changes. Does this get
controlled, or is this a procedure task? We are logging in as the schema owner.

Best Regards

Timothy Bryan

We are what we repeatedly do. Excellence, therefore, is not an act but a habit.

Aristotle

Hi Timothy,

For some reason this post did not make it to my yahoogroups mailbox.

For the release we test for backward compatibility with the previous version. We
just tested several older versions here in the office, back to 10.1. 10.6
controls objects correctly. There are any number of issues that would have been
addressed in intervening versions . 10.1 behaves as if Team Coding is not
installed if there is an issue with the VCS client.

You could try installing Subversion on the client and setting up the Provider
configuration, but I am not sure it would work. In any case, if the developer
wanted to switch off Team Coding he could simply disable Subversion.

I hope this helps

Stephen



I recently setup Team Coding with integration to Subversion. I was under the
impression this prevented anyone from changes to objects without first checking
the object out. Today, a co-worker changed a package and compiled it without
checking it out. He is not running the same version of TOAD as his is 10.1 and I
am using 11 and he has not setup his local repository. It was done for the
purpose of a test, but now we ask how to control changes. Does this get
controlled, or is this a procedure task? We are logging in as the schema owner.

On 10/01/12 16:12, Bryan, Timothy wrote:

...
Today, a co-worker changed a package and
compiled it without checking it out. He is not running the same version
of TOAD as his is 10.1 and I am using 11 and he has not setup his local
repository. It was done for the purpose of a test, but now we ask how to
control changes. Does this get controlled, or is this a procedure task?
We are logging in as the schema owner.

There's a Toad option that I use when I've got database scripts and
objects under Subversion version control -

View->Options
Editor/compile
Then uncheck "Allow compiling when source loaded from database".

This will prevent your developers from ever compiling any database
objects, unless they have loaded the script to make the required changes
from a file as opposed to generating the script from the Schema Browser,
for example, and then sending it to the editor.

Obviously, it's simple for anyone to turn off the option, but I find it
useful in conjunction with version control.

--
Cheers,
Norm. [TeamT]

That’s a good, easy suggestion – worthy maybe of the Toad FAQ web
page J

Hi

I have a flat file of type *.xml. How can I use TOAD to load data to an ORACLE
table ??
My TOAD is 11.0 and ORACLE is 10gR2

Thank you and best regards

Aci Polajnar
IT svetovalec – IT consultant
acip.vcf (328 Bytes)

Hi Bert,

On 11/01/12 11:56, Bert Scalzo wrote:

That’s a good, easy suggestion – worthy maybe of the Toad FAQ web page J
How about www.asktoad.com -> FAQ -> Editor -> Preventing users compiling
database objects under version control.

or

--
Cheers,
Norm. [TeamT]

You may be able to open it in Excel first and save it to an XLSX format, then
use Import Table Data in Toad.

SEE ATTACHMENT
acip.vcf (328 Bytes)

SEE ATTACHMENT
image001.jpeg

SEE ATTACHMENT
image003.gif

SEE ATTACHMENT
image002.jpeg

SEE ATTACHMENT
image005.gif