Oracle控制文件管理

控制文件作用:记录了数据库的结构和行为,有多少个数据文件,日志文件及其位置名称,状态,维护数据库的一致性,即记录了数据库的启动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.明确控制文件的名称和存储路径

参数设置错误将无法打开数据库,数据库打开以后,实例将同时写入所有的控制文件但是只会读取第一个控制文件的内容。

2.为数据库创建多路控制文件

a.多路控制文件内容必须完全一样,oracle实例同时将内容写入到control_files变量所设置的控制文件中。

b.初始化参数control_files中列出的第一个文件是数据库运行期间唯一可读取的控制文件。

c.创建,恢复和备份控制文件必须在数据库关闭的状态下运行,这样才能保证操作过程中控制文件不被修改。

d.数据库运行期间如果一个控制文件变为不可用,那么实例将不再运行,应该终止这个实例,并对破坏的控制文件进行修复。

3.将多路控制文件放在不同的硬盘上

4.采用操作系统镜像方式备份控制文件

5.手工方式备份控制文件

应该及时备份特别是发生了如下的操作的时候:

添加删除重命名数据文件

添加删除表空间,改变表空间读写状态

添加删除重做日志文件

控制文件备份:

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='*';

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/788967.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

C语言什么是局部变量?

一、问题 C程序中的变量有局部变量和全局变量&#xff0c;那么什么是局部变量呢&#xff1f; 二、解答 局部变量也称为内部变量&#xff0c;即在函数内部定义的变量。它只在本函数范围内有效&#xff0c;在函数外是不能使⽤该变量的。例如&#xff1a; int f1(int a) {int b,…

Android 窗口那些事儿

目录 1. &#x1f4c2; 前言 你&#xff0c;是否有过这些疑问&#xff1f; 2. &#x1f531; Window 2.1 认识 Window 的几个阶段 1&#xff09;阶段一&#xff1a;Window 约等于 Activity 2&#xff09;阶段二&#xff1a;Window 约等于 View 3&#xff09;阶段三&…

基于深度学习的危险物品检测系统(网页版+YOLOv8/v7/v6/v5代码+训练数据集)

摘要&#xff1a;本文详细介绍基于YOLOv8/v7/v6/v5的危险物品检测技术。主要采用YOLOv8技术并整合了YOLOv7、YOLOv6、YOLOv5的算法&#xff0c;进行了细致的性能指标对比分析。博客详细介绍了国内外在危险物品检测方面的研究现状、数据集处理方法、算法原理、模型构建与训练代码…

Git 实战教程

Git 是一款强大的分布式版本控制系统&#xff0c;广泛用于团队协作与项目管理。本文将为你提供一份 Git 的实战教程&#xff0c;通过实例演示 Git 的基本用法和高级特性&#xff0c;帮助你快速上手 Git。 一、Git 基础 安装 Git 首先&#xff0c;你需要在你的计算机上安装 G…

保健品wordpress外贸模板

保健品wordpress外贸模板 健康保养保健品wordpress外贸模板&#xff0c;做大健康行业的企业官方网站模板。 https://www.jianzhanpress.com/?p3514

蓝桥杯刷题第八天(dp专题)

这道题有点像小学奥数题&#xff0c;解题的关键主要是&#xff1a; 有2种走法固走到第i级阶梯&#xff0c;可以通过计算走到第i-1级和第i-2级的走法和&#xff0c;可以初始化走到第1级楼梯和走到第2级楼梯。分别为f[1]1;f[2]1(11)1(2)2.然后就可以循环遍历到后面的状态。 f[i…

XenCenter 2024 创建一个虚拟机

前言 实现&#xff0c;创建一个虚拟机&#xff0c;内存&#xff0c;cpu&#xff0c;磁盘&#xff0c;名称&#xff0c;网卡&#xff0c;配置 Xen Center 2024 download 创建虚拟机 选择系统类型 定义虚拟机名称 选择ISO镜像库 选择主服务器 分配虚拟机内存&#xff0c;cpu资源…

观察和配置MAC地址表

目录 原理概述 实验目的 实验内容 实验拓扑 ​编辑1&#xff0e;基本配置 2.观察正常状态时的MAC地址表 4.配置静态MAC地址表项 原理概述 MAC 地址表是交换机的一个核心组成部分&#xff0c;交换机主要是根据 MAC 地址表来进行帧的转发的。交换机对帧的转发操作行为一共有…

[Python学习篇] Python变量

