Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Datafile verify script

Re: Datafile verify script

From: Thomas Kyte <tkyte_at_us.oracle.com>
Date: Tue, 23 Feb 1999 21:20:22 GMT
Message-ID: <36d61b72.9097371@192.86.155.100>


A copy of this was sent to jdanton1_at_yahoo.com (if that email address didn't require changing) On Tue, 23 Feb 1999 20:32:36 GMT, you wrote:

>To all:
>
>I run the following script to very datafile status:
>
>select 'dbv file='||file_name, 'logfile='||tablespace_name||'.'||'log',
>'blocksize=8192' from sys.dba_data_files order by file_name
>
>the format comes back as the following:
>
>dbv file=/orad03_B/b91prd03/amost001.ds001.dbf logfile=AMOST001.log
> blocksize=8192
>
>What I would like to do is produce the logfile name as amost001.ds001.dbf.log,
>without hard coding it as the file name.
>

something like:

  1 select 'dbv file='||file_name || ' ' ||

  2     'logfile='|| substr( file_name, 1+instr(file_name,'/',-1) ) || '.log '||
  3     'blocksize=8192'

  4* from sys.dba_data_files order by file_name SQL> / 'DBVFILE='||FILE_NAME||''||'LOGFILE='||SUBSTR(FILE_NAME,1+INSTR(FILE_NAME,'/',-1))||'.LOG'||'BLOCKSIZE=8192'

dbv file=/d01/dbs/civtech.dbf logfile=civtech.dbf.log blocksize=8192 dbv file=/d01/dbs/news3.dbf logfile=news3.dbf.log blocksize=8192 ....

should do it.
>Does anyone know if by using some sort of substring function if I can
>accomplish this?
>
>Thanks,
>
>Joey D'Antoni
>
>-----------== Posted via Deja News, The Discussion Network ==----------
>http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
 

Thomas Kyte
tkyte_at_us.oracle.com
Oracle Service Industries
Reston, VA USA

--
http://govt.us.oracle.com/ -- downloadable utilities  



Opinions are mine and do not necessarily reflect those of Oracle Corporation Received on Tue Feb 23 1999 - 15:20:22 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US