๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ
ORACLE/SQL

[Oracle] ORA-00955 name is already used by an existing object ํ•ด๊ฒฐ :: ๋งˆ์ด์ž๋ชฝ

by ๐ŸŒปโ™š 2020. 3. 24.

ORA-00955

ORA-00955 : ๊ธฐ์กด์˜ ๊ฐ์ฒด๊ฐ€ ์ด๋ฆ„์„ ์‚ฌ์šฉํ•˜๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค. "name is already used by an existing object"

 

ํ…Œ์ด๋ธ”, ๋ทฐ, ์‹œํ€€์Šค ๋“ฑ ์˜ค๋ผํด ๊ฐ์ฒด๋ฅผ ์ƒ์„ฑํ•˜๋ ค๊ณ ํ•˜๋Š”๋ฐ ์œ„์™€ ๊ฐ™์€ ์—๋Ÿฌ๊ฐ€ ๋ฐœ์ƒํ•ฉ๋‹ˆ๋‹ค.

์ฃผ๋กœ ํ…Œ์ด๋ธ”์„ ์ƒ์„ฑํ•˜๋ ค๋Š”๋ฐ ์ด๋Ÿฐ ์—๋Ÿฌ๊ฐ€ ๋ฐœ์ƒํ•ด์„œ ํ…Œ์ด๋ธ”์„ DROP์‹œํ‚ค๋ ค๊ณ  ํ•˜๋Š”๋ฐ ํ…Œ์ด๋ธ”์€ ์กด์žฌํ•˜์ง€ ์•Š๋Š”๋‹ค๊ณ  ํ•˜๊ณ ... ๋‹ค์‹œ ๊ฐ™์€ ์ด๋ฆ„์œผ๋กœ ํ…Œ์ด๋ธ”์„ ์ƒ์„ฑํ•˜๋ ค๋Š”๋ฐ ์ด๋ฏธ ์‚ฌ์šฉํ•˜๊ณ  ์žˆ๋Š” ์ด๋ฆ„์ด๋ผ๊ณ ํ•˜๊ณ ... ๋„๋ฐ์ฒด ๋ญ๊ฐ€ ๋ฌธ์ œ์ธ์ง€....

 

์˜ค๋ผํด์—์„œ๋Š” ๊ฐ์ฒด์˜ ํƒ€์ž…์ด ๋‹ค๋ฅด๋”๋ผ๋„ ๊ฐ™์€ ๋ช…์นญ์œผ๋กœ ์ƒ์„ฑํ•  ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค. ๊ทธ๋ž˜์„œ ์œ„์™€ ๊ฐ™์€ ์ƒํ™ฉ์ด ๋ฒŒ์–ด์กŒ์„ ๋•Œ๋Š” ๋‹ค๋ฅธ ๊ฐ์ฒด ํƒ€์ž…์œผ๋กœ ํ•ด๋‹น ๋ช…์นญ์ด ์ƒ์„ฑ๋˜์–ด ์žˆ์„ ๊ฒ๋‹ˆ๋‹ค. ๋ฌธ์ œ๋ฅผ ํ•ด๊ฒฐํ•˜๊ธฐ ์œ„ํ•ด Data Dictionary์˜ ํ•ด๋‹น ์œ ์ €๊ฐ€ ์–ด๋–ค Object๋ฅผ ๋“ค๊ณ  ์žˆ๋Š”์ง€ ํ™•์ธํ•ด๋ณด๊ณ  ์‚ญ์ œํ•ด์ฃผ๋ฉด ๋ฉ๋‹ˆ๋‹ค.

 

 

ํ•ด๊ฒฐ

1
2
3
4
5
6
SELECT
    OBJECT_NAME
    ,OBJECT_TYPE
FROM
    USER_OBJECTS
WHERE OBJECT_NAME LIKE '%ํ…Œ์ด๋ธ”๋ช…%';

LIKE๋ฌธ์„ ์‚ฌ์šฉํ•ด์„œ ํ…Œ์ด๋ธ”๋ช…์„ ๊ฒ€์ƒ‰ํ•ด์„œ ํ•ด๋‹น ๊ฐ์ฒด๊ฐ€ ์–ด๋–ค ํƒ€์ž…์ธ์ง€ ํ™•์ธํ•ด์ค๋‹ˆ๋‹ค. EMP20์ด๋ผ๋Š” ๋ช…์นญ์œผ๋กœ ํ…Œ์ด๋ธ”์„ ์ƒ์„ฑํ•ด์ฃผ๋ ค๊ณ  ํ–ˆ๋Š”๋ฐ ์ด๋ฏธ ์žˆ๋Š” ์ด๋ฆ„์ด๋ผ๊ณ ํ•ด์„œ OBJECTS๋ฅผ ์ฐพ์•„๋ณด๋‹ˆ VIEW๋กœ ๋งŒ๋“ค์–ด์ ธ ์žˆ๋Š”๊ฒƒ์„ ํ™•์ธํ–ˆ์Šต๋‹ˆ๋‹ค. ํ•ด๋‹น  OBJECT๋กœ DROP ์ž‘์—…์„ ํ•ด์ฃผ๊ณ  ๋‹ค์‹œ ์ƒ์„ฑํ•˜๋ฉด ๋ฌธ์ œ์—†์ด ์ƒ์„ฑ์ด ๊ฐ€๋Šฅํ•  ๊ฒƒ์ž…๋‹ˆ๋‹ค.

 

๋Œ“๊ธ€