oracle数据库的一次异常起停处理。

在重启数据库的时候,忘记把一个应用关停了,想起来的时候,就ctrl+c,把数据库shutdown immediate 给强制停下了,把该应用再停止,然后shutdown immdiate,这时候数据报错了。

[email protected]:~> sqlplus ‘/as sysdba‘

SQL*Plus: Release 11.2.0.3.0 Production on Tue May 3 18:07:35 2016

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

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> shutdown immediate;
^C^C^C^C^C

^C^C^C^C

ORA-12152: TNS:unable to send break message

SQL> SQL> SQL> SQL>
SQL> shutdown immediate;
ORA-24324: service handle not initialized
ORA-01041: internal error. hostdef extension doesn‘t exist
SQL>
SQL>
SQL>
SQL> shutdown immediate;
ORA-24324: service handle not initialized
ORA-01041: internal error. hostdef extension doesn‘t exist
SQL>
SQL>
SQL> startup force;
ORA-24324: service handle not initialized
ORA-01041: internal error. hostdef extension doesn‘t exist
SQL> shutdown immediate;
ORA-24324: service handle not initialized
ORA-01041: internal error. hostdef extension doesn‘t exist
SQL>

此时alert日志的情况如下:

Additional information: 1
Additional information: 32823
Tue May 03 18:05:16 2016
Errors in file /opt/oracle/app/oracle/diag/rdbms/pm4h/pm4h/trace/pm4h_m000_21073.trc:
ORA-51106: check failed to complete due to an error. See error below
ORA-48101: error encountered when attempting to read a file [block] [/opt/oracle/app/oracle/diag/rdbms/pm4h/pm4h/metadata/HM_FINDING.ams] [0]
ORA-48102: encountered the end-of-file when reading the file
Additional information: 64840
Additional information: 1
Additional information: 32823
Tue May 03 18:06:45 2016
Errors in file /opt/oracle/app/oracle/diag/rdbms/pm4h/pm4h/trace/pm4h_m000_25185.trc:
ORA-51106: check failed to complete due to an error. See error below
ORA-48101: error encountered when attempting to read a file [block] [/opt/oracle/app/oracle/diag/rdbms/pm4h/pm4h/metadata/HM_FINDING.ams] [0]
ORA-48102: encountered the end-of-file when reading the file
Additional information: 64840
Additional information: 1
Additional information: 32823
Tue May 03 18:07:25 2016
opidcl aborting process unknown ospid (58374) as a result of ORA-2396
Tue May 03 18:07:26 2016

***********************************************************************

Fatal NI connect error 12547, connecting to:
(LOCAL=NO)

VERSION INFORMATION:
TNS for Linux: Version 11.2.0.3.0 - Production
Oracle Bequeath NT Protocol Adapter for Linux: Version 11.2.0.3.0 - Production
TCP/IP NT Protocol Adapter for Linux: Version 11.2.0.3.0 - Production
Time: 03-MAY-2016 18:07:26
Tracing not turned on.
Tns error struct:
ns main err code: 12547

TNS-12547: TNS:lost contact
ns secondary err code: 12560
nt main err code: 0
nt secondary err code: 0
nt OS err code: 0
opiodr aborting process unknown ospid (29320) as a result of ORA-609
Tue May 03 18:07:29 2016
opidcl aborting process unknown ospid (58149) as a result of ORA-2396
Tue May 03 18:07:44 2016
Errors in file /opt/oracle/app/oracle/diag/rdbms/pm4h/pm4h/trace/pm4h_m000_29720.trc:
ORA-51106: check failed to complete due to an error. See error below
ORA-48101: error encountered when attempting to read a file [block] [/opt/oracle/app/oracle/diag/rdbms/pm4h/pm4h/metadata/HM_FINDING.ams] [0]
ORA-48102: encountered the end-of-file when reading the file
Additional information: 64840
Additional information: 1
Additional information: 32823
Tue May 03 18:08:50 2016
Errors in file /opt/oracle/app/oracle/diag/rdbms/pm4h/pm4h/trace/pm4h_m000_31031.trc:
ORA-51106: check failed to complete due to an error. See error below
ORA-48101: error encountered when attempting to read a file [block] [/opt/oracle/app/oracle/diag/rdbms/pm4h/pm4h/metadata/HM_FINDING.ams] [0]
ORA-48102: encountered the end-of-file when reading the file
Additional information: 64840
Additional information: 1
Additional information: 32823
Tue May 03 18:10:03 2016
Shutting down instance (immediate)
Stopping background process SMCO
Shutting down instance: further logons disabled
Stopping background process QMNC
Tue May 03 18:10:05 2016
Stopping background process CJQ0
Stopping background process MMNL
Stopping background process MMON
License high water mark = 1426
Tue May 03 18:11:17 2016
ALTER DATABASE CLOSE NORMAL
Tue May 03 18:11:21 2016
SMON: disabling tx recovery
SMON: disabling cache recovery
^C

处理的措施:

1.查看共享内存资源
 ipcs -pmb

[email protected]:~> ipcs -pm;

------ Shared Memory Creator/Last-op PIDs --------
shmid owner cpid lpid
3145744 oracle 14924 32669
3178513 oracle 14924 32669
3211282 oracle 14924 32669
3244051 oracle 14924 32669
3276820 oracle 14924 32669
3309589 oracle 14924 32669
3342358 oracle 14924 32669
3375127 oracle 14924 32669
3407896 oracle 14924 32669
3440665 oracle 14924 32733

