daily pastebin goal
78%
SHARE
TWEET

RHN RESTORE.txt

trishoar Mar 4th, 2013 13 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Restoring an RHN database from an RMAN backup
  2. **********************************************
  3. Matthew Booth <mbooth@redhat.com> 22/09/2006
  4.  
  5. This document describes how to perform a complete restore of an embedded
  6. RHN Oracle database from the data gathered by the hot backup script. It is
  7. also possible to perform a partial restore from the same data, however
  8. that is outside the scope of this document.
  9.  
  10. Preparation
  11. ***********
  12. The full restore requires that the Oracle software be installed, but
  13. that no data or configuration relating the the rhnsat database be in
  14. place. To achieve this:
  15.  
  16.  1. Perform a normal satellite installation
  17.  
  18.  2. Stop the satellite with:
  19.      service rhn-satellite stop
  20.  
  21.  3. Make certain the database is stopped. As the oracle user, run:
  22.      export ORACLE_SID=rhnsat
  23.      sqlplus "/ as sysdba"
  24.      > shutdown abort;
  25.      > quit;
  26.  
  27.  3. Delete the following files:
  28.      /opt/apps/oracle/config/9.2.0/spfilerhnsat.ora
  29.      /rhnsat/admin/rhnsat/archive/*
  30.      /rhnsat/data/rhnsat/*
  31.  
  32. Restore
  33. *******
  34. With the database stopped and all its data and configuration files
  35. removed, the database can be fully recovered. The outline steps to
  36. achieve this will be:
  37.  
  38.  1. Restore rman data from persistent storage
  39.  2. Start the database with no configuration
  40.  3. Recover the spfile (Oracle server parameter file) from the backup
  41.  4. Restart the database using the restored spfile
  42.  5. Restore the database control file
  43.  6. Restore the database data as it was at the time of the backup
  44.  7. Make the database consistent by performing a recovery.
  45.  8. Reset the database's redo logs
  46.  9. Create new temp space for the database
  47.  
  48. Firstly, the rman data itself must be restored from persistent
  49. storage. It is important that this is recovered to the same directory
  50. it was originally created (ie /rhnsat/backup/data/) as this location is
  51. stored in the recovery data itself.
  52.  
  53. The following achieves 2-8 above. Footnotes are marked inside square
  54. brackets (eg [2]), and should not be entered as commands.
  55.  
  56. As the oracle user, do the following:
  57.  export ORACLE_SID=rhnsat
  58.  
  59.  rman target / nocatalog
  60.  >startup nomount; [1]
  61.  >restore spfile from '/rhnsat/backup/data/<relevant file (see note)>'; [2]
  62.  >shutdown immediate;
  63.  >startup nomount;
  64.  >restore controlfile from '/rhnsat/backup/data/<same file as above (see note)>'; [2]
  65.  >alter database mount;
  66.  >restore database;
  67.  >recover database; [3]
  68.  >alter database open resetlogs;
  69.  >shutdown immediate; [4]
  70.  
  71. [1]
  72.  This will complain:
  73.   startup failed: ORA-01078: failure in processing system parameters
  74.   LRM-00109: could not open parameter file '/opt/apps/oracle/web/product/9.2.0/dbsat.ora'
  75.  This can be ignored.
  76.  
  77. [2]
  78.  It's not easy to tell which file in /rhnsat/backup/data/ will contain
  79.  the spfile and controlfile. Try them all in reverse date order (most
  80.  recent first) until one works.
  81.  
  82. [3]
  83.  This will apply one or more logs, then give an error about a missing
  84.  one. The error can be ignored as it related to a log which did not
  85.  exist at the time of the backup.
  86.  
  87. [4]
  88.  The shutdown may give warnings which can be ignored.
  89.  
  90. At this point the recovered database can be started by running the
  91. following as root:
  92.  service rhn-database start
  93.  
  94. Finally, new temp space must be added by running the following as root:
  95.  sqlplus rhnsat/rhnsat@rhnsat
  96.  > alter tablespace temp_tbs add tempfile '/rhnsat/data/rhnsat/temp_01.dbf' size 256M;
  97.  
  98. Restoring other satellite configuration
  99. ***************************************
  100. Before restarting the satellite, the following must also be recovered
  101. from backup:
  102.  
  103.  /var/satellite
  104.  /var/www/html/pub
  105.    - Be sure to delete the existing contents of this directory first
  106.  /root/ssl-build
  107.    - Be sure to delete the existing contents of this directory first
  108.  /etc/rhn/rhn.conf
  109.  /etc/httpd/conf/ssl.csr/server.csr
  110.  /etc/httpd/conf/ssl.crt/server.crt
  111.  /etc/httpd/conf/ssl.key/server.key
  112.  /etc/jabberd/server.pem
  113.  
  114. Make sure the correct ssl cert is installed:
  115. rpm -e rhn-org-trusted-ssl-cert
  116. rpm -ivh /root/ssl-build/rhn-org-trusted-ssl-cert-1.0-1.noarch.rpm
  117.  
  118. Start the satellite with the following command as root:
  119.  
  120.  service rhn-satellite start
  121.  
  122. You will see a failure starting the database if it has already been
  123. started. This can be ignored.
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. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top