REDOLOG AND UNDO MANAGEMENT



REDOLOG FILESS:
----------------------






--> Recovery types : 


            --> media recovery (uses archived log files and backup files)
             --> crash recovery (uses online redolog files)






 --> for instruct the check point


       SQL> alter system checkpoint;




 --> for switching logfiles
  
       SQL> alter system switch logfile;




 --> redolog files have the follwing status 
       
        --> unused 


        --> current(presently working redlog file)


        --> active (the control jump to next redolog file and it is archived)


        --> inactive 




 --> for adding redolog files
     
       SQL> alter database add logfile group 4            
               'G:\apps\krish\oradata\surendra\redo4a.log'                                                                  
               'G:\apps\krish\oradata\surendra\redo1b.log') size  51200k;






 --> add member to redolog group


       SQL> alter database add log member     
               'G:\apps\krish\oradata\surendra\redo01b.log' to group1; 






 --> removing redolog group

       SQL> alter database drop logfile group 4;




 --> removing  member in redolog group


       SQL> ALTER DATABASE DROP LOGFILE MEMBER        
                'G:\APP\KRISH\ORADATA\SURENDRA\REDO01B.LOG';






---> change the database noarchivelog to archivelog


      SQL> shutdown
      SQL> startup mount
      SQL> alter database archivelog/noarchivelog;


      SQL>  archive loglist;






 --> dictionary views 
  
         -->dba_
         --> v$redolog
         --> v$log




 UNDO MANAGEMENT:
 -------------------------





 --> CREATING UNDO TABLESPACE WITH RETENTION NO GUARNATEE

    SQL> CREATE SMALLFILE UNDO TABLESPACE "UNDOTBS2" DATAFILE  

             'F:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\undo02.dbf'
             SIZE     100M AUTOEXTEND ON NEXT 64K MAXSIZE 200M   

             RETENTION NOGUARANTEE
 
 --> CREATING UNDO TABLESPACE WITH RETENTION  GUARNATEE

    SQL> CREATE SMALLFILE UNDO TABLESPACE "UNDOTBS2" DATAFILE   

             'F:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\undo02.dbf'
              SIZE     100M AUTOEXTEND ON NEXT 64K MAXSIZE   

             200M   RETENTION GUARANTEE





 --> FOR SWITCHING THE UNDO TBALESPACE
   
   SQL> ALTER SYSTEM SET UNDO_TABLESPACE=UNDOTBS2;

 --> FOR RETENTION GUARANTEE

   SQL> ALTER TABLESPACE UNDOTBS1 RETENTION GUARANTEE;

 --> FOR RETENTION NOGUARANTEE

   SQL> ALTER TABLESPACE UNDOTBS1 RETENTION NOGUARANTEE;

 --> FOR SETTING RETENTION PERIOD
                                                            
   SQL> ALTER SYATEM SET UNDO_RETENTION=1500;(DEFAULT 900)



         

No comments:

Post a Comment