Oracle的常见错误及解决办法

时间:2022-08-02 08:05:45

Oracle的常见错误及解决办法

Oracle的常见错误及解决办法

Oracle的常见错误及解决办法

Oracle的常见错误及解决办法

Oracle的常见错误及解决办法

Oracle的常见错误及解决办法

Oracle的常见错误及解决办法

Oracle的常见错误及解决办法

ORA-12528:
TNS:listener: all appropriate instances are blocking new connections

ORA-12528问题是因为监听中的服务使用了动态服务,实例虽然启动,但没有注册到监听。实例是通过PMON进程注册到监听上的,而PMON进程需要在MOUNT状态下才会启动。所以造成了上面的错误。

解决这个问题,有三种方法
1、把监听设置为静态;
2、在tnsnames.ora中追加(UR=A);
3、重新启动服务;

方法1、通过修改listener.ora的参数,把listener.ora动态注册设置为静态注册,然后重新启动监听

# listener.ora Network Configuration File: $ORACLE_HOME\network\admin\listener.ora
# Generated by Oracle configuration tools.

LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
      (ADDRESS = (PROTOCOL = TCP)(HOST = [IP])(PORT = 1521))
    )
  )
SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (GLOBAL_DBNAME = [DBNAME])
      (ORACLE_HOME = [$ORACLE_HOME])
      (SID_NAME = [SID])
    )
  )
    静态注册的风险:如果在instance运行中,lisener重新启动,就找不到instance了。静态注册需要先启动lisener,再启动instance。且静态模式下,lisener status显示的是unknown

方法2、启动到nomount状态,通过修改tnsnames.ora的参数
# tnsnames.ora Network Configuration File: $ORACLE_HOME\network\admin\tnsnames.ora
# Generated by Oracle configuration tools.
SYK =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = [IP])(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = SYK)
      (UR=A)
    )
  )
    然后连接上数据库
    SQL>alter database mount;
    SQL>alter database open;

方法3、重启ORACLE或者重启ORACLE服务
 在oracle帐户下依序执行如下命令:
sqlplus / as sysdba;//在其它帐户(如root)下执行可能会报错(ORA-01031)因为这些帐户没有在dba组中

shutdown immediate;
startup;

Oracle的常见错误及解决办法

http://blog.sina.com.cn/s/blog_636415010100x3lc.html

oracle实例名: error while loading shared libraries: libskgxp10.so: cannot open shared object file: No such file or directory

是环境变量LD_LIBRARY_PATH的问题。

在10g以后,一般情况下环境变量中没有必要设置LD_LIBRARY_PATH,但是一旦将ORACLE_HOME迁移到其他目录,则环境变量中还需要添加这个变量。

Linux和Unix支持TAR方式迁移ORACLE_HOME,如果有需要将ORACLE_HOME放到其他路径下,那么一般都会使用tar的方式将整个路径拷贝到目标目录。
但是迁移后,如果直接尝试sqlplus启动,可能报错:
[orat3@hpserver2 ~]$ sqlplus / as sysdba
sqlplus: error while loading shared libraries: libsqlplus.so: cannot open shared object file: No such file or directory
而设置LD_LIBRARY_PATH后,问题解决:
[orat3@hpserver2 ~]$ export LD_LIBRARY_PATH=$ORACLE_HOME/lib
[orat3@hpserver2 ~]$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.4.0 - Production on Sun Mar 18 16:10:57 2012
Copyright (c) 1982, 2007, Oracle. All Rights Reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL>
还有一种类似的错误:
[orat0@hpserver2 ~]$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.5.0 - Production on Sun Mar 18 16:12:03 2012
Copyright (c) 1982, 2010, Oracle. All Rights Reserved.
oracleorcl10g: error while loading shared libraries: libskgxp10.so: cannot open shared object file: No such file or directory
ERROR:
ORA-12547: TNS:lost contact
Enter user-name:
oracleorcl10g: error while loading shared libraries: libskgxp10.so: cannot open shared object file: No such file or directory
ERROR:
ORA-12547: TNS:lost contact
Enter user-name:
oracleorcl10g: error while loading shared libraries: libskgxp10.so: cannot open shared object file: No such file or directory
ERROR:
ORA-12547: TNS:lost contact
SP2-0157: unable to CONNECT to ORACLE after 3 attempts, exiting SQL*Plus
[orat0@hpserver2 ~]$ export LD_LIBRARY_PATH=$ORACLE_HOME/lib
[orat0@hpserver2 ~]$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.5.0 - Production on Sun Mar 18 16:12:18 2012
Copyright (c) 1982, 2010, Oracle. All Rights Reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL>
错误的表相虽然不同,但是解决方法是相同的。

http://blog.itpub.net/4227/viewspace-718879/

ORA-00204:ORA-00202:ORA-27091

