LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 01-28-2013, 08:14 PM   #1
redhatwannabe
Member
 
Registered: Dec 2008
Posts: 83

Rep: Reputation: 15
why cannot query registry$database?


Hi all,

here's my ksh 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
 
Old 01-29-2013, 02:18 PM   #2
millgates
Member
 
Registered: Feb 2009
Location: 192.168.x.x
Distribution: Slackware
Posts: 852

Rep: Reputation: 389Reputation: 389Reputation: 389Reputation: 389
What's $database? I don't see such variable being set in the script.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Sqlite Database Query Software jogl_z_8 Debian 2 10-31-2012 08:05 PM
Query a postgres database with Java cov Linux - Server 1 12-12-2009 09:29 AM
mod_auth_mysql query to multiple database loewen Linux - Newbie 2 11-21-2006 10:04 AM
Database query? GrayLOK Linux - General 1 08-10-2002 01:15 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 05:41 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration