天行健,君子当自强不息

目前专注于Oracle Clusterware、RAC、ASM的质量保证; 五年以上的自动化测试和软件质量保证经验,擅长企业测试自动化实施,软件性能测试等

联系我

===>MSN:ricky.zhu##msn.com ===>MAIL:ricky.zhu##gmail.com

Oracle Database 10g WorkshopII (Day2)

培训已经结束几天了,一直没来得及贴上来大纲,今天继续贴第二天的内容:

Day 2
Charpter4 Recovery from non-critical losses

If critical data lost, the database can’t functional works, or else database can still works.
If loss the temp data files, drop the old one and create a new one.
Log group state current: alter system switch log will switch the log group.
Log group state active: there are data not write to data file, alter system checkpoint will flush it.
If lose redo group member, drop the old one and add a new.
If index lost, re-create a new one. Use parallel and nologging to speed up the creation.
If password file lost, use orapwd command to create a new one. Then restart the instance.
Remote_login_password_file can be set to exclusive/ shared and none

Charpter5 Database Recovery

There are two kinds of recovery: use management way and using RMAN
User management: first restore=> manually copy data file/archived file to destination
Then recover=> recover the database, that’s apply the online /archived log files
You can recover the whole database, specified data file or tablespaces.
RMAN management also finished the same task, it’s automatically: restore and recover.
Situations need incompletely recover: missing archived/online redo or use control file to recover.
Incomplete recover can recover to: until time/until cancel/until SCN/until log sequence
Incomplete recovery has to open the db with resetlogs => then log sequence start from 1
Incomplete recovery can also recover to restore point (SCN/date), need to create before restore.
Create a new control file or use control file auto backup, we can create control file from command: backup control file to trace.
If we create new control file, then need to register the backup set to control file: catalog database.
Recovery from readonly tablespace is some different.

Charpter6 Flashback

User can flashback database= > use flashback logs
User can flashback table=> use recycle bin or undo tablespaces.
User can flashback transaction => use undo tablespaces.
Drop table, system will rename the table and it’s still in recycled bin
Purge will purge the recycle bin
Several ways to bypass the recycle bin: drop table purge, drop tbs including contents, drop user … cascade
Get the recycle bin using: show recycle bin or select from view: dba_recyclebin.
Flash database in case of only logic data lost.
If you don’t want to flashback some tbs, can exclude them.
Some situations can use flashback database: control file restore or recreated, tbs dropped or data file shrink.
Can get the flashback usage from view: v$flashback_database_log and v$flashback_database_stat.

Charpter7 Deal with Database Corruption

Data corrupt can be: data block version, block checksum or address corrupt
Data block corrupt mostly like: ora-1578 file #xxxx block #xxxx
We can verify this from: dbverify from os level or analyze from database level
Db_block_checking is set to false by default and db_block_checksum is set to true by default
Database tool exp can also detect the corruption.
Flashback can be used to resolve corruption
Package rdbms_repair usage: check_object => fill the corrupt in admin_tables
Admin_tables => create table for bad blocks.
Fix_corrupt_blocks => will mark the bad blocks but not fix it.

Block media recovery can also used to recovery: blockrecover datafile #xxxx block #xxxxx
Corruption block list can be get from v$database_block_corruption.
RMAN command: blockrecover corruption list to automatica repair the corrupt blocks.
For backupset we can query v$backup_corruption and image copy query: v$copy_corruption.

Related Posts

Tags:

1 Comment

  • At 2009.01.07 20:55, lizi said:

    :(

    (Required)
    (Required, will not be published)