You are on page 1of 7

fichier de controle

contient la base de donnee

il est requis a partir a l etat MOUNT et OPEN

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
les pannes de fichier de controle

-suprimer un fichier de control

fichier d'alerte
C:\app\user\diag\rdbms\orcl\orcl\alert\log.xml

<txt>ORA-00210: cannot open the specified control file


ORA-00202: control file: &apos;C:\APP\USER\ORADATA\ORCL\CONTROL01.CTL&apos;
ORA-27041: unable to open file
OSD-04002: ouverture impossible du fichier
O/S-Error: (OS 2) Le fichier spécifié est introuvable.
</txt>

++++++++++++++++++++++++++++++++++++++++++++++++

SQL> select name from v$controlfile;

aucune ligne sÚlectionnÚe

SQL>

SQL> show parameter control_files

NAME TYPE VALUE


------------------------------------ ----------- ------------------------------
control_files string C:\APP\USER\ORADATA\ORCL\CONTR
OL01.CTL, C:\APP\USER\ORADATA\
ORCL\CONTROL02.CTL
***********************************************************************************
***************************
ORCL\CONTROL02.CTL
SQL> host copy C:\APP\USER\ORADATA\ORCL\CONTROL02.CTL C:\APP\USER\ORADATA\ORCL\
CONTROL01.CTL
1 fichier(s) copié(s).

SQL>

***********************************************************************************
********************************
SQL> select instance_name , status from v$instance;

INSTANCE_NAME STATUS
---------------- ------------
orcl STARTED

SQL> alter database mount;


Base de donnÚes modifiÚe.

SQL> alter database open;

Base de donnÚes modifiÚe.

SQL> select instance_name , status from v$instance;

INSTANCE_NAME STATUS
---------------- ------------
orcl OPEN

SQL>

2 type de problemes

fichier endomager : on utilise son frere d'ou l'interet de multiplexage

SQL> alter system set control_files="C:\APP\USER\ORADATA\ORCL\CONTROL02.CTL"


scope=spfile;

SystÞme modifiÚ.

SQL> select name from v$controlfile;

NAME
--------------------------------------------------------------------------------
C:\APP\USER\ORADATA\ORCL\CONTROL01.CTL
C:\APP\USER\ORADATA\ORCL\CONTROL02.CTL

************************************************************

SQL> startup force


Instance ORACLE lancÚe.

Total System Global Area 1071333376 bytes


Fixed Size 1375792 bytes
Variable Size 562037200 bytes
Database Buffers 503316480 bytes
Redo Buffers 4603904 bytes
Base de donnÚes montÚe.
Base de donnÚes ouverte.
SQL>

***********************************************************************************
*
demarrage avec control file 2

SQL> select name from v$controlfile;


NAME
--------------------------------------------------------------------------------
C:\APP\USER\ORADATA\ORCL\CONTROL02.CTL

SQL>

***********************************************************************************
******************
SQL> alter system set control_files="C:\APP\USER\ORADATA\ORCL\CONTROL02.CTL","C:\
APP\USER\ORADATA\ORCL\CONTROL01.CTL" scope=spfile;

SystÞme modifiÚ.

SQL> select name from v$controlfile;

NAME
--------------------------------------------------------------------------------
C:\APP\USER\ORADATA\ORCL\CONTROL02.CTL

SQL> startup force


Instance ORACLE lancÚe.

PROBLEME DE L'INCOHERENCE ENTRE FICHIER DE CONTROLE

Total System Global Area 1071333376 bytes


Fixed Size 1375792 bytes
Variable Size 562037200 bytes
Database Buffers 503316480 bytes
Redo Buffers 4603904 bytes
ORA-00214: incoherence entre fichier de controle
'C:\APP\USER\ORADATA\ORCL\CONTROL02.CTL' version 4705 et fichier
'C:\APP\USER\ORADATA\ORCL\CONTROL01.CTL' version 4692

***********************************************************************************
***********************
SUPPRIMER L'ANCIEN VERSION DE FICHIER DE CONTROLE CONTROL01.CTL

SQL> host del C:\APP\USER\ORADATA\ORCL\CONTROL01.CTL

SQL> host copy C:\APP\USER\ORADATA\ORCL\CONTROL02.CTL C:\APP\USER\ORADATA\ORCL\


CONTROL01.CTL
1 fichier(s) copié(s).

SQL> alter database mount;

Base de donnÚes modifiÚe.

SQL> alter database open;

Base de donnÚes modifiÚe.

***********************************************************************************
*****************************

MULTIPLIXAGE
avoir plusieurs copy pour en cas de panne en lui renomer et l'utiliser

changer les parametre de fichier SPFILE qui va prendre en consideration lors de


prochaine demarrage
SQL> alter system set control_files="C:\APP\USER\FLASH_RECOVERY_AREA\ORCL2\
CONTROL02.CTL","C:\APP\USER\ORADATA\ORCL2\CONTROL01.CTL","C:\APP\USER\ORADATA\
ORCL2\CONTROL03.CTL" scope=spfile;

SystÞme modifiÚ.

SQL> shutdown immediate


Base de donnÚes fermÚe.
Base de donnÚes dÚmontÚe.
Instance ORACLE arrÛtÚe.
SQL> host copy C:\APP\USER\ORADATA\ORCL\CONTROL01.CTL C:\APP\USER\ORADATA\ORCL\
CONTROL03.CTL
1 fichier(s) copié(s).

