database.sarang.net
UserID
Passwd
Database
DBMS
MySQL
PostgreSQL
Firebird
ㆍOracle
Informix
Sybase
MS-SQL
DB2
Cache
CUBRID
LDAP
ALTIBASE
Tibero
DB 문서들
스터디
Community
공지사항
자유게시판
구인|구직
DSN 갤러리
도움주신분들
Admin
운영게시판
최근게시물
Oracle Q&A 41826 게시물 읽기
No. 41826
이상하네요. toad에서는 오류가 전혀없는데..리눅스터미널에선 에러작살이네요.
작성자
김건우(kwkim9734)
작성일
2020-11-13 18:56
조회수
1,483

실행한 쿼리는 다음과 같아요.

set linesize 165

set pagesize 200

set newpage 0

set verify off



clear column

column tablespace_name      format a22        heading "tablespace name"

column "All"                format 999,999.99 heading "Total(GB)"

column "used"               format 999,999.99 heading  "used(GB)"

column "percent"            format 999.99     heading  "per(%)"

column "free"               format 999.99     heading  "free(GB)"


prompt TABLESPACE USAGE


select ddf.tablespace_name,

        ddf.bytes/1024/1024/1024 "ALL",

        (ddf.bytes - dfs.bytes)/1024/1024/1024 "USED",

         dfs.bytes/1024/1024/1024 "free",

         round(((ddf.bytes - dfs.bytes) / ddf.bytes) * 100, 2) "percent"

from (select tablespace_name,

        sum(bytes) bytes

from dba_data_files

group by tablespace_name) ddf,


(select /*+ use_hash */

        f.tablespace_name,

        sum(decode(sign(nvl(s.bebytes,0)- f.bytes), -1, f.bytes, 0)) bytes,

        max(decode(sign(nvl(s.bebytes,0)- f.bytes), -1, f.bytes, 0)) bfbytes,

        max(nvl(s.bebytes,0)) bebytes

from (select tablespace_name,

          bytes

       from dba_free_space) f,

       (select tablespace_name,

             max(decode(next_extent, null, initial_extent, next_extent)) bebytes

from dba_segments


group by tablespace_name) s

where f.tablespace_name=s.tablespace_name(+)

group by f.tablespace_name) dfs


where ddf.tablespace_name = dfs.tablespace_name(+)

order by ((ddf.bytes - dfs.bytes)/ddf.bytes) desc

/


accept tbs_name prompt 'input tbs_name:' DEFAULT '% '


prompt   datafile info


select tablespace_name, file_name, bytes/1024/1024/1024 GB, autoextensible

from dba_data_files

where tablespace_name like '&tbs_name'

order by file_name

/

set verify on



















그런데....



(1) 리눅스에서 실행할 때..발생하는 오류상태

SQL> @tbss

TABLESPACE USAGE

SP2-0734: unknown command beginning "group by t..." - rest of line ignored.

SP2-0734: unknown command beginning "where f.ta..." - rest of line ignored.

SP2-0734: unknown command beginning "group by f..." - rest of line ignored.

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

SP2-0044: For a list of known commands enter HELP

and to leave enter EXIT.

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

from dba_segments

                *

ERROR at line 11:

ORA-00907: missing right parenthesis



input tbs_name:



(2)토-드에서 실행할때...


https://i.postimg.cc/nh01QqB3/1.png  <---- toad 실행시 tbs입력하라는 창에서 % 부분없애고 대문자로 테이블스페이스이름입력

https://i.postimg.cc/mrky3hSB/2.png



 

이 글에 대한 댓글이 총 1건 있습니다.

sqlplus에서 쿼리를 실행할떄 빈줄이 있으면 말씀하신 오류가 납니다. 빈줄을 모두 제거하고 실행하면 잘 되네요.

정상규(pajama)님이 2020-11-13 21:11에 작성한 댓글입니다.
[Top]
No.
제목
작성자
작성일
조회
41829쿼리질문 [4]
lee
2020-11-24
1613
41828쿼리문 에러 [3]
신승익
2020-11-23
2258
41827타입변환(to_number) 관련 문의 드립니다. [2]
이상영
2020-11-18
1491
41826이상하네요. toad에서는 오류가 전혀없는데..리눅스터미널에선 에러작살이네요. [1]
김건우
2020-11-13
1483
41825문자열 수식 계산하는 쿼리 [3]
group
2020-11-12
1670
41824테이블스페이스 조회하는쿼리인데...사용율까지 나오게 하려는데...계산을 잘못한건가요? 도움주세요 [2]
김건우
2020-11-11
1442
41823아래 질문이어서...show parameter local_listener에서 value값 안나옴
김건우
2020-11-10
1364
Valid XHTML 1.0!
All about the DATABASE... Copyleft 1999-2023 DSN, All rights reserved.
작업시간: 0.050초, 이곳 서비스는
	PostgreSQL v16.1로 자료를 관리합니다