HA

oracle安装后连接问题

1. ORA-12505: TNS:listener does not currently know of SID given in connect descriptor

  1. add to tnsnames.ora file, and run lsnrctl reload
ORCL = 
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
    (CONNECT_DATA =
      (SERVICE = DEDICATED)
      (SERVICE_NAME = orcl)
    )
  )
  1. excute alter system set local_listener = '(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521))' scope = both; in sqlplus.(username sys, password, orcl as sysdba)

2. 状态: 失败 -测试失败: IO 错误: The Network Adapter could not establish the connection

admin模式打开cmd,运行 lsnrctl start

reference