FAQ of oralce3

来源:互联网 发布:藏历万年历网络查询 编辑:程序博客网 时间:2024/05/21 16:56

1.1.1    安装oracle9i问题 报错:ora-00205 

ora-00205:
00205, 00000, "error in identifying controlfile, check alert log for more info"
// *Cause:  The system could not find a controlfile of the specified name and
//    size.
// *Action: Check that ALL controlfiles are online and that they are the same
//         files that the system created at cold start time.

由错误码明确可知:数据库起不来,是由于控制文件对应的指定命名或是所给的控制文件空间存在问题。

 

配置的控制文件空间小于规定的500M,需要扩大

1.1.2    oracle数据库启动时报ORA-03113错误

数据库双机,备机数据能正常启动,但是主机却始终无法启动,单独检查主机发现。使用sqlplus "/as sysdba" 能正常进入sql命令行,但是使用startup无法正常启动数据库。

  使用startup,数据库报以下错误
ORA-03113:end-of-file on communication channel
Process id: 22995
Session id: 665 serial number:3

由于在安装数据库双机起初均能正常启动,所以应该是后期对主机做了参数修改所造成的。但是无法准确判断具体是因为对oracle做了参数调整引起的,还是因为在安装其他模块时对os做系统调整所造成的。故只能一项一项的排查。

 1)因为备机上的oracle软件是从主机上tar过去的.所以判断应该是主机参数做了修改所导致的,于是将备机上的oracle tar到主机上,然后启动数据库,故障依然,故判断与oracle软件无关。
2)查找资料发现引起ora-03113有以下原因
Unix核心参数设置不当 
Oracle
执行文件权限不正确/环境变量问题 
客户端通信不能正确处理 
数据库服务器崩溃/操作系统崩溃/进程被kill 
Oracle 
内部错误 
特定SQLPL/SQL引起的错误 
空间不够 
防火墙的问题 
其它原因 
通过反复检查,应该是修改unix核心参数,导致系统资源不够所引起的.将正常机器的/etc/sysctl.conf文件替换即可.

 

 

1.1.3    数据库某表空间异常导致其它数据库启动失败

启动数据库时报如下错误:
ORA-01242: data file suffered media failure: database in NOARCHIVELOG mode
ORA-01116: error in opening database file 12
ORA-01110: data file 12: '/home/oracle/oradata/rringgw_data.dbf'
ORA-27041: unable to open file

通过提示信息可知,数据库启动失败是由于'/home/oracle/oradata/rringgw_data.dbf'表空间出现异常,致使数据库实例启动失败。

处理过程如下:
第一步:SQL>startup mount
第二步:SQL>alter database datafile '/home/oracle/oradata/rringgw_data.dbf' offline drop;
第三步:SQL>alter database open
如果启动正常,下面步骤不用执行了。
第四步:SQL>select sysdate from dual;
第五步:SQL>alter database open
第六步:SQL>alter database datafile '/home/oracle/oradata/rringgw_data.dbf' offline drop;
第七步:SQL>alter database open;
如果此时还是启动异常,那么先关闭数据库,再重新启动,即:
SQL>shutdown immediate;
SQL>startup;

需要在同一个数据库实例上创建多个数据库表空间,建议将不同数据库数据文件放在不同的表空间上,避免一个数据库表空间出现异常,导致所有数据库启动失败。

 

 

1.1.4    RAC库时因裸设备数据文件的Size指定过大导致报错ORA-01092

Oracle 9205版本,在使用裸设备建RAC库(Oracle cluster database)时,DBCA程序总是报ORA-01092错误。

oerr ora 01092
01092, 00000, "ORACLE instance terminated. Disconnection forced"
// *Cause:  The instance this process was connected to was terminated
//          abnormally, probably via a shutdown abort. This process
//          was forced to disconnect from the instance.
// *Action: Examine the alert log for more details. When the instance has been 
//          restarted, retry action.

1、首先检查了alert log,但是没有发现更为详细的错误信息;
2、停止DBCA程序,重新启动DBCA开始建库,问题依然;
3、重复多次,问题始终无法解决;第二天早晨重新执行DBCA建库时,发现指定datafilesize时,temp表空间的数据文件指定为2000M,而创建的对应的裸设备的大小却是1024M 而数据文件大小应该小于等于裸设备大小减去BLOCK SIZE8 KB by default),找到问题所在。

