SP2-0642: SQL*Plus internal error state 2021, context 1:1821:0
Unsafe to proceed
ERROR:
ORA--0001: Message -1 not found; product=RDBMS; facility=ORA
Today while working on one of the Shell script , I got the above the error, and its weird and I have experienced first time So not sure what's going on.
ssdqt.wt:oraqt 99> sh nil.sh QT
QWT
31-MAY-2021 15:59:06
QWT
SP2-0642: SQL*Plus internal error state 2021, context 1:1821:0
Unsafe to proceed
ERROR:
ORA--0001: Message -1 not found; product=RDBMS; facility=ORA
SP2-0152: ORACLE may not be functioning properly
ssdqt.wt:oraqt 99>
Till now this script was running fine , but today its giving me error . But after looking at Script Minutely .
Snippets from main script , which giving me above error.
ssdqt.wt:oraqt 99> cat nil.sh
chk_dbconn()
{
sqlplus -s / <<EOF
set pages 0
set lines 132
set term off
set recsep off
set feedback off
select name from v\$database;
EOF
}
###############################################################################
# chk_conn
###############################################################################
chk_conn()
{
sqlplus -s / <<-EOF
set pages 0
set lines 132
set term off
set recsep off
set feedback off
select name from v\$database;
EOF
}
###############################################################################
# sel_date
###############################################################################
sel_date1()
{
sqlplus -s / <<-EOF
set pages 0
set lines 132
set term off
set recsep off
set feedback off
select to_char(sysdate, 'DD-MON-YYYY HH24:MI:SS') from dual;
EOF
}
ORACLE_SID=$1
LEVEL=L0
if [ -z "$ORACLE_SID" ]
then
echo "ORACLE_SID is null"
exit
fi
. /home/oraqt/.rman_env
CONT=$(chk_dbconn)
echo $CONT
sel_date1
SID=`echo $ORACLE_SID | tr '[:upper:]' '[:lower:]'`
if [ $LOGNAME != "ora${SID}" ]
then
echo "Unix id must be ora${SID}"
exit
fi
DT=`date "+%m_%d_%y_%H_%M"`
export NLS_DATE_FORMAT='DD-MON-YYYY H24:MI:SS'==> Not proper
DIR=/tmp
if [ "$ORACLE_SID" != "$CONT" ]
then
echo "Source database is down [$CONN] "
exit
fi
echo $CONT
cat $DIR/RMAN_DATE
ssdqt.wt:oraqt 99>
After correcting Value My Script able to run Properly.
export NLS_DATE_FORMAT='DD-MON-YYYY HH24:MI:SS'
************************************************************
EOD
************************************************************
Small Test:- I did small Test case on Database.
[oraprd@prd2 STANDBY]$ echo $NLS_DATE_FORMAT
[oraprd@prd2 STANDBY]$ export NLS_DATE_FORMAT=MM-mon-YYYY
[oraprd@prd2 STANDBY]$ sqlplus /nolog
SP2-0642: SQL*Plus internal error state 2021, context 1:1816:0
Unsafe to proceed
ERROR:
ORA--0001: Message -1 not found; product=RDBMS; facility=ORA
SP2-0152: ORACLE may not be functioning properly
[oraprd@prd2 STANDBY]$
[oraprd@prd2 STANDBY]$ sqlplus / as sysdba
SP2-0642: SQL*Plus internal error state 2021, context 1:1816:0
Unsafe to proceed
ERROR:
ORA--0001: Message -1 not found; product=RDBMS; facility=ORA
SP2-0152: ORACLE may not be functioning properly
[oraprd@prd2 STANDBY]$ export NLS_DATE_FORMAT=DD-MON-YYYY
[oraprd@prd2 STANDBY]$ sqlplus / as sysdba
SQL*Plus: Release 19.0.0.0.0 - Production on Mon May 31 14:50:03 2021
Version 19.8.0.0.0
Copyright (c) 1982, 2020, Oracle. All rights reserved.
Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.8.0.0.0
SQL>
I can login to the Database..
No comments:
Post a Comment