Oracle 11g Rac 维护相对与10g而言难度有些许的增加,命令也多了一些,下面对11g rac 的Votedisk、OCR以及各种资源维护时用到的一
题:Oracle 11g Rac 维护相对与10g而言难度有些许的增加,命令也多了一些,下面对11g rac 的Votedisk、OCR以及各种资源维护时用到的一些命令进行总结,方便日后查看。
推荐阅读:
Oracle 11G RAC OCR 与 db_unique_name 配置关系 说明
重新配置与卸载Oracle 11GR2 Grid Infrastructure
管理Votedisk文件检查Votedisk状态
$ crsctl query css votedisk
在新位置增加一个votedisk
$ crsctl add css votedisk +data
迁移到其他磁盘组
$ crsctl replace votedisk +database
如果votedisk损坏,需要恢复,必须要以root用户先将Clusterware启动到"exclusive"模式
#crsctl start crs -excl
以root用户关闭和启动Clusterware服务
# crsctl stop crs [-f] ----f 代表强制
# crsctl start crs
管理OCR文件
对OCR进行手工备份
#ocrconfig -manualbackup
查看备份的OCR文件
#ocrconfig -showbackup
查看OCR备份文件的内容
#ocrdump -backupfile backup_file_name
对OCR备份文件进行恢复
#ocrconfig -restore file_name
以root用户在磁盘组DATABASE中创建一个OCR文件
#ocrconfig -add +database
删除多余的OCR文件
#ocrconfig -delete +database
把OCR文件从磁盘组DATA迁移到磁盘组DATABASE
#ocrconfig -replace +data -replacement +database
管理RAC集群的各种资源
对数据库实例,可以通过以下的命令分别查看状态、关闭实例、启动实例。可以通过-i 选项指定一个或多个实例,或者通过-n选项指定节点的名称
$srvctl status instance -d prod -i prod1,prod2
Instance prod1 is running on node ora1
Instance prod2 is running on node ora2
$srvctl stop instance -d prod -i prod1,prod2
$srvctl start instance -d prod -i prod1,prod2
对于数据库,可以通过以下命令查看数据库状态,关闭数据库,启动数据库,实际上,当把所以数据库实例关闭时,数据库也随之关闭
$srvctl status database -d prod
Instance PROD1 is running on node ora1
Instance PROD2 is running on node ora2
$srvctl stop database -d prod
$srvctl start database -d prod
在关闭数据库时,可以在srvctl命令后通过-o选项指定NORMAL,TRANSACTIONAL、IMMEDIATE、ABORT这几个关键字之一。
在启动数据库时,也可以在命令后通过-o选项指定OPEN、MOUNT、NOMOUNT这几个关键字之一
$srvctl start database -d prod -o mount
$srvctl stop database -d prod -o immediate
对于数据库监听器,可以通过以下几个命令启动和关闭,通过-n选项指定一个或多个节点名称
$srvctl status listener
$srvctl stop listener -n ora1
$srvctl start listener -n ora1,ora2
对于ASM实例,可以通过以下命令查看状态、启动和关闭实例,通过-n选项指定节点名称,也可通过-o选项指定OPEN、MOUNT、 NOMOUNT以及NORMAL、TRANSACTIONAL、IMMEDIATE、ABORT来启动或关闭实例,当所有ASM实例关闭时,ASM磁盘组也将随之关闭
$srvctl status asm -n ora1,ora2
$srvctl start asm -n ora1,ora2
$srvctl stop asm -n ora1,ora2 -o abort
对于ASM磁盘组,可以通过以下命令查看状态、关闭和启动磁盘组。通过-n选项指定节点,如果Clusterware或者数据库正在访问ASM磁盘组中文件,则磁盘组不能被关闭,在srvctl命令中通过-f选项强制关闭磁盘组
$srvctl status diskgroup -g dg1 -n ora1,ora2
$srvctl stop diskgroup -g dg1 -n ora1,ora2 -f
$srvctl start diskgroup -g dg1 -n ora1,ora2
对于VIP和SCAN,也可以通过srvctl命令查看状态已经启动和关闭。当这两种资源被关闭后,这样的IP地址将从操作系统中消失。对于SCAN,需要在命令中通过-i选项指定其编号。对于VIP,需要通过-i选项指定其名称
$srvctl status scan -i 1
$srvctl status vip -i ora1-vip
通过srvctl及其enable、disable、remove、add等子句,可以对各种资源进行激活、禁止、删除、添加等操作,,当一个资源被禁止后,它将无法随着RAC的启动而启动,除非被再次激活。当一个资源被删除后,它将从OCR中消失。在添加一个数据库监听器时需要指定监听器所使用的端口号以及数据库软件的安装目录。
$srvctl enable listener -l LISTENER -n ora1
$srvctl disable listener -l LISTENER -n ora1
$srvctl remove listener -l LISTENER
$srvctl add listener -l LISTENER -p 1521 -o /s01/app/oracle
注:以上命令看似简单,但是11g rac 由于参数增多,且各参数细分度不够,容易敲错命令。希望读者在进行生产库维护的时候要格外小心,以免造成不必要的麻烦。

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

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]

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 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

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

SublimeText3 Linux new version
SublimeText3 Linux latest version

Notepad++7.3.1
Easy-to-use and free code editor

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool

Dreamweaver CS6
Visual web development tools
