How to manage multiple versions of a set of shell and SQL script utilities


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting How to manage multiple versions of a set of shell and SQL script utilities
# 1  
Old 06-22-2004
Question How to manage multiple versions of a set of shell and SQL script utilities

Hi all ---

I have the need to manage multiple versions of a set of utility scripts -- both shell and SQL and other .dat files. I am wondering if anyone out there knows of a good way to "PATH" to SQL and text files in a way similar to how PATH facilitates finding executables in a pre-specified order.

For instance, I have 4 directories (versions) of my utilities -- New, Current, Old, Older. In Older I have a complete set of my utilities; under Old I have those files that were changed since Older; in Current I have those files that were changed since either Old or Older. In New I have only those files that are still being tested and which have been changed since either Current, Old or Older. Using PATH I can specify how to find my executables (shell scripts):

For Production -- PATH=/Current:/Old:/Older:

For Test -- PATH=/New:/Current:/Old:/Older:

But this won't help for non-executables like SQL (text). How do I dynamically find the text files?

Thanks much in advance!
# 2  
Old 06-22-2004
Perhaps you could have your scripts locate your text files relative to $0 ; that is, relative to the running script's location. You can use the `dirname' command to remove the filename from $0 leaving you with its parent directory.
# 3  
Old 06-23-2004
Dennis, there is no easy answer to Source Control and Configuration Management.

Using a Source Control utility such as SCCS, RCS, CVS or (for Windows) Source Safe is an integral activity for project development. I recommend you start using a Source Control utility if you do not already do so.

Your Configuration Management method may seem logical for the time being, but could become tricky to manage with a large amount of files.

Your method, from a systems testing point of view, has a flaw - you do not have a single definitive version of your system to test against. As well as other problems, it means (I think) that you and the testers are both working in the same system?

Consider using something like this:

DEVELOPMENT->TEST->LIVE

where each environment would contain complete suite of your files at whichever version level applies. You would then have an enviromental variable referencing the base directory to the environment
e.g. SYSDIR=/software/dev
or SYSDIR=/software/test

The system files would then be referenced in relation to that directory e.g. $SYSDIR/Bin/myexe
$SYSDIR/Scripts/myscript.sql
$SYSDIR/Sql/mysql.sql

Anyway this is just a suggestion, take it or leave it as you wish.

Also, how do you track changes to your database? It is not clear if you are controlling changes to it or not? Remember a database is in effect a global data area. Because of this, be extremely cautious of making changes to it, especially when you have gone live with your system.

On the subject of Source Control and Configuration Management I urge you to take the following steps:

1) Document your method of version control and how to 'release' a version of a file. Just so everyone knows what is supposed to happen and when ...

2) Document all files, and at which versions, when you make a 'release'.

3) Document a backout plan for a 'release'.

4) Take regular backups of everything. Test the backups will actually work too!.

Hope this helps

MBB
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How do You manage different program versions?

Hallo, I have an general question which happens when installing software by compiling them self. I'm using FreeBSD system 10.0 and the ports. for info, see: http--en.wikipedia.org/wiki/FreeBSD_Ports. As I installed BSD for some years there was (i.e.) perl-14 installed. Now, when doing some... (1 Reply)
Discussion started by: HL1234
1 Replies

2. Shell Programming and Scripting

Run different SQL on multiple DBs using SHELL script

Hi Experts, I have a list of Dbs.In that DBs i need to execute some sql scripts. each sql script is unique and it should run on particular DB only. For example. i have DBs like MDC20V,NDC20V,ODC20V and sql scripts like MD.sql,ND.sql,OD.sql.so MD.sql should run only in MDC20V and ND.sql should... (1 Reply)
Discussion started by: navsan420
1 Replies

3. Shell Programming and Scripting

Executing set of sql queries from shell script

Hi All, I tried executing set of queries from shell script but not able to capture the input query in the log file. The code looks something similar to below sqlplus user/pwd@dbname << EOF > output.log $(<inputfile.txt) EOF The above code is capturing the output of queries into... (9 Replies)
Discussion started by: loggedin.ksh
9 Replies

4. Shell Programming and Scripting

shell script help needed to manage FTP automation

Hi, I am very new in shell scripting. Have managed to prepare a script which will work to download data to local directory. But facing below problem. :wall: Please help me out. Thanks in advance. Problem: 1. I am unable to use delete command to delete data in the ftp location (I have... (2 Replies)
Discussion started by: ImranBD
2 Replies

5. UNIX and Linux Applications

how to execute multiple .sql scripts from within a shell script using sqlplus

using sqlplus I want to execute a .sql script that has dbms_output statments in rhe script. I want to write the dbms_output statements from .sql file to a log file. is this possible. thanks any help would be appreciated :wall: (1 Reply)
Discussion started by: TRS80
1 Replies

6. Shell Programming and Scripting

Help required in passing multiple arguments from a shell script to a pl/sql block

Hi, hope everyone are fine. Please find my issue below, and I request your help in the same In a configuration file, i have a variable defined as below TEST = 'One','Two','Three' I am trying to pass this variable in to a sql script which is define in a pl/sql block as follows, In the... (1 Reply)
Discussion started by: ramakanth_burra
1 Replies

7. Shell Programming and Scripting

How to execute the multiple line sql using shell script

Hi All, Please help me to write a shell script to execute the below sql query. select c.account_no,b.bill_no,a.pay_type,(b.total_due + b.recvd + b.adjusted + b.disputed + b.transferred) as amt_not_billed,d.cash_on_delivery, (select j.bill_no from billinfo_T y, bill_t j where... (1 Reply)
Discussion started by: girish.raos
1 Replies

8. Shell Programming and Scripting

How to manage several versions of Perl modules during the install?

Hello, I would really appreciate any advice on this issue: My Perl Module Environment: /usr/lpp/perl/lib/5.8.7 => has the Perl modules that come with the base Perl installation. Comes first in @INC concatination. /usr/lpp/perl/lib/site_perl/5.8.7 => has all my installed Perl modules... (1 Reply)
Discussion started by: genya01
1 Replies

9. Shell Programming and Scripting

Executing Multiple .SQL Files from Single Shell Script file

Hi, Please help me out. I have around 700 sql files to execute in a defined order, how can i do it from shell script (3 Replies)
Discussion started by: anushilrai
3 Replies

10. Shell Programming and Scripting

Manage starting point in shell script.

Hi, I'd like to run a script with an optional starting point. Meaning that if no parameter for the script => Do everything, otherwise start from the point specified in the parameter and continue till the end. I thought of using the "case ..." but I have no result. Script: # ---------------... (6 Replies)
Discussion started by: ai_dba
6 Replies
Login or Register to Ask a Question