• Save
Upcoming SlideShare
Loading in...5

Like this? Share it with your network









Total Views
Views on SlideShare
Embed Views



4 Embeds 239

http://www.blaazze.com 233
http://cache.baidu.com 3
http://cache.baiducontent.com 2
http://c.360webcache.com 1



Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
Post Comment
Edit your comment
  • 1.        Define the SCAN in your corporate DNS (Domain Name Service) Use the Grid Naming Service (GNS) and the SCAN will be created during cluster configuration
  • During install we will create a scan listener for each ip address defined to the SCAN name entered on the screen. Best Practice recommendation is 3, if you use GNS, you will get three However we will define one for each of the ip’s defined to the SCAN entered! NOTE: in a 2 node cluster, you will have 2 SCAN on one node ! Or 3 if the other node is down. Static IP allocation. Needs to be configured in DNS. Dhcp for scan vips => Requires GNS. Scan Listeners ae dispersed on the cluster IE they will try to be on different nodes NET will handle multiple ip addresses returned. Databases register with the SCAN. (Remote_listener) CRS resources are modelled for each scan listener ora.scan.vip where n=1,2,3 ora.scan.lsnr where n=1,2,3 ora.scan1.vip 1 ONLINE ONLINE stbpo38 ora.scan2.vip 1 ONLINE ONLINE stbpo37 ora.scan3.vip 1 ONLINE ONLINE stbpo36
  • If you want both scan registration and other nodes listener registration use TNSNAMES like listeners_db.us.acme.com= (address_list= (address=(protocol=tcp)(host=scan-vip1)(port=1521)) (address=(protocol=tcp)(host=scan-vip2)(port=1521)) (address=(protocol=tcp)(host=scan-vip3)(port=1521)) (address=(protocol=tcp)(host=node1-vip)(port=1521)) (address=(protocol=tcp)(host=node2-vip)(port=1521)))
  • ./srvctl status scan_listener SCAN Listener LISTENER_SCAN1 is enabled SCAN listener LISTENER_SCAN1 is running on node stbpo39 SCAN Listener LISTENER_SCAN2 is enabled SCAN listener LISTENER_SCAN2 is running on node stbpo40 SCAN Listener LISTENER_SCAN3 is enabled SCAN listener LISTENER_SCAN3 is running on node stbpo41
  • Failover is on by default. Load Balance must be set. 5.2.56 TCP.CONNECT_TIMEOUT Purpose Use the TCP.CONNECT_TIMEOUT parameter to specify the time, in seconds, for a client to establish a TCP connection to the database server. If a TCP connection to the database host is not established in the time specified, the connect attempt is terminated. The client receives an ORA-12170 : TNS:Connect timeout occurred error. Without this parameter, a client connection request to the database server can block for the default duration of the TCP connect timeout (approximately 8 minutes on Linux) when the database server host system is unreachable. This parameter only applies to TCP connections ( PROTOCOL=tcp in the TNS connect address).
  • This will have the instance register with the cman server as well as the SCAN listeners. You need all the scan VIPs registered so when you put them in a TNSNAMES, you must list the 3 VIPS in 3 address lines.

SINGLE CLIENT ACCESS NAME (SCAN) Presentation Transcript

  • 1. Single Client Access Name (SCAN) 单一客户端访问名称
  • 2. Single Client Access Name (SCAN)
    • 客户端使用 SCAN 来连接集群中数据库服务
    • 如果集群发生变化,无需修改客户端的连接
    • 跨越多个实例提供一个服务的负载均衡
    • 在实例间提供 failover 失败切换
    SCAN Back Office Front Office LOB Free
  • 3. SCAN 对网络的要求
    • 两种方式 :
      • 在自有 DNS 中定义 SCAN
      • 使用 Grid Naming Service (GNS) 并且在集群配置中创建 SCAN
      • 注 : 在测试环境中,若没有 DNS ,可以通过在 /etc/hosts (将 SCAN 域名解析为一个 IP )中配置来测试 SCAN
    sales1-scan.example.com IN A IN A IN A
  • 4. Single Client Access Name (SCAN)
    • 客户端可以使用 EZConnect 或简单 JDBC 连接
    • 一个集群会有 3 个 SCAN 监听器 , 每个 SCAN 监听器有对应的 SCAN VIP (在集群中是一种 resource )
    • 每个 SCAN VIP/ 监听器会失败切换到集群中的其他节点上
    sqlplus system/manager@sales1-scan:1521/oltp jdbc:oracle:thin:@sales1-scan:1521/oltp
  • 5. SCAN 的数据库设置
    • 实例在其每个节点上注册在本地监听器 (local listener) 里
    • 实例通过远端监听器 (remote_listener) 注册在 SCAN 监听器里
    • 若需从 SCAN 重定向连接,客户端须首先能够使用 VIPs 来连接
    remote_listener=‘scan:1521' local_listener=‘hostname-vip:1521'
  • 6. Oracle 集群中的 SCAN 资源
    • 在 Grid Infrastructure 安装过程中通过 root.sh 脚本创建
    • $srvctl config scan_listener
    • SCAN Listener LISTENER_SCAN1 exists. Port: TCP:1521
    • SCAN Listener LISTENER_SCAN2 exists. Port: TCP:1521
    • SCAN Listener LISTENER_SCAN3 exists. Port: TCP:1521
    • $srvctl config scan
    • SCAN name: sales1-scan, Network: 1/
    • SCAN VIP name: scan1, IP: /sales1-scan.mycompany.com/
    • SCAN VIP name: scan2, IP: /sales1-scan.mycompany.com/
    • SCAN VIP name: scan3, IP: /sales1-scan.mycompany.com/
  • 7. 连接的负载均衡 Clients SCAN Listeners Oracle RAC Database Application Server Local Listeners
  • 8. 连接的负载均衡 Clients SCAN Listeners Oracle RAC Database Application Server Listeners
  • 9. SQL*NET 与 SCAN
    • SQL*NET 先从 DNS 或 GNS 中获得 IP 地址 , 通过多个 IP 地址会将连接负载进行均衡和失败切换
    • 对于 MAA 部署环境 , 如果客户端皆使用了主库和备库 , SQL*NET 将获得共 6 个 IP, 通过这 6 个 IP 地址来实现负载均衡和失败切换
    sales.mycompany.com =(DESCRIPTION= (CONNECT_TIMEOUT=10)(RETRY_COUNT=3) (ADDRESS_LIST= (LOAD_BALANCE=on)(FAILOVER=ON) (ADDRESS=(PROTOCOL=tcp)(HOST=scan1)(PORT=1521)) (ADDRESS=(PROTOCOL=tcp)(HOST=scan2)(PORT=1521))) (CONNECT_DATA= (SERVICE_NAME= sales.mycompany.com)))
  • 10. 使用 CMAN 来配合 SCAN
    • 当通过来 CMAN 服务器来实现连接时 , 需要在 REMOTE_LISTENER 参数中添加 CMAN 服务器地址
    listeners_db.us.acme.com= (address_list= (address=(protocol=tcp)(host=scan-vip1)(port=1521)) (address=(protocol=tcp)(host=scan-vip2)(port=1521)) (address=(protocol=tcp)(host=scan-vip3)(port=1521)) (address=(protocol=tcp)(host=cman)(port=1521)))