Beruflich Dokumente
Kultur Dokumente
Here we are doing backup for PROD databases which is stored in /u01/app/oracle/PROD.
So add a directory and change the location in next steps. (The location of the directory is
/u01/app/oracle/oradata/archivelogs)
SQL> shutdown
SQL> startup mount
SQL>alter database archivelog
STEP4: Run this query and check all are in ONLINE mode.
STEP 6: We need to create one directory to store all the backup files. Normally I will create this
directory in /home/oracle/backupfiles/PROD. Here I will add backupfiles/PROD.
SQL> SELECT 'ALTER TABLESPACE ' || TABLESPACE_NAME || ' BEGIN BACKUP; ' FROM
DBA_TABLESPACES WHERE TABLESPACE_NAME NOT LIKE '%TEMP%';
STEP 8: Copy and paste the result from the above query and run at sql prompt to put dbf in back up
mode.
STEP 9: Now we need to copy all the *.dbf files which are located in
/u01/app/oracle/oradata/PROD/*.dbf to /home/oracle/backups/PROD/
STEP 10: Copy and paste the result from the above query and run at sql prompt.
RECOVERY:
Scenario: When we lost all the .log files, .dbf files and .ctl files in the /u01/app/oracle/oradata/PROD/
directory.
STEP 1: Check this folder where we stored all of our backup files. /home/oracle/backups/PROD/
Cp prod_ctl.ctl /u01/app/oracle/oradata/PROD/
STEP 3: We need to change the file name entry in initPROD.ora file which is located in
/u01/app/oracle/PROD/dbs/initPROD.ora.
STEP 4: Here we have entries for control files. As we lost all these control files and we have only one
control file with the name prod_ctl.ctl, we need to change the entries here. We just need to keep only
one entry in this file.
[ ]$. Oraenv
[ ]$ PROD
[ ]$ Sqlplus ‘/ as sydba”
SQL> startup nomount (not sure about this step, may be just startup or startup mount)
This command will reset the logs. Here it will ask us to take the file with options “Manually”,
“AUTO” and “Cancel”
Give auto.
Then again it will ask another sequence file. May be it won’t exists. Just give cancel at that time.
STEP 9: Go and check for /u01/app/oracle/oradata/PROD/ for the log files, dbf files. You need to make
sure all the files are recovered.