数据库11g升级中一次奇怪的问题 (30天)

客户的测试环境已经从10g升级到11g了。但是没过几天,数据hang住了,登都登不了了,而且通过sys,system,普通用户连接的错误都不一样

首先通过 一下命令来查看变量和进程是否都正常

 ps -ef|grep smon  
echo $ORACLE_SID

没发现问题

--使用sys,显示连接到一个空实例
sqlplus / as sysdba
SQL*Plus: Release 11.2.0.2.0 Production on Tue Aug 13 14:51:25 2013
Copyright (c) 1982, 2010, Oracle.  All rights reserved.
Connected to an idle instance.
SQL> 
--使用system连接,显示是oracle不在状态,这和standby物理备库在apply的时候连接进来的情况类似,但是这个库压根没用dataguard。
sqlplus system/xxxx@TEST
SQL*Plus: Release 11.2.0.2.0 Production on Tue Aug 13 14:49:17 2013
Copyright (c) 1982, 2010, Oracle.  All rights reserved.
ERROR:
ORA-01033: ORACLE initialization or shutdown in progress
Process ID: 0
Session ID: 0 Serial number: 0
--使用普通用户连接,显示oracle实例不可用
sqlplus TEST/TEST
SQL*Plus: Release 11.2.0.2.0 Production on Tue Aug 13 14:52:51 2013
Copyright (c) 1982, 2010, Oracle.  All rights reserved.
ERROR:
ORA-01034: ORACLE not available
ORA-27101: shared memory realm does not exist
Linux-x86_64 Error: 2: No such file or directory
Process ID: 0
Session ID: 0 Serial number: 0

我查看alert日志的时候就发现了如下的错误在日志中反复出现。

ORA-20011 ORA-29913 and ORA-29400 , KUP-XXXXX Errors
-----------------from alert log------------------------

Tue Aug 13 22:00:04 2013
XDB installed.
XDB initialized.
Tue Aug 13 22:00:17 2013
Begin automatic SQL Tuning Advisor run for special tuning task  "SYS_AUTO_SQL_TUNING_TASK"
End automatic SQL Tuning Advisor run for special tuning task  "SYS_AUTO_SQL_TUNING_TASK"
Tue Aug 13 22:00:24 2013
DBMS_STATS: GATHER_STATS_JOB encountered errors.  Check the trace file.
Errors in file /dbccbsPT1/oracle/xxxx/oradmp/bdump/diag/rdbms/xxxx/xxxx/trace/xxxx_j000_17725.trc:
ORA-20011: Approximate NDV failed: ORA-29913: error in executing ODCIEXTTABLEOPEN callout
ORA-29400: data cartridge error
KUP-11010: unable to open at least one dump file for fetch
Tue Aug 13 22:25:18 2013
Errors in file /dbccbsPT1/oracle/xxxx/oradmp/bdump/diag/rdbms/xxxx/xxxx/trace/xxxx_j002_17729.trc:
ORA-12012: error on auto execute of job "SYS"."ORA$AT_SA_SPC_SY_133"
ORA-20000: ORU-10027: buffer overflow, limit of 20000 bytes
ORA-06512: at "SYS.DBMS_ADVISOR", line 201
ORA-06512: at "SYS.DBMS_SPACE", line 2465
ORA-06512: at "SYS.DBMS_SPACE", line 2538
Wed Aug 14 02:00:00 2013
Closing scheduler window
Closing Resource Manager plan via scheduler window
Clearing Resource Manager plan via parameter

查看对应的trace文件,发现如下的日志

