Operating System - OpenVMS
1753664 Members
5873 Online
108798 Solutions
New Discussion юеВ

How to empty a log file in OpenVMS

 
SOLVED
Go to solution
GS Voz y RI
Advisor

How to empty a log file in OpenVMS

How can we empty a log file? We have several big log files and need to free space on disk.
7 REPLIES 7
Volker Halle
Honored Contributor

Re: How to empty a log file in OpenVMS

Hi,

this depends on how your application uses that logfile.

You could create a new version of the file, then restart your application (if it keeps the file open all the time and appends to an existing logfile).

Volker.
Uwe Zessin
Honored Contributor

Re: How to empty a log file in OpenVMS

Some system log files:

For the accounting file it is:
$ SET ACCOUNTING /NEW_FILE
this opens a new version.

For the operator log it is (on a trminal):
$ REPLY /ENABLE
$ REPLY /LOG
$ REPLY /DISABLE
again, a new version is created

For the error log:
$ SET DEFAULT SYS$ERRORLOG:
$ RENAME ERRLOG.SYS ERRLOG.OLD
a new file is automatically created

I don't have a VMS system handy at the moment, someone else will come up with the command to roll over the AUDIT log...
.
Volker Halle
Honored Contributor

Re: How to empty a log file in OpenVMS

The command to create a new AUDIT server logfile is:

$ SET AUDIT/JOURNAL=SECURITY/THRESHOLD=WARN=200
(to reset the space monitoring threshold and create a new smaller file)

$ SET AUDIT/SERVER=NEW_LOG

Volker.
GS Voz y RI
Advisor

Re: How to empty a log file in OpenVMS

One of the files we want to empty is sqlnet.log. What we need is to execute something like this (UNIX):

cp /dev/null sqlnet.log

but in VMS
Volker Halle
Honored Contributor

Re: How to empty a log file in OpenVMS

How about

$ CREATE sqlnet.log


Volker.
Volker Halle
Honored Contributor
Solution

Re: How to empty a log file in OpenVMS

or COPY NL: sqlnet.log

But it still depends on the application to re-open the file and continue to write on the new (empty) logfile.

Then you can PURGE sqlnet.log

Volker.
GS Voz y RI
Advisor

Re: How to empty a log file in OpenVMS

copy nl: seems to work as expected