Re: Trying to rename and copy a database..... WILL THIS WORK?
Posted in 1997
In article <5g9nen$kve@ncar.ucar.edu>, Eddie Roberts
<nws@stout.atd.ucar.edu> writes
>
>A user has asked me to restore a database from tape back onto
>an Online 7.2 server using a different database name. The user needs
>to keep the current database intact for operational use.
>
>Questions:
> I. Will the steps outlined below accomplish this task?
> II. Is there any easier method I should consider using?
>
>BTW - I'm running OnLine DS 7.20 UC2 on a HP J200 using HP-UX 10.20
>Steps:
>
>1. onmode -uy # place OnLine in quiescent mode
>2. ontape -s -L 0 # create level 0 archive just in case
>3. onmode -m # place OnLine back on-line
>4. dbexport database1 # run dbexport and place output of operational
> # database in database1.exp directory
drop database database1 next to free all the chunks in the dbspace.
The do oncheck -pe and make sure that nothing is using that dbspace.
There should be
a) reserved pages, chunk free list pages and a few tblspace
tblspace pages used in the first chunk of the dbspace. 53(?) pages
used in total for the first chunk of the dbspace.
b) two reserved pages, one chunk free list page (3 pages in total)
used in any other chunk in the dbspace.
[Online Admin Guide Volume 2 Version 7.1 Pages 43-15 and 43-16.]
Nothing else should be in each chunk for the dbspace i.e. no
tables/logs in that dbspace before the restore.
>5. ontape -r D dbspace1 # restore original data using *OLDER* backup
>tape
>6. dbexport -o db-tmp database1 # run dbexport again.. this time exporting older
> # data into a different location.
>7. dbimport database1 -d dbspce2 -l # restore original database
>
># Changing database name as shown below
>8. mv db-tmp/database1.exp db-tmp/database2.exp
>9. mv db-tmp/database2.exp/database1.sql db-tmp/database2.exp/database2.sql
>
Edit db-tmp/database2.exp/database2.sql and change the
"create database database1" at the start to
"create database database2".
>10. dbimport -i db-tmp database2 -d dspace2 -l # restore original database with
> # new name of database2
>
>
>I think the result of executing these steps will be:
> 1. The original database is intact.... that is it in the same "state"
> as it was before this "effort" was started.
Should be as it is in a different dbspace from the one which is
restored.
> 2. The old database is now online under the name of database2
>
Correct.
>Thanks in advance for any comments and/or suggestions,
Also
1. Take a full backup of UNIX first as well
2. Create filestore repair tapes (emergency boot disks/tapes) just
in case sometime goes horribly wrong and the machine won't boot
afterwards.
Standard procedure really.
PS I would not guarantee this will work and I doubt Informix would as
well. Have you considered creating a separate instance of Online
using cooked chunks (i.e. UNIX files) and restoring to that.
Use an 2Gb filesystem and a 2Gb rootdbs and restore into that...
>Eddie Roberts
--
David Williams