oracle资源在占用,所以必须进行资源释放,执行如下操作:

[email protected]:~> ipcrm -m 3145744

(这里必须一个一个的停,不能一次停 多个)

2.

SQL> shutdown immediate;
ORA-01034: ORACLE not available
ORA-27101: shared memory realm does not exist
Linux-x86_64 Error: 2: No such file or directory
SQL> startup force;
ORACLE instance started.

Total System Global Area 5.1310E+10 bytes
Fixed Size 2240344 bytes
Variable Size 3.1139E+10 bytes
Database Buffers 2.0133E+10 bytes
Redo Buffers 36098048 bytes
Database mounted.
Database opened.

时间: 2024-10-10 15:08:50

oracle数据库的一次异常起停处理。的相关文章

windows下同一台服务器上装有两个ORACLE数据库实例,通过命令启停数据库

同一台服务器上装有两个ORACLE数据库实例,通过命令启停数据库,如何区分操作的是哪个数据库实例?操作如下: 1.在命令行 set oracle_sid=one_实例   //先修改环境变量,这一步等于切换了数据库实例 sqlplus /nolog    connect /as sysdba    shutdown 或者 2.连接的时候 sqlplus user/[email protected] as sysdba    //也可以指定 shutdown immediate select in

java连接oracle数据库,关闭连接出现异常:java.sql.SQLRecoverableException: IO Error: Connection reset

java.sql.SQLRecoverableException: IO Error: Connection reset at oracle.jdbc.driver.T4CConnection.logoff(T4CConnection.java:612) at oracle.jdbc.driver.PhysicalConnection.close(PhysicalConnection.java:5094) at com.sms.send.StartTaskNew.run(SmsSend.java

C# 连接Oracle数据库异常总结

这2天因为工作需要连接Oracle数据库,中间发生了很多问题 一.使用OleDbConnection连接数据库 ------------------ Provider=OraOLEDB.Oracle.1;User ID=sajet;Password=tech;Data Source=(DESCRIPTION = (ADDRESS_LIST= (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.66.225)(PORT = 1521))) (CONNECT_DAT

Oracle数据库语句大全

转自:http://blog.sina.com.cn/s/blog_b5d14e2a0101c56z.html ORACLE支持五种类型的完整性约束 NOT NULL (非空)--防止NULL值进入指定的列,在单列基础上定义,默认情况下,ORACLE允许在任何列中有NULL值. CHECK (检查)--检查在约束中指定的条件是否得到了满足. UNIQUE (唯一)--保证在指定的列中没有重复值.在该表中每一个值或者每一组值都将是唯一的. PRIMARY KEY (主键)--用来唯一的标识出表的每

oracle数据库免费基础知识精讲视频分享!

课程简介:数据库基础知识.Oracle的环境搭建.Oracle体系结构.SQL语言基础.函数的使用.约束.索引.数据字典.分组查询.多表连接查询.子查询等.通过对Oracle数据库的系统详解,培养学 生的能力如下:在实际工作中,熟练使用SQL语句进行项目开发:能够使用复杂的SQL语句进行多表关联查询:具备数据库数据的管理和维护能力 . 课程目录: day01_安装数据库软件day02_数据库的基本使用selecl语句的使用day03_限制数据返回day04_字符函数.数字函数.日期函数day05

谈谈Oracle 数据库的系统权限UNLIMITED TABLESPACE

作者:赵全文 网名:guest 前日上午,开发同学反馈,应用程序在连接一套Oracle 11.2.0.4.0数据库的生产用户时,一直报"无操作表空间"的权限.于是,我赶紧连到SQLPLUS里进行查看该用户具有什么样的权限(包括系统权限.角色权限和对象权限),没有发现什么异常.大家都知道,一般在建立用户以后,都会给CONNECT和RESOURCE的角色权限.然后,我连到其它无报错的另一套Oracle 11.2.0.4.0数据库的生产用户上查看,两套数据库进行对比,发现报错的那套数据库没有

Oracle 数据库日常巡检

Oracle 数据库日常巡检 阅读目录 1. 检查数据库基本状况 2. 检查Oracle相关资源的使用情况 3. 检查Oracle数据库备份结果 4. 检查Oracle数据库性能 5. 检查数据库cpu.I/O.内存性能 6. 检查数据库安全性 7. 其他检查 回到顶部 1. 检查数据库基本状况 包含:检查Oracle实例状态,检查Oracle服务进程,检查Oracle监听进程,共三个部分. 1.1. 检查Oracle实例状态 select instance_name,host_name,sta

java连接oracle数据库的实现代码

package connectionOracleDatabase; import java.sql.Connection; import java.sql.DatabaseMetaData; import java.sql.DriverManager; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; public class ConnectionOracleDa

MSSQL复制功能实现与Oracle数据库同步

1.分别建立链接对数据库进行操作,SQLServer可以用ADO.NET,操作Oracle可以用OLEDB或者用System.Data.OracleClient(需要添加引用才能用) 这种方案的优点就是简单,各自写各自的数据库操作代码,缺点就是不能将两个数据库中的表直接进行联合查询,链接Oracle的每台机器必须安装OracleClient才可以使用. 2.使用同义词操作Oracle数据库. 这种方法的具体操作我在以前的文章中已经写清楚了,这样做一来可以进行表的联合查询二来不需要每台机器都安装O