oracle 11g rac ORA-01555 快照过旧报错处理

ORA-01555 快照过旧,是数据库中很常见的一个错误,比如当我们的事务需要使用undo来构建CR块的时候,

而此时对应的undo 已经不存在了, 这个时候就会报ORA-01555的错误。

环境是Oracle 11g RAC 由于客户执行一个比较复杂的SQL,使用PLSQL运行了88分钟后出现报错,这是一个要查看报表的SQL。

临时的处理方法如下:

以下为虚拟机模拟操作,建议数据库安装的时候这个参数一定要提前调整优化一下,不要使用默认值。

[[email protected] ~]# su - oracle
[[email protected] ~]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.4.0 Production on Fri Dec 23 10:39:44 2016
Copyright (c) 1982, 2013, Oracle.  All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options
[email protected]>show parameter undo;
NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
undo_management                      string      AUTO
undo_retention                       integer     900     --默认15分钟
undo_tablespace                      string      UNDOTBS1
[email protected]>
[email protected]>alter system set undo_retention=10800 scope=both;
System altered.

--查看表空间容量

[email protected]>col tablespace_name for a15
[email protected]>col free_rate for a15
[email protected]>SELECT a.tablespace_name,
             ROUND (a.total_size) "total_size(MB)",
             ROUND (a.total_size) - ROUND (b.free_size, 3) "used_size(MB)",
             ROUND (b.free_size, 3) "free_size(MB)",
             ROUND (b.free_size / total_size * 100, 2) || ‘%‘ free_rate
      FROM ( SELECT tablespace_name, SUM (bytes) / 1024 / 1024 total_size
                  FROM dba_data_files
              GROUP BY tablespace_name) a,
             ( SELECT tablespace_name, SUM (bytes) / 1024 / 1024 free_size
                 FROM dba_free_space
             GROUP BY tablespace_name) b
    WHERE a.tablespace_name = b.tablespace_name(+);
TABLESPACE_NAME total_size(MB) used_size(MB) free_size(MB) FREE_RATE
--------------- -------------- ------------- ------------- ---------------
SYSAUX                     600       178.625       421.375 70.23%
UNDOTBS1                   200        56.062       143.938 71.97%
USERS                        5             1             4 80%
SYSTEM                     700         287.5         412.5 58.93%
UNDOTBS2                   200         6.687       193.313 96.66%
[email protected]> SELECT   tablespace_name, status, SUM (bytes) / 1024 / 1024 "Bytes(M)"
        FROM   dba_undo_extents
    GROUP BY   tablespace_name, status;
TABLESPACE_NAME      STATUS      Bytes(M)
TABLESPACE_NAME STATUS      Bytes(M)
--------------- --------- ----------
UNDOTBS1        UNEXPIRED         11
UNDOTBS2        UNEXPIRED      2.125
UNDOTBS1        EXPIRED      44.0625
UNDOTBS2        EXPIRED       3.5625

1.出现ORA-01555错误,通常有2种情况:

1)SQL语句执行时间太长,或者UNDO表空间过小,或者事务量过大,或者过于频繁的提交,导致执行SQL过程中进行一致性读时,SQL执行后修改的前镜像(即UNDO数据)在UNDO表空间中已经被覆盖,不能构造一致性读块(CR blocks)。  这种情况最多。

2)SQL语句执行过程中,访问到的块,在进行延迟块清除时,不能确定该块的事务提交时间与SQL执行开始时间的先后次序。 这种情况很少。

2.第1种情况解决的办法:

1)增加UNDO表空间大小

2)增加undo_retention 时间,默认只有15分钟

3)优化出错的SQL,减少查询的时间,首选方法

4)避免频繁的提交

时间: 2024-08-05 19:12:44

oracle 11g rac ORA-01555 快照过旧报错处理的相关文章

Oracle 11g RAC 二节点root.sh执行报错故障一例

