sys密碼修改導致的RMAN-00571錯誤

kuqlan發表於2011-08-16

今天發現儲存增長情況不太正常,查一下rman備份日誌發現報錯如下:

RMAN>
sql statement: ALTER SESSION SET NLS_DATE_FORMAT="YYYY-MM-DD HH24:MI:SS"

RMAN>
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-00558: error encountered while parsing input commands
RMAN-01009: syntax error: found "identifier": expecting one of: "allocate, alter, backup, beginline, blockrecover, catalog, change, connect, copy, convert, create, cros
scheck, configure, duplicate, debug, delete, drop, exit, endinline, flashback, host, {, library, list, mount, open, print, quit, recover, register, release, replace, re
port, renormalize, reset, restore, resync, rman, run, rpctest, set, setlimit, sql, switch, spool, startup, shutdown, send, show, test, transport, upgrade, unregister, v
alidate"
RMAN-01008: the bad identifier was: ERROR
RMAN-01007: at line 1 column 1 file: standard input

[@more@]

最近也沒有更新過備份指令碼,但是在兩天前更新sys使用者的密碼,系統有Data guard災備庫;

原則上沒人改過,但是因OS的oracle、root使用者密碼等都是當時設定的密碼(部分人知道),後來沒有改過,因此也不敢保證沒有人改過。從last命令結果來看,故障報錯那天沒有人登入過。

$last |more

oracle pts/5 128.129.2.1 Tue Aug 16 11:42 still logged inoracle pts/4 128.129.2.2 Tue Aug 16 11:41 still logged in.....

仔細觀察備份相關指令碼後發現就是密碼改動導致的,具體如下:

$more delarch.sh

#!/bin/bash

. /export/home/oracle/.bash_profile

SH_HOME=/export/home/oracle/rman

cd $SH_HOME

echo "rman target / log log/rmandelarch_`date +"%Y%m%d"`.log append << !">rman_delete_arch.sh

echo "crosscheck archivelog all;">>rman_delete_arch.sh

echo "SQL 'ALTER SESSION SET NLS_DATE_FORMAT="YYYY-MM-DD HH24:MI:SS"';">>rman_delete_arch.sh

sqlplus -s "">>rman_delete_arch.sh << !

SET head off

SET feedback off

SELECT 'delete noprompt archivelog until time '''||to_char(MAX(FIRST_TIME),'YYYY-MM-DD HH24:MI:SS')||''';' FROM v$archived_log WHERE applied='YES';

exit

!

echo "exit;">>rman_delete_arch.sh

echo "!">>rman_delete_arch.sh

sh rman_delete_arch.sh

以上指令碼是為了避免還沒有應用到備庫的歸檔日誌還沒有被傳輸到備庫伺服器而被刪除,而從主庫伺服器中遠端登入到備庫,取出應用完歸檔的最大時間,根據該時間來刪除主庫上的歸檔日誌的。改完相應的密碼後故障已被排除。

總結:資料庫sys、system使用者密碼改動一般可能在備份、sqlloader指令碼或dblink等用到環境中正好被用到的。因此在修改之前有必要仔細核查。

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/18841027/viewspace-1053923/,如需轉載,請註明出處,否則將追究法律責任。

相關文章