Showing posts with label 오라클. Show all posts
Showing posts with label 오라클. Show all posts

오라클 버전 확인하는 쿼리

5:49 PM 0 Comments

SELECT * FROM v$version WHERE banner LIKE 'Oracle%';

오라클 데이타베이스 링크 만들기

5:36 PM 0 Comments

1. database link를 만들 수 있는 오라클 계정으로 오라클에 로그인한다 (with SQL*Plus).

2. 아래와 같이 쿼리를 실행한다.

CREATE DATABASE LINK 링크이름
CONNECT TO 아이디 IDENTIFIED BY 비밀번호
USING ‘연결문자열’;

연결문자열은 tnsnames.ora 을 참조. 보통은 ORACLE_HOME/network/admin 디렉토리에 저장된다.


Database Link 삭제

DROP DATBASE LINK 링크이름;

오라클 예약어와 예약문자열

5:33 PM 0 Comments

Reserved Word Reserved Character Operator

ABOUT

(none)

ABOUT

ACCUM

,

Accumulate

AND

&

And

BT

(none)

Broader Term

BTG

(none)

Broader Term Generic

BTI

(none)

Broader Term Instance

BTP

(none)

Broader Term Partitive

FUZZY

?

fuzzy

(none)

{ }

escape characters (multiple)

(none)

\

escape character (single)

(none)

( )

grouping characters

(none)

[ ]

grouping characters

HASPATH

(none)

HASPATH

INPATH

(none)

INPATH

MINUS

-

MINUS

NEAR

;

NEAR

NOT

~

NOT

NT

(none)

Narrower Term

NTG

(none)

Narrower Term Generic

NTI

(none)

Narrower Term Instance

NTP

(none)

Narrower Term Partitive

OR

|

OR

PT

(none)

Preferred Term

RT

(none)

Related Term

(none)

$

stem

(none)

!

soundex

SQE

(none)

Stored Query Expression

SYN

(none)

Synonym

(none)

>

threshold

TR

(none)

Translation Term

TRSYN

(none)

Translation Term Synonym

TT

(none)

Top Term

(none)

*

weight

(none)

%

wildcard character (multiple)

(none)

_

wildcard character (single)

WITHIN

(none)

WITHIN

오라클에서 특수 문자열 검색방법 ESCAPE 키워드

5:04 PM 0 Comments

오라클에서 특정 문자들은 특정한 기능을 수행하도록 예약되어 있다.
예를들면 Wild 문자열
_ (underscore): 문자 하나
% (percentage): 포함하는
' (apostrophe): 문자열의 시작과 끝

이러한 특수 문자들은 오라클이 쿼리를 해석할때 글자 그대로 해석하지 않기 때문에 쿼리를 만들때 반드시 이를 고려해야 한다.

예를들면 데이타베이스 테이블 "mytable"에 다음과 같이 데이타가 들어 있는 경우
ID, NAME
-------------
100, ABC
101, ABC%1
102, ABC%2
103, ABCD1
104, ABCD2


ID 101 ABC% 를 구하기 위하여 포함된 질의 결과를 얻으려고 할 때

SELECT * FROM mytable WHERE name like 'ABC%%' 을 수행하면 ABC로 시작하는 모든 레코드가 리턴된다.

이 경우 ABC%로 시작하는 레코드를 구하기 위하여는 아래와 같이

SELECT * FROM mytable WHERE name like 'ABC!%%' ESCAPE '!' 처럼 Escape 문자열이 어떤 것인지 명시적으로 알려 줘야 한다.

다시 말하면 ESCAPE 라는 키워드를 통해서 오라클로 하여금 특정 스페셜 문자를 글자 그대로 해석하도록 지정 할 수 있다.

Ex)
SELECT t.*, a.admincode
FROM usrgrp_type t, usrgrp_admincodes a
WHERE a.usrgrpid = t.usrgrpid
AND a.admincode like 'A!%%' ESCAPE '!'
ORDER BY a.admincode, a.usrgrpid

오라클에서 컬럼이름으로 테이블 검색

9:20 AM 0 Comments

SELECT table_name, column_name
FROM all_tab_columns
WHERE column_name like '%###%'

How to stop Oracle XDB (Port 8080 and Tomcat)

3:26 PM 0 Comments

TXDB stands for XML Database. It's a bundle of Oracle features to support XML in the database and includes HTTP and FTP interfaces (port 8080 and 2100 respectively). If you are not using XDB, and you're not on the 9.2.0.4 patchset, you should disable XDB. There were some serious security vulnerabilities that were fixed in the 9.2.0.4 patchset.

# How to turn off or change XDB configuration:

To disable XDB, you can use Oracle Database Configuration Assistant.

  1. Execute Oracle Database Configuration Assistant. Start -> Programs -> Oracle - OraHome92 -> Configuration and Migration Tools -> Database Configuration Assistant.
  2. At step 1 of 4, select "Configure database options in a database". Click Next.
  3. At step 2 of 4, select the database the you want to configure options in Available Database(s) list. Click Next.
  4. At step 3 of 4, click "Standard database features..." button.
  5. In the Standard databae features dialog, click "Customize..." button.
  6. Change XDB setting in the Oracle XML DB dialog. (Enable/Disable or Ports being used).
  7. Click button OK to close the Oracle XML DB dialog.
  8. Click button OKto close the Standard database features dialog.
  9. Click button Next
  10. At setp 4 of 4, Click button Finish.

# Quick tip to check ports listening:

After you doing above step, you can check whether or not 8080 port is being used by using following command.

c:\>netstat -an

# About Oracle XML DB

It provides HTTP, FTP and WebDAV protocol servers as part of the database. These servers will be available for client access as soon as the database starts up (I think thru Listner service). XML DB protocol servers are implemented using the Oracle shared server infrastructure. Default port for FTP is 2100 and the default for HTTP and WebDAV is 8080.