网络编程 | 站长之家 | 网页制作 | 图形图象 | 操作系统 | 冲浪宝典 | 软件教学 | 网络办公 | 邮件系统 | 网络安全 | 认证考试 | 系统进程
Firefox | IE | Maxthon | 迅雷 | 电驴 | BitComet | FlashGet | QQ | QQ空间 | Vista | 输入法 | Ghost | Word | Excel | wps | Powerpoint
asp | .net | php | jsp | Sql | c# | Ajax | xml | Dreamweaver | FrontPages | Javascript | css | photoshop | fireworks | Flash | Cad | Discuz!
当前位置 > 网站建设学院 > 网络编程 > 数据库 > Oracle教程
Tag:注入,存储过程,分页,安全,优化,xmlhttp,fso,jmail,application,session,防盗链,stream,无组件,组件,md5,乱码,缓存,加密,验证码,算法,cookies,ubb,正则表达式,水印,索引,日志,压缩,base64,url重写,上传,控件,Web.config,JDBC,函数,内存,PDF,迁移,结构,破解,编译,配置,进程,分词,IIS,Apache,Tomcat,phpmyadmin,Gzip,触发器,socket
数据库:数据库教程,数据库技巧,Oracle教程,MySQL教程,Sybase教程,Access教程,DB2教程,数据库安全,数据库文摘
本月文章推荐
.Ruby on Rails之Oracle应用.
.Oracle数据库exp imp按用户导出导.
.FAQ:ora-06550;pls-00553: 问题.
.教你怎样在Oracle 9i中正确转换时.
.ORACLE回滚段管理(下).
.Oracle 9i新特性研究系列之三 --.
.Oracle数据库物理文件空间设置方.
.说一说如何配置Oracle的MTS Part1.
.Oracle erp销售订单订单行状态不.
.Oracle容灾复制解决方案SharePlex.
.Oracle9i专题讲座精华集粹.
.Oracle中Trigger例子2.
.重建索引(rebuild index)与sort.
.Linux与硬盘分区.
.IE登录Linux上的10g解决em出现乱.
.联机热备份失败后,如何打开数据.
.轻松取得 Oracle 结构描述句法.
.最常碰到的10个Oracle错误.
.PL/SQL综合实例.
.深入研究Oracle数据库空间管理方.

备份的控制文件和新的数据文件

发表日期:2008-2-9


我们可以想象,假如控制文件是从备份中恢复的,那么数据库在open过程中又将如何呢? 首先备份控制文件,打开数据库,增进检查点:  [Oracle@jumper eygle]$ cp control01.ctl control01.ctl.bak
[oracle@jumper eygle]$ sqlplus "/ as sysdba" SQL*Plus: Release 9.2.0.4.0 - ProdUCtion on Fri Aug 11 10:46:05 2006 Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved. Connected to an idle instance. SQL> startup
ORACLE instance started. Total System Global Area  139531744 bytes
Fixed Size                   452064 bytes
Variable Size             121634816 bytes
Database Buffers           16777216 bytes
Redo Buffers                 667648 bytes
Database mounted.
Database opened.
SQL> alter system checkpoint; System altered. SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> exit
Disconnected from Oracle9i Enterprise Edition Release 9.2.0.4.0 - Production
With the Partitioning option
JServer Release 9.2.0.4.0 - Production 然后恢复旧的控制文件,mount数据库,转储数据文件头: [oracle@jumper eygle]$ mv control01.ctl control01.ctl.n
[oracle@jumper eygle]$ mv control01.ctl.bak control01.ctl
[oracle@jumper eygle]$ sqlplus "/ as sysdba" SQL*Plus: Release 9.2.0.4.0 - Production on Fri Aug 11 10:46:50 2006 Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved. Connected to an idle instance. SQL> startup mount;
ORACLE instance started. Total System Global Area  139531744 bytes
Fixed Size                   452064 bytes
Variable Size             121634816 bytes
Database Buffers           16777216 bytes
Redo Buffers                 667648 bytes
Database mounted.
SQL> alter session set events 'immediate trace name file_hdrs level 10'; Session altered. SQL> ! 我们看控制文件的信息(选择一个文件): DATA FILE #4:
  (name #4) /opt/oracle/oradata/eygle/eygle01.dbf
creation size=0 block size=8192 status=0xe head=4 tail=4 dup=1
 tablespace 4, index=4 krfil=4 prev_file=0
 unrecoverable scn: 0x0000.00000000 01/01/1988 00:00:00
 Checkpoint cnt:61 scn: 0x0000.002acb1e 08/11/2006 10:44:38
 Stop scn: 0x0000.002acb1e 08/11/2006 10:44:38
 Creation Checkpointed at scn:  0x0000.0015078d 06/06/2006 09:41:54
再看数据文件头信息:  FILE HEADER:
        Software vsn=153092096=0x9200000, Compatibility Vsn=134217728=0x8000000
        Db ID=1407686520=0x53e79778, Db Name='EYGLE'
        Activation ID=0=0x0
        Control Seq=989=0x3dd, File size=1280=0x500
        File Number=4, Blksiz=8192, File Type=3 DATA
Tablespace #4 - EYGLE  rel_fn:4
Creation   at   scn: 0x0000.0015078d 06/06/2006 09:41:54
Backup taken at scn: 0x0000.00000000 01/01/1988 00:00:00 thread:0
 reset logs count:0x232bee1f scn: 0x0000.0007c781 recovered at 08/11/2006 10:11:26
 status:0x0 root dba:0x00000000 chkpt cnt: 64 ctl cnt:63
begin-hot-backup file size: 0
Checkpointed at scn:  0x0000.002acb98 08/11/2006 10:46:24 我们注重到数据文件的chkpt cnt: 64 要大约控制文件的Checkpoint cnt:61,也就是说控制文件是旧的。 此时尝试打开数据库就会出现如下错误: [oracle@jumper udump]$ sqlplus "/ as sysdba" SQL*Plus: Release 9.2.0.4.0 - Production on Fri Aug 11 10:51:20 2006 Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.
Connected to:
Oracle9i Enterprise Edition Release 9.2.0.4.0 - Production
With the Partitioning option
JServer Release 9.2.0.4.0 - Production SQL> alter database open;
alter database open
*
ERROR at line 1:
ORA-01122: database file 1 failed verification check
ORA-01110: data file 1: '/opt/oracle/oradata/eygle/system01.dbf'
ORA-01207: file is more recent than controlfile - old controlfile Oracle告诉我们,控制文件是旧的。此时我们可以通过重建控制文件或者从旧的数据备份开始恢复。
上一篇:不安装ORACLE客户端的系统移植方法 人气:539
下一篇:从Oracle到SQL Server-SQL智能翻译器 人气:689
浏览全部Oracle教程的内容 Dreamweaver插件下载 网页广告代码 祝你圣诞节快乐 2009年新年快乐