moving Informix databases (cp)
Posted in 1992
We run Informix SQL on Unisys 5000 platforms. Our developers work in their home directories, and we have a single top-level directory called /informix where users access production copies of databases. Since we can have 50+ smallish databases (SE engine) on a machine, we are always copying databases around. Our philosophy is this: Our developers have DBPATH set to . in their .profiles. Our users have DBPATH set to /informix/xxxdir:/informix/yyydir:( etc):. in /etc/profile. When developers work they are at the shell, and simply cd to wherever the .ace/.per/.dbs directory they want lives, and work there, keeping each database's stuff under separate sub-directories in their HOME. The users dont cd anywhere. They live at HOME and simply sperform or sacego etc, and informix finds the programs/databases in the various production directories in their DBPATH. No duplication of names is allowed, obviously. Once a developer has a new database he wants us to install he has several rules he must follow (and we check up on 'em): 1) unique names for reports, forms, databases. 2) he must have verified no full path names in systables 3) if he wants logging, he must have created it in the system directory we use for log files in the first place, so it doesnt need to be moved, although it could be. 4) he must have granted root (our "installer") dba, and grant option on all tables. root is the person who will administer, add users, make changes, etc. 5) all user menus call M/P/R with single names, as they are found by DBPATH. All shell scripts are called with FULL path names as the users PATH variable couldnt accommodate the entire DBPATH also. 6) when he wants tables changed, users added etc he mails us the info and we do it. Root also has his DBPATH set to . Root cd's to the /informix/yyydir where the databases lives so all changes made thru isql are saved in the production directory. Once we know he has followed the rules, we do as another responder said. Root cd's to the developers HOME/subdir where the .dbs lives. He does a "find . -print|cpio -pdmu /informix/yyydir". This takes the .ace/arc/frm/per and .sql and .dbs/* files all over to the directory where production users can find it. root ensures informix is the group and all perms allow informix to do what is required. We have never had a problem with this procedure, and we do it many times a week. Perhaps there is more to his problem than I am seeing, but it is the only way we could do our job, and it seems to be working fine,as long as care is taken as you all have said, that no full paths are in systables, log file path is dealt with, and perms allow informix in. Also developers never accidentally change a production database this way, as they would have to cd there to see it. Hope this isnt too much repetition, but I saw so many negatives, I felt a need to affirm that it does indeed work! Ann Barnes Letterkenny Army Depot, Chambersburg, PA