更改temp数据文件的大小为1000M,重新执行DBCA,建库成功。

在测试环境重新测试建Oracle single instance database,模拟同样的错误,却发现报错信息不同,为ORA-27042 "not enough space on raw partition to fullfill request",报错更为准确。而在RAC环境却是报ORA-01092错误,报错并不准确,怀疑是Oracle RACbug

 

1.1.5    环境变量配置错误导致客户端连接数据库失败

1AIX5.3 ORACLE9206 RAC
2
、数据库已正常启动,监听也正常启动,但客户端在连接数据库时报如下错:
ERROR:
ORA-01034: ORACLE not available
ORA-27101: shared memory realm does not exist
IBM RS/6000 Error: 2: No such file or directory 

 

1、检查监听状态为正常.lsnrctl status
2、上网上进行查找错误原因,其解决方案为:
1. Fix the static database entries in LISTENER.ORA
Check that the SID_DESC statements in SID_LIST_<listener> in LISTENER.ORA contain correct values for the ORACLE_HOME, SID_NAME and GLOBAL_DBNAME entries.
Alternatively you may remove the SID_DESC entries for the databases in order to force the listener to use only dynamic instance registrations.

 

1、经检查oracle用户的环境变量,profile发现ORACLE_HOME=/home/oracle/.
在后面多了一个“/”。
2、删除该“/”重新登录并重启监听,即正常。

 

1.1.6    由于SGA的大小超过了操作系统shm的大小导致启动实例报错ORA-00845

 

suse10+oracle11g,修改oracle初始化参数“memory_max_target”后,启动实例报错ORA-00845: MEMORY_TARGET not supported on this system

该问题是由于SGA的大小超过了操作系统/dev/shm的大小。设置了memory_max_target后,memory_target也被自动设置上(与memory_max_target的值相等)。而memory_target是自动管理SGAPGA的,当自动分配给SGA的大小大于操作系统设置的/dev/shm的大小时,就会报ORA-00845错误。

1、修改/dev/shm的大小(使用root用户操作):
hbmcnsdb1B:~ # vi /etc/fstab
shm       /dev/shm     tmpfs      size=12g       0 0
该例中memory_max_target设置为10g,因此将size设置为12g(修改前为8g)。
2、重新挂载/dev/shm(使用root用户操作):
hbmcnsdb1B:~ # umount /dev/shm
hbmcnsdb1B:~ # mount /dev/shm
hbmcnsdb1B:~ # df -k /dev/shm
Filesystem           1K-blocks         Used  Available   Use%  Mounted on
shm                   12582912         0   12582912   0%    /dev/shm
3
、在重启数据库实例,正常启动。

在修改数据库初始化参数之前,可以创建pfile来备份spfile,以免修改了spfile后实例起不来而又要重新建实例。语句如下(使用sys登陆sqlplus执行):
SQL>create pfile='/home/oracle/pfile.ora' from spfile

 

1.1.7    启动实例时alert日志显示ORA-00130错误

启动oracle实例时,alert日志显示ORA-00130错误

alert日志:
Starting ORACLE instance (normal)
LICENSE_MAX_SESSION = 0
LICENSE_SESSIONS_WARNING = 0
......
......
DBW0 started with pid=3
LGWR started with pid=4
CKPT started with pid=5
SMON started with pid=6
Wed Jun  9 16:28:02 2010
ORA-00130: invalid listener address '(ADDRESS=(PROTOCOL=TCP)(HOST=)(PORT=1521))'
RECO started with pid=7

