select 'dbv file='||name||' blocksize='||block_size||' end='||
(bytes/block_size)||' logfile='||
substr (name, instr (name, '/', -1, 1) + 1)||'.'||file#||'.log'
from v$datafile;
In the case of Windows the file separator will be forward slash '\'
Hence we need to replace the backward slash '/' with the forward slash in
the above script.
-- For Windows the following modification is required
select 'dbv file=' || name || ' blocksize='|| block_size ||
' logfile=' || substr(name, instr(name, '\', -1, 1) +1) ||
'.' || file# || '.log' from v$datafile
/
If ASM storage being used, we need to specify USERID to get authenticated on ASM Instance.
You can use following query if you are running in ASM storage.
select 'dbv file=' || name || ' blocksize='|| block_size || ' USERID=sys/&SYS_PASSWORD logfile='
||
substr(name, instr(name, '/', -1, 1) +1) ||
'.' || file# || '.log' from v$datafile
/
CAUTION
SAMPLE CODE
Now you need to run the dbv commands for all the datafiles, which is spooled to dbvchk.sh.
Please proof read this script before executing the same.
$ cd /tmp/dbvlogs
$ chmod 755 dbvchk.sh
$ ./dbvchk.sh
In case of Windows, just run the above file. It is more appropriate to have a .bat or .cmd extension on windows.
If you have a Service Request logged, then compress the log files, upload the above compressed file to metalink.
$ tar cvf dbvlogs.tar *.log
$ compress dbvlogs.tar.Z
In case of a Windows operating system, simply use the a zip utility (7-Zip or Winzip) to compress the files.
SAMPLE OUTPUT
As per the above script, the dbv logs will be generated under /tmp/dbvlogs directory.
The files will have the name as follows.
For system datafile with the name /tmp/system.dbf and file# 1 the logfile will have the name like.
/tmp/dbvlogs/system.dbf.1.log
评论