Home Database Mysql Tutorial Oracle 11g修改RAC SCAN IP

Oracle 11g修改RAC SCAN IP

Jun 07, 2016 pm 05:15 PM

在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 of this Website
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

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)
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

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.

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]

How do you handle large datasets in MySQL? How do you handle large datasets in MySQL? Mar 21, 2025 pm 12:15 PM

Article discusses strategies for handling large datasets in MySQL, including partitioning, sharding, indexing, and query optimization.

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]

How do you drop a table in MySQL using the DROP TABLE statement? How do you drop a table in MySQL using the DROP TABLE statement? Mar 19, 2025 pm 03:52 PM

The article discusses dropping tables in MySQL using the DROP TABLE statement, emphasizing precautions and risks. It highlights that the action is irreversible without backups, detailing recovery methods and potential production environment hazards.

How do you represent relationships using foreign keys? How do you represent relationships using foreign keys? Mar 19, 2025 pm 03:48 PM

Article discusses using foreign keys to represent relationships in databases, focusing on best practices, data integrity, and common pitfalls to avoid.

How do you create indexes on JSON columns? How do you create indexes on JSON columns? Mar 21, 2025 pm 12:13 PM

The article discusses creating indexes on JSON columns in various databases like PostgreSQL, MySQL, and MongoDB to enhance query performance. It explains the syntax and benefits of indexing specific JSON paths, and lists supported database systems.

How do I secure MySQL against common vulnerabilities (SQL injection, brute-force attacks)? How do I secure MySQL against common vulnerabilities (SQL injection, brute-force attacks)? Mar 18, 2025 pm 12:00 PM

Article discusses securing MySQL against SQL injection and brute-force attacks using prepared statements, input validation, and strong password policies.(159 characters)

See all articles