Oracle9i启动过程中错误问题总结

38 篇文章 0 订阅

1:故障现象:ORA-01078: failure in processing system parameters 

 LRM-00109: could not open parameter file '/u01/app/oracle/product/10.2.0/db_1/dbs/initOracle.ora'
原理:在oracle9i和oracle10g中, 数据库默认将使用spfile启动数据库,如果spfile不存在,则就会出现上述错误。
解决办法:
 
方法一:将$ORACLE_BASE/admin/orcl/pfile目录下的init.ora.0212012125517形式的文件copy到$ORACLE_HOME/dbs目录下initoracl.ora即可。(注:initoracl.ora中的oracl为你的实例名 ORACLE_SID,这里我的SID为:Oracle)
 
方法二:将$ORACLE_HOME/dbs目录下spflieoracl.ora改名为spfileorcl10g.ora即可。(注:spfileorcl10g.ora中的orcl10g为环境变量中设置的SID,我的是Oracle)
 
2:ORA-01990: error opening password file '/oracle/app/product/920/dbs/orapw'
   ORA-27037: unable to obtain file status
   SVR4 Error: 2: No such file or directory
   Additional information: 3
     [ 处理方法 ]

问题是因为密码文件丢失或被破坏等原因造成文件不能访问。

查看命令orapwd语法:
$ orapwd
Usage: orapwd file= password= entries=
where
file - name of password file (mand),
password - password for SYS (mand),
entries - maximum number of distinct DBA and OPERs (opt),
There are no spaces around the equal-to (=) character.
查看密码文件所在位置:
$ pwd
/oracle/app/product/920/dbs
在指定位置重建密码文件:
$ orapwd file=/oracle/app/product/920/dbs/orapw password=sys123 entries=10
使用sqlplus重新启动oracle数据库:
$ sqlplus /nolog
sql>conn / as sysdba
sql>startup

 

Oracle 数据库密码文件的使用和维护 

3:ORA-01102: cannot mount database in EXCLUSIVE mode

 

 今天在自己虚拟机上玩DG,在主节点启动的时候报错ORA-01102: cannot mount database in EXCLUSIVE mode可能是上次虚拟机未正常关闭引起的,在网上查了一下相关资料,总结一下该类问题的排查过程,首先看一下数据库启动时报错信息

ORA-01102: <wbr>cannot <wbr>mount <wbr>database <wbr>in <wbr>EXCLUSIVE <wbr>mode

出现ORA-1102错误可能有以下几种可能:
一、在HA系统中,已经有其他节点启动了实例,将双机共享的资源(如磁盘阵列上的裸设备)占用了;
二、说明Oracle被异常关闭时,有资源没有被释放,一般有以下几种可能,
  1、 Oracle的共享内存段或信号量没有被释放;
  2、 Oracle的后台进程(如SMON、PMON、DBWn等)没有被关闭;
  3、 用于锁内存的文件lk和sgadef.dbf文件没有被删除。
 
第一点,因为我的是虚拟机,并没有配置HA,可以排除。
第二点,因为上次我虚拟机是直接断电关闭的,我们可以排除第二种可能的1、2点。接下来考虑第3点。
查$ORACLE_HOME/dbs目录:
ORA-01102: <wbr>cannot <wbr>mount <wbr>database <wbr>in <wbr>EXCLUSIVE <wbr>mode
从上面的查询结果可以看出,lk文件没有被删除。将它删除掉
再启动数据库,成功。

如果是Oracle进程没有关闭,用以下命令查出存在的oracle进程:
[oracle@dg1 dbs]# ps -ef|grep oracle  

root      2310  2358  0 16:00 pts/0    00:00:00 su - oracle  

oracle    2311  2310  0 16:00 pts/0    00:00:00 -bash  

root      2427  2403  0 10:47 pts/1    00:00:00 su - oracle  

……   

然后用kill -9命令杀掉进程
kill -9
 
