前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >关于两个简单问题的分析(r9笔记第10天)

关于两个简单问题的分析(r9笔记第10天)

作者头像
jeanron100
发布2018-03-19 16:36:19
7730
发布2018-03-19 16:36:19
举报

工作中碰到问题当然是见怪不怪了,而处理这些问题也是我们的价值所在。 今天处理了几个看起来比较有意思的小问题,当然究其原因,要不是不规范,要不就是基本功不够扎实。 问题1:奇怪的ORA-00600报错,常规的原因 对于ORA-00600的错误,其实自己也碰到过很多次了,绝大多数的情况下,这个错误还是能够反映出来一些不规范的现象。 比如今天得到了一个DDL语句,执行的时候有卡顿,然后直接抛出了ORA-00600的错误。 SQL> CREATE USER "KA_SYS" IDENTIFIED BY VALUES 'S:C4EA100810C8DE6923BCF6F2E2E C8C0FA1BCE0CCB11EA7A6E8234845C424;5FEFDBD83ED3C188' DEFAULT TABLESPACE "MIN_DATA" TEMPORARY TABLESPACE "TEMP"; CREATE USER "KA_SYS" IDENTIFIED BY VALUES 'S:C4EA100810C8DE6923BCF6F2E2E * ERROR at line 1: ORA-00600: internal error code, arguments: [kzsviver:4], [], [], [], [], [], [], [], [], [], [], [] 对于这个错误,自己顿时来了兴趣,不过自己一看,问题其实还是常规的问题,密码怎么串成两行了。这种情况下Oracle应该不知道该怎么处理了。 而进一步来分析,为什么DDL中的密码会串行,还是在生成语句的时候不够规范,我们完全可以格式化一下。 问题2:Switchover中跨存储的兼容问题 在之前分析Switchover的时候,有一个地方简单提了一句,就是备库的临时数据文件是可选的,在备库中如果不存在会尝试重建,如果因为配置原因,没有路径映射,则临时文件无法创建,这个也是一个潜在的问题。 今天在检查一个备库的时候,在open状态 SQL> select open_mode from v$database; OPEN_MODE -------------------- READ ONLY WITH APPLY 但是查看数据库日志,却发现了下面的一段错误日志: alert File 1003 not verified due to error ORA-01157 Errors in file /U01/app/oracle/diag/rdbms/statdb29/statdb2/trace/statdb2_dbw0_57554.trc: ORA-01186: file 1004 failed verification tests ORA-01157: cannot identify/lock data file 1004 - see DBWR trace file ORA-01110: data file 1004: '+DATA' File 1004 not verified due to error ORA-01157 Errors in file /U01/app/oracle/diag/rdbms/statdb29/statdb2/trace/statdb2_dbw0_57554.trc: ORA-01186: file 1005 failed verification tests ORA-01157: cannot identify/lock data file 1005 - see DBWR trace file ORA-01110: data file 1005: '+DATA' 可以根据错误信息得出,创建文件的时候,无法识别磁盘组而创建失败。根据更清晰的信息发现是在创建临时数据文件时抛错。 SQL> select file#,ts#,status,name from v$tempfile FILE# TS# STATUS NAME ---------- ---------- ------- ------------------------------ 1 3 ONLINE +DATA 2 3 ONLINE +DATA 3 3 ONLINE +DATA 4 3 ONLINE +DATA 查看数据字典发现临时文件指向了ASM磁盘组DATA,但是这个备库是文件系统,所以查询dba_temp_files会失败,因为文件压根不存在。 SQL> select file_name,bytes from dba_temp_files; select file_name,bytes from dba_temp_files * ERROR at line 1: ORA-01157: cannot identify/lock data file 1003 - see DBWR trace file ORA-01110: data file 1003: '+DATA' 当然要在备库删除临时数据文件,下面的几种失败方式供参考: SQL> drop tablespace temp including contents and datafiles; drop tablespace temp including contents and datafiles * ERROR at line 1: ORA-16000: database open for read-only access SQL> drop tablespace temp; drop tablespace temp * ERROR at line 1: ORA-16000: database open for read-only access 重新创建一个临时表空间来。 SQL> create temporary tablespace TEMP2 TEMPFILE '/U01/app/oracle/oradata/statdb29/temp01.dbf' SIZE 30G; create temporary tablespace TEMP2 TEMPFILE '/U01/app/oracle/oradata/statdb29/temp01.dbf' SIZE 30G * ERROR at line 1: ORA-00604: error occurred at recursive SQL level 1 ORA-16000: database open for read-only access 当然重启到mount尝试肯定是不对的。为什么,姿势不对,正确的姿势为: SQL> alter tablespace temp drop tempfile 3; Tablespace altered. 继续删除其它的临时数据文件,直到最后一个会报错。 SQL> alter tablespace temp drop tempfile 7; alter tablespace temp drop tempfile 7 * ERROR at line 1: ORA-03261: the tablespace TEMP has only one file 我们可以添加一个,继续删除错误的信息。 SQL> select file#,ts#,status,name from v$tempfile; FILE# TS# STATUS NAME ---------- ---------- ------- ------------------------------ 7 3 ONLINE +DATA SQL> alter tablespace temp add tempfile '/U01/app/oracle/oradata/statdb29/temp01.dbf' size 30G; Tablespace altered. SQL> alter tablespace temp drop tempfile 7; Tablespace altered. 如果仔细分析一下alert日志就会发现,其实前台虽然现实命令执行成功,但是后台的检查却抛出了ORA错误,当然我们需要了解这个分析的过程。 alter tablespace temp drop tempfile 5 Errors in file /U01/app/oracle/diag/rdbms/statdb29/statdb2/trace/statdb2_ora_58092.trc: ORA-01122: database file 1005 failed verification check ORA-01110: data file 1005: '+DATA' ORA-01565: error in identifying file '+DATA' ORA-17503: ksfdopn:2 Failed to open file +DATA ORA-15045: ASM file name '+DATA' is not in reference form Errors in file /U01/app/oracle/diag/rdbms/statdb29/statdb2/trace/statdb2_ora_58092.trc: ORA-01258: unable to delete temporary file +DATA Completed: alter tablespace temp drop tempfile 5 Wed May 25 18:15:11 2016 明白了这些,很多问题其实还是开始所说的,不够规范,基本功不够扎实。

本文参与 腾讯云自媒体分享计划,分享自微信公众号。
原始发表:2016-05-25,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 杨建荣的学习笔记 微信公众号,前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档