drop synonym aaa;
select * from tabname@dcmdb where 1=1; 方法二:
首先创建数据库链接:
CREATE PUBLIC DATABASE LINK 数据链名称 CONNECT TO 登陆用户名 IDENTIFIED BY 密码 USING '(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 对方Oracle服务器的IP地址)(PORT = 端口号))
)
(CONNECT_DATA =
(SERVICE_NAME = 对方Oracle服务器服务名)
)
)'
其中 数据链名称 为添加到本地Oracle数据库控制台(Oracle Enterprise Manager Console)树节点的服务名
要查询对方数据库的表TableName语句如下:
SELECT 字段名 FROM TableName@数据链名称;
复制表数据:
insert into 表名(字段名) (SELECT 字段名 FROM TableName@数据链名称);
查看DBLINK:
select owner, db_link from dba_db_links;
删除:
drop database link dblink名称
drop public database link dblink名称
Oracle密码的问题:
SQL> CREATE USER AAA IDENTIFIED BY 1;
CREATE USER AAA IDENTIFIED BY 1
*
ERROR 位于第 1 行:
ORA-00988: 缺少或无效口令
SQL> CREATE USER AAA IDENTIFIED BY"1";
用户已创建