报错信息ORA-00130: invalid listener address '(ADDRESS=(PROTOCOL=TCP)(HOST=)(PORT=1521))'显示HOST为空,初步判断为主机名配置有问题
检查主机名配置
root@sun880-2 # hostname
sun880-2
root@sun880-2 # more /etc/hosts
#
# Internet host table
#
::1     localhost       
127.0.0.1       localhost       
10.110.157.182  sun880-2        loghost         sun880-2.com    
10.110.157.181  sun880-1
10.110.157.185  float_ip
########################
10.110.157.187  sun1405a
10.110.157.188  sun1405b
10.110.157.191  sun440-a
10.110.157.192  sun440-b
10.110.157.120  blade150-a
10.110.157.121  blade150-b
检查文件/etc/hosts/etc/nodename/etc/hostname.eri0并没有错误
oracle用户ping主机名,正常
oracle@sun880-2$ ping sun880-2
sun880-2 is alive
测试oracle用户是否能识别sun880-2这个主机名,把sun880-2主机名配置在监听文件listener.oraHOST参数中,启动监听
oracle@sun880-2$ lsnrctl start
......
......
Log messages written to /opt/oracle/product/9.2/network/log/listener.log
Error listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=sun880-2)(PORT=1521)))
TNS-12545: Connect failed because target host or object does not exist
 TNS-12560: TNS:protocol adapter error
  TNS-00515: Connect failed because target host or object does not exist
   Solaris Error: 13: Permission denied

由上述分析可知:oracle并不能识别sun880-2主机名
root@sun880-2 # cd /etc
root@sun880-2 # ls -lt hosts
lrwxrwxrwx   1 root     root          12 Oct 12  2009 hosts -> ./inet/hosts
root@sun880-2 # ls -lt ./inet/hosts
-rw-------   1 root     sys          330 Jun  9 16:15 ./inet/hosts
原来是/etc/inet/hosts文件权限问题,修改文件权限为644,问题解决。

本案例中在oracle用户执行ping主机名的命令并不能判断oracle用户是否能识别这个主机名,这跟ping执行文件的权限有关
root@sun880-2 # ls -lt /usr/sbin/ping
-r-sr-xr-x   1 root     bin        53700 Apr 26  2005 /usr/sbin/ping
s
标志位是指让普通用户有root权限去执行这个命令

 

1.1.8    由于数据库的文件系统满导致ORA-09817

CCBM通过Ideploy自动安装过程中,在CCBM数据库的安装过程中失败,步骤是在创建CCBM数据库数据字典的步骤。 
  [INFO] [09-06-27 10:03:25 connection_verify] Execute for CCBM data install START! SQL*Plus: Release 11.1.0.6.0 - Production on Sat Jun 27 10:03:25 2009Copyright (c) 1982, 2007, Oracle. All rights reserved.ERROR:ORA-09817: Write to audit file FAILED.

[INFO] [09-06-27 10:03:25 modify_file] Execute for CCBM data install SUCCESSFUL! 
   [INFO] [09-06-27 10:03:25 connection_verify] Execute for CCBM data install START! SQL*Plus: Release 11.1.0.6.0 - Production on Sat Jun 27 10:03:25 2009Copyright (c) 1982, 2007, Oracle. All rights reserved.ERROR:ORA-09817: Write to audit file FAILED.
   [INFO] [09-06-27 10:03:25 test_conn] an ERROR connection ,please check databasename,username,password. FAILED! 

1、查看oracle的错误代码,首先分析是否为ideploy的问题。在主机上通过sqlpus直接登陆,同样失败。
SQL> connect sys/sys@ccbsauto as sysdba;
ERROR:
ORA-09817: Write to audit file failed.
2
、定位是否为数据库问题,使用system进行连接,成功,说明数据库正常。
3、根据日志进行分析,似乎是写入文件失败。
$ oerr ora 09817
09817, 00000, "Write to audit file failed."
// *Cause:  ORACLE was unable to write an entry to the file used as the
//          audit trail.
// *Action: Check the UNIX error number for a possible operating system error.
//          If there is no error, contact Oracle Support Services.

4
、定位为文件系统的问题。

1、在主机上通过sqlpus直接登陆,同样失败。
SQL> connect sys/sys@ccbsauto as sysdba;
ERROR:
ORA-09817: Write to audit file failed.
2
、检查主机的文件系统,发现文件系统满。
/home/oracle/admin/ccbsauto/dpdump#df -g
Filesystem    GB blocks      Free %Used    Iused %Iused Mounted on
/dev/hd4           1.00      0.85   15%    10856     6% /
/dev/hd2           3.00      0.59   81%    55093    28% /usr
/dev/hd9var        1.00      0.98    3%      673     1% /var
/dev/hd3           3.00      2.99    1%       83     1% /tmp
/dev/hd1          62.50     10.00   85%    61703     3% /home
3
、增加/home操作系统的空间。
4   
Warning: You are no longer connected to ORACLE.
SQL>  connect sys/sys@ccbsauto as sysdba;
Connected.

 

