很蛋疼的ORA-00911:无效的字符错误



今天在建一个DBlink 时出现 ORA-00911:无效的字符错误,
语法是
 
create public database link  tmsdb
  connect to user1 identified by  user1
useing '(DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.110)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = orcl)
    )
  )';
结果提示ORA-00911:无效的字符错误,用toad ,PL/SQL Developer试了还是这样
以前用条语很多遍了没有问题,今天真是神了。没办法把密码用引号引起来如下:

create public database link  test_dblink
  connect to user1 identified by  "user1"
useing '(DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.110)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = orcl)
    )
  )';

在次执行行,居然OK,本以为这样可以用了,用语句测试:
select * from dual@test_dblink;
报错无效的用户名或密码,可是这个用户和密码我用toad 或是PL/SQL Developer连接都没有问题,看来这个密码还是
有问题。

看来用户端的工具字符集还是有问题,于是直接连接到服务端,用sqlplus连接运行以下脚本

create public database link  tmsdb
  connect to user1 identified by  user1
useing '(DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.110)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = orcl)
    )
  )';

连接测试ok;


你可能感兴趣的:(无效,ORA-00911,字符错误)