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


推荐阅读
  • MySQL Administrator: 监控与管理工具
    本文介绍了 MySQL Administrator 的主要功能,包括图形化监控 MySQL 服务器的实时状态、连接健康度、内存健康度以及如何创建自定义的健康图表。此外,还详细解释了状态变量和系统变量的管理。 ... [详细]
  • 如何将955万数据表的17秒SQL查询优化至300毫秒
    本文详细介绍了通过优化SQL查询策略,成功将一张包含955万条记录的财务流水表的查询时间从17秒缩短至300毫秒的方法。文章不仅提供了具体的SQL优化技巧,还深入探讨了背后的数据库原理。 ... [详细]
  • 二维码的实现与应用
    本文介绍了二维码的基本概念、分类及其优缺点,并详细描述了如何使用Java编程语言结合第三方库(如ZXing和qrcode.jar)来实现二维码的生成与解析。 ... [详细]
  • 本文介绍了如何通过C#语言调用动态链接库(DLL)中的函数来实现IC卡的基本操作,包括初始化设备、设置密码模式、获取设备状态等,并详细展示了将TextBox中的数据写入IC卡的具体实现方法。 ... [详细]
  • CentOS下ProFTPD的安装与配置指南
    本文详细介绍在CentOS操作系统上安装和配置ProFTPD服务的方法,包括基本配置、安全设置及高级功能的启用。 ... [详细]
  • 本文介绍了如何在两个Oracle数据库(假设为数据库A和数据库B)之间设置DBLink,以便能够从数据库A中直接访问和操作数据库B中的数据。文章详细描述了创建DBLink前的必要准备步骤以及具体的创建方法。 ... [详细]
  • oracle 对硬件环境要求,Oracle 10G数据库软硬件环境的要求 ... [详细]
  • Redis:缓存与内存数据库详解
    本文介绍了数据库的基本分类,重点探讨了关系型与非关系型数据库的区别,并详细解析了Redis作为非关系型数据库的特点、工作模式、优点及持久化机制。 ... [详细]
  • 本文介绍了 PHP 的基本概念、服务器与客户端的工作原理,以及 PHP 如何与数据库交互。同时,还涵盖了常见的数据库操作和安全性问题。 ... [详细]
  • ABP框架是ASP.NET Boilerplate的简称,它不仅是一个开源且文档丰富的应用程序框架,还提供了一套基于领域驱动设计(DDD)的最佳实践架构模型。本文将详细介绍ABP框架的特点、项目结构及其在Web API优先架构中的应用。 ... [详细]
  • JUnit下的测试和suite
    nsitionalENhttp:www.w3.orgTRxhtml1DTDxhtml1-transitional.dtd ... [详细]
  • 解决JavaScript中法语字符排序问题
    在开发一个使用JavaScript、HTML和CSS的Web应用时,遇到从SQLite数据库中提取的法语词汇排序不正确的问题,特别是带重音符号的字母未按预期排序。 ... [详细]
  • 本文作为《WM平台上使用Sybase Anywhere 11》系列的第二篇,将继续探讨在Windows Mobile (WM) 系统中如何高效地操作Sybase Anywhere 11数据库。继上一篇关于安装与基本测试的文章之后,本篇将深入讲解数据库的具体操作方法。 ... [详细]
  • 本文详细探讨了BCTF竞赛中窃密木马题目的解题策略,重点分析了该题目在漏洞挖掘与利用方面的技巧。 ... [详细]
  • 本文详细介绍了 MySQL InnoDB 存储引擎的事务机制,包括 ACID 特性、redo 日志、undo 日志以及 checkpoint 的作用和实现方式。 ... [详细]
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社区 版权所有