Tag: log

How to extract information from listener.log?

The listener.log contains useful information for example hosts that connect to a database, frequency of connections, remote OS User which can be used in cases to determine when an instance is being moved to another server to identify the impact of the change. So using a script the contents can be parsed, the example below … Continue reading How to extract information from listener.log?

How to add or drop online-redo logs?

Below are the steps on how to add a new online redo-group. It could be of the same size as other groups or different size. 1) List log groups, their archive status, activity status and size SQL> SELECT GROUP#, ARCHIVED, STATUS, BYTES FROM V$LOG; GROUP# ARC STATUS BYTES ---------- --- ---------------- ----------- 1 NO ACTIVE … Continue reading How to add or drop online-redo logs?

How to find/modify SQLServer Agent logfile location?

To get the location of SQLServer Agent log file, the log file is called SQLAGENT.out DECLARE @oem_errorlog nvarchar(255) EXECUTE master.dbo.xp_instance_regread N'HKEY_LOCAL_MACHINE', N'SOFTWARE\Microsoft\MSSQLServer\SQLServerAgent', N'ErrorLogFile', @oem_errorlog OUTPUT, N'no_output' PRINT @oem_errorlog Sample Output: C:\Program Files (x86)\Microsoft SQL Server\MSSQL.1\MSSQL\LOG\SQLAGENT.OUT To modify location and name of SQLServer Agent logfile USE [msdb] GO EXEC msdb.dbo.sp_set_sqlagent_properties @errorlog_file=N'C:\temp\SQLAGENT.OUT' GO To recycle SQLServer Agent … Continue reading How to find/modify SQLServer Agent logfile location?

How to write a message to the alert log for testing

If you need to test you monitoring solution, this can be handy to directly write to the archive log. execute sys.dbms_system.ksdwrt(2,to_char(sysdate)|| ' 99 '); execute sys.dbms_system.ksdwrt(2,('ORA-07445: Alexs OEM Monitoring Test'));

How to re-establish logging if the listener.log isn’t logging without restarting listener?

For some reason if the listener.log was renamed (mv) or removed and listener will stop logging information to the logfile, one way to fix this issue is to restart the listener but it would require taking an outage. If one can't restart the listener you can work around this issue by turning off log and … Continue reading How to re-establish logging if the listener.log isn’t logging without restarting listener?

How full is the current redo log file?

SQL> SELECT le.leseq "Current log sequence No", 100*cp.cpodr_bno/le.lesiz "Percent Full", cp.cpodr_bno "Current Block No", le.lesiz "Size of Log in Blocks" FROM x$kcccp cp, x$kccle le WHERE le.leseq =CP.cpodr_seq AND bitand(le.leflg,24) = 8; Current log sequence No Percent Full Current Block No Size of Log in Blocks ----------------------- ------------ ---------------- --------------------- 13 29.0625 29760 102400

Archive log history by the hour

-- Print # of archive logs for yesterday by the hour -- can be used to determine to schedule archive logs backups, to view number of times log switches occurs set linesize 200 set trimspool on set feedback off Column 00 format 999 Column 01 format 999 Column 02 format 999 Column 03 format 999 … Continue reading Archive log history by the hour