Set new name

–######################################################################
–# Autor : Rodrigo Mufalani (rodrigo@mufalani.com.br)
–# Data : Fev 25, 2012
–# De : Mufalani
–# Para :
–# Motivo : Gerar comandos set newname for datafile para todos os datafiles de um database
–######################################################################
–# Obs : Alterar os paths OLD e NEW
–######################################################################

set trimspool on
set pages 0
set lin 1000
set feedback off
set echo off

spool set_new_name_datafile.txt

select ‘set newname for datafile ‘||file#||’ to ”’||replace(name,’SOME/PATH/OLD/’,/SOME/PATH/NEW/’)||”’;’
from v$datafile;

spool off;

 

Deixe uma resposta

O seu endereço de email não será publicado. Campos obrigatórios são marcados com *