Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
set echo off
set pagesize 0
set heading off
set feedback off
set verify off
set trimspool on
accept oldstr prompt "What string do you want to replace in filenames? "
accept newstr prompt "What should replace the old string in filenames? "
prompt
prompt
spool TempMV.sh
select 'mv '||member||' '||replace(member,ltrim(rtrim('&oldstr')),ltrim(rtrim('&newstr')))
from v$logfile
where instr(member,'&oldstr')>0;
select 'mv '||file_name||' '||replace(file_name,ltrim(rtrim('&oldstr')),ltrim(rtrim('&newstr')))
from dba_data_files
where instr(file_name,'&oldstr')>0;
spool off
prompt
prompt Wrote File "TempMV.sh"
prompt
spool TempRename.sql
select 'alter database Rename file' from dual;
select decode(rownum,1,' ',' ,')||''''||
file_name||'''' from dba_data_files
where instr(file_name,'&oldstr')>0;
select ' ,'''||member||'''' from v$logfile
where instr(member,'&oldstr')>0;
select 'to' from dual;
select decode(rownum,1,' ',' ,')||''''||
replace(file_name,ltrim(rtrim('&oldstr')),ltrim(rtrim('&newstr')))||''''
from dba_data_files
where instr(file_name,'&oldstr')>0;
select ' ,'''||
''''||replace(member,ltrim(rtrim('&oldstr')),ltrim(rtrim('&newstr')))||''''
from v$logfile
where instr(member,'&oldstr')>0;
select ';' from dual;
spool off
prompt
prompt Wrote File "TempRename.sql"
prompt
@RenameFiles
What string do you want to replace in filenames? D:\DHUNT\ORACLEDATA\DBDATA\DHUNT\DHUNTDATA
What should replace the old string in filenames? C:\DBDATA\DATA
mv D:\DHUNT\ORACLEDATA\DBDATA\DHUNT\DHUNTDATA101.DBF C:\DBDATA\DATA101.DBF
mv D:\DHUNT\ORACLEDATA\DBDATA\DHUNT\DHUNTDATA201.DBF C:\DBDATA\DATA201.DBF
Wrote File "TempMV.sh"
alter database Rename file
'D:\DHUNT\ORACLEDATA\DBDATA\DHUNT\DHUNTDATA101.DBF'
,'D:\DHUNT\ORACLEDATA\DBDATA\DHUNT\DHUNTDATA201.DBF'
to
'C:\DBDATA\DATA101.DBF'
,'C:\DBDATA\DATA201.DBF'
;
Wrote File "TempRename.sql"