sqlplus 組件意外被破壞恢複測試,sqlplus組件測試
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 。。。。意外損壞,是不是也可以按上方法來替換解決呢?找機會測下