Starting background process VKRM
Tue Aug 13 22:00:00 2013
VKRM started with pid=31, OS id=17443 
trace file1:
*** 2013-08-13 22:00:24.222
*** SESSION ID:(6238.93) 2013-08-13 22:00:24.222
*** CLIENT ID:() 2013-08-13 22:00:24.222
*** SERVICE NAME:(SYS$USERS) 2013-08-13 22:00:24.222
*** MODULE NAME:(DBMS_SCHEDULER) 2013-08-13 22:00:24.222
*** ACTION NAME:(ORA$AT_OS_OPT_SY_132) 2013-08-13 22:00:24.222
ORA-20011: Approximate NDV failed: ORA-29913: error in executing ODCIEXTTABLEOPEN callout
ORA-29400: data cartridge error
KUP-11010: unable to open at least one dump file for fetch
*** 2013-08-13 22:00:24.230
DBMS_STATS: GATHER_STATS_JOB: GATHER_TABLE_STATS('"SYSTEM"','"TEST_TABLE_TARGET_EXT"','""', ...)
DBMS_STATS: ORA-20011: Approximate NDV failed: ORA-29913: error in executing ODCIEXTTABLEOPEN callout
ORA-29400: data cartridge error
KUP-11010: unable to open at least one dump file for fetch
*** 2013-08-13 22:00:24.252
DBMS_STATS: GATHER_STATS_JOB: GATHER_TABLE_STATS('"SYSTEM"','"TEST_TABLE_SOURCE_EXT"','""', ...)
DBMS_STATS: ORA-20011: Approximate NDV failed: ORA-29913: error in executing ODCIEXTTABLEOPEN callout
ORA-29400: data cartridge error
KUP-11010: unable to open at least one dump file for fetch

这个问题很容易和其他外部的原因联系起来,首先是实例不可用的问题,想要查问题,连都连不进去。 本来打算使用Hanganalyze来分析一下。但sqlplus连不进去,

sqlplus -prelim /nolog之后再connect / as sysdba也不行

最后和Unix team的人沟通了一下,他们有完整的备份,

我记得前几天storage好像有问题了,和他们的人确认了下,他们最后发现时storage的问题,及时的修复了。

实例可以连上了。查看alert还是发现会有如上alert里面的ora 错误,我就有点凌乱了。从metalink上可以看到这个问题很可能是datapump相关的问题导致的

排除了job中有datapump相关的job,注意力集中在了外部表上

我采用了如下的方式

SQL> spool obj.out
SQL> set linesize 200 trimspool on
SQL> set pagesize 2000
SQL> col owner form. a30
SQL> col created form. a25
SQL> col last_ddl_time form. a25
SQL> col object_name form. a30
SQL> col object_type form. a25
SQL> 
SQL> select OWNER,OBJECT_NAME,OBJECT_TYPE, status,
  2  to_char(CREATED,'dd-mon-yyyy hh24:mi:ss') created
  3  ,to_char(LAST_DDL_TIME , 'dd-mon-yyyy hh24:mi:ss') last_ddl_time
  4  from dba_objects
  5  where object_name like 'ET$%'
  6  /
no rows selected
SQL> select owner, TABLE_NAME, DEFAULT_DIRECTORY_NAME, ACCESS_TYPE
  2  from dba_external_tables
  3  order by 1,2
  4  /
OWNER                          TABLE_NAME                     DEFAULT_DIRECTORY_NAME         ACCESS_
------------------------------ ------------------------------ ------------------------------ -------
SYSTEM                         TEST_TABLE_SOURCE_EXT        DATA_PUMP_DIR                  CLOB
SYSTEM                         TEST_TABLE_TARGET_EXT        DATA_PUMP_DIR                  CLOB

查询到如上的两个外部表,基本可以找到问题了。

--使用system连接上来,看看那个表

SQL> conn system/xxx
Connected.
SQL> select count(*)from  TEST_TABLE_SOURCE_EXT;
select count(*)from  TEST_TABLE_SOURCE_EXT
*
ERROR at line 1:
ORA-29913: error in executing ODCIEXTTABLEOPEN callout
ORA-29400: data cartridge error
KUP-11010: unable to open at least one dump file for fetch

发现 报错正式alert中的错误,仔细分析了下,是因为我的这个外部表的directory当时是用了系统中默认的data_pump_dir,升级以后ORACLE_HOME改变了,所以原本的dump所在的目录就不可用了。