Oracle数据库启动报如下错误:
ORA-00204: error in reading (block 3, # blocks 8) of controlfile
ORA-00202: controlfile:'/app/oracle/OraHome1/database/datafiles/control1.ctl'
ORA-27091: skgfqio: unable to queue I/O
SVR4 Error: 25: Inappropriate ioctl for device
Additional information: 3

说明control1.ctl文件有问题啦!
想把这个文件mv到别的目录做个备份,但I/O error,果然是坏了!
一般控制文件有3个,除非3个都坏了,不然可以用好的替换坏的:
rm control1.ctl
cp control2.ctl control1.ctl
再重新启动Oracle就OK啦!

http://blog.sina.com.cn/s/blog_49c1dffa0100teu5.html

Oracle的常见错误及解决办法

ORA-01031: insufficient privileges

出错的场景:

(1)用sqlplus "/ as sysdba"登陆
(2)登陆成功后在执行相关操作

第二种情况没什么说的,没权限,赋权即可

第一情况的解决办法:
要sqlplus "/ as sysdba"进行登陆必须满足如下条件:
(1)linux/unix下有环境变量ORACLE_SID,windows不要求
(2)配置环境变量ORACLE_HOME
(3)linux/unix下$ORACLE_HOME/bin/oracle文件在u,g下有s权限(让非oracle用户可以拥有相当于oracle帐户 的,赋值方法chmod u+s,g+s $ORACLE_HOME/bin/oracle)
(4)执行此操作的用户必须在dba用户组
(5)sqlnet.ora文件必须支持sqlplus /as sysdba,否则会报如下错误:

Oracle的常见错误及解决办法

Tips:

Linux/unix下非oracle用户下不建议使用sqlplus "/ as sysdba"登陆,建议使用sqlplus /nolog后使用conn 命令或sqlplus username[@sid]登陆

http://blog.sina.com.cn/s/blog_622a00690100zklx.html

sqlnet.ora中配置操作系统验证的相关说明

1、在windows下,SQLNET.AUTHENTICATION_SERVICES必须设置为NTS或者ALL才能使用OS认证;不设置或者设置为其他任何值都不能使用OS认证。
<Windows>
sqlnet.ora文件为空时采用Oracle密码文件验证
SQLNET.AUTHENTICATION_SERVICES= (NTS) 基于操作系统验证;
SQLNET.AUTHENTICATION_SERVICES= (NONE) 基于Oracle密码文件验证
SQLNET.AUTHENTICATION_SERVICES= (NONE,NTS) 二者并存,注意是半角,否则不识别

2、在linux下,在SQLNET.AUTHENTICATION_SERVICES的值设置为ALL,或者不设置的情况下,OS验证才能成功;设置为其他任何值都不能使用OS认证。
<Unix/Linux>
默认情况下Unix/Linux下的sqlnet.ora文件是没有SQLNET.AUTHENTICATION_SERVICES参数的,
此时是操作系统验证和Oracle密码验证并存,加上SQLNET.AUTHENTICATION_SERVICES这个参
数后,不管SQLNET.AUTHENTICATION_SERVICES设置为NONE还是NTS还是(NONE,NTS),都是
基于Oracle密码验证。

The information in this document applies to:
Oracle Net Services - Version: 10.1.0.3
This problem can occur on any platform.
Symptoms
The listener fails to start with the following errors:
TNS-12537: TNS:connection closed
TNS-12560: TNS:protocol adapter error
TNS-00507: Connection closed
Linux Error: 29: Illegal seek
Generic to Unix platforms.

出现下图错误是因为/etc/hosts中没有配置localhost的映射

Oracle的常见错误及解决办法

Oracle的常见错误及解决办法

出现下图错误是因为
(情况1)/etc/hosts中的localhost映射配置错误
(情况2)$ORACLE_HOME/network/admin/listener.ora中HOST的值配置错误

Oracle的常见错误及解决办法
Cause
Wrong syntax in hosts file and also due to the the tnslsnr process was enhanced in
10.1.0.3 to support FAN(Fast Application Notification) via
ONS (Oracle Notification Services). This new code opens a socket open on localhost.
Therefore"localhost" should be defined on the system.

This new code opens a socket open on localhost. Therefore "localhost" should be defined on the
system.
Fix
Change /etc/hosts file to include
127.0.0.1 localhost.localdomain localhost

http://blog.itpub.net/35489/viewspace-84958/

造成ORA-12560: TNS: 协议适配器错误的问题的原因有三个:
1.监听服务没有起起来
windows平台个一如下操作:开始---程序---管理工具---服务,打开服务面板,
启动oraclehome92TNSlistener服务。
2.database instance没有起起来
windows平台如下操作:开始---程序---管理工具---服务,打开服务面板,
启动oracleserviceXXXX,XXXX就是你的database SID.
3.ORACLE_SID设置的不对
(1)regedit,然后进入HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE\HOME0将该环境变量ORACLE_SID设置为XXXX,XXXX就是你的databaseSID.
(2)我的电脑,属性--高级--环境变量---系统变量--新建,变量名=oracle_sid,变量值=XXXX,XXXX就是你的database SID.
(3)在使用sqlplus前,在command line下输set oracle_sid=XXXX,XXXX就是你的database SID.
http://blog.sina.com.cn/s/blog_49d5466301016jqe.html

sqlplus / as sysdba 与 sqlplus "/ as sysdba" 的区别是什么?

10G的sqlplus稍微改进了一点,
下面是摘抄10G新特性的一段:

必须使用引号吗?为什么,不!
在 Oracle9i 中取消了对内部登录的支持之后,全世界许多 DBA 表示反对:他们应当如何在命令行上输入 SYS 的口令并保持安全性?嗯,答案是在操作系统提示符中使用引号:
sqlplus "/ as sysdba"

引号的使用令人遗憾,但还是被大家所接受(虽然有些怨言)。在 Oracle Database 10g 中不需要这样了。现在您可以在 OS 命令提示符下,输入以下命令,不需要引号

sqlplus / as sysdba

作为 SYSDBA 登录。这种改进不仅意味着您少输了两个字符,还有一些额外的好处,例如在 Unix 之类的操作系统中不需要 escape 字符。

http://www.itpub.net/thread-661977-1-1.html

如果一个Oracle帐户为dba,则可以在sqlplus中使用conn user@网络服务名 as sysdba

Net Configuration Assistant

ORA-12533

Oracle的常见错误及解决办法

是tnsnames.ora配置错误

tnsnames.ora的位置%ORACLE_HOME%\network\admin\tnsnames.ora

tnsnames.ora通过手工改来配置时,需要遵守以下规则:

Oracle的常见错误及解决办法

在oracle帐户下使用$ORACLE_HOME/bin/dbstart启动oracle实例时,一种错误的解决办法:

Oracle的常见错误及解决办法

Oracle的常见错误及解决办法

/etc/oratab文件解析:

[oracle@node1 ~]$ vi /etc/oratab
# This file is used by ORACLE utilities. It is created by root.sh
# and updated by the Database Configuration Assistant when creating
# a database.

# This file is used by ORACLE utilities. It is created by root.sh
# and updated by the Database Configuration Assistant when creating
# a database.

# A colon, ':', is used as the field terminator. A new line terminates
# the entry. Lines beginning with a pound sign, '#', are comments.
#
# Entries are of the form:
# $ORACLE_SID:$ORACLE_HOME:<N|Y>
#
# The first and second fields are the system identifier and home
# directory of the database respectively. The third filed indicates
# to the dbstart utility that the database should , "Y", or should not,
# "N", be brought up at system boot time.
#
# Multiple entries with the same $ORACLE_SID are not allowed.
#
orcl:/u01/app/oracle/product/10.2.0/db_1:N
最后的N或者Y表示是否允许dbstart来启动数据库,如果为N则实例不能通过dbstart启动,表现为sqlplus连接实例时显示Connected to an idle instance.
如果为Y则实例可以通过dbstart启动,sqlplus连接后数据库即为open状态。

http://blog.chinaunix.net/uid-23177306-id-2531086.html

[oracle@localhost bin]$ vi dbstart
#!/bin/sh
#
# $Id: dbstart.sh 22-may-2008.05:05:45 arogers Exp $
# Copyright (c) 1991, 2008, Oracle. All rights reserved.
#

###################################
#
# usage: dbstart $ORACLE_HOME
#
# This script is used to start ORACLE from /etc/rc(.local).
# It should ONLY be executed as part of the system boot procedure.
#
# This script will start all databases listed in the oratab file
# whose third field is a "Y". If the third field is set to "Y" and
# there is no ORACLE_SID for an entry (the first field is a *),
# then this script will ignore that entry.

在linux系统下,用root用户采用dbstart脚本直接启动oracle服务或监听
第一个问题:启动服务的同时没有启动监听
[root@localhost ~]# su - oracle -c "dbstart"
ORACLE_HOME_LISTNER is not SET, unable to auto-start Oracle Net Listener
Usage: /oradata/oracle/112/bin/dbstart ORACLE_HOME
Processing Database instance "orcl": log file /oradata/oracle/112/startup.log

ORACLE_HOME_LISTNER is not SET, unable to auto-start Oracle Net Listener这个提示说明
启动oracle服务的同时没有启动oracle监听服务,因此如果想在启动oracle服务的同时i启动监听
就需要修改dbstart,将ORACLE_HOME_LISTNER值设为$ORACLE_HOME(原来是为$1)
[root@localhost ~]# vi /oradata/oracle/112/bin/dbstart

注:dbshut一样的道理,如果想关闭数据库服务的同时关闭监听服务也是将dbshut文件中的ORACLE_HOME_LISTNER值设为$ORACLE_HOME

http://www.cnblogs.com/lanzi/archive/2012/04/15/2450930.html
http://www.cnblogs.com/lanzi/archive/2012/04/15/2450928.html

3.赋予自启动脚本执行权限

chmod 775 /etc/init.d/orcl

4. 增加配置服务

[root@localhost ~]# /sbin/chkconfig --add orcl

orcl 服务不支持 chkconfig
“服务不支持 chkconfig”:——这个提示是因为oracle自启动脚本前面必须要有以下这两行
#chkconfig: 2345 00 01
#description:oracle 11g service

当然如果不采用这个命令进行配置服务,也可以手动方式创建文件链接来完成,如下所示:

文件链接
ln -s /etc/init.d/orcl /etc/rc.d/rc2.d/S99orcl
ln -s /etc/init.d/orcl /etc/rc.d/rc3.d/S99orcl
ln -s /etc/init.d/orcl /etc/rc.d/rc4.d/S99orcl
ln -s /etc/init.d/orcl /etc/rc.d/rc5.d/S99orcl
ln -s /etc/init.d/orcl /etc/rc.d/rc0.d/K01orcl
ln -s /etc/init.d/orcl /etc/rc.d/rc1.d/K01orcl
ln -s /etc/init.d/orcl /etc/rc.d/rc6.d/K01orcl
http://www.cnblogs.com/lanzi/archive/2012/04/18/2456022.html
 
 http://www.cnblogs.com/hibernate315/archive/2012/01/30/2398869.html
 
 ORA-12518:
 Oracle的常见错误及解决办法

原因:
listener.ora中配置错误:
SID_LIST_LISTENER=(

(SID_DESC=

(SID_NAME=实际的$ORACLE_SID)

(ORACLE_HOME=实际的$ORACLE_HOME)

(PROGRAM=实际的$ORACLE_SID)//此处配置错误,实际使用的实例不需要配置这个,这行去掉或改为(global_dbname=实际的$ORACLE_SID)即可

)

)
关于ora-12518的其他情况及处理办法:
http://www.cnblogs.com/chinhr/archive/2011/10/11/2207528.html

关于listener.ora配置内容:

Oracle文档上是这样写的

The LISTENER entry defines the listening protocol address for a listener named LISTENER,
and the SID_LIST_LISTENER entry provides information about the services statically supported by the listener LISTENER.

Example 10-1 Example listener.ora File
LISTENER= (DESCRIPTION=
(ADDRESS_LIST=
(ADDRESS=(PROTOCOL=tcp)(HOST=sales-server)(PORT=1521))
(ADDRESS=(PROTOCOL=ipc)(KEY=extproc)
)))

SID_LIST_LISTENER=
(SID_LIST=
(SID_DESC=
(SID_NAME=plsextproc)
(ORACLE_HOME=/oracle10g)
(PROGRAM=extproc)))“

the SID_LIST_LISTENER entry provides information about the services statically supported by the listener LISTENER”这句话要如何理解呢?
感觉上Listener是提供了“protocol address”
然后SID_LIST_LISTENER提供了在“protocol address”上跑的具体应用。 这样的理解对吗?

It's better to do some reading on dynamic registration, which your 10g version supports. Once you understand that, you'll understand what static registration is and why it's rarely needed.

http://www.itpub.net/thread-1517929-1-1.html

TNS-01155: 在 LISTENER.ORA 中指定的 SID_LIST_LISTENER 参数不正确
近日在配置Oracle 10G的流复制环境时,遇到一个问题,关闭数据库(shutdown immediate)后,通过SQL Plus连接数据库:conn sys/his@orc0 as sysdba,出现如下错误:
ORA-12514: TNS: 监听程序当前无法识别连接描述符中请求的服务
通过重启服务的方式启动数据库,再次连接却能成功登录,也就是说在关闭数据库状态下无法连接服务器。
开始以为是系统环境变量Oracle_SID的配置问题,因为机器有多个实例,一阵折腾后还是不能连接。后来查资料得知:
Oracle9i以后,后台进程PMON自动在监听器中注册在系统参数SERVICE_NAMES中定义的服务名,SERVICE_NAMES默认为DB_NAME+DOMAIN_NAME。监听配置文件listener.ora中可以不必指定监听的服务名。但是,当数据库处于关闭状态下PMON进程没有启动,也就不会自动注册监听的实例名,所以使用sqlplus sys/his@orc0 as sysdba 会出现ORA-12514错误。
如果在listener.ora文件中指定监听的实例名,则即使数据库处于关闭状态,仍然可以连接。
listener.ora
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = G:/oracle/product/10.2.0/db_1)
(PROGRAM = extproc)
)
(SID_DESC =
(GLOBAL_DBNAME = ORCL)
(ORACLE_HOME = G:/oracle/product/10.2.0/db_1)
(SID_NAME = ORCL)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = zyk)(PORT = 1521))
)
)

