热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

【ORA】ORA01033,ORA09968,ORA01102

[oracle@oracle~]$impxxxx/userfile=/usr/local/src/666.dmpfull=ybuffer=40960000Import:

[oracle@oracle ~]$ imp xxxx/user file=/usr/local/src/666.dmp full=y buffer=40960000

Import: Release 10.2.0.5.0 - Production on Thu Apr 19 14:01:24 2018
Copyright (c) 1982, 2007, Oracle. All rights reserved.
IMP-00058: ORACLE error 1033 encountered
ORA-01033: ORACLE initialization or shutdown in progressUsername:
Password:

用sqlplus进入到数据库中,查看数据库的状态,发现是nomount模式

SQL select instance_name ,status from v$instance;

SQL INSTANCE_NAME STATUS
---------------- ------------
orcl STARTD

尝试启动数据库

SQL ALTER DATABASE MOUNT;

结果报错:

ORA-01102: cannot mount database in EXCLUSIVE mode

结果上alert日志里看到了相关的报错:

ALTER DATABASE MOUNT
Thu Apr 19 14:05:59 CST 2018
sculkget: failed to lock /opt/app/oracle/product/10.2//dbs/lkORCL exclusive
sculkget: lock held by PID: 1745
Thu Apr 19 14:05:59 CST 2018
ORA-09968: unable to lock file
Linux-x86_64 Error: 11: Resource temporarily unavailable
Additional information: 1745
Thu Apr 19 14:05:59 CST 2018
ORA-1102 signalled during: ALTER DATABASE MOUNT...
ORA-09968: unable to lock file
Linux-x86_64 Error: 11: Resource temporarily unavailable

网上找到了相关的解释:

metadata这样解释的:

Problem Description:

====================

You are trying to startup the database and you receive the following error:

ORA-01102: cannot mount database in EXCLUSIVE mode

Cause: Some other instance has the database mounted exclusive or shared.

Action: Shutdown other instance or mount in a compatible mode.

Problem Explanation:

====================

A database is started in EXCLUSIVE mode by default. Therefore, the ORA-01102 error is misleading and may have occurred due to one of the following reasons:

- there is still an "sgadef sid .dbf" file in the "ORACLE_HOME/dbs" directory

- the processes for Oracle (pmon, smon, lgwr and dbwr) still exist

- shared memory segments and semaphores still exist even though the

database has been shutdown

- there is a "ORACLE_HOME/dbs/lk sid " file

Search Words:

=============

ORA-1102, crash, immediate, abort, fail, fails, migration

Solution Description:

=====================

Verify that the database was shutdown cleanly by doing the following:

1. Verify that there is not a "sgadef sid .dbf" file in the directory "ORACLE_HOME/dbs".

% ls $ORACLE_HOME/dbs/sgadef sid .dbf If this file does exist, remove it.

% rm $ORACLE_HOME/dbs/sgadef sid .dbf

2. Verify that there are no background processes owned by "oracle"

% ps -ef | grep ora_ | grep $ORACLE_SID

If background processes exist, remove them by using the Unix

command "kill". For example:

% kill -9 rocess_ID_Number

3. Verify that no shared memory segments and semaphores that are owned by "oracle" still exist

% ipcs -b

If there are shared memory segments and semaphores owned by "oracle", remove the shared memory segments

% ipcrm -m Shared_Memory_ID_Number

and remove the semaphores

% ipcrm -s Semaphore_ID_Number

NOTE: The example shown above assumes that you only have one

database on this machine. If you have more than one

database, you will need to shutdown all other databases

before proceeding with Step 4.

4. Verify that the "$ORACLE_HOME/dbs/lk sid " file does not exist

5. Startup the instance

Solution Explanation:

=====================

The "lk sid " and "sgadef sid .dbf" files are used for locking shared memory. It seems that even though no memory is allocated, Oracle thinks memory is still locked. By removing the "sgadef" and "lk" files you remove any knowledge oracle has of shared memory that is in use. Now the database can start.

