Re: Trying to rename and copy a database..... WILL THIS WORK?
Posted in 1997
Eddie Roberts wrote:
>
> 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
> 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
>
> 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.
> 2. The old database is now online under the name of database2
>
> Thanks in advance for any comments and/or suggestions,
> Eddie Roberts
You don't need to dbexport the database twice unless you're doing it to
play it safe. Before doing the dbimport, the first line of the dbexport
specifies the database, this has to be changed.