OEL6.X IBM v3500存储多路径配置   http://koumm.blog.51cto.com/703525/1439760 2. 采用RHEL6.5 multipath多路径软件安装采用ASMLIB方式配置ASM共享磁盘成功,但是在第二节点执 行root.sh报如下错误提示,解决方式见3. Disk Group CRS creation failed with the following message:   ORA-15018: diskgroup cannot be creat

Oracle 12C RAC安装grid时root.sh报错ORA-00845

Oracle 12C RAC安装grid时root.sh在二节点报错: CRS-2676: Start of 'ora.cssd' on 'prodb2' succeeded CRS-2672: Attempting to start 'ora.cluster_interconnect.haip' on 'prodb2' CRS-2672: Attempting to start 'ora.ctssd' on 'prodb2' CRS-2676: Start of 'ora.ctssd' on

Oracle 11g服务OracleDBConsoleorcl启动失败(异常或报错)

OracleDBConsoleorcl:Oracle数据库控制台服务,orcl是Oracle的实例标识,默认的实例为orcl.在运行Enterprise Manager(企业管理器OEM)的时候,需要启动这个服务.(非必须启动),但是有时候当我们修改了主机名或改变了ip地址后这个服务会启动不了,导致em访问不了. 我们可以考虑删掉原来的配置,自己从新配置.个人解决这个问题是在win10上 . 第一步: 右击开始->选择命令提示符(管理员)(注意这里必须是管理员模式下,否则会失败!)-> &qu

20170514002Oracle 11g R2安装过程中遇到的报错及解决办法

Oracle 11g R2安装过程中遇到的报错及解决办法 1.提示Check if the DISPLAYvariable is set.    Failed<<<< 解决方案: #xhost +  //切换到root用户输入 #su – Oracle  //切换到oracle用户 $./runInstaller  //执行安装程序 xhost 是用来控制X server访问权限的. 通常当你从hostA登陆到hostB上运行hostB上的应用程序时, 做为应用程序来说,hostA

oracle 11g rac dbca建库时提示创建监听

Oracle 11g rac dbca建库时提示创建监听 在安装oracle 11g rac时,使用dbca建库的过程中提示需要创建监听: Default Listener "LISTENER" is not configured in Grid Infrantructure home.Use NetCA to configure Default Listener and return DBCA 解决步骤如下 因为oracle 11g rac在安装过程中会自动创建监听,无需手动创建,首

Oracle 11g RAC停止和启动步骤

关闭前备份控制文件/参数文件:   sqlplus / as sysdba alter database backup controlfile to '/home/oracle/control.ctl.bak'; create pfile='/home/oracle/init<实例名>.ora' from spfile; 一,oracle 11g RAC关闭顺序 1.停止em服务su - oracleexport ORACLE_UNQNAME=db11emctl status dbconsol

管理oracle 11g RAC 常用命令

1).检查集群状态: [[email protected] ~]$ crsctl check cluster CRS-4537: Cluster Ready Services is online CRS-4529: Cluster Synchronization Services is online CRS-4533: Event Manager is online 2).所有 Oracle 实例 —(数据库状态): [[email protected] ~]$ srvctl status da

Oracle 11g RAC oc4j/gsd Offline

Oracle 11g RAC中,发现oc4j以及gsd服务都处于offline状态,这是Oracle 11g RAC默认情形.即便如此,并不影响数据库的使用,因为 oc4j 是用于WLM 的一个资源, WLM在 11.2.0.2 才可用.GSD则是用于支持dbca,srvctl,oem等的交互工具.本文描述将这两个服务切换到online. [python] view plain copy print? 1.环境 [[email protected] ~]# cat /etc/issue Ente

oracle 11g RAC安装节点二执行结果错误CRS-5005: IP Address: 192.168.1.24 is already in use in the network

[[email protected] ~]# /u01/app/oraInventory/orainstRoot.sh Changing permissions of /u01/app/oraInventory. Adding read,write permissions for group. Removing read,write,execute permissions for world. Changing groupname of /u01/app/oraInventory to oins