热门标签 | 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


推荐阅读
  • 本文深入探讨 MyBatis 中动态 SQL 的使用方法,包括 if/where、trim 自定义字符串截取规则、choose 分支选择、封装查询和修改条件的 where/set 标签、批量处理的 foreach 标签以及内置参数和 bind 的用法。 ... [详细]
  • 本文探讨了MariaDB在当前数据库市场中的地位和挑战,分析其可能面临的困境,并提出了对未来发展的几点看法。 ... [详细]
  • 实体映射最强工具类:MapStruct真香 ... [详细]
  • 本文详细介绍了优化DB2数据库性能的多种方法,涵盖统计信息更新、缓冲池调整、日志缓冲区配置、应用程序堆大小设置、排序堆参数调整、代理程序管理、锁机制优化、活动应用程序限制、页清除程序配置、I/O服务器数量设定以及编入组提交数调整等方面。通过这些技术手段,可以显著提升数据库的运行效率和响应速度。 ... [详细]
  • ElasticSearch 集群监控与优化
    本文详细介绍了如何有效地监控 ElasticSearch 集群,涵盖了关键性能指标、集群健康状况、统计信息以及内存和垃圾回收的监控方法。 ... [详细]
  • 主调|大侠_重温C++ ... [详细]
  • 本文详细介绍了如何在Linux系统中创建和管理DB2数据库,包括用户切换、数据库创建、错误处理、连接与断开、表空间和缓冲池的创建,以及用户权限管理和数据导入导出等操作。 ... [详细]
  • 1:有如下一段程序:packagea.b.c;publicclassTest{privatestaticinti0;publicintgetNext(){return ... [详细]
  • 获取计算机硬盘序列号的方法与实现
    本文介绍了如何通过编程方法获取计算机硬盘的唯一标识符(序列号),并提供了详细的代码示例和解释。此外,还涵盖了如何使用这些信息进行身份验证或注册保护。 ... [详细]
  • 深入探讨CPU虚拟化与KVM内存管理
    本文详细介绍了现代服务器架构中的CPU虚拟化技术,包括SMP、NUMA和MPP三种多处理器结构,并深入探讨了KVM的内存虚拟化机制。通过对比不同架构的特点和应用场景,帮助读者理解如何选择最适合的架构以优化性能。 ... [详细]
  • 对象自省自省在计算机编程领域里,是指在运行时判断一个对象的类型和能力。dir能够返回一个列表,列举了一个对象所拥有的属性和方法。my_list[ ... [详细]
  • 本文详细介绍了如何在云服务器上配置Nginx、Tomcat、JDK和MySQL。涵盖从下载、安装到配置的完整步骤,帮助读者快速搭建Java Web开发环境。 ... [详细]
  • 本文探讨了在 SQL Server 中使用 JDBC 插入数据时遇到的问题。通过详细分析代码和数据库配置,提供了解决方案并解释了潜在的原因。 ... [详细]
  • 本文深入探讨了 Oracle 数据库的网络配置,包括全局数据库名、实例名等关键参数的设置与作用,旨在为数据库管理员和开发人员提供全面的参考。 ... [详细]
  • 本文详细探讨了Java中的ClassLoader类加载器的工作原理,包括其如何将class文件加载至JVM中,以及JVM启动时的动态加载策略。文章还介绍了JVM内置的三种类加载器及其工作方式,并解释了类加载器的继承关系和双亲委托机制。 ... [详细]
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社区 版权所有