Tuesday, January 13, 2009

Turn on Listener Logging

Enable loggin in listener:
In order to know, which listener commands were executing, one should enable the logging by the following:

LSNRCTL> set log_directory …/log
LSNRCTL> set log_file Listener_.log
LSNRCTL> set log_status on LSNRCTL> save_config

Set the Listener Password :
Setting Listener Password is strongly recommended in order to prevent the distinct attacks. There are two ways to do the same. Either by setting PASSWORDS_listenername parameter in listener.ora file (Password will be in a Clear Text – Not Recommended)Or By using lsnrctl set password command (Highly Recommended).

Sunday, January 11, 2009

BLOCK RECOVER BY RMAN

Recover corrupt blocks in three datafiles
------------------------------------------

BLOCKRECOVER DATAFILE 2 BLOCK 12, 13;

BLOCKRECOVER DATAFILE 2 BLOCK 12,13 DATAFILE 3 BLOCK 5,98,99 DATAFILE 4 BLOCK 19;

Limit block recovery by restoration type

RUN {
BLOCKRECOVER DATAFILE 3 BLOCK 2,3,4,5 TABLESPACE sales DBA 4194405, 4194409, 4194412
FROM DATAFILECOPY;
}

Limit block recovery by backup tag
-----------------------------------

BLOCKRECOVER TABLESPACE SYSTEM DBA 4194404, 4194405 FROM TAG "weekly_backup";

Limit block recovery by time
-----------------------------
BLOCKRECOVER TABLESPACE SYSTEM DBA 4194404, 4194405 RESTORE UNTIL TIME 'SYSDATE-2';


Repair all corrupt blocks in the database
-----------------------------------------
BACKUP VALIDATE DATABASE;BLOCKRECOVER CORRUPTION LIST;

This command will find, list and then recover all corrupted blocks in the database using the gv$database_block_corruption view.