Change Oracle control files location

scripts et trucs Ajouter un commentaire

keywords : control file, Oracle control file, Change Control File location,  CONTROL_FILES, Change default Control File location

Its not possible to change CONTROL FILES location with Oracle ENterprise Manager Console ( OEM ) . But you can do it with some SQL commands and…a SPFILE. Here is the script :

$> sqlplus /nolog
SQL> connect sys as sysdba

SQL> show parameter CONTROL_FILES
NAME                                 TYPE        VALUE
———————————— ———– ——————————
control_files                        string      E:\ORADATA\ORCL\CONTROL01.CTL,
E:\ORADATA\ORCL\CONTROL02.CTL
,  E:\ORADATA\ORCL\CONTROL03.CTL

SQL> CREATE PFILE=’c:\temp\pfile.ora’ FROM SPFILE;

edit  c:\temp\pfile.ora and change one of the PATH value for CONTROL_FILES
here :
E:\ORADATA\ORCL\CONTROL03.CTL becomes  C:\TEMP\CONTROL03.CTL

copy the  control file
ici CONTROL03.CTL de E:\ORADATA\ORCL\ vers c:\TEMP

– shutdown and restart with the new parameter
SQL> shutdown abort
SQL> startup

SQL> show parameter control_files
NAME                                 TYPE        VALUE
———————————— ———– ——————————
control_files                        string      E:\ORADATA\ORCL\CONTROL01.CTL,
E:\ORADATA\ORCL\CONTROL02.CTL
, C:\TEMP\CONTROL03.CTL

You’re done !

Faire un commentaire