Migrating databases from 5.X to 7.X
Posted in 1996
diana,
i'm posting this here as my mail to you bounced. maybe others
will find this useful as well.
below is a file that i wrote up really quick explaining the steps that
i took to do this on my system. i'm going from sunos 4.1.4 (old server) to
solaris 2.4 (new server).
let me know if you have any questions:
this is the procedure that i have followed to migrate my databases to
the new server. i have two separate servers, so i have the luxury of having
them both running at the same time. the idea was to take a certain set of
databases off the old server, (actaully moving one whole dbspace at a time),
and migrate them to the new server.
the procedure is as follows:
- there seems to be a problem with version 5.X dbexport writing the
<dbname.exp> directory on a file system that is remote mounted, or
maybe i'm just missing something. anyway, i have a big file system
on the old server that i dbexport all the databases to, and then
remote mount this on the new server for the imports. note that
this is on sunos...
- foreach db_name in (list of databases)
cd to temp space
mkdir db_name
chmod 777 db_name
cd db_name
dbexport db_name
if (status is ok)
dbschema -d db_name db_name_schema
grep grant db_name_schema > db_name_perms
rm db_name_schema echo "revoke connect from public" | isql db_name
echo "revoke resource from public" | isql db_name
echo finished load for db_name
else
echo load failed for db_name
/bin/rm -rf *.out
endif
end
- the effect of this is to unload each database in the list, and
then get a list of all permissions that are on the database, just
in case. then revoke all connect and resource permissions from
the database. this way, if someone has the wrong enviornment set,
and attempts to go to the old server, they won't be able to connect
to the database. note that this won't hold true for the owner of
the database, or dba, but it will take care of most cases.
- then go to the new server, and remote mount the file system that
the databases were unloaded to. note that you might only be able
to unload one or a few databases at a time, depending on the amount
of space that you have.
- then on the server:
foreach db_name in (list of databases)
cd to temp_space
get owner of db_name from previously created list of db owners
if (owner is not "")
cd db_name
su owner -c "source /usr/informix/.cshrc;
dbimport -d <dbspace> db_name -l" echo load is finished for db_name
/bin/rm -rf *.exp
else
echo load failed for db_name > db_no_loads
endif
end
- i decided that it was best to keep the original owners of the
databases. note that this script will have to run as root, as
it su's to anyone who owns a database. the file for the owners
was prepared from dumping the pages of the database tblspace from
the rootdbspace, and then extracting the database names and their
owners. i don't know if there is an easier way to do this.
- this should be it. the dbimport takes care of building all the
indexes and setting persmissions and such. the only thing that i
saw that wasn't done was i needed to go in and grant connect and
resource to databases that needed them.
foreach db_name in (list of databases)
echo "grant connect to public; grant resource to public" |
isql db_name
end
mickm
--PAA13559.828572404/tanger.etak.com--
----- End Included Message -----