以上粗体部件为增加的内容,修改后重启监听服务后即可。
附:通过在lsnrctl中输入set display verbose,然后再通过命令service查看,服务状态为READY表示PMON自动注册的服务名,而UNKNOWN则表示该服务是手工在LISTENER.ORA中配置的数据库服务

http://blog.csdn.net/iwanttobeagoodman/article/details/4352823

1、在CMD中启动SQLPLUS;用sqlplus /as sysdba登录,提示
连接到:Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production
2.执行ALTER USER acutal_username ACCOUNT UNLOCK;解锁
3.更改sys 和system 设置用户名、密码;
SQL> alter acutal_username sys identified by acutal_password;

ORA-12547: TNS: 丢失连接
Oracle的常见错误及解决办法

查明原因:
sqlnet.ora对访问ip进行了限制:
sqlnet.ora的配置情况:

[oracle@localhost admin]$ more sqlnet.ora
# sqlnet.ora Network Configuration File: /oracle/app/oracle/product/11.2.0/dbhome_1/network/admin/sqlnet.ora
# Generated by Oracle configuration tools. TCP.VALIDNODE_CHECKING = YES SQLNET.CRYPTO_CHECKSUM_TYPES_SERVER= (MD5) SQLNET.CRYPTO_SEED = 'OracleEncryption' SQLNET.ENCRYPTION_TYPES_SERVER= (AES256) TCP.INVITED_NODES= (ip1,ip2,ip3,ip4,ip5) ADR_BASE = /oracle/app/oracle SQLNET.EXPIRE_TIME=10

