Saturday, December 15, 2012

LGWR Generates Trace file "Warning: Log Write Time xxxms, Size xxxxkb"

Found tracefile omr_lgwr_841.tr, and below error after patched database to 10.2.0.4


/u00/app/oracle/admin/omr/bdump/omr_lgwr_841.trc
Oracle Database 10g Release 10.2.0.4.0 - Production
ORACLE_HOME = /u00/app/oracle/product/10.2.0
System name:    SunOS
Node name:      etravel2k
Release:        5.10
Version:        Generic_147441-01
Machine:        i86pc
Instance name: omr
Redo thread mounted by this instance: 1
Oracle process number: 8
Unix process pid: 841, image: oracle@etravel2k (LGWR)

*** 2012-11-23 09:52:50.704
*** SERVICE NAME:() 2012-11-23 09:52:50.703
*** SESSION ID:(275.1) 2012-11-23 09:52:50.703
tkcrrsarc: (WARN) Failed to find ARCH for message (message:0x1)
tkcrrpa: (WARN) Failed initial attempt to send ARCH message (message:0x1)
Maximum redo generation record size = 156160 bytes
Maximum redo generation change vector size = 150676 bytes
tkcrrsarc: (WARN) Failed to find ARCH for message (message:0x10)
tkcrrpa: (WARN) Failed initial attempt to send ARCH message (message:0x10)
*** 2012-11-23 09:52:58.396
Warning: log write time 500ms, size 682KB
*** 2012-11-23 09:52:58.993
Warning: log write time 590ms, size 887KB
*** 2012-11-23 09:52:59.655
Warning: log write time 670ms, size 952KB
*** 2012-11-23 09:53:00.285
Warning: log write time 620ms, size 1087KB
*** 2012-11-23 09:53:00.918
Warning: log write time 640ms, size 960KB
*** 2012-11-23 09:53:01.594
Warning: log write time 670ms, size 1087KB
*** 2012-11-23 09:53:02.196
Warning: log write time 610ms, size 960KB
*** 2012-11-23 09:53:02.908
Warning: log write time 710ms, size 992KB
*** 2012-11-23 09:53:03.562
Warning: log write time 650ms, size 1055KB

when found out this error on metalink(601316.1), they tell this problem can occur on any platform, after upgrading to 10.2.0.4

And This warning message will be generated only if the log write time is more than 500 ms.

Anyway this problem tell us and we should check the disk is slow or not... and OS problem.

If everything OK... So, we can ignore these messages.

Monday, December 3, 2012

Enabling Flashback Database in Oracle:


Enabling Flashback Database in Oracle:

SQL> select flashback_on from v$database;

FLASHBACK_ON
------------------
NO



SQL> SHUTDOWN IMMEDIATE;
SQL> STARTUP MOUNT;



SQL> ALTER SYSTEM SET DB_FLASHBACK_RETENTION_TARGET=4320; # 3 days
SQL> ALTER SYSTEM SET DB_RECOVERY_FILE_DEST_SIZE=10737418240; # 10G
SQL> ALTER SYSTEM SET DB_RECOVERY_FILE_DEST='/u01/app/oracle/flash_recovery_area';

SQL> show parameter DB_RECOVERY_FILE_DEST

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
db_recovery_file_dest                string      /u01/app/oracle/flash_recovery_area
db_recovery_file_dest_size           big integer 10G


SQL> ALTER DATABASE FLASHBACK ON;
SQL> ALTER DATABASE OPEN;

SQL> SELECT flashback_on FROM v$database;

FLASHBACK_ON
-----------------
YES

In order to disable flash recovery area issue,
SQL> ALTER SYSTEM SET DB_RECOVERY_FILE_DEST='' SCOPE=BOTH SID='*';
System altered


To check the estimated flashback size :
SQL> SELECT ROUND(ESTIMATED_FLASHBACK_SIZE/1024/1024/1024) FROM V$FLASHBACK_DATABASE_LOG;

To create a guaranteed restore point :
SQL> create restore point RESTORE_POINT guarantee flashback database;
SQL> select NAME, SCN, TIME from V$RESTORE_POINT;


To flashback the database to specific time :
SQL>  flashback database to timestamp to_timestamp('dd/mm/ccyy HH24:MI:SS', 'DD/MM/YYYY HH24:MI:SS');

To drop a restore point
SQL> select NAME, SCN, TIME from V$RESTORE_POINT;
SQL> drop restore point RESTORE_POINT;