Oracle Study之案例--Oracle Sqlplus错误

迷南。 2022-08-07 10:39 332阅读 0赞

Oracle Study之案例—Oracle Sqlplus错误

系统环境:

操作系统:AIX5.3

数据库: Oracle 10gR2

wKiom1S3elTR8RPtAAIs2ex0EMc791.jpg

案例分析:

  1. 1、查看空间信息
  2. [oracle@aix220 ~]$df -m
  3. Filesystem MB blocks Free %Used Iused %Iused Mounted on
  4. /dev/hd4 17408.00 1238.15 93% 37699 12% /
  5. /dev/hd2 8192.00 6310.39 23% 46534 4% /usr
  6. /dev/hd9var 2048.00 1725.55 16% 1704 1% /var
  7. /dev/hd3 2048.00 1902.58 8% 420 1% /tmp
  8. /dev/fwdump 3072.00 3071.21 1% 4 1% /var/adm/ras/platform
  9. /dev/hd1 2048.00 1821.98 12% 74 1% /home
  10. /proc - - - - - /proc
  11. /dev/hd10opt 2048.00 1374.77 33% 8934 3% /opt
  12. /dev/lv00 1024.00 991.80 4% 18 1% /var/adm/csd
  13. /dev/arch 10240.00 8347.63 19%
  14. /dev/lv02 15360.00 10097.80 35% 123693 4% /u01
  15. 2、查看文件权限
  16. [oracle@aix220 ~]$ls -ld /u01/app/oracle/admin/master/
  17. drwxr-x--- 8 oracle dba 512 Feb 17 16:40 /u01/app/oracle/admin/master/
  18. [oracle@aix220 ~]$ls -ld /u01/app/oracle/admin/master/adump/
  19. drwxr-x--- 2 oracle dba 1536 Feb 17 19:48 /u01/app/oracle/admin/master/adump/
  20. 3、查看文件系统信息
  21. [oracle@aix220 dbs]$cat /etc/filesystems
  22. /u01:
  23. dev = /dev/lv02
  24. vfs = jfs
  25. log = /dev/loglv00
  26. mount = true
  27. options = rw
  28. account = false
  29. [root@aix220 /]#lsvg -l oraclevg
  30. oraclevg:
  31. LV NAME TYPE LPs PPs PVs LV STATE MOUNT POINT
  32. loglv00 jfslog 1 1 1 closed/syncd N/A
  33. lv02 jfs 120 120 1 closed/syncd /u01
  34. [root@aix220 /]#df -m
  35. Filesystem MB blocks Free %Used Iused %Iused Mounted on
  36. /dev/hd4 17408.00 1238.18 93% 37700 12% /
  37. /dev/hd2 8192.00 6310.39 23% 46534 4% /usr
  38. /dev/hd9var 2048.00 1725.56 16% 1704 1% /var
  39. /dev/hd3 2048.00 1902.58 8% 420 1% /tmp
  40. /dev/fwdump 3072.00 3071.21 1% 4 1% /var/adm/ras/platform
  41. /dev/hd1 2048.00 1821.98 12% 74 1% /home
  42. /proc - - - - - /proc
  43. /dev/hd10opt 2048.00 1374.77 33% 8934 3% /opt
  44. /dev/lv00 1024.00 991.80 4% 18 1% /var/adm/csd
  45. /dev/arch 10240.00 8347.63 19% 52 1% /arch
  46. /dev/lv01 5120.00 4959.25 4% 16 1% /flash
  47. /dev/lv03 25600.00 24796.43 4% 17 1% /home/oracle/arch_master
  48. rhel152:/backup/cuug15/storage30 14111.05 13052.23 8% 31 1% /backup
  49. mount文件系统失败:
  50. [root@aix220 /]#mount /u01
  51. Replaying log for /dev/lv02.
  52. mount: /dev/lv02 on /u01: Unformatted or incompatible media
  53. The superblock on /dev/lv02 is dirty. Run a full fsck to fix.
  54. 修复文件系统:
  55. [root@aix220 /]#fsck -y /dev/lv02
  56. ......
  57. ** Phase 5 - Check Inode Map
  58. ** Phase 6 - Check Block Map
  59. Bad Block Map (SALVAGED)
  60. ** Phase 6b - Salvage Block Map
  61. Superblock is marked dirty (FIXED)
  62. 123665 files 10749336 blocks 20707944 free
  63. ***** Filesystem was modified *****
  64. mount文件系统成功:
  65. [root@aix220 /]#mount /u01
  66. [root@aix220 /]#df -m
  67. Filesystem MB blocks Free %Used Iused %Iused Mounted on
  68. /dev/hd4 17408.00 1238.16 93% 37699 12% /
  69. /dev/hd2 8192.00 6310.39 23% 46534 4% /usr
  70. /dev/hd9var 2048.00 1725.55 16% 1704 1% /var
  71. /dev/hd3 2048.00 1902.58 8% 420 1% /tmp
  72. /dev/fwdump 3072.00 3071.21 1% 4 1% /var/adm/ras/platform
  73. /dev/hd1 2048.00 1821.98 12% 74 1% /home
  74. /proc - - - - - /proc
  75. /dev/hd10opt 2048.00 1374.77 33% 8934 3% /opt
  76. /dev/lv00 1024.00 991.80 4% 18 1% /var/adm/csd
  77. /dev/lv02 15360.00 10111.30 35% 123674 4% /u01
  78. 执行sqlplus命令成功:
  79. [root@aix220 /]#su - oracle
  80. [oracle@aix220 ~]$sqlplus '/as sysdba'
  81. SQL*Plus: Release 10.2.0.1.0 - Production on Tue Feb 17 19:46:03 2015
  82. Copyright (c) 1982, 2005, Oracle. All rights reserved.
  83. Connected to an idle instance.
  84. SQL>

