晶晶实验九之详细论述增量检查点篇
摘录一篇晶晶小妹的关于检查点与rba的文章,写的很好。原文链接http://bbs.chinaunix.net/thread-1278164-1-1.html[@more@]**为什么要有检查点?被修改过的块,在oracle中都被统称为脏块.所有的脏块被一个链表串起来,称做检查点队列.在buffer cache中,每一个块都有一个buffer header 简称BH,在BH中有一个ckptq项,此项目中记录了指向检查点队列上一个块和下一个块的指针.如果某一个块不在检查点队列中,他的ckptq项为空.通过ckptq项oracle将所有的脏块串成了一个双向链表.这个双向链表就是检查点队列了.1,只有脏块才会在检查点队列中,非脏块
Redo Byte Address (RBA)
Redo Byte Address (RBA)来源http://www.ixora.com.au/notes/rba.htm[@more@]Recent entries in the redo thread of an Oracle instance are addressed using a 3-part redo byte address, or RBA. An RBA is comprised of the log file sequence number (4 bytes) the log file block number (4 bytes) the byte offset into the block at which the redo record starts (2 bytes) RBAs are not necessarily unique within their thread, because the log file sequence number may be reset to 1 in all threads if a database is opene
系统表空间恢复
系统表空间恢复[@more@]Ø 系统表空间损坏或丢失 SQL> alter database open resetlogs;alter database open resetlogs*ERROR at line 1:ORA-01157: cannot identify/lock data file 1 - see DBWR trace fileORA-01110: data file 1: '/u01/oradata/retc/rwsw_system' SQL> recover database using backup controlfile;ORA-00283: recovery session canceled due to errorsORA-01110: data file 1: '/u01/oradata/retc/rwsw_system'ORA-01157: cannot identify/lock data file 1 - see DBWR trace fileORA-01110: data file 1:
数据文件恢复
数据文件恢复[@more@]Ø 数据文件rwsw_quest1损坏或丢失SQL> alter database open resetlogs;alter database open resetlogs*ERROR at line 1:ORA-01157: cannot identify/lock data file 11 - see DBWR trace fileORA-01110: data file 11: '/u01/oradata/retc/rwsw_quest1'SQL> recover database;ORA-00283: recovery session canceled due to errorsORA-01610: recovery using the BACKUP CONTROLFILE option must be doneSQL> recover database using backup controlfile until cancel;ORA-00283: recovery session
联机重做日志文件恢复
联机重做日志文件恢复[@more@]Ø 损坏状态为INACTIVE的联机日志文件SQL> select group#,thread#,sequence#,members,archived,status,first_change# from v$log order by group#;GROUP# THREAD# SEQUENCE# MEMBERS ARCHIV STATUS FIRST_CHANGE#---------- ---------- ---------- ---------- ------ -------------------------------- ------------- 1 1 9 2 YES INACTIVE 30536577211 2 1 8 2 YES INACTIVE 3053657
全库恢复(异机)
全库恢复到另外一台测试库,属于异机恢复[@more@]Ø 测试库创建PFILE参数文件INITSHESTATE.ORA*.aq_tm_processes=0*.compatible='9.2.0.0.0'*.db_block_size=8192*.db_cache_size=268435456*.db_name=shestate*.db_file_multiblock_read_count=16*.job_queue_processes=10*.open_cursors=300*.pga_aggregate_target=254803968*.processes=150*.session_max_open_files=20#*.sga_target=767557632*.sga_max_size=536870912*.large_pool_size=33554432*.shared_pool_size=262144000*.sort_area_size=524288*.undo_management='AUTO'*.
控制文件恢复
控制文件恢复[@more@]$ export ORACLE_SID=shestate$ rman target / nocatalogRecovery Manager: Release 9.2.0.5.0 - 64bit ProductionCopyright (c) 1995, 2002, Oracle Corporation. All rights reserved.connected to target database (not started)RMAN> set dbid=3563853082executing command: SET DBIDRMAN> startup nomount;Oracle instance startedTotal System Global Area 1411877936 bytesFixed Size 744496 bytesVariable Size 1358954496 bytesDatabase Buffers 50331648 bytesRedo Buffers 1847296 bytesRMAN> RU
搞懂ORACLE数据库介质恢复(二)
搞懂介质恢复-使用备份的控制文恢复数据库[@more@]数据文件user01.dbf丢失,控制文件丢失--restore controlfile;--restore datafile 4;--目前数据库为mount状态:查看相关SCN:--备份控制文件记录的CNSQL> select checkpoint_change# from v$database;CHECKPOINT_CHANGE#------------------5277885--备份控制文件记录的SCNSQL> select file#,checkpoint_change# from v$datafile;FILE# CHECKPOINT_CHANGE#---------- ------------------1 52779302 52779303 52779304 52779305 52779306 52779307 52779308 5277930--当前数据库数据文
搞懂ORACLE数据库介质恢复(一)
搞懂介质恢复-使用当前的控制文件恢复数据库[@more@]数据文件users01丢失1.首先是restore数据文件restore前:比较SCN控制文件记录的SCNSQL> col checkpoint_change# for 9999999999SQL> select file#,checkpoint_change# from v$datafile;FILE# CHECKPOINT_CHANGE#---------- ------------------1 52736332 52736333 52736334 52736335 52736336 52736337 52736338 5273633数据文件记录的SCNSQL> select file#,checkpoint_change# from v$datafile_header;FILE# CHECKPOINT_CHANGE#---------- ------------------1 52736332 5273
RMAN 备份,未使用catalog,控制文件丢失的解决办法(2)
作者: Fenng | 可以转载, 但必须以超链接形式标明文章原始出处和作者信息及版权声明网址: http://www.dbanotes.net/database/rman_nocatalog_lost_controlfile_howto.html 解决过程[@more@]首先,用控制文件作数据库系统的全备份: C:WUTemp>rman target / Recovery Manager: Release 9.2.0.1.0 - Production. Copyright (c) 1995, 2002, Oracle Corporation. All rights reserved. connected to target database: DEMO (DBID=3272375326) RMAN> run {2> allocate channel C1 type disk;3> backup full tag 'Ful
RMAN 备份,未使用catalog,控制文件丢失的解决办法(1)
作者: Fenng | 可以转载, 但必须以超链接形式标明文章原始出处和作者信息及版权声明网址: http://www.dbanotes.net/database/rman_nocatalog_lost_controlfile_howto.html 情况描述客户报告数据库故障,新来的系统管理员误操作。删掉了一些文件。具体情况是:删掉了所有重要数据文件、所有控制文件。数据库原来是归档模式,用 RMAN (Recovery Manager) 备份数据,而 RMAN 使用控制文件。幸运的是,最后一次 RMAN full 备份是包括了控制文件在内。系统没有设定自动备份控制文件。现在状况是数据库无法启动。 不用说,客户的备份方案不够完善
使用rman catalog命令恢复数据库
有这样的一种需要恢复数据库场景:当前数据库有一份全备,归档,联机重做日志都没有损坏或丢失,但是控制文件意外的损坏了,而且更糟糕的是,居然没有备份的控制文件(当然, 这种情形很少见),这种情形下,只有重建控制文件,但是重建控制文件也是一件很棘手的事情,如果数据库有上百个数据文件,要写在控制文件里,不是件容易的是,这就要求数据库管理员对数据库结构相当熟悉。这也是说明了控制文件的重要性了。我这里的场景是使用alter database backup controlfile to trace得到重建控制文件的脚本,纯粹是为了今天要说的主题来的。在
使用dbms_backup_restore进行全库恢复
在备份集无法restore的情况下,使用dbms_backup_restore包在nomount状态下restore数据文件,然后恢复数据库。[@more@][oracle@primary dbs]$ rman target /Recovery Manager: Release 10.2.0.5.0 - Production on Sun Dec 2 15:18:58 2012Copyright (c) 1982, 2007, Oracle. All rights reserved.connected to target database: dbwdn (not mounted)RMAN> run2> {3> allocate channel t1 device type disk;4> restore database from '0vnrrptr_1_1.bak';5> release channel t1;6> }using target database control file
rman镜像拷贝copy datafile 与copy datafilecopy的区别
copy datafile 与copy datafilecopy的区别:[@more@]RMAN> copy2> datafile '/u01/app/oracle/oradata/dbwdn/users01.dbf' to '/tmp/users01.dbf';Starting backup at 02-DEC-2012 13:57:54using channel ORA_DISK_1channel ORA_DISK_1: starting datafile copyinput datafile fno=00004 name=/u01/app/oracle/oradata/dbwdn/users01.dbfoutput filename=/tmp/users01.dbf tag=TAG20121202T135754 recid=12 stamp=800978275channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01Finished backup at 02-DEC-2012 13:5
rm 误删除数据库文件的恢复过程
在linux redhat 5.4版本,rm误删除数据库文件的恢复过程如下:[@more@]1.首先测试rm 误删除数据库文件[oracle@primary dbwdn]$ lltotal 2153164-rw-r----- 1 oracle dba 8536064 Nov 27 21:50 control01.ctl-rw-r----- 1 oracle dba 8536064 Nov 27 21:50 control02.ctl-rw-r----- 1 oracle dba 8536064 Nov 27 21:50 control03.ctl-rw-r----- 1 oracle dba 104865792 Nov 27 21:32 ggs01.dbf-rw-r----- 1 oracle dba 525344768 Nov 27 21:32 perfstat.dbf-rw-r----- 1 oracle dba 52429312 Nov 27 21:10 redo01.log-rw-r----- 1 oracle d
一次rman备份失败后的成功处理
使用rman命令全备份数据库:[oracle@primary u01]$ rman target /Recovery Manager: Release 10.2.0.5.0 - Production on Tue Nov 27 21:25:33 2012Copyright (c) 1982, 2007, Oracle. All rights reserved.connected to target database: DBWDN (DBID=3486622777)RMAN> backup incremental level = 0 database format '/u01/bak/full_0_bak.bak';[@more@]Starting backup at 27-NOV-2012 21:26:35using target database control file instead of recovery catalogallocated channel: ORA_DISK_1channel ORA_DISK_1: sid=142 devtype=DI
使用oracle duplicate技术复制需要恢复的表空间到测试环境(异机)(二)
续《使用oracle duplicate技术复制需要恢复的表空间到测试环境(异机)(一)》[@more@]datafile 61 not processed because file is offlinedatafile 62 not processed because file is offlinedatafile 63 not processed because file is offlinedatafile 64 not processed because file is offlinedatafile 65 not processed because file is offlinestarting media recoveryOracle Error: ORA-01547: warning: RECOVER succeeded but OPEN RESETLOGS would get error belowORA-01194: file 1 needs more recovery to be consistentORA-01
使用oracle duplicate技术复制需要恢复的表空间到测试环境(异机)(一)
一、测试项目使用oracle duplicate技术复制需要恢复的表空间到测试环境二、测试目的假定数据库有数据损坏,在flashback、灾备库、快照库无法进行恢复的情况下,使用数据库高级技术TSPITR(Tablespace Point-In-Time Recovery)进行数据恢复.三、测试环境目标数据库数据库版本:oracle 9.2.0.7系统环境 :AIX 5.2IP地址 :172.16.34.33db_name :retc辅助数据库数据库版本:oracle 9.2.0.7系统环境 :AIX 5.2IP地址 :172.16.34.35db_name :auxCatalog数据库 数据库版本:oracle 9.2.0.1 系统环境 :windows 2003
简述oracle数据库乱码产生的原因以及解决方法
数据库字符集为西文WE8ISO8859P1,但是WE8ISO8859P1字符集并没有存储中文的编码,如果我的客户端字符集为ZHS16GBK,以GBK来编码汉字,这个时候,我客户端进行INSERT INTO T1 VALUES(1,'中国');COMMIT;那么我在客户端查看SELECT ID,NAME FROM T1看到的结果集一定是??这样的乱码。[@more@]因为,客户端字符集为ZHS16GBK,而数据库字符集为西文WE8ISO8859P1,既然客户端与数据库端的字符集不一样,那么,数据库端必然要进行转码处理,从客户端传送到数据库端的是“中国”的编码: d6,d0,b9,fa。当编码 d6,d0,b9,fa传送到数据库服务器端的时
通过验证访问ASM实例
要想了解如何访问ASM实例,必须先要了解ASM系统权限.[@more@]1. ASM权限因为ASM实例没有数据字典信息,无法使用ASM验证方式验证登陆到实例用户的合法性,因此只能使用操作系统验证的方式验证连接到ASM实例的用户的合法性.a ) SYSASM系统权限,属于系统创建的组OSASM,如asmadmin,完全管理ASM的权限b ) SYSDBA系统权限,属于系统创建的组OSDBA,(属于ASM),如asmdba,能够访问ASM上面的数据,创建和删除ASM文件,授予和收回访问ASM文件的权限,不能创建和RESIZE磁盘组.c ) SYSOPER系统权限,属于系统创建的组OSOPER(属于ASM),如asmoper,能够