在11gR2中,引入了SCAN(Single Client Access Name)的特性,该特性的好处在于,在数据库与客户端之间,添加了一层虚拟的服务层
在11gR2中,引入了SCAN(Single Client Access Name)的特性,该特性的好处在于,在数据库与客户端之间,添加了一层虚拟的服务层,就是所谓的scan ip以及scan ip listener,在客户端仅需要配置scan ip的tns信息,通过scan ip listener,,连接后台集群数据库。这样,不论集群数据库是否有添加或者删除节点的操作,均不会对client产生影响。当有客户端应用程序使用SCAN ip访问数据库时,scan listener会将连接转发到local listener上。
RAC=
(DESCRIPTION=
(ADDRESS=(PROTOCOL=tcp)(HOST=SCAN)(PORT=1521))
(CONNECT_DATA=(SERVICE_NAME=RAC))
)
Client should connect to the SCAN name -> scan listener, scan listener will redirect the connection(sometimes beneath) to the node VIP, and all succeeding procedures are same with the previous versions.
和SCAN ip 相关的ip信息在SCAN 资源创建的时候就被初始化了。在不使用GNS的情况下:任何对DNS和/etc/hosts 中SCAN 中的变更都不会自动同步到Clusterware中而是要手工执行相关的更新操作。下面介绍一下修改scan ip的具体步骤:
实验环境:
版本:
Clusterware :11.2.0.2
database :11.2.0.1
旧scan ip
10.250.7.210
新scan ip
10.250.7.141
10.250.7.142
10.250.7.143
1 查看scan ip的状态信息:
srvctl">grid@rac1:/home/grid>srvctl config scan
SCAN 名称: scan, 网络: 1/10.250.7.0/255.255.255.0/eth0
SCAN VIP 名称: scan1, IP: /scan/10.250.7.210
grid@rac1:/home/grid>
2 停止scan_listener ,scan 应用
srvctl">grid@rac1:/home/grid>srvctl stop scan_listener
srvctl">grid@rac1:/home/grid>srvctl stop scan
3 确认 scan_listener,scan 的状态
srvctl">grid@rac1:/home/grid>srvctl status scan_listener
SCAN 监听程序 LISTENER_SCAN1 已启用
SCAN 监听程序 LISTENER_SCAN1 未运行
srvctl">grid@rac1:/home/grid>srvctl status scan
SCAN VIP scan1 已启用
SCAN VIP scan1 未运行
crs_stat">grid@rac1:/home/grid>crs_stat -t | grep scan
ora.scan1.vip ora....ip.type OFFLINE OFFLINE
grid@rac1:/home/grid>
grid@rac1:/home/grid>
crs_stat">grid@rac1:/home/grid>crs_stat -t | grep lsnr
ora....ER.lsnr ora....er.type ONLINE ONLINE rac1
ora....N1.lsnr ora....er.type OFFLINE OFFLINE
ora....C1.lsnr application ONLINE ONLINE rac1
ora....C2.lsnr application ONLINE ONLINE rac2
4 在所有节点中 /etc/hosts 文件中修改 scan 对应的ip:
10.250.7.141 scan
10.250.7.142 scan
10.250.7.143 scan
srvctl">grid@rac1:/home/grid>srvctl modify scan -h
修改 SCAN 名称。
用法: srvctl modify scan -n
-n 域名限定的 SCAN 名
-h 输出用法
grid 用户无权更改scan ip,必须使用root权限
srvctl">grid@rac1:/home/grid>srvctl modify scan -n scan
PRCS-1034 : 无法修改单客户机访问名 scan
PRCR-1071 : 无法注册或更新 资源类型 ora.scan_vip.type
CRS-0245: User does not have enough privilege to perform. the operation
[root@rac1 ~]# /opt/11202/11.2.0/grid/bin/srvctl modify scan -n scan
5 变更后,进行确认:
[root@rac1 ~]# /opt/11202/11.2.0/grid/bin/srvctl config scan
SCAN 名称: scan, 网络: 1/10.250.7.0/255.255.255.0/eth0
SCAN VIP 名称: scan1, IP: /scan/10.250.7.141
对于/etc/hosts文件解析scan ip,因为不能做轮训的负载均衡,所以这时候scan ip就只能有一个了。
6 重新启动scan,scan_listener
srvctl">grid@rac1:/home/grid>srvctl start scan
srvctl">grid@rac1:/home/grid>srvctl start scan_listener
7 确认scan 和scan_listener.ora的状态:
crs_stat">grid@rac1:/home/grid>crs_stat -t | grep scan
ora.scan1.vip ora....ip.type ONLINE ONLINE rac2
crs_stat">grid@rac1:/home/grid>crs_stat -t | grep lsnr
ora....ER.lsnr ora....er.type ONLINE ONLINE rac1
ora....N1.lsnr ora....er.type ONLINE ONLINE rac2
ora....C1.lsnr application ONLINE ONLINE rac1
ora....C2.lsnr application ONLINE ONLINE rac2
进行ping测试
ping">grid@rac1:/home/grid>ping 10.250.7.141
PING 10.250.7.141 (10.250.7.141) 56(84) bytes of data.
64 bytes from 10.250.7.141: icmp_seq=1 ttl=64 time=1.52 ms
64 bytes from 10.250.7.141: icmp_seq=2 ttl=64 time=0.226 ms
--- 10.250.7.141 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1000ms
rtt min/avg/max/mdev = 0.226/0.873/1.520/0.647 ms
ping">grid@rac1:/home/grid>ping 10.250.7.142
PING 10.250.7.142 (10.250.7.142) 56(84) bytes of data.
与修改private ip ,vip 不一样,修改scan ip 无需停止数据库实例,asm 或者重启crs,相对比较简单!

This article explores optimizing MySQL memory usage in Docker. It discusses monitoring techniques (Docker stats, Performance Schema, external tools) and configuration strategies. These include Docker memory limits, swapping, and cgroups, alongside

This article addresses MySQL's "unable to open shared library" error. The issue stems from MySQL's inability to locate necessary shared libraries (.so/.dll files). Solutions involve verifying library installation via the system's package m

The article discusses using MySQL's ALTER TABLE statement to modify tables, including adding/dropping columns, renaming tables/columns, and changing column data types.

This article compares installing MySQL on Linux directly versus using Podman containers, with/without phpMyAdmin. It details installation steps for each method, emphasizing Podman's advantages in isolation, portability, and reproducibility, but also

This article provides a comprehensive overview of SQLite, a self-contained, serverless relational database. It details SQLite's advantages (simplicity, portability, ease of use) and disadvantages (concurrency limitations, scalability challenges). C

This guide demonstrates installing and managing multiple MySQL versions on macOS using Homebrew. It emphasizes using Homebrew to isolate installations, preventing conflicts. The article details installation, starting/stopping services, and best pra

Article discusses configuring SSL/TLS encryption for MySQL, including certificate generation and verification. Main issue is using self-signed certificates' security implications.[Character count: 159]

Article discusses popular MySQL GUI tools like MySQL Workbench and phpMyAdmin, comparing their features and suitability for beginners and advanced users.[159 characters]


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

SublimeText3 Chinese version
Chinese version, very easy to use

SublimeText3 Mac version
God-level code editing software (SublimeText3)

MantisBT
Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

Dreamweaver CS6
Visual web development tools

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software
