ORA01650数据库教程 -电脑资料

电脑资料 时间:2019-01-01 我要投稿
【www.unjs.com - 电脑资料】

   

    数据库很多表频繁报错 ora-01688 ORA-01650 等错误

    ORA-01650: unable to extend rollback segment %s by %s in tablespace %s

    Cause: Failed to allocate extent for the rollback segment in tablespace.

    Action: Use the ALTER TABLESPACE ADD DATAFILE statement to add one or more files to the specified tablespace.

    从原因上看 unable to extend 是因为没有邻近的空间可以去扩展

    报错的是motorola表空间

    首先!我的所有表的next 都是1m pctincrease 0

    所以我就先去查motorola 所在表空间最大的邻近空间

    SQL>SELECT max(bytes)

    FROM   dba_free_space

    WHERE  tablespace_name = 'MOTOROLA';

    MAX(BYTES)

    ----------

    2126503936

    这个结果明显比表的设置 next extent= 1024k 要大

    那我们看看RPT_MOT_CELL_PER的参数

    SELECT next_extent, pct_increase, tablespace_name

    FROM  dba_tab_partitions

    WHERE partition_name='P9' AND table_owner = 'MOT_NMC' AND TABLE_NAME='RPT_MOT_CELL_PER';

    NEXT_EXTENT PCT_INCREASE

    ----------- ------------

    TABLESPACE_NAME

    ------------------------------------------------------------

    1048576           0

    MOTOROLA

    metalink上提供了解决方法:

    1.ALTER TABLESPACE motorola COALESCE;

    The extents must be adjacent to each other for this to work

    我用了!没有用

    2 add datafile 或者 resize

    这个明显是有效果的!后来我加了数据文件以后也是有效果的!

    3.修改next

    这个也是有效的

    后来我发现我的思路有问题了

    早最大的extent 并没有用!

    SELECT count(*)

    FROM   dba_free_space

    WHERE  tablespace_name = 'MOTOROLA';

    ————————

    47212

    SELECT count(*)

    FROM   dba_free_space

    WHERE  tablespace_name = 'MOTOROLA'

    and bytes<1048576;

    ————————

    47208

    大部分extent都是小与1m的所以不能分配 oracle不会去找最大!

最新文章