于是我尝试关闭数据库,

SQL SHUTDOWN IMMEDIATE;

数据库关闭正常

但是查看后台进程:

发现所有的后台进程还在

ps -ef | grep ora_
oracle 29890 1 0 14:13 ? 00:00:00 ora_pmon_orcl
oracle 29892 1 0 14:13 ? 00:00:00 ora_psp0_orcl
oracle 29894 1 0 14:13 ? 00:00:00 ora_mman_orcl
oracle 29896 1 0 14:13 ? 00:00:07 ora_dbw0_orcl
oracle 29898 1 0 14:13 ? 00:00:05 ora_lgwr_orcl
oracle 29900 1 0 14:13 ? 00:00:00 ora_ckpt_orcl
oracle 29902 1 0 14:13 ? 00:00:00 ora_smon_orcl
oracle 29904 1 0 14:13 ? 00:00:00 ora_reco_orcl
oracle 29906 1 0 14:13 ? 00:00:00 ora_cjq0_orcl
oracle 29908 1 0 14:13 ? 00:00:02 ora_mmon_orcl
oracle 29910 1 0 14:13 ? 00:00:00 ora_mmnl_orcl
oracle 29912 1 0 14:13 ? 00:00:00 ora_d000_orcl
oracle 29914 1 0 14:13 ? 00:00:00 ora_s000_orcl
oracle 29934 1 0 14:13 ? 00:00:00 ora_qmnc_orcl
oracle 29955 1 0 14:13 ? 00:00:00 ora_q000_orcl
oracle 29957 1 0 14:13 ? 00:00:00 ora_q001_orcl
oracle 30268 1 0 14:51 ? 00:00:00 ora_j000_orcl
oracle 30275 30184 0 14:53 pts/1 00:00:00 /bin/bash -c ps -ef | grep ora_
oracle 30277 30275 0 14:53 pts/1 00:00:00 grep ora_

根据上面的博客内容,断定是第二种问题,于是强制kill掉pmon进程

[oracle@oracle ~]$ ps -ef | grep pmon
oracle 29890 1 0 14:13 ? 00:00:00 ora_pmon_orcl
oracle 30282 29844 0 14:55 pts/1 00:00:00 grep pmon

[oracle@oracle ~]$ kill -9 29890

kill掉pmon进程后,所有的进程会慢慢结束关闭,再次查看发现已经全部关闭了

这次再重启数据库

sqlplus / as sysdba
SQL startup

最后启动成功了,数据库彻底开启

SQL select instance_name ,status from v$instance;
INSTANCE_NAME STATUS
---------------- ------------
orcl OPEN

这回再导入数据,发现正常导入

参考:

https://www.cnblogs.com/kerrycode/p/3656655.html

http://blog.itpub.net/12272958/viewspace-716020


