일(job)/DBMS
[ORACLE] 오라클 ORA-01471 시노님(synonym) Alias Create, Drop
뽀&쏭
2016. 1. 18. 17:12
--FN_GET_RSV_YN 함수의 Synonym을 생성해보자...
CREATE SYNONYM FN_GET_RSV_YN FOR BNK.FN_GET_RSV_YN;
테이블 Synonym을 생성한것과 같은 방법으로 Function로 생성하려하니 에러 발생
ORA-01471: cannot create a synonym with same name as object
모든 사용자에게 synonym을 부여하면 해결되지만 "모든"이라는 단어가 거슬린다...
CREATE PUBLIC SYNONYM FN_GET_RSV_YN FOR BNK.FN_GET_RSV_YN;
원인을 찾아보니...명시적으로 사용자를 지정해야 하더이다...아래와 같이...
CREATE PUBLIC SYNONYM TEMP.FN_GET_RSV_YN FOR BNK.FN_GET_RSV_YN;
출처 : http://ora-01471.ora-code.com/
ORA-01471: cannot create a synonym with same name as object
Cause: An attempt was made to create a private synonym with the same name as the object to which it refers. This error typically occurs when auser attempts to create a private synonym with the same name as one of their objects.
Action: Choose a different synonym name or create the synonym under a different username....