Oracle private Dblink and pubic dblink

Source: Internet
Author: User
Tags dba

db:11.2.0.3.0


Oracle DBLINK is created into private and public DBLINK, which is created by default as private; Private Dblink only the created schema can be deleted, SYS can not be deleted, public dblink any schema can be deleted, as long as the permissions are sufficient.

First, PRIVATE DBLINK:
Recover DBA Authority:
Sql> revoke DBA from Yoon;

Revoke succeeded.


Attempt to connect, unable to connect:
Sql> Conn Yoon/yoon
ERROR:
Ora-01045:user YOON lacks CREATE SESSION privilege; Logon denied


Warning:you is no longer connected to ORACLE.


Connect SYS
Sql> Conn/as SYSDBA
Connected.


Authorized
Sql> Grant Connect to Yoon;

Grant succeeded.


Sql> Grant CREATE DATABASE link to Yoon;

Grant succeeded.


Sql> Conn Yoon/yoon
Connected.


Current User:
Sql> Show User
USER is "YOON"


Create Dblink:
Sql> CREATE DATABASE link Dblink_yoon connect to Yoon identified by Yoon using ' Yoon ';

Database Link created.


Connect the SYS User:
Sql> Conn/as SYSDBA
Connected.


Delete Dblink:
Sql> drop database link dblink_yoon;
Drop DATABASE Link Dblink_yoon
*
ERROR at line 1:
Ora-02024:database Link not found


Sql> Show User
USER is "SYS"
Sql> drop database link dblink_yoon;
Drop DATABASE Link Dblink_yoon
*
ERROR at line 1:
Ora-02024:database Link not found


View Dblink
Sql> select * from Dba_db_links;

OWNER db_link USERNAME HOST CREATED
---------- ------------- ---------- ---------- ---------
YOON Dblink_yoon YOON YOON 14-nov-14


Connect Create Dblink User:
Sql> Conn Yoon/yoon
Connected.

Sql> drop database link dblink_yoon;

Database Link dropped.

Second, public DBLINK:

Sql> Conn/as SYSDBA
Connected.
Sql> Grant DBA to Yoon;

Grant succeeded.

Sql> Conn Yoon/yoon
Connected.
Sql> Show User
USER is "YOON"
sql> Create public database link Dblink_yoon connect to Yoon identified by Yoon using ' Yoon ';

Database Link created.


Sql> Conn/as SYSDBA
Connected.

Sql> Grant DBA to Yoon;

Grant succeeded.


Sql> Conn Yoon/yoon
Connected.

Sql> Show User
USER is "YOON"

sql> Create public database link Dblink_yoon connect to Yoon identified by Yoon using ' Yoon ';

Database Link created.


Sql> Conn/as SYSDBA
Connected.

Sql> select * from Dba_db_links;

OWNER db_link USERNAME HOST CREATED
---------- ------------- ---------- ---------- ---------
Public Dblink_yoon YOON YOON 14-nov-14

sql> Drop public database link dblink_yoon;

Database Link dropped.

Oracle private Dblink and pubic dblink

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.