推荐阅读
  • 在Oracle11g以前版本中的的DataGuard物理备用数据库,可以以只读的方式打开数据库,但此时MediaRecovery利用日志进行数据同步的过 ... [详细]
  • 本文讨论了在数据库打开和关闭状态下,重新命名或移动数据文件和日志文件的情况。针对性能和维护原因,需要将数据库文件移动到不同的磁盘上或重新分配到新的磁盘上的情况,以及在操作系统级别移动或重命名数据文件但未在数据库层进行重命名导致报错的情况。通过三个方面进行讨论。 ... [详细]
  • 图解redis的持久化存储机制RDB和AOF的原理和优缺点
    本文通过图解的方式介绍了redis的持久化存储机制RDB和AOF的原理和优缺点。RDB是将redis内存中的数据保存为快照文件,恢复速度较快但不支持拉链式快照。AOF是将操作日志保存到磁盘,实时存储数据但恢复速度较慢。文章详细分析了两种机制的优缺点,帮助读者更好地理解redis的持久化存储策略。 ... [详细]
  • 本文介绍了如何使用php限制数据库插入的条数并显示每次插入数据库之间的数据数目,以及避免重复提交的方法。同时还介绍了如何限制某一个数据库用户的并发连接数,以及设置数据库的连接数和连接超时时间的方法。最后提供了一些关于浏览器在线用户数和数据库连接数量比例的参考值。 ... [详细]
  • Oracle Database 10g许可授予信息及高级功能详解
    本文介绍了Oracle Database 10g许可授予信息及其中的高级功能,包括数据库优化数据包、SQL访问指导、SQL优化指导、SQL优化集和重组对象。同时提供了详细说明,指导用户在Oracle Database 10g中如何使用这些功能。 ... [详细]
  • 本文详细介绍了MysqlDump和mysqldump进行全库备份的相关知识,包括备份命令的使用方法、my.cnf配置文件的设置、binlog日志的位置指定、增量恢复的方式以及适用于innodb引擎和myisam引擎的备份方法。对于需要进行数据库备份的用户来说,本文提供了一些有价值的参考内容。 ... [详细]
  • 本文介绍了Oracle数据库中tnsnames.ora文件的作用和配置方法。tnsnames.ora文件在数据库启动过程中会被读取,用于解析LOCAL_LISTENER,并且与侦听无关。文章还提供了配置LOCAL_LISTENER和1522端口的示例,并展示了listener.ora文件的内容。 ... [详细]
  • Oracle分析函数first_value()和last_value()的用法及原理
    本文介绍了Oracle分析函数first_value()和last_value()的用法和原理,以及在查询销售记录日期和部门中的应用。通过示例和解释,详细说明了first_value()和last_value()的功能和不同之处。同时,对于last_value()的结果出现不一样的情况进行了解释,并提供了理解last_value()默认统计范围的方法。该文对于使用Oracle分析函数的开发人员和数据库管理员具有参考价值。 ... [详细]
  • Oracle seg,V$TEMPSEG_USAGE与Oracle排序的关系及使用方法
    本文介绍了Oracle seg,V$TEMPSEG_USAGE与Oracle排序之间的关系,V$TEMPSEG_USAGE是V_$SORT_USAGE的同义词,通过查询dba_objects和dba_synonyms视图可以了解到它们的详细信息。同时,还探讨了V$TEMPSEG_USAGE的使用方法。 ... [详细]
  • 本文详细介绍了如何使用MySQL来显示SQL语句的执行时间,并通过MySQL Query Profiler获取CPU和内存使用量以及系统锁和表锁的时间。同时介绍了效能分析的三种方法:瓶颈分析、工作负载分析和基于比率的分析。 ... [详细]
  • Windows7 64位系统安装PLSQL Developer的步骤和注意事项
    本文介绍了在Windows7 64位系统上安装PLSQL Developer的步骤和注意事项。首先下载并安装PLSQL Developer,注意不要安装在默认目录下。然后下载Windows 32位的oracle instant client,并解压到指定路径。最后,按照自己的喜好对解压后的文件进行命名和压缩。 ... [详细]
  • 本文介绍了Oracle存储过程的基本语法和写法示例,同时还介绍了已命名的系统异常的产生原因。 ... [详细]
  • 解决.net项目中未注册“microsoft.ACE.oledb.12.0”提供程序的方法
    在开发.net项目中,通过microsoft.ACE.oledb读取excel文件信息时,报错“未在本地计算机上注册“microsoft.ACE.oledb.12.0”提供程序”。本文提供了解决这个问题的方法,包括错误描述和代码示例。通过注册提供程序和修改连接字符串,可以成功读取excel文件信息。 ... [详细]
  • 先看一段错误日志:###Errorqueryingdatabase.Cause:com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransie ... [详细]
  • Postgresql备份和恢复的方法及命令行操作步骤
    本文介绍了使用Postgresql进行备份和恢复的方法及命令行操作步骤。通过使用pg_dump命令进行备份,pg_restore命令进行恢复,并设置-h localhost选项,可以完成数据的备份和恢复操作。此外,本文还提供了参考链接以获取更多详细信息。 ... [详细]
author-avatar
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有