SQL>

alter system set control_files="C:\APP\USER\FLASH_RECOVERY_AREA\ORCL2\


CONTROL02.CTL","C:\APP\USER\ORADATA\ORCL2\CONTROL01.CTL","C:\APP\USER\ORADATA\ORCL\
CONTROL03.CTL" ,"C:\APP\USER\FLASH_RECOVERY_AREA\ORCL2\CONTROL04.CTL","C:\APP\USER\
FLASH_RECOVERY_AREA\ORCL2\CONTROL05.CTL" scope=spfile;

host copy C:\APP\USER\FLASH_RECOVERY_AREA\ORCL2\CONTROL02.CTL C:\APP\USER\


ORADATA\ORCL2\CONTROL04.CTL

num sequence stocker dans les fichier de controle

identifient des transaction


***********************************************************************************
***********************************************************************************
*********************************************************************************

Microsoft Windows [version 10.0.19044.2251]


(c) Microsoft Corporation. Tous droits réservés.

C:\Windows\system32>set oracle_sid=rafiq

C:\Windows\system32>sqlplus / as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on Mar. DÚc. 13 19:25:12 2022

Copyright (c) 1982, 2010, Oracle. All rights reserved.

ConnectÚ Ó :
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> select name from v$controlfile;

NAME
--------------------------------------------------------------------------------
C:\APP\USER\ORADATA\RAFIQ\CONTROL01.CTL
C:\APP\USER\FLASH_RECOVERY_AREA\RAFIQ\CONTROL02.CTL

SQL> show parameter control_files;

NAME TYPE VALUE


------------------------------------ ----------- ------------------------------
control_files string C:\APP\USER\ORADATA\RAFIQ\CONT
ROL01.CTL, C:\APP\USER\FLASH_R
ECOVERY_AREA\RAFIQ\CONTROL02.C
TL
SQL>
SQL>
SQL> select value from v$parameter where
2 name='control_files';

VALUE
--------------------------------------------------------------------------------
C:\APP\USER\ORADATA\RAFIQ\CONTROL01.CTL, C:\APP\USER\FLASH_RECOVERY_AREA\RAFIQ\C
ONTROL02.CTL

SQL> CONNECT / AS SYSDBA


ConnectÚ.
SQL> shutdown
Base de donnÚes fermÚe.
Base de donnÚes dÚmontÚe.
Instance ORACLE arrÛtÚe.
SQL>
SQL> host copy C:\app\user\oradata\Rafiq\control01.ctl C:\app\user\oradata\Rafiq\
control01.bak
1 fichier(s) copié(s).

SQL> CONNECT / AS SYSDBA


ConnectÚ Ó une instance inactive.
SQL> shutdown
ORA-01034: ORACLE not available
ORA-27101: shared memory realm does not exist
SQL> shutdown
ORA-01034: ORACLE not available
ORA-27101: shared memory realm does not exist
SQL> show user
USER est "SYS"
SQL> host del C:\app\user\oradata\Rafiq\control01.ctl

SQL> startup
Instance ORACLE lancÚe.

Total System Global Area 1071333376 bytes


Fixed Size 1375792 bytes
Variable Size 553648592 bytes
Database Buffers 511705088 bytes
Redo Buffers 4603904 bytes
ORA-00205: erreur lors de l'identification du fichier de controle; consultez le
journal d'alertes

SQL> shutdown
ORA-01507: base de donnees non montee

Instance ORACLE arrÛtÚe.


SQL>
SQL>
SQL> host copy C:\app\user\oradata\Rafiq\control01.bak C:\app\user\oradata\Rafiq\
control01.ctl
1 fichier(s) copié(s).

SQL> startup
Instance ORACLE lancÚe.

Total System Global Area 1071333376 bytes


Fixed Size 1375792 bytes
Variable Size 553648592 bytes
Database Buffers 511705088 bytes
Redo Buffers 4603904 bytes
Base de donnÚes montÚe.
Base de donnÚes ouverte.
SQL>
SQL>
SQL>
SQL> CONNECT / AS SYSDBA
ConnectÚ.
SQL> alter system set
2 control_files="C:\app\user\oradata\Rafiq\control01.ctl"
3 ,"C:\app\user\oradata\Rafiq\control02.ctl"
4 scope=spfile;

SystÞme modifiÚ.
SQL> SHUTDOWN IMMEDIATE;
Base de donnÚes fermÚe.
Base de donnÚes dÚmontÚe.
Instance ORACLE arrÛtÚe.
SQL> host copy C:\app\user\oradata\Rafiq\control01.ctl C:\app\user\oradata\Rafiq\
control02.ctl
1 fichier(s) copié(s).

SQL> STARTUP
Instance ORACLE lancÚe.

Total System Global Area 1071333376 bytes


Fixed Size 1375792 bytes
Variable Size 553648592 bytes
Database Buffers 511705088 bytes
Redo Buffers 4603904 bytes
Base de donnÚes montÚe.
Base de donnÚes ouverte.
SQL> SELECT name FROM v$controlfile;

NAME
--------------------------------------------------------------------------------
C:\APP\USER\ORADATA\RAFIQ\CONTROL01.CTL
C:\APP\USER\ORADATA\RAFIQ\CONTROL02.CTL

SQL> SELECT records_total FROM


2 v$controlfile_record_section WHERE type = 'DATAFILE';

RECORDS_TOTAL
-------------
32

SQL>

You might also like