另外,虽然我们上面排除了共享内存段和信号量的问题,但是排查方法是什么呢?首先要先查看信号量信息,一般而言直接清除内存段是无法清除的,把信号量清除后,内存段一般会自动释放,查看信号量信息
ORA-01102: <wbr>cannot <wbr>mount <wbr>database <wbr>in <wbr>EXCLUSIVE <wbr>mode
清除信号量信息
ipcrm -s 229377
查看内存段信息
ORA-01102: <wbr>cannot <wbr>mount <wbr>database <wbr>in <wbr>EXCLUSIVE <wbr>mode
清除内存段信息
ipcrm –m 4620292
总结:
当发生1102错误时,可以按照以下流程检查、排错:

1.如果是HA系统,检查其他节点是否已经启动实例;

2.检查Oracle进程是否存在,如果存在则杀掉进程;

3.检查信号量是否存在,如果存在,则清除信号量;

4.检查共享内存段是否存在,如果存在,则清除共享内存段;

5.检查锁内存文件lk和sgadef.dbf是否存在,如果存在,则删除。

 

4:ORA-01507: database not mounted

今天启动数据库时报错了!

SQL> startup mount        

ORACLE instance started.

 

Total System Global Area  608174080 bytes

Fixed Size                 1220844 bytes

Variable Size            176164628 bytes

Database Buffers      427819008 bytes

Redo Buffers             2969600 bytes

ORA-01102: cannot mount database in EXCLUSIVE mode

 

Google了一下发现一个写的非常好的帖子,详细内如如下(被我修改过了!)

 

分析原因:

一、在HA系统中,已经有其他节点启动了实例,将双机共享的资源(如磁盘阵列上的裸设备)占用了;

 

二、说明Oracle被异常关闭时,有资源没有被释放,一般有以下几种可能,

1、 Oracle的共享内存段或信号量没有被释放;

2、 Oracle的后台进程(如SMON、PMON、DBWn等)没有被关闭;

3、 用于锁内存的文件lk<sid>sgadef<sid>.dbf文件没有被删除。

 

解决思路:

当发生1102错误时,可以按照以下流程检查、排错:

如果是HA系统,检查其他节点是否已经启动实例检查Oracle进程是否存在,如果存在则杀掉进程检查信号量是否存在,如果存在,则清除信号量检查共享内存段是否存在,如果存在,则清除共享内存段检查锁内存文件lk<sid>和sgadef<sid>.dbf是否存在,如果存在,则删除。

 

具体做法:

首先,虽然我们的系统是HA系统,但是备节点的实例始终处在关闭状态,这点通过在备节点上查数据库状态可以证实。

其次、是因系统掉电引起数据库宕机的,系统在接电后被重启,因此我们排除了第二种可能种的1、2点。最可疑的就是第3点了。

查$ORACLE_HOME/dbs目录:

$ cd $ORACLE_HOME/dbs

$ ls sgadef*

sgadef* not found

$ ls lk*

/opt/oracle/product/ 10.2.0/db_1/dbs/lkSIMPLY

lkSIMPLY

果然,lk<sid>文件没有被删除。将它删除掉

$ rm lk*

 

再次启动时又遇到下面的错误,不过别担心,继续后面的操作就搞定

SQL> startup mount

ORACLE instance started.

 

Total System Global Area  608174080 bytes

Fixed Size    1220844 bytes

Variable Size     176164628 bytes

Database Buffers      427819008 bytes

Redo Buffers    2969600 bytes