因为那两个外部表是之前临时抽取数据用的,所以可以删掉了。

SQL> drop table TEST_TABLE_SOURCE_EXT;
Table dropped.
SQL> drop table TEST_TABLE_TARGET_EXT;
Table dropped.

隐患排除了,alert再没有报这个错。一切正常了。

metalink中对于这个问题的原因描述如下:Doc ID 1274653.1

CAUSE

The primary cause of this issue is that an external table existed at some point in time but does not now. However, the database still believes the table exists since the dictionary information about the object has not been modified to reflect the change. When DBMS_STATS is run against the table in question, it makes a call out to the external table which fails because the object is not there. There are many reasons that an external table may not exist including:

  • Temporary Datapump external tables have not been cleaned up properly. The dictionary information should have been dropped when the DataPump jobs completed.
  • An External table has been removed without clearing up the corresponding data dictionary information. For example: Oracle Demo Schema Tables such as the external table “SALES_TRANSACTIONS_EXT” may have been removed but the dictionary has not been updated to reflect this. The "SALES_TRANSACTIONS_EXT" table is an external table in the "SH" schema which is one of Demo Schema provided by Oracle.

原文发布于微信公众号 - 杨建荣的学习笔记(jianrong-notes)

原文发表时间:2014-04-02

本文参与腾讯云自媒体分享计划,欢迎正在阅读的你也加入,一起分享。

发表于

我来说两句

0 条评论
登录 后参与评论

相关文章

来自专栏乐沙弥的世界

使用datapump 导出导入同义词(export and import synonym using datapump)

      对于同义词的备份我们有多种方式来实现,如直接通过脚本生成同义词的创建脚本,或者使用dbms_metadata.get_ddl来提取同义词的定义脚本。...

603
来自专栏杨建荣的学习笔记

SQL*Loader-805的解决(r2笔记36天)

使用sql*loader是大型项目中数据迁移的利器。如果是外部系统,其他数据库到oracle的数据迁移,使用文本式文件是最兼容的方式。 sqlldr的加载效率是...

2998
来自专栏数据和云

回答了这四个问题,少踩12c 多租户的好多坑

在ACOUG的年终大会上,我分享了一个主题,列举了使用Oracle 12c多租户的过程中可能遇到的各种坑,当你使用一个新产品或者新特性时,如果你不了解,就可能是...

3286
来自专栏乐沙弥的世界

Oracle RAC环境下配置statspack

    Statspack是Oracle 9i时代的产物,对于监控与分析数据库性能有着跨里程碑的意义,是AWR的前身。在Oracle 10g后AWR取代了sta...

553
来自专栏数据库新发现

Oracle数据库恢复:归档日志损坏案例一则

链接:http://www.eygle.com/archives/2010/11/recover_archivelog_corruption.html

592
来自专栏沃趣科技

Oracle 12c系列(五)|PDB Refresh

作者 杨禹航 出品 沃趣技术 PDB Refresh是12C推出的特性,具有对源端PDB进行增量同步的功能,每次刷新会将源端PDB中的任何更改同步到目标...

4166
来自专栏乐沙弥的世界

ORA-32004 的错误处理

启动数据库时,收到了ORA-32004 的错误,错误多是一些过时且在当前版本中不在使用的参数,如果碰到类似的错误,只需要将其

762
来自专栏沃趣科技

Oracle 12c ASM专题|Flex Diskgroup相关概念

原文链接 https://martincarstenbach.wordpress.com/2017/07/11/12-2-new-feature-the-fle...

2747
来自专栏文渊之博

利用PowerShell复制SQLServer账户的所有权限

问题   对于DBA或者其他运维人员来说授权一个账户的相同权限给另一个账户是一个很普通的任务。但是随着服务器、数据库、应用、使用人员地增加就变得很枯燥乏味又耗时...

2098
来自专栏用户2442861的专栏

基于Spring + Spring MVC + Mybatis 高性能web构建

http://blog.csdn.net/zoutongyuan/article/details/41379851#comments

431

扫描关注云+社区