One of the problems with Linux in Oracle is that you are allowed to
create Oracle data files (.dbf files) that contain special characters
like spaces and punctuation marks.
When you create a Oracle data file with special characters all sorts
of strange things may happen, and the best solution is to re-name the
data file without the special characters:
1 - Take the tablespace offline
2 - Fix the data file name (see script below)
3 -
re-name the
data file
4 - put the tablespace online
Here is a script from
Penguin Pete that will detect and repair all Oracle Linux data files
that contain a "space", replacing it with an underscore:
#!/bin/bash
ls > /tmp/list
# we have to make the list file in a separate
# directory so that it
doesn't get included
# in
the list of the current directory!
mv /tmp/list ./list
cat list | tr ' ' '_' > listnew
# this turns spaces into underscores
FILE_COUNT=$(wc -l list | awk '{print $1}')
LOOP=1
while [ "$LOOP" -le "$FILE_COUNT" ]
do
AWKFEED="FNR=="$LOOP
# the
command to feed awk
#
output will be 'FNR==1', 'FNR==2', ..
OLDFILE=$(awk $AWKFEED list)
NEWFILE=$(awk $AWKFEED listnew)
mv "$OLDFILE" "$NEWFILE"
# keep the quotes to make the shell read file
# names with spaces as
one file
LOOP=$(($LOOP+1))
done
rm list
rm listnew
exit 0