473,397 Members | 2,068 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

Database error

Hello,

Can anyone try to help me debug this script? Or at least explains why the error occurs?

Error:
SP2-0734: unknown command beginning "where a..." - rest of line ignored.

SP2-0734: unknown command beginning "order by 5..." - rest of line ignored.

----------------------------------------------------------------------------------------

Script:

#!/bin/bash

output=‘sqlplus -s "/ as sysdba" <<EOF

set verify off

set echo off

set pagesize 9999

set feedback off

Spool on

set heading off

Spool <Insert filename>.csv

Select sysdate from dual



select nvl(b.tablespace_name,nvl(a.tablespace_name,'UNKNO WN')) ts_name

, kbytes_alloc kbytes

, kbytes_alloc-nvl(kbytes_free,0) used

, nvl(kbytes_free,0) free

, ((kbytes_alloc-nvl(kbytes_free,0))/kbytes_alloc)*100pct_used

, nvl(largest,0) largest

from (select sum(bytes)/1024Kbytes_free, max(bytes)/1024 largest, tablespace_name from dba_free_space group by tablespace_name) a, (select sum(bytes)/1024 Kbytes_alloc, tablespace_name from dba_data_files group by tablespace_name) b



where a.tablespace_name (+) = b.tablespace_name

order by 5,1

Spool off

exit

EOF

`
End of Script

THANK YOU!
May 14 '07 #1
2 1914
Motoma
3,237 Expert 2GB
This is a problem with your Oracle commands. As such, I have moved this to the Oracle Forum with the hopes that the community there will be much more helpful.
May 15 '07 #2
Saii
145 Expert 100+
Hello,

i think you need a ; after first select. Also there is some spacing problem for alias name used like pct_used, kbytes_alloc or maybe that is pasting typo..

hope that helps
May 15 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

16
by: John | last post by:
Hello. If I want to set up my first database and start using it in Dreamweaver what do I need to do? The book I'm working on has a CD with the database on. It is telling me to put it in the...
6
by: Clay Beatty | last post by:
When you create database diagrams in Enterprise Manager, the details for constructing those diagrams is saved into the dtproperties table. This table includes an image field which contains most of...
6
by: Marvin Libson | last post by:
Hi All: I am running DB2 UDB V7.2 with FP11. Platform is Windows 2000. I have created a java UDF and trigger. When I update my database I get the following error: SQL1224N A database...
1
by: pintur | last post by:
The message is: SQL1036C Errore di I/O durante l' accesso al database. SQLSTATE=58030 what is the proble? what for restore tables? thanks
9
by: Wayne Smith | last post by:
I've come up against a major headache that I can't seem to find a solution for but I'm sure there must be a workaround and I would really be grateful of any help. I'm currently building a web...
0
by: Jonathan Wood | last post by:
I seem to be having errors creating and accessing an SQL database. Unfortunatley, I am brand new to SQL setup and administration issues so this really is not my area of expertise. I know I had...
9
by: Jerim79 | last post by:
I am no PHP programmer. At my current job I made it known that I was no PHP programmer during the interview. Still they have given me a script to write with the understanding that it will take me a...
12
by: Steve | last post by:
I have a database that raises an error when you try to open it and it doesn't open. Trying to open the database with the OpenDatabase method raises the same error. Trying to import any objects...
2
by: Scott Jones | last post by:
Hello, In an attempt to save disk space, I went in and gzipped all of the log files for my database running DB2 version 7.2 . This resulted in the database being marked bad because a log file...
221
Atli
by: Atli | last post by:
You may be wondering why you would want to put your files “into” the database, rather than just onto the file-system. Well, most of the time, you wouldn’t. In situations where your PHP application...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.