变量的作用 计算机的存储分为内存储器即内存&#xff0c;外存储器即硬盘&#xff0c;程序运行代码在内存中运行&#xff0c;内存可以理解为一块一块的存储地址&#xff0c;变量就是给某一块内存地址起的一个名字&#xff0c;变量的值就存储在这块内存中&#xff0c;通过变量名称…

OpenHarmony实战:轻量带屏解决方案之恒玄芯片移植案例

本文章基于恒玄科技 BES2600W 芯片的欧智通 Multi-modal V200Z-R 开发板&#xff0c;进行轻量带屏开发板的标准移植&#xff0c;开发了智能开关面板样例&#xff0c;同时实现了 ace_engine_lite、arkui_ui_lite、aafwk_lite、appexecfwk_lite、HDF 等部件基于 OpenHarmony Lite…

集成电路企业tapeout,如何保证机台数据准确、完整、高效地采集?

Tapeout即流片&#xff0c;集成电路行业中将CDS最终版电路图提交给半导体制造厂商进行物理生产的过程。在芯片设计与制造的流程中&#xff0c;Tapeout是非常重要的阶段&#xff0c;包括了布局&#xff08;Layout&#xff09;、连线&#xff08;Routing&#xff09;、分析&#…

Linux下使用vim文本编辑器

linux自带vi编辑器&#xff0c;使用升级版vim输入命令 sudo apt install vim 1.文件操作 vim 文件名&#xff1a;打开文件2.命令行模式 &#xff1a;进入命令行 q 退出 q! 退出不保存 wq 保存退出3.三种模式…

Linux 线程互斥、互斥量、可重入与线程安全

目录 一、线程互斥 1、回顾相关概念 2、抢票场景分析代码 多个线程同时操作全局变量 产生原因 如何解决 二、互斥量 1、概念 2、初始化互斥量&#xff1a; 方法1&#xff1a;静态分配 方法2&#xff1a;动态分配 3、销毁互斥量&#xff1a; 4、加锁和解锁 示例抢…

企业如何设计和实施有效的网络安全演练?

现实世界中&#xff0c;武装部队一直利用兵棋推演进行实战化训练&#xff0c;为潜在的军事冲突做准备。随着当今的数字化转型&#xff0c;同样的概念正在以网络安全演习的形式在组织中得到应用&#xff0c;很多企业每年都会基于合理的网络攻击场景和事件响应做一些测试和模拟。…

redis-BitMap(位图)使用方法

一&#xff0c;BitMap介绍 使用位存储&#xff0c;信息状态只有 0 和 1 Bitmap是一串连续的2进制数字&#xff08;0或1&#xff09;&#xff0c;每一位所在的位置为偏移(offset)&#xff0c;在bitmap上可执行AND,OR,XOR,NOT以及其它位操作。 二 &#xff0c;应用场景 签到统计…

金字塔建设之谜

金字塔是梯形分层的&#xff0c;又称作层级金字塔。它是一种高大的角锥体建筑物&#xff0c;底座四方形&#xff0c;每个侧面是三角形&#xff0c;样子就像汉字的“金”字&#xff0c;所以我们叫它“金字塔”。 但实际上目前在中国、美洲多地都发现了金字塔型结构的墓穴。但是…

鸿蒙南向开发案例:【智能养花机】

样例简介 智能养花机通过感知花卉、盆栽等植宠生长环境的温度、湿度信息&#xff0c;适时为它们补充水分。在连接网络后&#xff0c;配合数字管家应用&#xff0c;用户可远程进行浇水操作。用户还可在应用中设定日程&#xff0c;有计划的按日、按周进行浇水。在日程中用户可添…

uniapp-打包app-图标配置

依次找到manifest->App图标配置&#xff0c;然后点击浏览&#xff0c;从本地文件夹中选择你们项目的logo&#xff0c;然后点击自动生成所有图标并替换&#xff0c;即可&#xff1a;

uniapp创建opendb-city-china Schema文件后,如何导入城市的数据?

1.点击opendb-city-china后面的详情&#xff0c;进入到gitee代码仓库 2.下载如下图所示的data.json文件 3.将本地创建的opendb-city-china.schema.json上传到云端 4.点击导入json 如果直接将data.json导入会报错&#xff0c;如下图所示: 5.将data.json本来的数组对象&#…

如何展示科技产品的原理和应用

一、合理安排展示区域 不同的科技产品具有不同的展示需求&#xff0c;设计师需要根据展品的特点和大小&#xff0c;合理安排展示区域。对于较大的科技产品&#xff0c;可以设置特定的展台或展示区域&#xff0c;并配备合适的灯光和装饰&#xff0c;以凸显产品的重要性和独特性。…