Tag Archives: Pre Upgrade Steps

Why execution is different from orginal bash registry$database?

By jediwannabe

Hi all,

here’s my script

Code:


#!/bin/ksh
if [ -z "$DB_CREATE_PATH" ]
then
export DB_CREATE_PATH=`pwd`
fi

echo
echo "********************--Menu--*****************************"
echo "*** "
echo "*** 1. Pre-Upgrade Steps "
echo "*** 7. Exit "

read a

if [ $a == 1 ]
then

echo "1 Pre-Upgrade Steps"
${ORACLE_HOME}/bin/sqlplus /nolog <<!EOF
set termout on
set echo on
set time on

connect / as SYSDBA;

column timecol new_value timestamp
column spool_extension new_value suffix
SELECT to_char(sysdate,'dd_Mon_yyyy_hhmi') timecol,'.log' spool_extension FROM
sys.dual;
column output new_value dbname
SELECT value || '_' output FROM v$parameter WHERE name = 'db_name';

--step 6 step 7 start
spool logs/tz_version_nls_char_&&dbname&&timestamp&&suffix
select TZ_VERSION from registry$database;
select value from NLS_DATABASE_PARAMETERS where parameter = 'NLS_NCHAR_CHARACTERSET';
spool off
--step 6 step 7 end

exit;
!EOF
fi


when I examine the output code it is as follow

Code:

09:30:41 SQL> select TZ_VERSION from registry;
select TZ_VERSION from registry
*
ERROR at line 1:
ORA-00942: table or view does not exist

09:30:41 SQL> select value from NLS_DATABASE_PARAMETERS where parameter = 'NLS_NCHAR_CHARACTERSET';

VALUE
-----------------------------------------------------------------------------------------------------------------------------
-------------------------
AL16UTF16

1 row selected.

09:30:41 SQL> spool off


can someone tell me how do I make sure that registry$database is queried instead of registry?

thanks

Source: FULL ARTICLE at The UNIX and Linux Forums