oracle 主机字符

用“select name from v$database;”的name就是主机字符串;
用“select * from global_name;”查看全局域名。


1、如果是用本机的SQL*Plus连接本机的数据库,则“主机字符串”可以为空。
2、如果 安装后没有改动默认的是你写的oracle实例名,如果你也没有改默认就是orcl,最后加上 as sysdba(如:orcl as sysdba)
3、文件位置:D:\oracle\product\10.2.0\db_1\network\ADMIN\tnsnames.ora

orcl =
 
 (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = computername)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = orcl)
    )
  )
 
SERVER_orcl =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.180)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME =orcl)
    )
  )
4、 用“select name from v$database;”的name就是主机字符串;
    用“select * from global_name;”查看全局域名。

你可能感兴趣的:(SQL)