alter database add logfile size 1e7;

I am in the processing in adding logfiles to a 10gR2 database.

SQL> alter database add logfile group 10 size 1e7;

Database altered.
$ ls -l
-rw-r-----   1 oracle     10000896 Nov  1 15:00
    o1_mf_10_3lmq05ld_.log

The file size is 10,000,896 bytes.

What about this :

SQL> alter database drop logfile group 10;

Database altered.
SQL> alter database add logfile size 1e;
alter database add logfile size 1e
*
ERROR at line 1:
ORA-00741: logfile size of (2251799813685248) blocks 
exceeds maximum logfile size

No way! Oracle does not want me to add a logfile of 1 Exabyte !

Remember the logfile blocks are OS blocks of 512 bytes. Not Oracle blocks.

Ok, let’s try something else

SQL> alter database add logfile size 1p;
alter database add logfile size 1p
*
ERROR at line 1:
ORA-00741: logfile size of (2199023255552) blocks 
exceeds maximum logfile size

No, one Petabyte is not a realistic size for a log file.

I have one more try, but unfortunately it works :evil:

SQL> alter database add logfile size 1t;

...

It just takes ages…

$ ls -l
-rw-r-----   1 oracle   dba      1099511628288 Nov  1 14:49
    o1_mf_5_3lmpb6w6_.log
$ du -g o1_mf_5_3lmpb6w6_.log
6.09    o1_mf_5_3lmpb6w6_.log
$ df -gt .
Filesystem    GB blocks      Used      Free %Used Mounted on
/dev/u02_lv      140.00     19.32    120.68   14% /u02

The ls shows the file size has been set to 1T and 6 Gigabytes have been allocated yet. Since I do not want to fill my filesystem, I just shutdown-abort my instance and remove that file…

2 thoughts on “alter database add logfile size 1e7;”

  1. Laurent, please bear in mind that the blocksize of the oracle logfiles is stated in the manual as ‘the O/S blocksize’, but in fact it’s a size that has been defined by oracle itself (presumably to be in line with operating system sizes)
    It’s 512 bytes on Linux (32 bits) and windows (32 bits), but if my memory serves me well, it’s different on HPUX and Tru64.

Leave a Reply

Your email address will not be published.


*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>