今天测试oracle stream 创建database link 出现如下错误:
[@more@]
SQL> create database link test.com.cn connect to scott identified by oracle using 'test';
Database link created.
SQL> select * from emp@test.com.cn;
select * from emp@test.com.cn
*
ERROR at line 1:
ORA-01017: invalid username/password; logon denied
ORA-02063: preceding line from TEST
Database link created.
SQL> select * from emp@test.com.cn;
select * from emp@test.com.cn
*
ERROR at line 1:
ORA-01017: invalid username/password; logon denied
ORA-02063: preceding line from TEST
在网上baidu之后发现密码需要加上双引号。奇怪,为什么要加上呢????
SQL> drop database link test.com.cn;
Database link dropped.
Database link dropped.
SQL> create database link test.com.cn connect to scott identified by "oracle" using 'test';
Database link created.
Database link created.
SQL> select * from emp@test.com.cn
2 ;
EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
---------- ---------- --------- ---------- --------- ---------- ---------- ----------
7369 SMITH CLERK 7902 17-DEC-80 800 20
7499 ALLEN SALESMAN 7698 20-FEB-81 1600 300 30
7521 WARD SALESMAN 7698 22-FEB-81 1250 500 30
2 ;
EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
---------- ---------- --------- ---------- --------- ---------- ---------- ----------
7369 SMITH CLERK 7902 17-DEC-80 800 20
7499 ALLEN SALESMAN 7698 20-FEB-81 1600 300 30
7521 WARD SALESMAN 7698 22-FEB-81 1250 500 30
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/24237320/viewspace-1060052/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/24237320/viewspace-1060052/