| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> c.d.o.server -> Re: Control Chars in Filename
Norman Dunbar wrote:
> how about running sqlplus and doing something like :
>
> select 'host rm '||name||
> from v$datafile
> where name like 'whatever';
The NAME from v$datafile did not show the control chars when I ran the select.. it might have if I spooled it to file. Likely the control chars were written to tty and interpreted, which is why the filename looked like a valid one (i.e. no control chars) from the Server Manager output.
It was very weird staring at Oracle saying that the filename is invalid when doing the offline drop - I copied and pasted that filename from the SELECT name output displayed on the screen, how could it not exist!? :-)
What I could have tried, using your example, is something like:
==
SPOOL fubar
SELECT
'ALTER DATABASE DATAFILE '''||name||''' OFFLINE DROP;'
FROM v$datafile;
SPOOL off
@fubar
==
> 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.
Yep, TAB does it on Linux.
However, the file was there no more on Unix. Which is why I had to do the offline drop of the file in the database, in order to get the db opened, so that I can zap the corresponding tablespace, because the file does not exist anymore.
Another trick is using double switches with the rm command. This tells it
that all chars following are filenames. This allows you to do a:
# rm -- -Rf
.. and delete the file called "-RF" instead of trying to force remove files
via a recursive directory scan.. :-)
-- BillyReceived on Thu Oct 31 2002 - 07:01:43 CST
![]() |
![]() |