16 Ağustos 2010 Pazartesi

Listener.log Dosyası ve Boyutları

Selamlar,

Oracle'da dikkat edilmesi gereken bir konu da listener.log dosyasının boyutları. Belli bir zaman sonra bu dosya korkunç boyutlara ulaşabiliyor ve üzerine yazılamadığı için silmek, yedeklemek, yani kurtulmak gerekebilir.

Siz listener.log dosyasından bir şekilde kurtulabilirsiniz yalnız siz bu dosyası sildiğiniz veya yedeklediğiniz zaman, yenisini yaratacaksınız. Bu yeni yarattığınız listener.log dosyasını eğer Oracle'a tanıtmazsanız Oracle bu yeni dosyaya yazmaya başlamayacaktır.

Aşağıdaki çıktıları kontrol ederek ne demek istediğimi daha detaylı olarak anlayabilirsiniz;

$ lsnrctl show log_file;

LSNRCTL for HPUX: Version 10.2.0.4.0 - Production on 16-AUG-2010 15:39:28

Copyright (c) 1991, 2007, Oracle. All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=optdb)(PORT=1521)))
LISTENER parameter "log_file" set to listener.log
The command completed successfully

$ lsnrctl show log_file;

LSNRCTL for HPUX: Version 10.2.0.4.0 - Production on 16-AUG-2010 15:39:28

Copyright (c) 1991, 2007, Oracle. All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=optdb)(PORT=1521)))
LISTENER parameter "log_file" set to listener.log
The command completed successfully
$ lsnrctl show log_directory;

LSNRCTL for HPUX: Version 10.2.0.4.0 - Production on 16-AUG-2010 15:39:52

Copyright (c) 1991, 2007, Oracle. All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=optdb)(PORT=1521)))
LISTENER parameter "log_directory" set to /opt/oracle/product/10.2.0/db_1/network/log/
The command completed successfully

--> Listener'ın log dosyasının adı listener.log ve dizini /opt/oracle/product/10.2.0/db_1/network/log/
--> Şimdi listener.log dosyasından kurtulalım;

$ rm /opt/oracle/product/10.2.0/db_1/network/log/listener.log

--> Yeni bir listener.log dosyası yaratalım;

$ cat /opt/oracle/product/10.2.0/db_1/network/log/listener.log
$ --> Bu dosya şimdilik boş.

$ sqlplus sys/password@opttest as sysdba

SQL*Plus: Release 10.2.0.4.0 - Production on Mon Aug 16 15:41:23 2010

Copyright (c) 1982, 2007, Oracle. All Rights Reserved.


Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
$ cat /opt/oracle/product/10.2.0/db_1/network/log/listener.log
$ --> Bağlantı sağladık ama hala boş!

--> Yeni yarattığımız log dosyasını tanımlamamız gerekiyor;

$ lsnrctl set log_file /opt/oracle/product/10.2.0/db_1/network/log/listener.log

LSNRCTL for HPUX: Version 10.2.0.4.0 - Production on 16-AUG-2010 15:41:52

Copyright (c) 1991, 2007, Oracle. All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=optdb)(PORT=1521)))
LISTENER parameter "log_file" set to /opt/oracle/product/10.2.0/db_1/network/log/listener.log
The command completed successfully

LSNRCTL> set log_status off;
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=optdb)(PORT=1521)))
LISTENER parameter "log_status" set to OFF
The command completed successfully
LSNRCTL> set log_status on;
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=optdb)(PORT=1521)))
LISTENER parameter "log_status" set to ON
The command completed successfully
LSNRCTL> exit
$ ls -lrt
total 89736
-rw-r----- 1 oracle oinstall 1480 Mar 5 2009 opttest.log
-rw-r----- 1 oracle oinstall 45932608 May 28 00:34 sqlnet.log
-rw-r----- 1 oracle oinstall 38 Aug 16 15:44 listener.log
$ cat listener.log
16-AUG-2010 15:44:31 * log_status * 0

$ sqlplus aircom/password@opttest

SQL*Plus: Release 10.2.0.4.0 - Production on Mon Aug 16 15:44:52 2010

Copyright (c) 1982, 2007, Oracle. All Rights Reserved.


Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
$ ls -lrt
total 89736
-rw-r----- 1 oracle oinstall 1480 Mar 5 2009 opttest.log
-rw-r----- 1 oracle oinstall 45932608 May 28 00:34 sqlnet.log
-rw-r----- 1 oracle oinstall 255 Aug 16 15:44 listener.log
$ cat listener.log
16-AUG-2010 15:44:31 * log_status * 0
16-AUG-2010 15:44:52 * (CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=opttest)(CID=(PROGRAM=sqlplus@optdb)(HOST=optdb)(USER=oracle))) * (ADDRESS=(PROTOCOL=tcp)(HOST=10.6.105.131)(PORT=49787)) * establish * opttest * 0
$
İyi çalışmalar.

Ogan

Hiç yorum yok:

Takip et: @oganozdogan