可以看出,正是由于存在tcp.validnode_checking=yes才去检查tcp.invited_nodes定义的节点,将客户端ip地址加入该文件中即可。

Oracle的常见错误及解决办法

Oracle修改表中记录时出现record is locked by another user的问题

在操作表时没有commit,导致表被锁,只要执行下面两行语句,就可以了将行锁解锁了。
1.Select t2.username,t2.sid,t2.serial#,t2.logon_time from v$locked_object t1,v$session t2 where t1.session_id=t2.sid;
-- 查看被锁表的sid 和 serial#
2.alter system kill session 'sid, serial#';
--kill 锁 ,例如输入 alter system kill session '140, 25';
执行完以上两步后,就可以编辑数据了

http://blog.sina.com.cn/s/blog_77f88ea601012jyy.html

使用alter database 移动数据文件时,在执行完alter database rename <source file path> to <des file path>命令之后,再试图打开数据库:alter database open。报错:

ORA-01113:文件7需要介质恢复

ORA-01110:数据文件7:’E:ORACLE/PRODUCT/10.2.0/ORADATA/ORCL/TEST01.DBF’。

这是由于数据库认为这个数据文件遭到破坏了,需要使用recover命令通过备份、日志信息来恢复。数据库的备份恢复是个比较复杂的问题,但是这个实例的解决办法还是比较简单的。

