Sunday, April 10, 2011

Problem- ORA-01555 snapshot too old error

Impact: It affects read consistency of oracle.
Solution:
The ORA-01555 snapshot too old error can be addressed by several remedies:
  1.  Re-schedule long-running queries when the system has less DML load.
  2. Increasing size of rollback segments.  The ORA-01555 snapshot too old also relates to your setting for automatic undo retention
  3. Don't fetch between commits.

Problem:Restoring the Server Parameter File (SPFILE) from Backup

Impact:When an Oracle Instance is started, the characteristics of the Instance are established by parameters specified within the initialization parameter file.so if spfile is missing instance cannot be started.
Solution:
If you have configured control file autobackups, the SPFILE is backed up with the control file whenever an autobackup is taken.
If you want to restore the SPFILE from the autobackup, you must first set the DBID for your database, and then use the RESTORE SPFILE FROM AUTOBACKUP command. The procedure is similar to restoring the control file from autobackup. You must first set the DBID for your database, and then use the RESTORE CONTROLFILE FROM AUTOBACKUP command:
RMAN> SET DBID 320066378;
RMAN> RUN {
    SET CONTROLFILE AUTOBACKUP FORMAT 
          FOR DEVICE TYPE DISK TO 'autobackup_format';
    RESTORE SPFILE FROM AUTOBACKUP;
    }

Problem:Restore of the Control File from Control File Autobackup

Impact:control file is lost or damage and and database cannot be started.

Solution:
If we dont have recovery catalog and want to restore the control file from autobackup, the database must be in a NOMOUNT state. You must first set the DBID for your database, and then use the RESTORE CONTROLFILE FROM AUTOBACKUP command:
RMAN> SET DBID 320066378;
RMAN> RUN {
    SET CONTROLFILE AUTOBACKUP FORMAT 
          FOR DEVICE TYPE DISK TO 'autobackup_format';
    RESTORE CONTROLFILE FROM AUTOBACKUP;
    }

Friday, April 8, 2011

Problem:Recovering from a lost tempfile

Impact: It can affect certain operations which use data in the temp files.
Solution:Restart the database. The database starts and if the original disk directory location is available, Oracle recreates all missing tempfiles.
If the temp datafiles are nopt recovered then:
recreate the temp files as shown:
ALTER TABLESPACE <tablespace_name> ADD TEMPFILE Maxsize unlimited;
 


Problem:ORA-01173:Data dictionary indicates missing data file from system tablespace

Impact:datafiles are missing in system tablespace .
Solution:
 Try to recover the database from a more recent control file or
recreate the control file, ensuring all datafiles are included for the system tablespace in the command line.

Problem:How to drop tablespace if datafile is missing

Impact: data files are missing and you cannot delete tablespace

Solution: Follow these commands
(1)startup mount
(2)alter database datafile '/path/to/filename' offline drop;
(3)alter database open;
(4)drop tablespace tbsp_name including contents cascade constraints;

Problem:Index is lost or damage

Impact: Lost or damaged index affects the database performance,queries that use indexes run slow.

Solution:
Drop the damaged index :
DROP INDEX [schema.]index [FORCE]
Recreate index:  example:
CREATE INDEX index_name ON table_name(column_name)
      TABLESPACE tablespace_name;