search
HomeDatabaseMysql TutorialOracle 11g修改RAC SCAN IP

在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上。

Oracle 11g修改RAC SCAN IP



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,相对比较简单!

linux

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Reduce the use of MySQL memory in DockerReduce the use of MySQL memory in DockerMar 04, 2025 pm 03:52 PM

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

How to solve the problem of mysql cannot open shared libraryHow to solve the problem of mysql cannot open shared libraryMar 04, 2025 pm 04:01 PM

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

How do you alter a table in MySQL using the ALTER TABLE statement?How do you alter a table in MySQL using the ALTER TABLE statement?Mar 19, 2025 pm 03:51 PM

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

Run MySQl in Linux (with/without podman container with phpmyadmin)Run MySQl in Linux (with/without podman container with phpmyadmin)Mar 04, 2025 pm 03:54 PM

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

What is SQLite? Comprehensive overviewWhat is SQLite? Comprehensive overviewMar 04, 2025 pm 03:55 PM

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

Running multiple MySQL versions on MacOS: A step-by-step guideRunning multiple MySQL versions on MacOS: A step-by-step guideMar 04, 2025 pm 03:49 PM

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

How do I configure SSL/TLS encryption for MySQL connections?How do I configure SSL/TLS encryption for MySQL connections?Mar 18, 2025 pm 12:01 PM

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]

What are some popular MySQL GUI tools (e.g., MySQL Workbench, phpMyAdmin)?What are some popular MySQL GUI tools (e.g., MySQL Workbench, phpMyAdmin)?Mar 21, 2025 pm 06:28 PM

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

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
Repo: How To Revive Teammates
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

MantisBT

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

Dreamweaver CS6

Visual web development tools

DVWA

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