oracle 注册账户共享,oracle 共享服务连接静态注册服务

oracle 共享服务连接静态注册服务

默认oracle的共享服务是注册到动态注册服务里面的[email protected]> select * from v$version where rownum=1;

BANNER

----------------------------------------------------------------------------------------------------------------------------------------------------------------

Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production

[[email protected] admin]$ cat listener.ora

# listener.ora Network Configuration File: /home/u01/app/oracle/product/11.2.0/db_1/network/admin/listener.ora

# Generated by Oracle configuration tools.

SID_LIST_LISTENER =

(SID_LIST =

(SID_DESC =

(GLOBAL_DBNAME =prod3.oracle.com)  --这是静态注册服务

(ORACLE_HOME = /home/u01/app/oracle/product/11.2.0/db_1)

(SID_NAME =PROD3)

)

(SID_DESC =

(GLOBAL_DBNAME = PLSExtProc)

(ORACLE_HOME = /home/u01/app/oracle/product/11.2.0/db_1)

(SID_NAME = PLSExtProc)

)

)

LISTENER =

(DESCRIPTION =

(ADDRESS = (PROTOCOL = TCP)(HOST = server1)(PORT = 1521))

)

设置共享服务器:

alter system set DISPATCHERS = ‘(PROTOCOL=TCP)(DISPATCHERS=3)‘;

alter system set shared_server_sessions=200 scope=both;

alter system set max_dispatchers=10 scope=both;

alter system set shared_servers=10 scope=both;

alter system set max_shared_servers=30 scope=both;

[[email protected] admin]$ lsnrctl services

LSNRCTL for Linux: Version 11.2.0.3.0 - Production on 20-APR-2015 15:46:17

Copyright (c) 1991, 2011, Oracle.  All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=server1)(PORT=1521)))

Services Summary...

Service "PLSExtProc" has 1 instance(s).

Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...

Handler(s):

"DEDICATED" established:0 refused:0

LOCAL SERVER

Service "PROD3" has 1 instance(s).

Instance "PROD3", status READY, has 4 handler(s) for this service...

Handler(s):

"DEDICATED" established:0 refused:0 state:ready

LOCAL SERVER

"D001" established:0 refused:0 current:0 max:1022 state:ready

DISPATCHER

(ADDRESS=(PROTOCOL=tcp)(HOST=server1)(PORT=57907))

"D000" established:0 refused:0 current:0 max:1022 state:ready

DISPATCHER

(ADDRESS=(PROTOCOL=tcp)(HOST=server1)(PORT=64757))

"D002" established:0 refused:0 current:0 max:1022 state:ready

DISPATCHER

(ADDRESS=(PROTOCOL=tcp)(HOST=server1)(PORT=31428))

Service "prod3.oracle.com" has 1 instance(s).

Instance "PROD3", status UNKNOWN, has 1 handler(s) for this service...

Handler(s):

"DEDICATED" established:0 refused:0

LOCAL SERVER

The command completed successfully

--静态注册服务prod3.oracle.com里面没有dispatcher,动态注册prod3里面有

cat tnsnames.ora

PROD3_S =

(DESCRIPTION =

(ADDRESS_LIST =

(ADDRESS = (PROTOCOL = TCP)(HOST = server1)(PORT = 1521))

)

(CONNECT_DATA =

(server=shared)

(SERVICE_NAME =prod3.oracle.com)

)

)

PROD3 =

(DESCRIPTION =

(ADDRESS_LIST =

(ADDRESS = (PROTOCOL = TCP)(HOST = server1)(PORT = 1521))

)

(CONNECT_DATA =

(server=dedicated)

(SERVICE_NAME =prod3.oracle.com)

)

)

因为服务prod3.oracle.com 里面没有dispatcher,所以当你作为共享服务连接的时候会报错ORA-12523

SQL*Plus: Release 11.2.0.3.0 Production on Mon Apr 20 15:48:49 2015

Copyright (c) 1982, 2011, Oracle.  All rights reserved.

ERROR:

ORA-12523: TNS:listener could not find instance appropriate for the client

connection

将共享服务注册到静态监听里面

修改参数

alter system set dispatchers=‘(PROTOCOL=TCP)(DISPATCHERS=3)(SERVICE=PROD3,PROD3.ORACLE.COM)‘;

指定service参数

[[email protected] admin]$ lsnrctl services

LSNRCTL for Linux: Version 11.2.0.3.0 - Production on 20-APR-2015 15:49:42

Copyright (c) 1991, 2011, Oracle.  All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=server1)(PORT=1521)))

Services Summary...

Service "PLSExtProc" has 1 instance(s).

Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...

Handler(s):

"DEDICATED" established:0 refused:0

LOCAL SERVER

Service "PROD3" has 1 instance(s).

Instance "PROD3", status READY, has 4 handler(s) for this service...

Handler(s):

"DEDICATED" established:0 refused:0 state:ready

LOCAL SERVER

"D002" established:0 refused:0 current:0 max:1022 state:ready

DISPATCHER

(ADDRESS=(PROTOCOL=tcp)(HOST=server1)(PORT=31428))

"D001" established:0 refused:0 current:0 max:1022 state:ready

DISPATCHER

(ADDRESS=(PROTOCOL=tcp)(HOST=server1)(PORT=57907))

"D000" established:0 refused:0 current:0 max:1022 state:ready

DISPATCHER

(ADDRESS=(PROTOCOL=tcp)(HOST=server1)(PORT=64757))

Service "prod3.oracle.com" has 2 instance(s).

Instance "PROD3", status UNKNOWN, has 1 handler(s) for this service...

Handler(s):

"DEDICATED" established:0 refused:0

LOCAL SERVER

Instance "PROD3", status READY, has 3 handler(s) for this service...

Handler(s):

"D002" established:0 refused:0 current:0 max:1022 state:ready

DISPATCHER

(ADDRESS=(PROTOCOL=tcp)(HOST=server1)(PORT=31428))

"D001" established:0 refused:0 current:0 max:1022 state:ready

DISPATCHER

(ADDRESS=(PROTOCOL=tcp)(HOST=server1)(PORT=57907))

"D000" established:0 refused:0 current:0 max:1022 state:ready

DISPATCHER

(ADDRESS=(PROTOCOL=tcp)(HOST=server1)(PORT=64757))

The command completed successfully

现在以共享服务器访问:

[[email protected] admin]$ sqlplus[email protected]_sas sysdba

SQL*Plus: Release 11.2.0.3.0 Production on Mon Apr 20 15:50:09 2015

Copyright (c) 1982, 2011, Oracle.  All rights reserved.

Connected to:

Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production

With the Partitioning, OLAP, Data Mining and Real Application Testing options

本文乃原创文章,请勿转载。如须转载请详细标明转载出处

原文:http://blog.csdn.net/cloudsnowe/article/details/45151157

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值