windows 清空oracle的监听日志listener.log

时间:2021-08-23 08:17:24

 最近接手一个windows 下的oracle ,发现监听日志已经到了1.5G。

以前都是在aix,linux上干活 ,突然倒了windows反而不太习惯。

下面记录一下清理过程:

 

D:\oracle\product\102\NETWORK\log>echo >listener.log
The process cannot access the file because it is being used by another process.


D:\oracle\product\102\NETWORK\log>copy /y sqlnet.log listener.log
        1 file(s) copied.
D:\oracle\product\102\NETWORK\log>dir
 Volume in drive C is System
 Volume Serial Number is B8E0-1DBE

 Directory of D:\oracle\product\102\NETWORK\log

09/20/2011  02:42 PM    <DIR>          .
09/20/2011  02:42 PM    <DIR>          ..
09/20/2011  03:10 PM               541 listener.log
09/20/2011  03:09 PM                13 sqlnet.log
               2 File(s)            554 bytes
               2 Dir(s)  13,273,034,240 bytes free


D:\Liangwei>help copy
Copies one or more files to another location.

COPY [/D] [/V] [/N] [/Y | /-Y] [/Z] [/A | /B ] source [/A | /B]
     [+ source [/A | /B] [+ ...]] [destination [/A | /B]]

  source       Specifies the file or files to be copied.
  /A           Indicates an ASCII text file.
  /B           Indicates a binary file.
  /D           Allow the destination file to be created decrypted
  destination  Specifies the directory and/or filename for the new file(s).
  /V           Verifies that new files are written correctly.
  /N           Uses short filename, if available, when copying a file with a
               non-8dot3 name.
  /Y           Suppresses prompting to confirm you want to overwrite an
               existing destination file.  覆盖文件不提示
  /-Y          Causes prompting to confirm you want to overwrite an
               existing destination file.  覆盖文件提示
  /Z           Copies networked files in restartable mode.

The switch /Y may be preset in the COPYCMD environment variable.
This may be overridden with /-Y on the command line.  Default is
to prompt on overwrites unless COPY command is being executed from
within a batch script.

To append files, specify a single file for destination, but multiple files
for source (using wildcards or file1+file2+file3 format).