- Restoring an RHN database from an RMAN backup
- **********************************************
- Matthew Booth <mbooth@redhat.com> 22/09/2006
- This document describes how to perform a complete restore of an embedded
- RHN Oracle database from the data gathered by the hot backup script. It is
- also possible to perform a partial restore from the same data, however
- that is outside the scope of this document.
- Preparation
- ***********
- The full restore requires that the Oracle software be installed, but
- that no data or configuration relating the the rhnsat database be in
- place. To achieve this:
- 1. Perform a normal satellite installation
- 2. Stop the satellite with:
- service rhn-satellite stop
- 3. Make certain the database is stopped. As the oracle user, run:
- export ORACLE_SID=rhnsat
- sqlplus "/ as sysdba"
- > shutdown abort;
- > quit;
- 3. Delete the following files:
- /opt/apps/oracle/config/9.2.0/spfilerhnsat.ora
- /rhnsat/admin/rhnsat/archive/*
- /rhnsat/data/rhnsat/*
- Restore
- *******
- With the database stopped and all its data and configuration files
- removed, the database can be fully recovered. The outline steps to
- achieve this will be:
- 1. Restore rman data from persistent storage
- 2. Start the database with no configuration
- 3. Recover the spfile (Oracle server parameter file) from the backup
- 4. Restart the database using the restored spfile
- 5. Restore the database control file
- 6. Restore the database data as it was at the time of the backup
- 7. Make the database consistent by performing a recovery.
- 8. Reset the database's redo logs
- 9. Create new temp space for the database
- Firstly, the rman data itself must be restored from persistent
- storage. It is important that this is recovered to the same directory
- it was originally created (ie /rhnsat/backup/data/) as this location is
- stored in the recovery data itself.
- The following achieves 2-8 above. Footnotes are marked inside square
- brackets (eg [2]), and should not be entered as commands.
- As the oracle user, do the following:
- export ORACLE_SID=rhnsat
- rman target / nocatalog
- >startup nomount; [1]
- >restore spfile from '/rhnsat/backup/data/<relevant file (see note)>'; [2]
- >shutdown immediate;
- >startup nomount;
- >restore controlfile from '/rhnsat/backup/data/<same file as above (see note)>'; [2]
- >alter database mount;
- >restore database;
- >recover database; [3]
- >alter database open resetlogs;
- >shutdown immediate; [4]
- [1]
- This will complain:
- startup failed: ORA-01078: failure in processing system parameters
- LRM-00109: could not open parameter file '/opt/apps/oracle/web/product/9.2.0/dbsat.ora'
- This can be ignored.
- [2]
- It's not easy to tell which file in /rhnsat/backup/data/ will contain
- the spfile and controlfile. Try them all in reverse date order (most
- recent first) until one works.
- [3]
- This will apply one or more logs, then give an error about a missing
- one. The error can be ignored as it related to a log which did not
- exist at the time of the backup.
- [4]
- The shutdown may give warnings which can be ignored.
- At this point the recovered database can be started by running the
- following as root:
- service rhn-database start
- Finally, new temp space must be added by running the following as root:
- sqlplus rhnsat/rhnsat@rhnsat
- > alter tablespace temp_tbs add tempfile '/rhnsat/data/rhnsat/temp_01.dbf' size 256M;
- Restoring other satellite configuration
- ***************************************
- Before restarting the satellite, the following must also be recovered
- from backup:
- /var/satellite
- /var/www/html/pub
- - Be sure to delete the existing contents of this directory first
- /root/ssl-build
- - Be sure to delete the existing contents of this directory first
- /etc/rhn/rhn.conf
- /etc/httpd/conf/ssl.csr/server.csr
- /etc/httpd/conf/ssl.crt/server.crt
- /etc/httpd/conf/ssl.key/server.key
- /etc/jabberd/server.pem
- Make sure the correct ssl cert is installed:
- rpm -e rhn-org-trusted-ssl-cert
- rpm -ivh /root/ssl-build/rhn-org-trusted-ssl-cert-1.0-1.noarch.rpm
- Start the satellite with the following command as root:
- service rhn-satellite start
- You will see a failure starting the database if it has already been
- started. This can be ignored.
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy.


