Alessandro Forcinawrites: > I have to upgrade my application working on a 5 Gb database running under > Ingres 6.04-06 (Solaris 2.5), and I have to move the whole Ingres installation > to another server. Since the unload/reload of the db from one server to the > other one would take several hours (8 to 10 typically) I'd like to accomplish > this task by the checkpoint utility, which is much faster (1.5 hours). I had a > lot of trials, but most of them didn't end successfully. > > The problem seems to arise when the ckpdb command checks for the paths of the > db installation (which are different for the two servers of course) in the > aaaaaaa.cnf file, and for the dumped pages in the > $II_SYSTEM/ingres/dmp/default/"dbname" directory (even if the chekpoint has > been taken offline, and the users were out). > > So, is there a "clean" way to move databases between two servers using ckpdb? We use the Perl script I've included below when we move databases around. It is known to work under Ingres 6.4/05 (never tested against 6.4/06 but I doubt the .cnf or .dmp files have changed their format). To use it: % cd % modcnf -i aaaaaaa.cnf % mv aaaaaaa.cnf aaaaaaa.cnf.bak % mv aaaaaaa.cnf.new aaaaaaa.cnf % modcnf -i .dmp % mv .dmp .dmp.bak % mv .dmp.new .dmp Of course, modcnf is in the "use at your own risk" category. > Should I configure the two server EXACTLY in the same way, as to $II_SYSTEM > paths and whatsoever? That might be easier. :-) Ciao. ---- BEGIN PERL SCRIPT ----- #!/local/bin/perl # FPA - @(#)modcnf 1.1 98/02/04 # (C)Copyright 1996, Fremantle Port Authority # # This script reads an Ingres database configuration file and modifies it. # with the intention of "renaming" a database. # modcnf must be run on the .cnf file as well as the latest .dmp file. # # NOTE # # This script will only work on databases which are # stored in a single Ingres location. # Preserve the script's name for later use (warnings, filenames, etc) ($program = $0) =~ s:.*/::; use Getopt::Std; getopt ('i:'); die "Usage: $program -i \n" unless $opt_i; $file = $opt_i; # Reserve exactly enough space for the config file's contents $buf = pack ("C8192", 0); # Read those contents into our buffer open (I, "<$file") || die "$file: $!\n"; read (I, $buf, 8192); close (I); # Get the current database name $olddb = substr ($buf, 0x14, 0x10); $olddb =~ s/\s.*//; print "Old database name: $olddb\n"; # Prompt for the new one. print "New database name: "; chomp ($newdb = <>); substr ($buf, 0x14, 16) = pack ("A16", $newdb); change ("data directory", , 0x18a3, $olddb, $newdb); change ("journal directory", 0x1953, $olddb, $newdb); change ("checkpoint directory", 0x1a03, $olddb, $newdb); change ("sort directory", 0x1ab3, $olddb, $newdb); change ("dump directory", 0x1b63, $olddb, $newdb); open (O, "> $file.new") || die "$file.new: $!\n"; syswrite (O, $buf, 8192); close (O); # Update a single "location" within the database configuration. We # expect that a "location" string is immediately preceded by the usable # length of that string and that the entire string length is exactly # 128 bytes. sub change { local ($txt, $pos, $old, $new) = @_; local ($loc, $loclen, $nloc); # Read the current value $loclen = ord (substr ($buf, $pos, 1)); $loc = substr ($buf, $pos + 1, $loclen); print "\nOld $txt: $loc\n"; # Build the default new value and get the user's choice $loc =~ s:/$old$:/$new:; print "New $txt: [$loc]\n> "; chop ($nloc = <>); # Put the appropriate choice back into the file $loc = $nloc if $nloc; $loclen = length ($loc); substr ($buf, $pos, 1) = chr ($loclen); substr ($buf, $pos + 1, 128) = pack ("A128", $loc); } ---- END PERL SCRIPT ----- -- ------------------------+-------------------------+---------------------------- Daniel Baldoni | Phone: +61-8-9430-3439 | Fremantle Port Authority Systems Administrator | FAX: +61-8-9336-1391 | 1 Cliff Street, ------------------------+-------------------------+ Fremantle, require 'std/disclaimer.pl' | Western Australia 6160 --------------------------------------------------+---------------------------- "Any time there's something so ridiculous that no rational systems programmer would even consider trying it, they send for me" (I'm not good, just crazy) - Paraphrased from "King of the Murgos" by David Eddings
© William Yuan 2000
Email William