控制文件作用:记录了数据库的结构和行为,有多少个数据文件,日志文件及其位置名称,状态,维护数据库的一致性,即记录了数据库的启动SCN号和终止SCN号。

控制文件的位置和个数记录在参数文件中,通常控制文件采用多路复用的方式来存放管理,一个数据库中最多有8个控制文件,超过了不行,至少不行,默认创建数据库有3个控制文件。启动时由参数文件记录顺序决定控制文件使用顺序。

控制文件为二进制文件,一般不超过100m,数据库启动到mount阶段时读取控制文件内容,以后一直在用。控制文件记录了数据库名字,标示符,创建时间戳,表空间名字,日志文件名字,SCN号,归档备份信息、字符集等。

查找控制文件:

方法一:

SQL> show parameter control_file

NAME                                 TYPE        VALUE

------------------------------------ ----------- ------------------------------------------------------------------------------

control_file_record_keep_time        integer     7

control_files                        string      /u01/oracle/oradata/orcl/contr

ol01.ctl, /u01/oracle/oradata/

orcl/control02.ctl, /u01/oracl

e/oradata/orcl/control03.ctl

方法二:

SQL>col name for a29;

SQL>col value for a40;

SQL> select name,value from v$parameter where name like '%control_file%';

NAME                          VALUE

----------------------------- ----------------------------------------

control_files                    /u01/oracle/oradata/orcl/control01.ctl,

/u01/oracle/oradata/orcl/control02.ctl,

/u01/oracle/oradata/orcl/control03.ctl

control_file_record_keep_time     7

方法三:

SQL> col name for a40;

SQL> select name,status from v$controlfile;

NAME                                     STATUS

---------------------------------------- -------

/u01/oracle/oradata/orcl/control01.ctl

/u01/oracle/oradata/orcl/control02.ctl

/u01/oracle/oradata/orcl/control03.ctl

查看控制文件记录内容:

方法一:

[oracle@localhost ~]$ strings /u01/oracle/oradata/orcl/control01.ctl

方法二:

SQL> alter database backup controlfile to trace as '/u01/oracle/controlfile.txt';

Database altered.

SQL> ho cat /u01/oracle/controlfile.txt

方法三:

SQL> desc v$controlfile_record_section

Name                                      Null?    Type

----------------------------------------- -------- ----------------------------

TYPE                                               VARCHAR2(28)

RECORD_SIZE                                        NUMBER

RECORDS_TOTAL                                      NUMBER

RECORDS_USED                                       NUMBER

FIRST_INDEX                                        NUMBER

LAST_INDEX                                         NUMBER

LAST_RECID                                         NUMBER

SQL> select type,record_size from v$controlfile_record_section;

TYPE                         RECORD_SIZE

---------------------------- -----------

DATABASE                             316

CKPT PROGRESS                       8180

REDO THREAD                          256

REDO LOG                              72

DATAFILE                             428

..........

方法三:转储控制文件内容

方法a:

SQL> alter system set events 'immediate trace name controlf level 10';

System altered.

SQL> show parameter user_d

NAME                                 TYPE        VALUE

------------------------------------ ----------- -----------------------------------------------------------------------

user_dump_dest                       string      /u01/oracle/admin/orcl/udump

[oracle@localhost ~]$ ll /u01/oracle/admin/orcl/udump并查看最新的文件信息

[oracle@localhost ~]$ cat /u01/oracle/admin/orcl/udump/orcl_ora_29296.trc

方法b:

SQL> oradebug setmypid

SQL> select spid from v$process where addr=(select paddr from v$session where sid=(select sid from v$mystat where rownum=1));

SQL> oradebug dump controlf 3

SQL> show parameter user_d

SQL> ho ls /u01/oracle/admin/orcl/udump/

[oracle@localhost ~]$ cat /u01/oracle/admin/orcl/udump/orcl_ora_3223.trc

方法三(11g新增):

