oracle常见错误代码及其解决办法详解.doc

上传人:sk****8 文档编号:3520401 上传时间:2019-06-01 格式:DOC 页数:23 大小:69.50KB
下载 相关 举报
oracle常见错误代码及其解决办法详解.doc_第1页
第1页 / 共23页
oracle常见错误代码及其解决办法详解.doc_第2页
第2页 / 共23页
oracle常见错误代码及其解决办法详解.doc_第3页
第3页 / 共23页
oracle常见错误代码及其解决办法详解.doc_第4页
第4页 / 共23页
oracle常见错误代码及其解决办法详解.doc_第5页
第5页 / 共23页
点击查看更多>>
资源描述

1、oracle 常见错误代码及其解决办法详解在使用 ORACLE 的过程过,我们会经常遇到一些 ORACLE 产生的错误,对于初学者而言,这些错误可能有点模糊,而且可能一时不知怎么去处理产生的这些错误,本人就使用中出现比较频繁的错误代码一一做出分析,希望能够帮助你找到一个合理解决这些错误的方法,同时也希望你能够提出你的不同看法。毕竟作为一种交流的手段,个人意见难免过于偏颇,而且也必定存在着不足,出错之处在所难免。写这篇文章的目的就是想通过相互之间的交流共同促进,共同进步。ORA-01650:unable to extend rollback segment NAME by NUM intable

2、space NAME产生原因:上述 ORACLE 错误为回滚段表空间不足引起的,这也是 ORACLE数据管理员最常见的 ORACLE 错误信息。当用户在做一个非常庞大的数据操作导致现有回滚段的不足,使可分配用的回滚段表空间已满,无法再进行分配,就会出现上述的错误。解决方式:使用“ALTER TABLESPACE tablespace_name ADD DATAFILE filename SIZE size_of_file”命令向指定的数据增加表空间,根据具体的情况可以增加一个或多个表空间。当然这与还与你主机上的裸盘设备有关,如果你主机的裸盘设备已经没有多余的使用空间,建议你不要轻意的增加回滚段

3、表空间的大小,可使用下列的语句先查询一下剩余的 tablespace 空间有多少:Select user_name,sql_text from V$open_cursor where user_name=;如果多余的空间比较多,就可以适当追加一个大的回滚段给表空间使用,从而避免上述的错误。你也可以用以下语句来检测一下 rollback segment 的竞争状况:Select class,count from V$waitstat where calss in(system undo header,system undo block,undo header,undo block);和Selec

4、t sum(value) from V$sysstat where name in (db_block_gets,consistents gets);如果任何一个 class in count/sum(value)大于 1%,就应该考虑增加rollback segment。相应的英文如下:Cause:Failed to allocate extent from the rollback segment in tablespaceAction:Use the ALTER TABLESPACE ADD DATAFILE statement to add one or more files to t

5、he specified tablespace.ORA-01652:unable to extend temp segment by num in tablespace name产生原因:ORACLE 临时段表空间不足,因为 ORACLE 总是尽量分配连续空间,一但没有足够的可分配空间或者分配不连续就会出现上述的现象。解决方法:我们知道由于 ORACLE 将表空间作为逻辑结构-单元,而表空间的物理结构是数据文件,数据文件在磁盘上物理地创建,表空间的所有对象也存在于磁盘上,为了给表空间增加空间,就必须增加数据文件。先查看一下指定表空间的可用空间,使用视图 SYS.DBA_FREE_SPACE,视

6、图中每条记录代表可用空间的碎片大小:SQLSelect file_id,block_id,blocks,bytes from sys.dba_free_space where tablespace_name=;返回的信息可初步确定可用空间的最大块,看一下它是否小于错误信息中提到的尺寸,再查看一下缺省的表空间参数:SQLSELECT INITIAL_EXTENT,NEXT_EXTENT,MIN_EXTENTS,PCT_INCREASE FROM SYS.DBA_TABLESPACES WHERE TABLESPACE_NAME=name;通过下面的 SQL 命令修改临时段表空间的缺省存储值:SQ

7、LALTER TABLESPACE name DEFAULT STORAGE (INITIAL XXX NEXT YYY);适当增大缺省值的大小有可能解决出现的错误问题,也可以通过修改用户的临时表空间大小来解决这个问题:SQLALTER USER username TEMPORARY TABLESPACE new_tablespace_name;使用 ALTER TABLESPACE 命令,一但完成,所增加的空间就可使用,无需退出数据库或使表空间脱机,但要注意,一旦添加了数据文件,就不能再删除它,若要删除,就要删除表空间。一个报错例子如下:ORA-1652:unable to extend t