执行命令:
recover datafile ’E:ORACLE/PRODUCT/10.2.0/ORADATA/ORCL/TEST01.DBF’
提示完成介质恢复,再打开数据库:alter database open。一切正常。
http://blog.csdn.net/libingquan008/article/details/6021441

Oracle的常见错误及解决办法

os位数与oracle位数不一致

http://blog.itpub.net/79686/viewspace-1016474/

Linux位数查看办法:
(1)
终端输入:
file /sbin/init
如 显示:
/sbin/init: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.6.9, dynamically linked (uses shared libs), for GNU/Linux 2.6.9, stripped
即是32位的 linux, 如是64位的, 显示的是 64-bit
(2)
终端输入:
uname -a
如 显示:
Linux redhat-tj 2.6.18-128.el5 #1 SMP Wed Jan 21 10:44:23 EST 2009 i686 i686 i386 GNU/Linux
则是32位
(3)
终端输入:
getconf WORD_BIT
如 显示:
32
则是32位的linux

http://blog.chinaunix.net/uid-20423564-id-1949491.html

安装 oracle 时出现如下错误:

[oracle@database]$ ./runInstaller
Starting Oracle Universal Installer... Checking Temp space: must be greater than 80 MB. Actual 1184 MB Passed
Checking swap space: must be greater than 150 MB. Actual 3027 MB Passed
Checking monitor: must be configured to display at least 256 colors
>>> Could not execute auto check for display colors using command /usr/bin/xdpyinfo. Check if the DISPLAY variable is set. Failed <<<< Some requirement checks failed. You must fulfill these requirements before continuing with the installation,at which time they will be rechecked. Continue? (y/n) [n]

解决办法(1):
注销登录用户,使用oracle安装用户重新登录系统即可解决,比如之前已经创建好的安装用户oracle,使用oracle用户登录系统就可以解决问题

解决办法(2):
在root用户下执行xhost +,然后切换到oracle帐户下,执行安装程序即可
解决办法(3)
如果你确认你的软硬件 都安装设置都没问题那么你直接跳过检测吧· 
./runInstaller -ignoreSysPrereqs跳过检测

[oracle@sense database]$ ./runInstaller
Starting Oracle Universal Installer... Checking Temp space: must be greater than 80 MB. Actual 1184 MB Passed
Checking swap space: must be greater than 150 MB. Actual 3027 MB Passed
Checking monitor: must be configured to display at least 256 colors. Actual 16777216 Passed
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2009-01-03_05-06-47PM. Please wait .

http://blog.itpub.net/22275400/viewspace-766534/

http://www.linuxidc.com/Linux/2010-04/25651.htm

Error in invoking target 'mkldflags ntcontab.o nnfgt.o' of makefile '/opt/app/oracle/product/11.2.0/dbhome_1/network/lib/ins_net_client.mk'

Oracle的常见错误及解决办法

安装gcc,后点Retry即可。
相关操作:

解决方法:
该问题一般是gcc的问题。 RedHat Linux在安装gcc时需要cpp和cloog-ppl
但是在安装cpp的时候需要这个依赖: libmpfr.so.()(64bit) is needed by cpp-4.4.-.el6.x86_64
安装cloog-ppl的时候需要这2个依赖: libppl.so.()(64bit) is needed by cloog-ppl-0.15.-1.2.el6.x86_64
libppl_c.so.()(64bit) is needed by cloog-ppl-0.15.-1.2.el6.x86_64
解决方法: 确定是一个,因为那时候就是用这个光盘的东西装的系统。
后来解决了,不用yum,只是缺了两个包而已。
之前报这个依赖
libmpfr.so. is needed by cpp-4.4.-.el6.i686
libppl.so. is needed by cloog-ppl-0.15.-1.2.el6.i686
libppl_c.so. is needed by cloog-ppl-0.15.-1.2.el6.i686
是缺了这两个包……
mpfr-2.4.-.el6.x86_64.rpm
ppl-0.10.-.el6.x86_64.rpm
这两个安装好之后就可以安装cpp和cloog-ppl了,之后就能安装gcc了……
http://www.linuxidc.com/Linux/2015-04/116144.htm [root@localhost Packages]# rpm -ivh mpfr-2.4.-.el6.i686.rpm
warning: mpfr-2.4.-.el6.i686.rpm: Header V3 RSA/SHA256 Signature, key ID fd431d51: NOKEY
Preparing... ########################################### [%]
:mpfr ########################################### [%]
[root@localhost Packages]# [root@localhost Packages]# rpm -ivh ppl-0.10.-.el6.i686.rpm
warning: ppl-0.10.-.el6.i686.rpm: Header V3 RSA/SHA256 Signature, key ID fd431d51: NOKEY
Preparing... ########################################### [%]
:ppl ########################################### [%]
[root@localhost Packages]# [root@localhost Packages]# rpm -ivh cpp-4.4.-.el6.i686.rpm
warning: cpp-4.4.-.el6.i686.rpm: Header V3 RSA/SHA256 Signature, key ID fd431d51: NOKEY
Preparing... ########################################### [%]
:cpp ########################################### [%]
[root@localhost Packages]# [root@localhost Packages]# rpm -ivh cloog-ppl-0.15.-1.2.el6.i686.rpm
warning: cloog-ppl-0.15.-1.2.el6.i686.rpm: Header V3 RSA/SHA256 Signature, key ID fd431d51: NOKEY
Preparing... ########################################### [%]
:cloog-ppl ########################################### [%]
[root@localhost Packages]# [root@localhost Packages]# rpm -ivh gcc-4.4.-.el6.i686.rpm
warning: gcc-4.4.-.el6.i686.rpm: Header V3 RSA/SHA256 Signature, key ID fd431d51: NOKEY
Preparing... ########################################### [%]
:gcc ########################################### [%]
[root@localhost Packages]#

