科技行者

行者学院 转型私董会 科技行者专题报道 网红大战科技行者

知识库

知识库 安全导航

至顶网软件频道Oracle8i回滚段表空间出现坏块的解决

Oracle8i回滚段表空间出现坏块的解决

  • 扫一扫
    分享文章到微信

  • 扫一扫
    关注官方公众号
    至顶头条

今天早上刚到公司便接到网通客户的投诉电话,说网管数据库出问题了,数据库有坏块,回滚段里的部分数据不能读取,需要帮忙解决。 我查看了一下swappALRT.log文件。

作者:中国IT实验室 来源:中国IT实验室 2007年10月11日

关键字: ORACLE

  • 评论
  • 分享微博
  • 分享邮件

在本页阅读全文(共4页)

执行完后开始在新的回滚段表空间下建回滚段,存储参数和原来保持一致:

SQL> select? 'create public rollback segment '||segment_name||' 
tablespace rbs01 storage(initial 524288 next 524288 MINEXTENTS
 8 MAXEXTENTS 4096 OPTIMAL 4194304); from dba_rollback_segs;

也是做了个脚本,免的一个一个敲!

下面的大回滚段要单独建,总之,系统里面最好要有一个大的回滚段,有大事物的时候就派上用场了。

SQL> create public rollback segment APPRBS tablespace rbs01
 storage(initial 2097152 next 10485760 MINEXTENTS 50 
MAXEXTENTS 32765); 
Rollback segment created.

查看新建的回滚段状态:

SQL> select segment_name,owner,status,tablespace_name from dba_rollback_segs;
SYSTEM?????????????? SYS??? ONLINE?????????? SYSTEM
RBS0???????????????? PUBLIC OFFLINE????????? RBS01
RBS1???????????????? PUBLIC OFFLINE????????? RBS01
RBS2???????????????? PUBLIC OFFLINE????????? RBS01
RBS3???????????????? PUBLIC OFFLINE????????? RBS01
RBS4???????????????? PUBLIC OFFLINE????????? RBS01
RBS5???????????????? PUBLIC OFFLINE????????? RBS01
RBS6???????????????? PUBLIC OFFLINE????????? RBS01
RBS7???????????????? PUBLIC OFFLINE????????? RBS01
RBS8???????????????? PUBLIC OFFLINE????????? RBS01
RBS10??????????????? PUBLIC OFFLINE????????? RBS01
RBS11??????????????? PUBLIC OFFLINE????????? RBS01
RBS12??????????????? PUBLIC OFFLINE????????? RBS01
RBS13??????????????? PUBLIC OFFLINE????????? RBS01
RBS14??????????????? PUBLIC OFFLINE????????? RBS01
RBS15??????????????? PUBLIC OFFLINE????????? RBS01
RBS16??????????????? PUBLIC OFFLINE????????? RBS01
RBS17??????????????? PUBLIC OFFLINE????????? RBS01
RBS18??????????????? PUBLIC OFFLINE????????? RBS01
RBS19??????????????? PUBLIC OFFLINE????????? RBS01
RBS20??????????????? PUBLIC OFFLINE????????? RBS01
RBS21??????????????? PUBLIC OFFLINE????????? RBS01
RBS22??????????????? PUBLIC OFFLINE????????? RBS01
RBS23??????????????? PUBLIC OFFLINE????????? RBS01
RBS24??????????????? PUBLIC OFFLINE????????? RBS01
RBS26??????????????? PUBLIC OFFLINE????????? RBS01
RBS27??????????????? PUBLIC OFFLINE????????? RBS01
RBS28??????????????? PUBLIC OFFLINE????????? RBS01
RBS25??????????????? PUBLIC OFFLINE????????? RBS01
APPRBS?????????????? PUBLIC OFFLINE????????? RBS01
30 rows selected.

除了system,都是offline状态。

继续做脚本让除system外的回滚段online:

SQL> select 'alter rollback segment '||segment_name||' online;'? from dba_rollback_segs;
alter rollback segment RBS0 online;
alter rollback segment RBS1 online;
alter rollback segment RBS2 online;
alter rollback segment RBS3 online;
alter rollback segment RBS4 online;
alter rollback segment RBS5 online;
alter rollback segment RBS6 online;
alter rollback segment RBS7 online;
alter rollback segment RBS8 online;
alter rollback segment RBS9 online;
alter rollback segment RBS10 online;
alter rollback segment RBS11 online;
alter rollback segment RBS12 online;
alter rollback segment RBS13 online;
alter rollback segment RBS14 online;
alter rollback segment RBS15 online;
alter rollback segment RBS16 online;
alter rollback segment RBS17 online;
alter rollback segment RBS18 online;
alter rollback segment RBS19 online;
alter rollback segment RBS20 online;
alter rollback segment RBS21 online;
alter rollback segment RBS22 online;
alter rollback segment RBS23 online;
alter rollback segment RBS24 online;
alter rollback segment RBS26 online;
alter rollback segment RBS27 online;
alter rollback segment RBS28 online;
alter rollback segment RBS25 online;
alter rollback segment APPRBS online;

执行以上脚本后,删除原来的undo表空间RBS:

SQL>drop tablespace rbs including contents;
Tablespace dropped.

做到这里即完成了所要求的工作,好了,剩下的就留做数据测试了,收工,明天等数据库测试结果。

查看本文来源

    • 评论
    • 分享微博
    • 分享邮件
    邮件订阅

    如果您非常迫切的想了解IT领域最新产品与技术信息,那么订阅至顶网技术邮件将是您的最佳途径之一。

    重磅专题
    往期文章
    最新文章