1.1.9    ora-04030错误

操作系统平台:suse10
数据库版本:11.1.0.7
alert
日志不断地出现ora-04030报错信息
数据库能正常登录,尝试执行几个简单SQL没有任何问题。

alert日志报错信息:
Sat May 16 02:19:35 2009
Errors in file /oracle/db/diag/rdbms/orc/orc1/trace/orc1_ora_140082.trc  (incident=80473):
ORA-04030: out of process memory when trying to allocate 86040 bytes (kxs-heap-w,control file i/o buffer) 
Sat May 16 02:19:38 2009
Sweep Incident[80473]: completed
Sat May 16 02:20:35 2009
Errors in file /oracle/db/diag/rdbms/orc/orc1/trace/orc1_ora_140082.trc  (incident=80474):
ORA-04030: out of process memory when trying to allocate 86040 bytes (kxs-heap-w,control file i/o buffer) 

oracle进程的PGA(私有内存区)内存分配溢出时,就会触发ora-04030错误。
首先检查系统的物理内存的使用情况
vmstat 2 30 发现系统还剩超过1GB的空闲内存
生成awr报告,评估PGA的内存分配情况
PGA Target Est (MB) Size Factr W/A MB Processed Estd Extra W/A MB Read/ Written to Disk  Estd PGA Cache Hit % Estd PGA Overalloc Count Estd Time
178 0.13 39,010.38 6,319.05 86.00 217 23,957,946
356 0.25 39,010.38 2,121.54 95.00 67 21,739,436
712 0.50 39,010.38 0.00 100.00 0 20,618,140
1,068 0.75 39,010.38 0.00 100.00 0 20,618,140
1,424 1.00 39,010.38 0.00 100.00 0 20,618,140
1,709 1.20 39,010.38 0.00 100.00 0 20,618,140
PGA
并没有额外分配内存,也就是说整个数据库的PGA使用是正常的。

 

检查当前oracle会话使用多少PGA内存
SQL> col name format a30
SQL> select
  2     sid,name,value
  3  from
  4     v$statname n,v$sesstat s
  5  where
  6     n.STATISTIC# = s.STATISTIC# and
  7     name like 'session%memory%'
  8  order by 3 asc;
       SID NAME                                VALUE
---------- ------------------------------ ----------
       280 session uga memory                 173168
       334 session uga memory max             173168
……
       SID NAME                                VALUE
---------- ------------------------------ ----------
       307 session pga memory max           11957728
       306 session pga memory max           11957728
       294 session uga memory              249913824
       294 session uga memory max          249913848
       294 session pga memory              250713776
       294 session pga memory max          250779312

占用最多内存会话为294,内存使用量约为250M
% ulimit -a
time(seconds)        unlimited
file(blocks)         unlimited
data(kbytes)         256000
stack(kbytes)        256000
memory(kbytes)       256000
coredump(blocks)     unlimited
nofiles(descriptors) 2000

可知系统对oracle用户下每个进程使用内存上限为256000K
根据SID294得出所对应的进程号,把相应的进程杀掉,4030报错不再出现。
建议把用户进程使用内存上限设为较大的值

 

 

1.1.10 建立表空间报ora-01144错的处理案例

创建一个新表空间时使用了一个超过32G的裸设备作为数据文件,但执行时出错,错误信息如下:

ORA-01144: File size %n blocks exceeds maximum of  4194303 blocks

这是因为在创建表空间时指定的数据文件太大引起的.oracle对数据文件的大小有限制,每个数据文件的最大值同db_block_size大小相关,计算公式是:
The maximum file size = db_block_size * 4194303
以下是db_block_size同数据文件最大值的对应关系:
db_block_size    Maximum data file size
       -------------    ----------------------   
            2kb                 8Gb-2kb
            4kb                16Gb-4kb
            8kb                32Gb-8kb
           16kb                64Gb-16kb
           32kb               128Gb-32kb

将建立表空间语句中的数据文件大小减少到32G以下,再重新执行该语句,执行成功。

原创粉丝点击