[root@localhost ~]# select value from v$diag_info where name='default trace file';

控制文件管理:

控制文件个数和位置的管理(多路复用):

通过spfile修改控制文件个数及位置:

将控制文件减少到1个:

SQL> alter system set control_files='/u01/oracle/oradata/orcl/control01.ctl' scope=spfile;

System altered.

SQL> shutdown immediate

Database closed.

Database dismounted.

ORACLE instance shut down.

SQL> startup

ORACLE instance started.

Total System Global Area  285212672 bytes

Fixed Size                  1218968 bytes

Variable Size              83887720 bytes

Database Buffers          192937984 bytes

Redo Buffers                7168000 bytes

Database mounted.

Database opened.

SQL> show parameter control_f

NAME                                 TYPE        VALUE

------------------------------------ ----------- -------------------------------------------------------------

control_file_record_keep_time        integer     7

control_files                        string      /u01/oracle/oradata/orcl/contr

将控制文件增加到3个:

SQL> alter system set control_files='/u01/oracle/oradata/orcl/control01.ctl'

,'/u01/oracle/oradata/orcl/control02.ctl','/u01/oracle/oradata/orcl/control03.ctl' scope=spfile;

System altered.

SQL> shutdown immediate

Database closed.

Database dismounted.

ORACLE instance shut down.

SQL> startup

ORACLE instance started.

Total System Global Area  285212672 bytes

Fixed Size                  1218968 bytes

Variable Size              83887720 bytes

Database Buffers          192937984 bytes

Redo Buffers                7168000 bytes

ORA-00214: control file '/u01/oracle/oradata/orcl/control01.ctl' version 677

inconsistent with file '/u01/oracle/oradata/orcl/control02.ctl' version 668

可以看到重启数据库报错version不一致,此时应该把高版本的copy给低版本即可:

SQL>exit

[oracle@localhost orcl]$ cp control01.ctl control02.ctl

[oracle@localhost orcl]$ cp control01.ctl control03.ctl

[oracle@localhost orcl]$ sqlplus / as sysdba

SQL*Plus: Release 10.2.0.1.0 - Production on Sun Mar 15 19:29:56 2015

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

Connected to:

Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production

With the Partitioning, OLAP and Data Mining options

SQL> startup force

ORACLE instance started.

Total System Global Area  285212672 bytes

Fixed Size                  1218968 bytes

Variable Size              83887720 bytes

Database Buffers          192937984 bytes

Redo Buffers                7168000 bytes

Database mounted.

Database opened.

SQL> show parameter control_f

NAME                                 TYPE        VALUE

------------------------------------ ----------- ------------------------------------------------------------------------

control_file_record_keep_time        integer     7

control_files                        string      /u01/oracle/oradata/orcl/contr

ol01.ctl, /u01/oracle/oradata/

orcl/control02.ctl, /u01/oracl

e/oradata/orcl/control03.ctl

查看控制文件状态:查看控制文件是否存在、磁盘空间是否够用、控制文件大小是否超过100m

SQL> show parameter control_f

NAME                                 TYPE        VALUE

------------------------------------ ----------- ------------------------------------------------------------------------

control_file_record_keep_time        integer     7

control_files                        string      /u01/oracle/oradata/orcl/contr

ol01.ctl, /u01/oracle/oradata/

orcl/control02.ctl, /u01/oracl

e/oradata/orcl/control03.ctl

然后查看控制文件具体路径是否存在:

[oracle@localhost orcl]$ ls /u01/oracle/oradata/orcl/*.ctl

/u01/oracle/oradata/orcl/control01.ctl

/u01/oracle/oradata/orcl/control02.ctl

/u01/oracle/oradata/orcl/control03.ctl

查看磁盘容量是否够用:

[oracle@localhost orcl]$ df -h

文件系统              容量  已用 可用 已用% 挂载点

/dev/mapper/VolGroup00-LogVol00

18G   11G  6.3G  62% /

/dev/sda1              99M   12M   82M  13% /boot

tmpfs                 506M     0  506M   0% /dev/shm

查看控制文件大小:如果超过100m,需要重建控制文件

[oracle@localhost orcl]$ ls -l /u01/oracle/oradata/orcl/*.ctl

-rw-r----- 1 oracle oinstall 7061504 03-15 19:38 /u01/oracle/oradata/orcl/control01.ctl

-rw-r----- 1 oracle oinstall 7061504 03-15 19:38 /u01/oracle/oradata/orcl/control02.ctl

-rw-r----- 1 oracle oinstall 7061504 03-15 19:38 /u01/oracle/oradata/orcl/control03.ctl

控制文件备份:

1)热备:

SQL>alter database backup controlfile to '/u01/oracle/controlfile2015.bak';-->归档备份

SQL>alter database backup controlfile to trace as '/u01/oracle/controlfile2015.txt';

-->归档非归档均可备份

2)rman备份

[oracle@localhost orcl]$ rman target /

Recovery Manager: Release 10.2.0.1.0 - Production on Sun Mar 15 19:56:47 2015

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

connected to target database: ORCL (DBID=1401907058)

RMAN> backup current controlfile;

RMAN> backup database include current controlfile;

3)设置控制文件自动备份

RMAN> show all;

RMAN configuration parameters are:

CONFIGURE RETENTION POLICY TO REDUNDANCY 1; # default

CONFIGURE BACKUP OPTIMIZATION OFF; # default

CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default

CONFIGURE CONTROLFILE AUTOBACKUP OFF; # default

CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '%F'; # default

CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET; # default

CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default

CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default

CONFIGURE MAXSETSIZE TO UNLIMITED; # default

CONFIGURE ENCRYPTION FOR DATABASE OFF; # default

CONFIGURE ENCRYPTION ALGORITHM 'AES128'; # default

CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default

CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/u01/oracle/10g/dbs/snapcf_orcl.f'; # default

通过红色部分可以看出现在controlfile的自动备份是被off的,通过以下命令打开自动备份。

RMAN> CONFIGURE CONTROLFILE AUTOBACKUP ON;

恢复:

1)控制文件不一致解决办法:

查看控制文件版本号,复制新的给旧的;

SQL> startup

ORACLE instance started.

Total System Global Area  285212672 bytes

Fixed Size                  1218968 bytes

Variable Size              83887720 bytes

Database Buffers          192937984 bytes

Redo Buffers                7168000 bytes

ORA-00214: control file '/u01/oracle/oradata/orcl/control01.ctl' version 677

inconsistent with file '/u01/oracle/oradata/orcl/control02.ctl' version 668

可以看到重启数据库报错version不一致,此时应该把高版本的copy给低版本即可:

SQL>exit

[oracle@localhost orcl]$ cp control01.ctl control02.ctl

[oracle@localhost orcl]$ cp control01.ctl control03.ctl

[oracle@localhost orcl]$ sqlplus / as sysdba

SQL*Plus: Release 10.2.0.1.0 - Production on Sun Mar 15 19:29:56 2015

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

Connected to:

Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production

With the Partitioning, OLAP and Data Mining options

SQL> startup force

ORACLE instance started.

Total System Global Area  285212672 bytes

Fixed Size                  1218968 bytes

Variable Size              83887720 bytes

Database Buffers          192937984 bytes

Redo Buffers                7168000 bytes

Database mounted.

Database opened.

SQL>

修改spfile使用最新的控制文件。

SQL> startup

ORACLE instance started.

Total System Global Area  285212672 bytes

Fixed Size                  1218968 bytes

Variable Size              83887720 bytes

Database Buffers          192937984 bytes

Redo Buffers                7168000 bytes

ORA-00214: control file '/u01/oracle/oradata/orcl/control01.ctl' version 677

inconsistent with file '/u01/oracle/oradata/orcl/control02.ctl' version 668

通过以上错误,我们看到了控制文件版本号,不一致,所以修改参数文件使用最新的版本号:

SQL> alter system set control_files='/u01/oracle/oradata/orcl/control01.ctl' scope=spfile;

System altered.

SQL> shutdown immediate

Database closed.

Database dismounted.

ORACLE instance shut down.

SQL> startup

ORACLE instance started.

Total System Global Area  285212672 bytes

Fixed Size                  1218968 bytes

Variable Size              83887720 bytes

Database Buffers          192937984 bytes

Redo Buffers                7168000 bytes

Database mounted.

Database opened.

2)控制文件丢失有备份恢复方法

A、非归档、有全备需要重建控制文件。

SQL> startup

ORACLE instance started.

Total System Global Area  285212672 bytes

Fixed Size                  1218968 bytes

Variable Size              83887720 bytes

Database Buffers          192937984 bytes

Redo Buffers                7168000 bytes

ORA-00205: error in identifying control file, check alert log for more info

通过查看警告日志alert_orc.log, control04.ctl丢失,内容如下:

[oracle@localhost ~]$ vi /u01/oracle/admin/orcl/bdump/alert_orcl.log

4051 Sun Mar 15 20:46:44 2015

4052 ORA-00202: control file: '/u01/oracle/oradata/orcl/control04.ctl'

4053 ORA-27037: unable to obtain file status

4054 Linux Error: 2: No such file or directory

4055 Additional information: 3

4056 Sun Mar 15 20:46:47 2015

4057 ORA-205 signalled during: ALTER DATABASE   MOUNT...

解决方法:1)如果存在多个控制文件,只丢失了其中一个控制文件,把存在的copy给丢失的即可解决。

2)如果所有控制文件都丢失了,重建数据库(最惨情况),可以通过控制文件转储文件或跟踪文件查看内容,恢复内容。

SQL> create controlfile reuse database orcl noarchivelog noresetlogs

2  maxlogfiles 16

3  maxinstances 8

4  maxlogmembers 3

5  maxloghistory 1

6  logfile

7  group 1 '/u01/oracle/oradata/orcl/redo01.log' size 50m,

8  group 2 '/u01/oracle/oradata/orcl/redo02.log' size 50m,

9  group 3 '/u01/oracle/oradata/orcl/redo03.log' size 50m

10  datafile

11  '/u01/oracle/oradata/orcl/example01.dbf',

....................

12  charecter set utf8

SQL>alter database open;

恢复数据库:SQL>recover database;

B、归档,有备份,控制文件丢失恢复

如果数据库不是归档模式,首先将数据库改为归档模式,方法如下:

SQL> archive log list

Database log mode              No Archive Mode

Automatic archival             Disabled

Archive destination            USE_DB_RECOVERY_FILE_DEST

Oldest online log sequence     12

Current log sequence           14

SQL> shutdown immediate

Database closed.

Database dismounted.

ORACLE instance shut down.

SQL> startup mount

ORACLE instance started.

Total System Global Area  285212672 bytes

Fixed Size                  1218968 bytes

Variable Size              83887720 bytes

Database Buffers          192937984 bytes

Redo Buffers                7168000 bytes

Database mounted.

SQL> alter database archivelog;

Database altered.

备份控制文件:

SQL> alter database backup controlfile to '/u01/oracle/ctl2015.ctl';

Database altered.

SQL> startup

ORACLE instance started.

Total System Global Area  285212672 bytes

Fixed Size                  1218968 bytes

Variable Size              88082024 bytes

Database Buffers          188743680 bytes

Redo Buffers                7168000 bytes

ORA-00205: error in identifying control file, check alert log for more info

通过查看alert_orcl.log文件可知control05.ctl文件丢失:

[oracle@localhost ~]$ vi /u01/oracle/admin/orcl/bdump/alert_orcl.log

ALTER DATABASE   MOUNT

Mon Mar 16 07:55:45 2015

ORA-00202: control file: '/u01/oracle/oradata/orcl/control05.ctl'

ORA-27037: unable to obtain file status

Linux Error: 2: No such file or directory

Additional information: 3

Mon Mar 16 07:55:48 2015

ORA-205 signalled during: ALTER DATABASE   MOUNT...

copy备份文件到指定文件:

SQL> ho cp /u01/oracle/ctl2015.ctl /u01/oracle/oradata/orcl/control05.ctl

SQL> alter database mount;

Database altered.

SQL> alter database open;

alter database open

ERROR at line 1:

ORA-01589: must use RESETLOGS or NORESETLOGS option for database open

SQL> alter database recover database using backup controlfile;

alter database recover database using backup controlfile

*

ERROR at line 1:

ORA-00279: change 855457 generated at 03/16/2015 07:48:55 needed for thread 1

ORA-00289: suggestion :

/u01/oracle/flash_recovery_area/ORCL/archivelog/2015_03_16/o1_mf_1_15_%u_.arc

ORA-00280: change 855457 for thread 1 is in sequence #15

SQL> alter database recover database using backup controlfile until change 855457;

alter database recover database using backup controlfile until change 855457

*

ERROR at line 1:

ORA-00275: media recovery has already been started

至此还是没能恢复控制文件,所以我们采取重建控制文件的方法恢复(也可以设置隐藏参数):

SQL> CREATE CONTROLFILE REUSE DATABASE orcl NORESETLOGS  NOARCHIVELOG

2  MAXLOGFILES 16

3  MAXLOGMEMBERS 3

4  MAXDATAFILES 100

5  MAXINSTANCES 8

6  MAXLOGHISTORY 292

7  logfile

8  GROUP 1 '/u01/oracle/oradata/orcl/redo01.log'  SIZE 50M,

9  GROUP 2 '/u01/oracle/oradata/orcl/redo02.log'  SIZE 50M,

10  GROUP 3 '/u01/oracle/oradata/orcl/redo03.log'  SIZE 50m

11  datafile

12  '/u01/oracle/oradata/orcl/system01.dbf',

13  '/u01/oracle/oradata/orcl/undotbs01.dbf',

14  '/u01/oracle/oradata/orcl/sysaux01.dbf',

15  '/u01/oracle/oradata/orcl/users01.dbf',

16  '/u01/oracle/oradata/orcl/example01.dbf'

17  CHARACTER SET ZHS16GBK

18  /

Control file created.

SQL> alter database open;

Database altered.

SQL> select name,value from v$parameter where name like '%control_f%';

NAME                                      VALUE

--------------------------------------------------------------------------------

control_files                  /u01/oracle/oradata/orcl/control05.ctl

control_file_record_keep_time   7

至此控制文件恢复成功。

归档、有备份:正确恢复方式

SQL> startup

ORACLE instance started.

Total System Global Area  285212672 bytes

Fixed Size                  1218968 bytes

Variable Size             100664936 bytes

Database Buffers          176160768 bytes

Redo Buffers                7168000 bytes

ORA-00205: error in identifying control file, check alert log for more info

 

SQL> ho cp /u01/oracle/ctl.ctl /u01/oracle/oradata/orcl/control01.ctl

SQL> ho cp /u01/oracle/ctl.ctl /u01/oracle/oradata/orcl/control02.ctl

SQL> ho cp /u01/oracle/ctl.ctl /u01/oracle/oradata/orcl/control03.ctl

 

SQL> shutdown

ORA-01507: database not mounted

ORACLE instance shut down.

 

SQL> startup

ORACLE instance started.

Total System Global Area  285212672 bytes

Fixed Size                  1218968 bytes

Variable Size             100664936 bytes

Database Buffers          176160768 bytes

Redo Buffers                7168000 bytes

Database mounted.

ORA-01589: must use RESETLOGS or NORESETLOGS option for database open

 

SQL> alter database open resetlogs;

alter database open resetlogs

*

ERROR at line 1:

ORA-01194: file 1 needs more recovery to be consistent

ORA-01110: data file 1: '/u01/oracle/oradata/orcl/system01.dbf'

 

SQL> alter database recover database using backup controlfile;

alter database recover database using backup controlfile

*

ERROR at line 1:

ORA-00279: change 864828 generated at 03/16/2015 10:04:20 needed for thread 1

ORA-00289: suggestion :

/u01/oracle/flash_recovery_area/ORCL/archivelog/2015_03_16/o1_mf_1_16_%u_.arc

ORA-00280: change 864828 for thread 1 is in sequence #16

 

SQL> shutdown

ORA-01013: user requested cancel of current operation

SQL> startup  force

ORACLE instance started.

Total System Global Area  285212672 bytes

Fixed Size                  1218968 bytes

Variable Size             100664936 bytes

Database Buffers          176160768 bytes

Redo Buffers                7168000 bytes

Database mounted.

ORA-01589: must use RESETLOGS or NORESETLOGS option for database open

 

SQL> alter database open resetlogs;

alter database open resetlogs

*

ERROR at line 1:

ORA-01113: file 1 needs media recovery

ORA-01110: data file 1: '/u01/oracle/oradata/orcl/system01.dbf'

 

SQL> recover database;

ORA-00283: recovery session canceled due to errors

ORA-01610: recovery using the BACKUP CONTROLFILE option must be done

 

SQL> recover database using backup controlfile;

ORA-00279: change 864828 generated at 03/16/2015 10:04:20 needed for thread 1

ORA-00289: suggestion :

/u01/oracle/flash_recovery_area/ORCL/archivelog/2015_03_16/o1_mf_1_16_%u_.arc

ORA-00280: change 864828 for thread 1 is in sequence #16

Specify log: {<RET>=suggested | filename | AUTO | CANCEL}

/u01/oracle/oradata/orcl/redo01.log

ORA-00310: archived log contains sequence 14; sequence 16 required

ORA-00334: archived log: '/u01/oracle/oradata/orcl/redo01.log'

SQL> recover database using backup controlfile;

ORA-00279: change 864828 generated at 03/16/2015 10:04:20 needed for thread 1

ORA-00289: suggestion :

/u01/oracle/flash_recovery_area/ORCL/archivelog/2015_03_16/o1_mf_1_16_%u_.arc

ORA-00280: change 864828 for thread 1 is in sequence #16

Specify log: {<RET>=suggested | filename | AUTO | CANCEL}

/u01/oracle/oradata/orcl/redo02.log

ORA-00310: archived log contains sequence 15; sequence 16 required

ORA-00334: archived log: '/u01/oracle/oradata/orcl/redo02.log'

 

SQL> recover database using backup controlfile;

ORA-00279: change 864828 generated at 03/16/2015 10:04:20 needed for thread 1

ORA-00289: suggestion :

/u01/oracle/flash_recovery_area/ORCL/archivelog/2015_03_16/o1_mf_1_16_%u_.arc

ORA-00280: change 864828 for thread 1 is in sequence #16

Specify log: {<RET>=suggested | filename | AUTO | CANCEL}

/u01/oracle/oradata/orcl/redo03.log

Log applied.

Media recovery complete.

 

SQL> alter database open resetlogs;

Database altered.

SQL> archive log list

Database log mode              Archive Mode

Automatic archival             Enabled

Archive destination            USE_DB_RECOVERY_FILE_DEST

Oldest online log sequence     0

Next log sequence to archive   1

Current log sequence           1

SQL>

加隐藏参数恢复控制文件:

SQL> startup force

ORACLE instance started.

Total System Global Area  285212672 bytes

Fixed Size                  1218968 bytes

Variable Size             104859240 bytes

Database Buffers          171966464 bytes

Redo Buffers                7168000 bytes

ORA-00205: error in identifying control file, check alert log for more info

 

SQL> ho cp /u01/oracle/ctl.ctl /u01/oracle/oradata/orcl/control01.ctl

SQL> ho cp /u01/oracle/ctl.ctl /u01/oracle/oradata/orcl/control02.ctl

SQL> ho cp /u01/oracle/ctl.ctl /u01/oracle/oradata/orcl/control03.ctl

 

SQL> alter database mount

Database altered.

 

SQL> alter database open;

alter database open

*

ERROR at line 1:

ORA-01589: must use RESETLOGS or NORESETLOGS option for database open

 

SQL> alter database recover database using backup controlfile;

alter database recover database using backup controlfile

*

ERROR at line 1:

ORA-00283: recovery session canceled due to errors

ORA-19909: datafile 1 belongs to an orphan incarnation

ORA-01110: data file 1: '/u01/oracle/oradata/orcl/system01.dbf'

 

SQL> recover database;

ORA-00283: recovery session canceled due to errors

ORA-01610: recovery using the BACKUP CONTROLFILE option must be done

 

SQL> recover database using backup controlfile;

ORA-00283: recovery session canceled due to errors

ORA-19909: datafile 1 belongs to an orphan incarnation

ORA-01110: data file 1: '/u01/oracle/oradata/orcl/system01.dbf'

 

SQL> alter system set "_allow_resetlogs_corruption"=true scope=spfile;

System altered.

 

SQL> startup force;

ORACLE instance started.

Total System Global Area  285212672 bytes

Fixed Size                  1218968 bytes

Variable Size             104859240 bytes

Database Buffers          171966464 bytes

Redo Buffers                7168000 bytes

Database mounted.

ORA-01589: must use RESETLOGS or NORESETLOGS option for database open

 

SQL> alter database open resetlogs;

alter database open resetlogs

*

ERROR at line 1:

ORA-01092: ORACLE instance terminated. Disconnection forced

SQL> exit

Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production

With the Partitioning, OLAP and Data Mining options

[uniread] Saved history (486 lines)

[oracle@localhost orcl]$ sql / as sysdba

[uniread] Loaded history (486 lines)

SQL*Plus: Release 10.2.0.1.0 - Production on Mon Mar 16 11:16:46 2015

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

Connected to an idle instance.

 

SQL> startup

ORACLE instance started.

Total System Global Area  285212672 bytes

Fixed Size                  1218968 bytes

Variable Size             104859240 bytes

Database Buffers          171966464 bytes

Redo Buffers                7168000 bytes

Database mounted.

Database open.

SQL>

删除隐藏参数:

SQL>alter system reset "_allow_resetlogs_corruption" scope=spfile sid='*';

Oracle体系结构之控制文件管理的更多相关文章

  1. Oracle体系结构之参数文件管理

    参数文件作用:主要用来记录数据库配置信息,数据库在启动时,需要读取参数文件中关于控制文件的信息,分配内存,打开进程,会话等.数据库启动时第一个读取参数文件. 参数文件分类: 1)pfile:文本文件, ...

  2. Oracle体系结构之密码文件管理

    oracle密码文件主要用来控制sysdba和sysoper用户用于远程登录.通常,oracle用户登录database有两种方式,一种是通过本地操作系统验证登录,一种是通过密码文件验证登录. 操作系 ...

  3. Oracle体系结构之控制文件的多路复用技术

    在Windows操作系统中,如果注册表文件被损坏了,就会影响操作系统的稳定性.严重的话,会导致操作系统无法正常启动.而控制文件对于Oracle数据库来说,其作用就好象是注册表一样的重要.如果控制文件出 ...

  4. Oracle体系结构之数据文件管理

    数据文件分2个方向管理: 物理结构和逻辑结构. 数据库的存储层次结构图: ............. 逻辑结构:                                  物理结构: .... ...

  5. oracle 体系结构

    oracle 体系结构 数据库的体系结构是指数据库的组成.工作过程与原理,以及数据在数据库中的组织与管理机制. 1. oracle工作原理: 1).在数据库服务器上启动Oracle实例:2).应用程序 ...

  6. Oracle实例和Oracle数据库(Oracle体系结构)

    --========================================== --Oracle实例和Oracle数据库(Oracle体系结构) --==================== ...

  7. 【转载】Oracle实例和Oracle数据库(Oracle体系结构)

    免责声明:     本文转自网络文章,转载此文章仅为个人收藏,分享知识,如有侵权,请联系博主进行删除.     原文作者:Leshami      原文地址:http://blog.csdn.net/ ...

  8. oracle 体系结构解析

    三.oracle 体系结构 1.oracle内存由SGA+PGA所构成 2.oracle数据库体系结构数据库的体系结构是指数据库的组成.工作过程与原理,以及数据在数据库中的组织与管理机制. oracl ...

  9. Oracle 课程一之Oracle体系结构

    课程目标 •理解ORACLE数据库体系架构—内存结构和进程 •理解SQL在数据库中的运作流程 •理解UNDO&REDO原理 •理解commit原理   1.Oracle数据库概述 •数据库:物 ...

随机推荐

  1. 【代码审计】iZhanCMS_v2.1 代码执行漏洞分析

      0x00 环境准备 iZhanCMS官网:http://www.izhancms.com 网站源码版本:爱站CMS(zend6.0) V2.1 程序源码下载:http://www.izhancms ...

  2. MongoDB 备份恢复

    备份: mongodump --host -u admin -p -o /tmp/alldb/ // 备份所有的库 mongodump --host -u admin -p -d mydb -o /t ...

  3. VS2017编译Poco1.9.0的64版本

    需要先准备好OpenSSL1.0.2 下载poco-poco-1.9.0-release.zip,解压,修改buildwin.cmd中的OPENSSL_DIR路径,特别注意OPENSSL_LIB的路径 ...

  4. .Net学习心得

      把握自己就是,就是时时拥一颗清澈的心,拥有一片明朗的情怀,缓缓地,从2014的国度里跨进了2015,而我们也就随之告别了2个月的学习之旅,在这里我们拥有了如白色漂渺的梦,黯然升起,在彩色的云霄里飘 ...

  5. 《C++ Primer Plus》16.3 标准模板库 学习笔记

    STL提供了一组表示容器.迭代其.函数对象和算法的模板.容器是一个与数组类似的单元,可以存储若干个值.STL容器是同质的,即存储的值的类型相同:算法是完成特定任务(如对数组进行排序或在链表中查找特定值 ...

  6. iText7生成pdf

    1 官网 http://developers.itextpdf.com/itext-java 2 form中加入表格 http://developers.itextpdf.com/content/be ...

  7. SQL中ROW_NUMBER()/RANK() /DENSE_RANK() OVER函数的基本用法

    一.ROW_NUMBER()的用法 语法:ROW_NUMBER() OVER(PARTITION BY COLUMN ORDER BY COLUMN) row_number()从1开始,为每一条分组记 ...

  8. 【C#新特性】不用out ref同时返回多个值-元组Tuple

    元组Tuple,它是一种固定成员的泛型集合 下面先看看官方的一个使用例子: 创建一个包含7个元素的Tuple数组 // Create a 7-tuple. , , , , , );// Display ...

  9. intellij2016.03激活

    激活的时候采用server的方式 :http://jetbrains.tech

  10. jQuery队列(三)

    看了一下队列剩下的几个方法,在没有应用场景的情况下,对它所做的一些处理不能明白.后续希望可以通过动画部分代码的阅读能搞清楚这些处理的意义.jQuery.fn.extend({ // 推迟队列中函数的执 ...