ORA-00205: error in identifying control file, check alert log for more info   : (

 

查看共享内存段

[root@simply bdump]# ipcs -map

 

------ Shared Memory Creator/Last-op --------

shmid   owner  cpid    lpid

786444  root    6490   6438

819213  root    6549   6438

1409040 oracle   31502  16728

根据ID号清楚共享内存段

ipcrm –m 1409040

我这里操作是没有成功的,不过执行了下面的操作就ok了!

 

查看信号量

[root@simply bdump]# ipcs -s

 

key       semid      owner   perms    nsems

0x17ff6454 360448     oracle    640     154

 

清除oracle的信号量

[root@simply bdump]# ipcrm -s 360448

 

再次查询确认

[root@simply bdump]# ipcs -s

 

------ Semaphore Arrays --------

key  semid  owner  perms   nsems

 

再查询共享内存段也ok了!

[root@simply bdump]# ipcs -m

 

如果是Oracle进程没有关闭,

$kill -9 <PID>

   5:ORA-00205: error in identifying control file, check alert log for more info

ORA-00205: error in identifying control file, check alert log for more info   : (

 

查看共享内存段

[root@simply bdump]# ipcs -map

 

------ Shared Memory Creator/Last-op --------

shmid   owner  cpid    lpid

786444  root    6490   6438

819213  root    6549   6438

1409040 oracle   31502  16728

根据ID号清楚共享内存段

ipcrm –m 1409040

我这里操作是没有成功的,不过执行了下面的操作就ok了!

 

查看信号量

[root@simply bdump]# ipcs -s

 

key       semid      owner   perms    nsems

0x17ff6454 360448     oracle    640     154

 

清除oracle的信号量

[root@simply bdump]# ipcrm -s 360448

 

再次查询确认

[root@simply bdump]# ipcs -s

 

------ Semaphore Arrays --------

key  semid  owner  perms   nsems

 

再查询共享内存段也ok了!

[root@simply bdump]# ipcs -m

 

如果是Oracle进程没有关闭,

$kill -9 <PID>

 

 

ORA-01102: cannot mount database in EXCLUSIVE mode

一.今天在STARTUP一数据库时,发生如下错误:
SQL> conn /as sysdba
Connected to an idle instance.
SQL> startup
ORACLE instance started.
Total System Global Area 276824064 bytes
Fixed Size                   778736 bytes
Variable Size             137371152 bytes
Database Buffers          138412032 bytes
Redo Buffers                 262144 bytes
ORA-01102: cannot mount database in EXCLUSIVE mode
SQL> shutdown immediate
ORA-01507: database not mounted

ORACLE instance shut down.
GOOGLE一下,发现是lk<SID>文件造成的,该文件位于ORALCE_HOME下的dbs目录下,马上检查该文件:
[root@qa-oracle dbs]# fuser -u lkNDMSQA
lkNDMSQA:             6666(oracle) 6668(oracle) 6670(oracle) 6672(oracle) 6674(oracle) 6676(oracle) 6678(oracle) 6680(oracle) 6690(oracle) 6692(oracle) 6694(oracle) 6696(oracle) 6737(oracle) 6830(oracle)
果然该文件没释放,用fuser命令kill掉:
[root@qa-oracle dbs]# fuser -k lkNDMSQA
lkNDMSQA:             6666 6668 6670 6672 6674 6676 6678 6680 6690 6692 6694 6696 6737 6830
[root@qa-oracle dbs]# fuser -u lkNDMSQA
然后:
SQL> startup 
ORACLE instance started.
Total System Global Area 276824064 bytes
Fixed Size                   778736 bytes
Variable Size             137371152 bytes
Database Buffers          138412032 bytes
Redo Buffers                 262144 bytes
Database mounted.
Database opened.
SQL>
数据库成功OPEN.
二.说明Oracle被异常关闭时,有资源没有被释放,一般有以下几种可能,
1、 Oracle的共享内存段或信号量没有被释放;
2、 Oracle的后台进程(如SMON、PMON、DBWn等)没有被关闭;
3、 用于锁内存的文件lk<sid>和sgadef<sid>.dbf文件没有被删除。
首先,虽然我们的系统是HA系统,但是备节点的实例始终处在关闭状态,这点通过在备节点上查数据库状态可以证实。
其次、是因系统掉电引起数据库宕机的,系统在接电后被重启,因此我们排除了第二种可能种的1、2点。最可疑的就是第3点了。
查$ORACLE_HOME/dbs目录:
$ cd $ORACLE_HOME/dbs
$ ls sgadef*
sgadef* not found
$ ls lk*
lkORA92
果然,lk<sid>文件没有被删除。将它删除掉
$ rm lk*

再启动数据库,成功。

 

 

三.有可能还会出现以下错误

ORA-00205: error in identifying control file, check alert log for more info

 

报此错误有一种情况是在环境变量里面没添加NLS_LANG,必须加上这一句。

export NLS_LANG=AMERICAN_CHINA.ZHS16GBK

 

 

 

ORA-01102: cannot mount database in EXCLUSIVE mode
今天在STARTUP一数据库时,发生如下错误:
 
SQL> conn /as sysdba
Connected to an idle instance.
SQL> startup
ORACLE instance started.
Total System Global Area  276824064 bytes
Fixed Size                   778736 bytes
Variable Size             137371152 bytes
Database Buffers          138412032 bytes
Redo Buffers                 262144 bytes
ORA-01102: cannot mount database in EXCLUSIVE mode
SQL> shutdown immediate
ORA-01507: database not mounted

ORACLE instance shut down.
 
GOOGLE一下,发现是lk<SID>文件造成的,该文件位于ORALCE_HOME下的dbs目录下,马上检查该文件:
 
[root@qa-oracle dbs]# fuser -u lkNDMSQA
lkNDMSQA:             6666(oracle)  6668(oracle)  6670(oracle)  6672(oracle)  6674(oracle)  6676(oracle)  6678(oracle)  6680(oracle)  6690(oracle)  6692(oracle)  6694(oracle)  6696(oracle)  6737(oracle)  6830(oracle)
 
果然该文件没释放,用fuser命令kill掉:
[root@qa-oracle dbs]# fuser -k lkNDMSQA
lkNDMSQA:             6666  6668  6670  6672  6674  6676  6678  6680  6690  6692  6694  6696  6737  6830
[root@qa-oracle dbs]# fuser -u lkNDMSQA
 
然后:
 
SQL> startup  
ORACLE instance started.
Total System Global Area  276824064 bytes
Fixed Size                   778736 bytes
Variable Size             137371152 bytes
Database Buffers          138412032 bytes
Redo Buffers                 262144 bytes
Database mounted.
Database opened.
SQL>
 
数据库成功OPEN.

sqlplus "/ as sysdba" 连不上,报ora-01031:insufficient privileges解决方法

 

注意多个数据库实例时候,set ORACLE_SID='',

1、检查sqlnet.ora(WINDOWS下位于%ORACLE_HOME%NETWORKADMIN目录)是否包含这句:SQLNET.AUTHENTICATION_SERVICES=(NTS),没有的话加上

 

2、检查登陆windows的用户(administrator或安装oracle时候使用的用户)是不是在包含在ORA_DBA组中,域用户没有连上域服务器时就可能出现这种现象。

3. 要保证 remote_login_passwordfile 参数 = EXCLUSIVE .

4. 看看是否需要使用orapassw生成口令文件 .


一种解决方法案例:

1、检查系统参数:
SQL> show parameter password

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
remote_login_passwordfile            string      EXCLUSIVE
2、
select * from v$pwfile_users;
SQL>
为空

3、
SQL> grant sysdba to sys;
grant sysdba to sys
*
ERROR at line 1:
ORA-01994: GRANT failed: password file missing or disabled
4、建立password文件
D:/>orapwd file="D:/oracle/product/10g/db_1/database/PWDoratest.ora" password=gp
oswong entries=10
5、
SQL> select * from v$pwfile_users;

USERNAME                       SYSDB SYSOP
------------------------------ ----- -----
SYS                            TRUE  TRUE
SYS正常显示出来。
6、重新在远程以SYSDBA登录,可正常使用。


如果口令文件创建的有问题,也是会报如下的错误:

ora-01031:insufficient privileges

口令文件的命名格式应为orapwsid,并且sid是区分大小写的。由于Target Database连接Auxiliary Database时需要验证口令,
如果违反了以上规则,将会提示ORA-01031: insufficient privileges。


我在用linux创建duplicate数据库的时候 就是因为口令文件创建的路径和名称不对才遇到这个错误

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值