sqlplus 组件意外被破坏恢复测试

来源:互联网 发布:php面试代码题 编辑:程序博客网 时间:2024/05/01 06:56
sqlplus 组件意外被破坏恢复

在执行 sqlplus / as sysdba 命令后没啥反应,有点奇诡。。。
[oracle@lixora bin]#sqlplus / as sysdba
[oracle@lixora bin]# ls -trl
...
-rwxr-x--x 1 oracle oinstall         0 Dec  9 15:52 sqlplus  -------这个文件居然被写空了发火
...

恢复测试:
从oracle 11201拷贝一个sqlplus 过来,修改完权限后进行测试:

[oracle@lixora bin]# ls -trl
-rwxr-x--x 1 oracle oinstall      9197 Dec 24 10:26 sqlplus
[oracle@lixora ~]$ sqlplus / as sysdba
SP2-1503: Unable to initialize Oracle call interface
SP2-0152: ORACLE may not be functioning properly
[oracle@lixora ~]$ 


关于上述报错官方解释:
01503,0, "Unable to initialize Oracle call interface\n"
// *Cause:  Indicates a library used by SQL*Plus to communicate with
//          the database failed to initialize correctly.
// *Action: Check that the Oracle environment or registry entries are
//          consistent and correct.  If using the SQL*Plus Instant Client
//          make sure the SQL*Plus and Oracle libraries are from the
//          same release. Make sure you have read access to the libraries.


00152,0, "ORACLE may not be functioning properly\n"
// *Cause:  Unable to initialize a session to the Oracle instance.
// *Action: Make a note of the message and the number, then contact
//          the Database Administrator.


从报错的信息来看主要是sqlplus 无法调用正常的lib 库文件,因而无法和/bin/目录下的oracle(rdbms)进行通信;
那么如果是从同平台同版本的oracle 数据库中拷贝一个sqlplus 组件过来,没准就能用的?
[oracle@lixora bin]# ls -trl
...
-rwxr-x--x 1 oracle oinstall      7725 Dec 24 10:29 sqlplus


再次测试:
[oracle@lixora bin]$ !sql
sqlplus / as sysdba
SQL*Plus: Release 10.2.0.3.0 - Production on Wed Dec 24 10:30:18 2014
Copyright (c) 1982, 2006, Oracle.  All Rights Reserved.
Connected to an idle instance.


SQL> startup

ORACLE instance started.

Total System Global Area  583008256 bytes
Fixed Size                  2074440 bytes
Variable Size             436209848 bytes
Database Buffers          138412032 bytes
Redo Buffers                6311936 bytes
Database mounted.   --------》数据库可以正常启动
Database opened.


来点暴力的,但是感觉和数据库没啥关系啊?
SQL> startup force
ORACLE instance started.
Total System Global Area  583008256 bytes
Fixed Size                  2074440 bytes
Variable Size             440404152 bytes
Database Buffers          134217728 bytes
Redo Buffers                6311936 bytes
Database mounted.
Database opened.


SQL> show parameter dump
NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
background_core_dump                 string      partial
background_dump_dest                 string      /oracle/admin/lixora/bdump
core_dump_dest                       string      /oracle/admin/lixora/cdump
max_dump_file_size                   string      1024
shadow_core_dump                     string      partial
user_dump_dest                       string      /oracle/admin/lixora/udump
SQL> select open_mode from v$database;
OPEN_MODE
----------
READ WRITE

SQL> select * from dual;
D
-
X




一切ok,这里冒出一个想法,如果 rman or dbca or netca 。。。。意外损坏,是不是也可以按上方法来替换解决呢?找机会测下

1 0