8、emp segment by 207381 in tablespace TEMPSPACE相应的英文如下:Cause: Failed to allocate extent for temp segment in tablespaceAction:Use the ALTER TABLESPACE ADD DATAFILE statement to add one or more files to the specified tablespace or create the object in another tablespace.ORA-01578:Oracle data block corru

9、pted(file # num,block # num)产生原因:当 ORACLE 访问一个数据块时,由于 1、硬件的 I/O 错误;2、操作系统的 I/O 错误或缓冲问题;3、内存或 paging 问题;4、 ORACLE 试图访问一个未被格式化的系统块失败;5、数据文件部分溢出等上述几种情况的一种引起了逻辑坏块或者物理坏块,这时就会报 ORA-01578 的错误。解决方式:由于 ORACLE 只有在访问到有问题的数据文件时才会报错,所以报错的时间有可能会比实际出错的时间要晚,如果 ORA-01578 出错信息提示数据坏块指向的是用户自己的数据文件,则用以下方法来解决:如果通过下面的 SQL

10、 语句查出的坏块出现有索引上,则只需重建索引即可SQLSelect owner,segment_name,segment_type from dba_extents where file_id= and between block_id and block_id+blocks-1;(和分别是 ORA-01578 报出的坏块出现的文件号和块号)如果坏块出现在表上,先用以下语句分析是否为永久性坏块(建议多执行一两次,有助于鉴别数据坏块是永久性的(硬盘上的物理坏块)还是随机性的(内存或硬件错误引起): SQLAnalyze table validate structure cascade;执行该命令

11、后,可能会出现以下的结果:ORA-01578:与原先错误信息有相同的参数,为永久性的物理或逻辑坏块;与原先错误信息有不同的参数,可能与内存,page space 和 I/O 设备有关。如果用户有此表的最新备份,那么最好是用此备份来恢复此表,或者使用event 10231 来取出坏块以外的数据:.先关闭数据库.编辑 init.ora 文件,加入:event=”10231 trace name context forever,level 10”.startup restrict.创建一个临时表:SQLcreate table errortemp as select * from error;(er

12、ror 是坏表的表名).把 event 从 init.ora 文件中删掉并重起数据库.rename 坏表,把临时表 rename 成坏表的表名.创建表上的 INDEX 等如果 ORA-01578 出错信息提示数据坏块指向的是数据字典或者是回滚段的话,你应该立即与 ORACLE 公司联系,共同商量一个好的解决办法。这里所讲的解决方法只是比较常见的一种,一些更为具体的解决办法可以查看一下 ORACLE 的故障解决手册,那里面有浞及使用 ROWID 方法来取出坏块以外的数据的方法,这里就不介绍了。相应的英文如下:Cause:The given data block was corrupted,pro

13、bably due to program errorsAction:Try to restore the segment containing the given data block,This may involve dropping the segment and recreating it,If there is a trace file,report the messages recorded in it to customer support.ORA-01628:max # of extents num reached for rollback segment num产生原因:这种错

14、误通常为一个回滚段和一个表空间已经达到 MAXEXTENTS参数设置的极限。要注意的是这个 MAXEXTENTS 不是该回滚段或表空间的硬件极限,硬件极限取决于数据库创建时在 init.ora 文件中指定的 DB_BLOCK_SIZE 参数的值。解决方法:使用 SQL 命令 ALTER TABLESPACESTORAGE(MAXEXTENTS XXXX)来增加 MAXEXTENTS,其中“XXXX”值必须大于错误信息中所指的数值,但不能大于 LARGEST MAXEXTENT 的值,如果已经达到了 LARGEST MAXEXTENT VALUE,解决的办法就是重新创建较大的范围尺寸,使用带有选

15、项 COMPRESS=Y的 Export 工具导出表,如果表空间有可用空间,先给表做一个备份,用 alter tablespace tablespace_name 更改其名字,然后再装载表回数据库。查看其错误出现的地方,如果出现在回滚段或索引上,那么必须将其删除并重建,如果出现在临时表空间,修改临时表空间的存储字段,便可解决这个问题。一个报错例子如下:ORA-1628:max # extents 50 reached for rollback segment RBS_1相应的英文如下:Cause: An attempt was made to extend a rollback segment

16、 that already has reached its maximum size or space could not be allocated in the data dictionary to contain the definition of the object.Action:If possible,increase the value of either the MAXEXTENTS or PCTINCREASE initialization parameters or find the data dictionary table lacking space and alter

17、the storage parameters,as described in the Oracle8 Server Administrators Guide.ORA-00600:internal error code,arguments:num,?,?,?,?产生原因:这种错误通常为 ORACLE 的内部错误,只对 OSS 和 ORACLE 开发有用。ORA-600 的错误经常伴随跟踪文件的状态转储(系统状态和进程状态),系统状态存储将包括 ORACLE RDBMS 持有的当前对象的信息,进程状态转储则将显示特殊进程持有的对象,当进程符合了某错误条件时,经常是由于一些信息取自它持有的一个块,如

18、果我们知道这些错误进程持有的块,就容易跟踪问题的来源。解决方法:一般来说出现这个错误我们本身是无法解决的,只有从提高系统本身各方面来解决这个内部问题,如增加硬件设备,调整系统性能,使用OPS(当然 OPS 从某种意义上说并不是一种好的解决方式)等。ORA-600 错误的第一个变量用于标记代码中错误的位置(代码中的每个部分的第一变量都不一样),从第二个到第五个变量显示附加信息,告诉 OSS 代码在哪里出现了错误。一个报错例子如下:ORA-00600: internal error code, arguments: 1237, , , , , , , 相应的英文如下:Cause:This is a

19、 catchall internal error message for Oracle program exceptions.It indicates that a process has met a low-level,unexpected condition.Various causes of this message include:Time-outs(超时)File corruption(文件太老)Failed data checks in memory(内存检索失败)Hardware,memory,or I/O errors(硬件、内存或者磁盘错误)Incorrectly resto

20、red files(错误的重建文件)ORA-03113:end-of-file on communication channel产生原因:通讯不正常结束,从而导致通讯通道终止解决方法:1.检查是否有服进程不正常死机,可从 alert.log 得知2.检查 sql*Net Driver 是否连接到 ORACLE 可执行程序3.检查服务器网络是否正常,如网络不通或不稳定等4.检查同一个网上是否有两个同样名字的节点5.检查同一个网上是否有重复的 IP 地址相应的英文如下:Cause:An unexpected end-of-file was processed on the communicatio

21、n channel.The problem could not be handled by the Net8,two task,software.This message could occur if the shadow two-task process associated with a Net8 connect has terminated abnormally,or if there is a physical failure of the interprocess communication vehicle,that is,the network or server machine

22、went down.Action:If this message occurs during a commection attempt,check the setup files for the appropriate Net8 driver and confirm Net8 software is correctly installed on the server.If the message occurs after a connection is well established,and the error is not due to a physical failure,check i

23、f a trace file was generated on the server at failure time.Existence of a trace file may suggest an Oracle internal error that requires the assistance of customer support.ORA-00Array42:table or view does not exist产生原因:这是由于装载的表或视图不存在,多半是 CATEXP.SQL 还没有运行,无法执行 Export 视图,如果 CATEXP.SQL 已经运行,则可能是版本错误。解决方

24、法:因为 Import 和 Export 共享的一些视图是通过运行 CATEXP.SQL来装载的(它们具有相同的视图),并不生成单独的 CATEXP.SQL,因而造成视图与 Export 代码不同步,较难保持彼此之间的兼容,用户就必须建立自己的Export 应用,从而避免 ORA- 00Array42 的错误。相应的英文如下:Cause:The table or view entered does not exist,a synonym that is jnot allowed here was used,or a view was referenced where a table is re

25、quired.Existing user tables and views can be listed by querying the data dictionary.Certain privileges may required to access the table.If an application returned this message,the table the application tried to access does not exist in the database,or the application does not have access to it.Actio

26、n:Check each of the following:The spelling of the table or view name.That a view is not specified where a table is requiredThat an existing table or view name exists.Contact the database administrator if the table needs to be created or if user or application priviledes are required to access the ta

27、ble.Also, if attempting to access a table or view in another schema,make certain thecorrect schema is referenced and that access to the object is granted.ORA-015Array8:rollback segment “name” is not onlineCause:The rollback segment was taken offline either manually or by SMON.Action:Check the status

28、 of the rollback segment in DBA_ROLLBACK_SEGS.ORA-1636: rollback segment “name” is already onlineCause:A rollback segment can only be used by one instance and an instance is trying to bring a rollback segment online that is already in use.Action:Check that the values set in the initialization parame

29、ter file for parameters ROLLBACK_SEGMENTS,ROLLBACK_SEGMENT_INITIAL,and ROLLBACK_SEGMENT_COUNT are correctly set for the instance whiththe problem,Also check that the instance is using the correct initialization parameter file.Make sure you are not confused about the difference between private and pu

30、blic rollback segments.See the Oracle8 Server Administrators Guide for more information about using rollback segments in paraller mode.上述错误均为我们在使用回滚段时比较常见的问题,ORA-015Array8 指明当前使用的回滚段的状态为“not online”,不能使用,将它改为“online”状态即可使用;ORA-01636 指明当前回滚段已经为“online”状态,可以直接使用,不用再集合它。ORA-1636 signalled during: alter

31、 rollback segment rb00 online我们在做统计时还可能遇到下述问题:一个 rollback segment 的状态为”Needs Recovery”的现象,这是由于 ORACLE 回退一个事物表中的没有提交的事物时失败所造成的。通常原因为一个 datafile 或者 tablespace 是在 offline的状态或者一个 undo 的目标被破坏或者 rollback segment 被破坏。解决的办法是将所有的 tablespace 和 datafile 都置为 online 状态,如果不能解决则做下面的工作:1.在 initsid.ora 中加入 event=”10

32、015 trace name context forever lever 10”;2.shutdown 数据库然后重启;3.在$ORACLE_HOME/rdbms/log 下,找到 startup 时生成的 trace file;4.在 trace 文件中,找到下列信息“error recovery tx(#,#) object #”;5.根据 object#(与 sys.dba_objects 表中的 object_id 相同)在sys.dba_objects 表中查出该 object 的名字;6.将该 object drop 掉;7.在 init.ora 文件中将该 rollback se

33、gment 放回 rollback_segments 参数中,删除 event;8.shutdown 数据库然后重启。此时”Needs Recovery”的问题应该是完全解决了,否则就是 rollback segment 被破坏了。ORA-01688:unable to extend table name.name partition NAME by NUM in tablespace NAME产生原因:指定的 tablespace 空间已经被占用满,无法扩展。解决方法:使用“ALTER TABLESPACE ADD DATAFILE”命令增加文件系统文件和原始分区,或者增加 INITIAL

34、的大小(如:alter tablespace CDRS101 default storage(next 500M pctincrease 1))应该能够解决,否则就是有人使用你的表空间上创建了一个比较大的数据文件导致你的表空间不够用。一个报错例子如下: ORA-1688: unable to extend table RMMCDR.LOCAL_CDR partition LOCAL_CDR101 by 460800 in tablespace CDRS101相应的英文如下:Cause:An extent could not be allocated for a table segment in

35、 tablespaceAction:Use the ALTER TABLESPACE ADD DATAFILE statement to add one or more files to the specified tablespace. 认识 EM(企业管理器)的体系结构=Oracle Enterprise Manager (EM) 2.x 实现了一个 3 层结构,其组成如下:第一层 First-tier:第一层是客户端工具,如:EM Console, DBA Management Pack 和其他集成的 Oracle 应用。这些工具是从 Windows NT, Windows Array5

36、, Windows Array8 或 Sun Solaris 机器的本地启动的。这些工具也可以是通过浏览器下载下来的 JAVA applet。中间层 Middle-tier:中间层(也就是第二层) 由安装在 Windows NT 或 Sun Solaris server 上的Oracle Management Server (OMS)构成。要使用 EM Console(企业管理器的控制台)和 Job&Event subsystem(任务与事件子系统),必须有一个配置好的 Oracle Management Server。OMS 提供了:- 访问 EM 库(Repository)中的信息- 分派

37、控制台的请求- 控制任务执行- 监控事件- 通过电子邮件或寻呼提示任务的完成或事件发生多个 OMS 能够提供:- 无需额外的管理,就可以实现负载的分布- 工作量能够自动地被共享和均衡- 容错:一个 OMS 可以重做另外一个 OMS 的工作量第三层 Third-tier:第三层是智能代理(Intelligent Agent),是在每个 server 上必须安装的,用来执行任务和监控发生在该服务器各被管理对象上的事件的软件. 被管理对象包括网络节点(服务器)、数据库、侦听程序(listener)以及其他安装在这些结点上的 Oracle 服务。这三层可以是在同一台机器上,不同的机器上,或任意的组合,都可以。B. 企业管理器(EM)框架的设置=为了配置简便,每层配置后,应先验证是否配置正确,然后到下一层。方便的构造过程是从第三层到第一层。I. 配置第三层:为了管理结点和结点上的 oracle 服务,必须在结点上配置并运行一个智能代理(Intelligent Agent)。智能代理是由 Oracle Server CD 上安装的。详细安装信息,参考 Oracle Server 安装指南和 Intelligent Agent 用户指南。如果被管理的结点是一个 Windows NT 系统:

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 实用文档资料库 > 策划方案

Copyright © 2018-2021 Wenke99.com All rights reserved

工信部备案号浙ICP备20026746号-2  

公安局备案号:浙公网安备33038302330469号

本站为C2C交文档易平台,即用户上传的文档直接卖给下载用户,本站只是网络服务中间平台,所有原创文档下载所得归上传人所有,若您发现上传作品侵犯了您的权利,请立刻联系网站客服并提供证据,平台将在3个工作日内予以改正。