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 -> Control Chars in Filename

Control Chars in Filename

From: Norman Dunbar <Norman.Dunbar_at_lfs.co.uk>
Date: Thu, 31 Oct 2002 12:15:31 -0000
Message-ID: <E2F6A70FE45242488C865C3BC1245DA702DD37E7@lnewton.leeds.lfs.co.uk>


Billy,

how about running sqlplus and doing something like :

select 'host rm '||name||
from v$datafile
where name like 'whatever';

I'm assuming the control characters will be noted there, so no worries. Of course, you might also need to put double quotes around the filename if your version of Unix doesn't want to play.

Then you can spool the reuslts & run it as a script direct from sqlplus.

Cheers,
Norman.

PS. In Unix, if I have a similar problem, I can do this on HP :

type in rm and the first letter of the name then press ESC ESC to have the shell complete the name. I believe that the TAB key does a similar job in Linux.

You might need more letters if there are other files with the same leading characters - but you know the drill.

Cheers,
Norman.



Norman Dunbar
Database/Unix administrator
Lynx Financial Systems Ltd.
mailto:Norman.Dunbar_at_LFS.co.uk
Tel: 0113 289 6265
Fax: 0113 289 3146
URL: http://www.Lynx-FS.com
-------------------------------------


-----Original Message-----
From: Billy Verreynne [mailto:vslabs_at_onwe.co.za] Posted At: Thursday, October 31, 2002 11:53 AM Posted To: server
Conversation: Control Chars in Filename
Subject: Re: Control Chars in Filename

Eric Parker wrote:

> Another solution (assuming the filename is "abc<unknown
> characters>xyz.dbf") is to enter
>
> rm -i abc*xyz.dbf
>
> then pressing y or n appropriately as prompted.

Eric, the problem was not rm'ing the file via Unix shell scripting.

It was passing a string literal to Oracle that contained the correct filename, including the control characters.

The SQL command is:
ALTER DATABASE
  DATAFILE '<filename>' OFFLINE DROP;

This must be passed to Oracle via a client such as SQL*Plus. The problem was
how to get those control characters into that literal... to which the solution we used was to put this command in a Unix text file, using vi to
insert those control chars, and then running the text file through Server
Manager as STDIN.

--
Billy
Received on Thu Oct 31 2002 - 06:15:31 CST

Original text of this message

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