Oracle 更改服务名方法

转载:Oracle 更改服务名方法

  1. 运行db的sqlplus:sqlplus sys/sys as sysdba (sys/sys为“用户名”/“密码”)
    或配置client的监听后运行Client的sqlplus

  2. 查看当前服务名:SQL> show parameter service_name

  3. 修改服务名:SQL> alter system set service_names='orcl' scope=both;

  4. 修改listener.ora(加粗部分):
    SID_LIST_LISTENER =
    (SID_LIST =
    (SID_DESC =
    (GLOBAL_DBNAME = ORCL)
    (ORACLE_HOME = D:\Oracle11g)
    (SID_NAME = ORCL)
    )

    (SID_DESC =
    (SID_NAME = PLSExtProc)
    (ORACLE_HOME = D:\Oracle11g)
    (PROGRAM = extproc)
    )
    )
    LISTENER =
    (DESCRIPTION_LIST =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
    (ADDRESS = (PROTOCOL = TCP)(HOST = onest)(PORT = 1521))
    )
    )

推荐阅读更多精彩内容