数据库库报ORA-09925: Unable to create audit trail file,当时查 df -h有可用空间,目录的权限也正确,未df -i查看Inodes使用情况,审计目录下有将近24W个文件,初步猜测是因为审计生成文件过多导致目录所在分区的Inodes用光了,当时删除部分审计TRACE文件后正常未查看 Inodes使用情况。

汇总了下:ORA-09925的原因大致有以下三种:—其实可以根据报错判断是权限问题还是磁盘空间问题

原因一:目录权限问题—目录权限被改,无权限向目录写审计数据
Oracle bin目录(实际是整个oracle目录)的属主被更改: —ls -al bin
解决方法
chown -R oracle.oinstall /opt/orace
原因二:确实磁盘没空间了 —df -h
原因三:磁盘Inodes用光—df -i

参考:模拟Linux磁盘分区有可用空间无可用Inodes时报错:No space left on device

报错示例:—部分网络

示例1:可以根据报错信息判断是目录权限问题导致不能写入

ORA-09925: Unable to create audit trail file
Linux Error: 13: Permission denied
Additional information: 9925
ORA-09925: Unable to create audit trail file
Linux Error: 13: Permission denied
Additional information: 9925

示例2:—只读文件系统—没有写权限(可能是文件系统出问题)

ORA-09925: Unable to create audit trail file
Linux-x86_64 Error: 30: Read-only file system
Additional information: 9925
ORA-01075: you are currently logged on

示例3:—没有可用空间

wKiom1S4dWTwKcNbAAG6a2Edp1Y833.jpg##############################
MOS上的一段描述及解决:
Problem Description —————————-
Problem occurs when: $ORACLE_HOME/rdbms/audit directory is full or $ORACLE_HOME/rdbms/audit directory doesn’t exist as a side effect of this problem oracle asks for password after connect internal

Solution Description ——————————
Make space available in $ORACLE_HOME/rdbms/audit by removing files that are not needed or Make sure the directory exists and is readable by oracle or Change init.ora audit_file_dest to an existing directory. Change init.ora parameter means restart instance as workaround kill pmon.

Explanation —————-
The behavior on Unix is to write a file named ora_.aud into the directory specified by audit_file_dest. The default directory is /rdbms/audit. The file will contain an entry for the audited action, which would be internal logins or startup. On ports which support an OS audit trail, these records will be written there. This feature is not affected by the settings of the audit_trail parameter.

ORA-09925: “Unable to create audit trail file”

Cause: ORACLE was not able to create the file being used to hold audit trail records.

Action: Check the UNIX error number for a possible operating system error.
If there is no error, contact ORACLE customer support.

References —————

[NOTE:1018924.102] ORA-09925 ON DATABASE STARTUP [NOTE:1056988.6] ORA-09925 DURING HOT BACKUPS [NOTE:21073.1]

OERR: ORA-9925 “Unable to create audit trail [BUG:723955] SQLPLUS ALLOWS DB STARTUP (BUT NOT SHUTDOWN)

IF AUDIT_FILE_DEST DOESN’T EXIST

Search Words —————— ORA-09925 audit trail audit_file_dest

本文出自 “天涯客的blog” 博客,请务必保留此出处http://tiany.blog.51cto.com/513694/1604445

发表评论

表情:
评论列表 (有 0 条评论,332人围观)

还没有评论,来说两句吧...

相关阅读