报错信息:
登陆及执行命令时,都会有ORA_04031的报错:

SQL> show parameter shared_pool_size
ORA-04031: unable to allocate 3896 bytes of shared memory ("shared
pool","SELECT NAME NAME_COL_PLUS_SH...","sga heap(1,0)","kglsim object batch")

oracle 10g,执行$ORACLE_HOME/bin/dbshutdown后,重启数据即可
Tips:无法通过sqlplus中的shutdown或startup force来进行,因为执行这些命令时提示没有权限(sqlnet.ora中没有任何参数,linux环境)。
登陆时的报错信息:

[oracle@localhost admin]$ sqlplus "/as sysdba"

SQL*Plus: Release 11.2.0.2.0 Production on Fri Sep 18 09:22:20 2015

Copyright (c) 1982, 2010, Oracle.  All rights reserved.

ERROR:
ORA-01075: 您现在已登录 Enter user-name: system@ems
Enter password:
错误”ora-04031 无法分配XXX字节的共享内存(XXX)”的解决办法:

oracle 9i:
sys用户以sysdba身份登录
先查看当前shared_pool_size值
sql>show parameter shared_pool_size;
然后
sql>alter system set shared_pool_size=’比原先值适当增加’ scope=spfile;
然后
sql>shutdown immediate
sql>startup oracle 10g:
oracle 10g shared_pool_size默认值为0,也就是系统自动管理shared pool内存,这时可以适当增加shared_pool_reserved_size的值,仍然让系统自动管理这部分内存 sql>alter system set shared_pool_reserved_size=’比原先值适当增加’ scope=spfile;
sql>shutdown immediate
sql>startup
ERROR at line 1:
ORA-02097: parameter cannot be modified because specified value is invalid
ORA-00823: Specified value of sga_target greater than sga_max_size SQL> alter system set sga_target=2000M scope=both;
alter system set sga_target=2000M scope=both
*
ERROR at line 1:
ORA-02097: parameter cannot be modified because specified value is invalid
ORA-00823: Specified value of sga_target greater than sga_max_size SQL>
SQL>
SQL>
SQL> alter system set sga_target=2000M scope
2 ; *
ERROR at line 2:
ORA-00927: missing equal sign SQL>
SQL>
SQL> create pfile='/home/oracle/oracle/pfile_t.ora' from spfile
2 ;
create pfile='/home/oracle/oracle/pfile_t.ora' from spfile
*
ERROR at line 1:
ORA-07391: sftopn: fopen error, unable to open text file. SQL>
SQL>
SQL>

http://www.linuxidc.com/Linux/2013-08/88291.htm

ORA-01658
oracle导入数据出错:ORA-01658:无法为表空间XXX中的段创建INITIAL区
原因:表数据库中表空间在已满时未设置自动扩展,即此时数据库表空间已满。
解决:
(1)查看报错表空间是否自动扩展(可能存在部分数据文件可以自动扩展,部分不可以)

select file_name,autoextensible,increment_by from dba_data_files d
where d.TABLESPACE_NAME='报错中的表空间名';

以修改表空间的方式增加:

语法:

alter database datafile 表空间文件路径 AUTOEXTEND(自动扩展) ON NEXT 表空间满后增加的大小

例如:

alter database datafile 'C:\ORACLE\PRODUCT\10.2.0\ORADATA\VGSM\VGSM' AUTOEXTEND ON NEXT 200m

(2)

1、查询当前用户的所属表空间

select * from user_users;

2、增加表空间有两种方法:

以sysdba登陆进数据库

语法:

alter tablespace 表空间名称

add datafile 表空间存放路径  size 表空间大小 autoextend on next 增长的大小 maxsize 空间最大值(如果不限制空间最大值就用unlimited)

例如:

alter tablespace vgsm
add datafile 'c:\oracle\product\10.2.0\oradata\vgsm\vgsm_01.dbf'
size 1024M autoextend on next 50M maxsize unlimited;

http://www.cnblogs.com/hfliyi/p/3551338.html

ERROR:
ORA-00604: 递归 SQL 级别 1 出现错误
ORA-01653: 表 SYS.AUD$ 无法通过 128 (在表空间 SYSTEM 中) 扩展
ORA-02002: 写入审计线索时出错
ORA-00604: 递归 SQL 级别 1 出现错误
ORA-01653: 表 SYS.AUD$ 无法通过 128 (在表空间 SYSTEM 中) 扩展

Oracle的常见错误及解决办法

Oracle的常见错误及解决办法

把SYSTEM表空间改为自动扩展,也不行
原因:
SYSTEM表空间所在的磁盘空间满了。在另一个文件系统中为SYSTEM表空间新增一个表空间

ALTER TABLESPACE "SYSTEM" ADD DATAFILE '/home/oracle/datafile/system10.dbf' SIZE 500M AUTOEXTEND ON NEXT 50M MAXSIZE UNLIMITED;

system10.dbf是不存在的。
注意事项:
/home/oracle/datafile/这个目录,oracle用户要有写权限。

其它

查看表空间是否具有自动扩展的能力的SQL
SELECT T.TABLESPACE_NAME,D.FILE_NAME,
D.AUTOEXTENSIBLE,D.BYTES,D.MAXBYTES,D.STATUS
FROM DBA_TABLESPACES T,DBA_DATA_FILES D
WHERE T.TABLESPACE_NAME =D.TABLESPACE_NAME
ORDER BY TABLESPACE_NAME,FILE_NAME;

http://www.51testing.com/html/73/33873-214039.html

java.sql.SQLException: ORACLE:ORA-01552: cannot use system rollback segment for non-system tablespace 'Hibernate'

解决办法:

修改数据库参数
1、设置默认undo表空间
2、undo表空间为自动管理

 

Oracle的常见错误及解决办法

Oracle的常见错误及解决办法

Oracle的常见错误及解决办法

Oracle的常见错误及解决办法

http://blog.chinaunix.net/uid-22457844-id-3131307.html

还有可能是默认的回滚表空间,没有空间了

查看还原表空间的剩余空间
SQL> l
  1* select file_name,tablespace_name,bytes/1024/1024 MB,autoextensible from dba_data_files
SQL> /

FILE_NAME                                          TABLESPACE_NAME         MB AUT
-------------------------------------------------- --------------- ---------- ---
/u01/app/oracle/oradata/orcl/risenet.dbf           RISENET
/u01/app/oracle/oradata/orcl/perfstat.dbf          PERFSTAT               500 NO
/u01/app/oracle/oradata/orcl/example01.dbf         EXAMPLE                100 YES
/u01/disk1/users01.dbf                             USERS                    5 YES
/u01/app/oracle/oradata/orcl/sysaux01.dbf          SYSAUX                 250 YES
/u01/app/oracle/oradata/orcl/undotbs01.dbf         UNDOTBS1
/u01/disk2/system01.dbf                            SYSTEM                 490 YES
/u01/app/oracle/oradata/orcl/undotbs02.dbf         UNDOTBS2                50 NO
/u01/disk1/pioneer_data.dbf                        PIONEER_DATA             5 YES
/u01/disk2/pioneer_indx.dbf                        PIONEER_INDX             6 NO
/u01/disk3/pioneer_undo.dbf                        PIONEER_UNDO             7 NO
11 rows selected.

SQL> l
  1* select tablespace_name,bytes/1024/1024 "MB" from dba_free_space  where tablespace_name like '%UNDO%'
SQL> /
TABLESPACE_NAME         MB
--------------- ----------
UNDOTBS2             31.75
PIONEER_UNDO        5.6875

由上查询可知,默认表空间没有空间了,可以切换回滚空间untotbs2为系统的默认表空间。(也可以增加默认表空间untotbs1的大小。)
SQL> alter system set undo_tablespace=undotbs2;
System altered.

SQL> show parameter undo
NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
undo_management                      string      AUTO
undo_retention                       integer     900
undo_tablespace                      string      UNDOTBS2
SQL> create table scott.test
  2  (id number(8),
  3  name varchar2(20));
Table created.
问题解决!

http://blog.itpub.net/12778571/viewspace-346816/

默认的回滚表空间不存在的情况

创建表的时候报

ORA-01552 cannot use system rollback segment for non-system tablespace
SQL> CREATE TABLE DEPT
  2         (DEPTNO NUMBER(2) CONSTRAINT PK_DEPT PRIMARY KEY,
  3          DNAME VARCHAR2(14) ,
  4          LOC VARCHAR2(13) ) ;
CREATE TABLE DEPT
*
ERROR at line 1:
ORA-01552: cannot use system rollback segment for non-system tablespace 'USERS'

解决办法:

SQL> show parameter undo

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
undo_management                      string      MANUAL
undo_retention                       integer     900
undo_tablespace                      string      UNDOTBS2

SQL> alter system set undo_tablespace='undotbs3' scope=spfile;

System altered.

SQL> alter system set undo_management=auto scope=spfile;

System altered.

SQL> show parameter undo

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
undo_management                      string      AUTO
undo_retention                       integer     900
undo_tablespace                      string      undotbs3

重新测试刚才出错的语句

SQL> conn scott/tiger
Connected.
SQL> 
SQL> 
SQL> CREATE TABLE DEPT
  2         (DEPTNO NUMBER(2) CONSTRAINT PK_DEPT PRIMARY KEY,
  3          DNAME VARCHAR2(14) ,
  4          LOC VARCHAR2(13) ) ;

Table created.

我的由于没有undotbs2,并且undo_management为手动模式,所以必须切换

http://blog.csdn.net/huashnag/article/details/8507060

ORA-32001: write to SPFILE requested but no SPFILE specified at startup

SQL> alter system set  sga_max_size=2048M scope=spfile; 
alter system set  sga_max_size=2048M scope=spfile 

ERROR at line 1: 
ORA-32001: write to SPFILE requested but no SPFILE specified at startup

SQL> show parameter spfile;

NAME                                 TYPE        VALUE 
------------------------------------ ----------- ------------------------------ 
spfile                               string

SQL> create spfile from pfile;

File created.

SQL> shutdown immediate; 
Database closed. 
Database dismounted. 
ORACLE instance shut down. 
SQL> startup; 
ORACLE instance started.

Total System Global Area 1068937216 bytes 
Fixed Size                  2166536 bytes 
Variable Size             427819256 bytes 
Database Buffers          624951296 bytes 
Redo Buffers               14000128 bytes 
Database mounted. 
Database opened. 
SQL> alter system set sga_max_size=2048M scope=spfile;

System altered.

SQL> alter system set sga_target=2048M scope=spfile;

System altered.

SQL>  shutdown immediate; 
Database closed. 
Database dismounted. 
ORACLE instance shut down. 
SQL> startup; 
ORACLE instance started.

Total System Global Area 2137886720 bytes 
Fixed Size                  2161400 bytes 
Variable Size             469763336 bytes 
Database Buffers         1644167168 bytes 
Redo Buffers               21794816 bytes 
Database mounted. 
Database opened. 
SQL> show parameter sga;

NAME                                 TYPE        VALUE 
------------------------------------ ----------- ------------------------------ 
lock_sga                             boolean     FALSE 
pre_page_sga                         boolean     FALSE 
sga_max_size                         big integer 2G 
sga_target                           big integer 2G

http://www.cnblogs.com/quanweiru/p/4053316.html

ORA-12641: Authentication service failed to initialize

命令:

sqlplus system/admin@orcl

报错情况:

SQL*Plus: Release 11.2.0.2.0 Production on Wed May 11 16:11:43 2016

Copyright (c) 1982, 2010, Oracle.  All rights reserved.

ERROR:
ORA-12641: Authentication service failed to initialize

解决办法:

将$ORACLE_HOME/network/admin/sqlnet.ora文件中的
SQLNET.AUTHENTICATION_SERVICES=ALL
改为:
SQLNET.AUTHENTICATION_SERVICES=none
即用户登陆时都要使用户名和密码

使用  sqlplus "/as sysdba" 会报下面的错误:

SQL*Plus: Release 11.2.0.2.0 Production on Wed May 11 17:27:52 2016

Copyright (c) 1982, 2010, Oracle. All rights reserved.

ERROR:
ORA-01031: 权限不足

Enter user-name:

问题虽然解决,但原理不是很清楚。

相关环境信息:

 lsb_release -a
LSB Version: :base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch
Distributor ID: RedHatEnterpriseServer
Description: Red Hat Enterprise Linux Server release 6.6 (Santiago)
Release: 6.6
Codename: Santiago
uname -a
Linux localhost 2.6.32-504.el6.x86_64 #1 SMP Tue Sep 16 01:56:35 EDT 2014 x86_64 x86_64 x86_64 GNU/Linux
SQL> select * from v$version;

BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
PL/SQL Release 11.2.0.2.0 - Production
CORE 11.2.0.2.0 Production
TNS for Linux: Version 11.2.0.2.0 - Production
NLSRTL Version 11.2.0.2.0 - Production

SQLNET.AUTHENTICATION_SERVICES的相关解释

作用:
Use the parameter SQLNET.AUTHENTICATION_SERVICES to enable one or more authentication services.
If authentication has been installed, it is recommended that this parameter be set to either none or to one of the authentication methods.
默认值:None
一般可选值:
NONE for no authentication methods. A valid username and password can be used to access the database.
ALL for all authentication methods
NTS for Windows NT native authentication(An authentication method that enables  a client single login access to a Windows NT server and a database running on the server)

2、 ORA-00845: MEMORY_TARGET not supported on this system

Oracle解释如下:

[oracle@node3 ~]$ oerr ora 845
00845, 00000, "MEMORY_TARGET not supported on this system"
// *Cause: The MEMORY_TARGET parameter was not supported on this operating system or /dev/shm was not sized correctly on Linux.
// *Action: Refer to documentation for a list of supported operating systems. Or, size /dev/shm to be at least the SGA_MAX_SIZE on each Oracle instance running on the system.

其实,在启动过程中,告警日志会报以下错误:

WARNING: You are trying to use the MEMORY_TARGET feature. This feature requires the /dev/shm file system to be mounted for at least 369098752 bytes. /dev/shm is either not mounted or is mounted with available space less than this size. Please fix this so that MEMORY_TARGET can work as expected. Current available is 261324800 and used is 0 bytes. Ensure that the mount point is /dev/shm for this directory.
memory_target needs larger /dev/shm

原因:AMM是11g引入的新特性,它会利用到Linux系统中的/dev/shm,/dev/shm必须大于或等于memory_target。

解决方法:

1> 立即生效--注意:/dev/shm的size值必须为整数,默认是内存的一半

[root@node3 oracle]# umount tmpfs
[root@node3 oracle]# mount -t tmpfs shmfs -o size=400m /dev/shm

2> 修改/etc/fstab

tmpfs                   /dev/shm                tmpfs   defaults,size=400m      0 0

也可以先修改/etc/fstab,然后用 mount -o remount /dev/shm重新挂载/dev/shm

在RHEL6以上是系统的一个bug,即便在/etc/fstab中修改了/dev/shm的值,重启后依然恢复到内存的一半。

https://bugzilla.redhat.com/show_bug.cgi?id=669700,关于网上说的修改/etc/rc.d/rc.sysinit文件,经测试,仍然无法解决问题,反而会导致其它的盘没有挂载。

最后,只能将 mount -o remount /dev/shm编辑到/etc/rc.local文件中

3. ORA-29701: unable to connect to Cluster Synchronization Service

手动启动CSS:crsctl start res ora.cssd

http://www.cnblogs.com/ivictor/p/3958280.html