#########################################################################################################################
디비링크 생성
#########################################################################################################################
create {public} database link {dblink_name}
connect to {userid}
identified by {password}
using '{connectstring}';
위의 connectstring은 tnsnames.ora 에 등록된 걸 사용할 수도 있고
아래처럼 직접 Connect String을 적을 수도 있다.
CREATE DATABASE LINK 디비링크명
CONNECT TO 계정명
IDENTIFIED BY 계정비밀번호
USING '(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=호스트주소)(PORT = 1521)))(CONNECT_DATA=(SERVICE_NAME=서비스아이디)))';
#########################################################################################################################
디비링크 조회
#########################################################################################################################
select * from user_db_links;
select * from dba_db_links;
#########################################################################################################################
디비링크 암호 확인
#########################################################################################################################
select name,passwordx from sys.link$;
#########################################################################################################################
다른 유저를 소유자로 디비링크 생성
#########################################################################################################################
dblink는 owner.object 형식으로 만들 수가 없다.
domain 명으로 인식해버리기 때문이다.
따라서 다른 방법을 사용해야 한다.
아래처럼 프로시저를 생성해서 사용한다.
CREATE PROCEDURE otheruser.cre_db_lnk AS
BEGIN
EXECUTE IMMEDIATE 'CREATE DATABASE LINK newlink '
||'CONNECT TO remoteuser IDENTIFIED BY pw '
||'USING ''remotetns''';
END cre_db_lnk;
/
'Knowledge > Oracle' 카테고리의 다른 글
Datapump export in ASM (0) | 2014.03.20 |
---|---|
About View (0) | 2014.03.07 |
About Sequence (0) | 2014.03.07 |
User 생성시 quota 관련 주의점 (0) | 2014.01.09 |
통계정보 수집 전략에 대한 가이드라인 (0) | 2013.12.11 |