数据库

位置:IT落伍者 >> 数据库 >> 浏览文章

Oracle 10g RAC 常用维护命令


发布日期:2020年12月20日
 
Oracle 10g RAC 常用维护命令

所有实例和服务的状态

[oracle@vzwc ~]$ srvctl status database d zwc

Instance zwc is running on node vzwc

Instance zwc is running on node vzwc

单个实例的状态

[oracle@vzwc ~]$ srvctl status instance d zwc i zwc

Instance zwc is running on node vzwc

[oracle@vzwc ~]$ srvctl status instance d zwc i zwc

Instance zwc is running on node vzwc

特定节点上节点应用程序的状态

[oracle@vzwc ~]$ srvctl status nodeapps n vzwc

VIP is running on node: vzwc

GSD is running on node: vzwc

Listener is running on node: vzwc

ONS daemon is running on node: vzwc

[oracle@vzwc ~]$

[oracle@vzwc ~]$ srvctl status nodeapps n vzwc

VIP is running on node: vzwc

GSD is running on node: vzwc

Listener is running on node: vzwc

ONS daemon is running on node: vzwc

ASM 实例的状态

[oracle@vzwc ~]$ srvctl status asm n vzwc

ASM instance +ASM is running on node vzwc

[oracle@vzwc ~]$

[oracle@vzwc ~]$ srvctl status asm n vzwc

ASM instance +ASM is running on node vzwc

显示 RAC 数据库的配置

[oracle@vzwc ~]$ srvctl config database d zwc

vzwc zwc /u/app/oracle/product//db_

vzwc zwc /u/app/oracle/product//db_

显示节点应用程序的配置 —(VIPGSDONS监听)

[oracle@vzwc ~]$ srvctl config nodeapps n vzwc a g s l

VIP exists: /vzwcvip///eth

GSD exists

ONS daemon exists

Listener exists

[oracle@vzwc ~]$

[oracle@vzwc ~]$ srvctl config nodeapps n vzwc a g s l

VIP exists: /vzwcvip///eth

GSD exists

ONS daemon exists

Listener exists

显示 ASM 实例的配置

[oracle@vzwc ~]$ srvctl config asm n vzwc

+ASM /u/app/oracle/product//db_

[oracle@vzwc ~]$

[oracle@vzwc ~]$ srvctl config asm n vzwc

+ASM /u/app/oracle/product//db_

RAC正在运行的实例

SQL> SELECT

inst_id

instance_number inst_no

instance_name inst_name

parallel

status

database_status db_status

active_state state

host_name host

FROM gv$instance

/

INST_ID INST_NO INST_NAME PAR STATUS DB_STATUS STATE HOST

  

zwc YES OPEN ACTIVE NORMAL vzwc

zwc YES OPEN ACTIVE NORMAL vzwc

磁盘组中的所有数据文件

SQL> select name from v$datafile

union

select member from v$logfile

union

select name from v$controlfile

union

select name from v$tempfile

/

NAME

+DATADG/zwc/controlfile/current

+DATADG/zwc/datafile/example

+DATADG/zwc/datafile/sysaux

+DATADG/zwc/datafile/system

+DATADG/zwc/datafile/undotbs

+DATADG/zwc/datafile/undotbs

+DATADG/zwc/datafile/users

+DATADG/zwc/onlinelog/group_

+DATADG/zwc/onlinelog/group_

+DATADG/zwc/onlinelog/group_

+DATADG/zwc/onlinelog/group_

+DATADG/zwc/tempfile/temp

+FLASHDG/zwc/controlfile/current

+FLASHDG/zwc/onlinelog/group_

+FLASHDG/zwc/onlinelog/group_

+FLASHDG/zwc/onlinelog/group_

+FLASHDG/zwc/onlinelog/group_

OCR存放路径

[oracle@vzwc ~]$ ocrcheck

Status of Oracle Cluster Registry is as follows :

Version :

Total space (kbytes) :

Used space (kbytes) :

Available space (kbytes) :

ID :

Device/File Name : /dev/raw/raw

Device/File integrity check succeeded

Device/File not configured

Cluster registry integrity check succeeded

VOTEDISK存放路径

[oracle@vzwc ~]$ crsctl query css votedisk

/dev/raw/raw

located votedisk(s)

clusterware版本

[oracle@vzwc ~]$ crsctl query crs activeversion

CRS active version on the cluster is []

RAC资源查看

[oracle@vzwc ~]$ crs_stat t

Name Type Target State Host

oraSMasm application ONLINE ONLINE vzwc

oraClsnr application ONLINE ONLINE vzwc

oravzwcgsd application ONLINE ONLINE vzwc

oravzwcons application ONLINE ONLINE vzwc

oravzwcvip application ONLINE ONLINE vzwc

oraSMasm application ONLINE ONLINE vzwc

oraClsnr application ONLINE ONLINE vzwc

oravzwcgsd application ONLINE ONLINE vzwc

oravzwcons application ONLINE ONLINE vzwc

oravzwcvip application ONLINE ONLINE vzwc

orazwcdb application ONLINE ONLINE vzwc

oracinst application ONLINE ONLINE vzwc

oracinst application ONLINE ONLINE vzwc

停止 Oracle 实例当此实例(和相关服务)关闭后关闭 ASM 实例最后关闭节点应用程序(虚拟 IPGSDTNS 监听器和  ONS)

export ORACLE_SID=zwc

emctl stop dbconsole

srvctl stop instance d zwc i zwc

srvctl stop asm n vzwc

srvctl stop nodeapps n vzwc

启动节点应用程序(虚拟 IPGSDTNS 监听器和 ONS)当成功启动节点应用程序后启动 ASM 实例最后启动 Oracle  实例(和相关服务)以及EM

export ORACLE_SID=zwc

srvctl start nodeapps n vzwc

srvctl start asm n vzwc

srvctl start instance d zwc i zwc

emctl start dbconsole

启动/停止所有实例及其启用的服务

srvctl start database d zwc

srvctl stop database d zwc

               

上一篇:oracle 11gR2 物理备用数据库搭建及切换

下一篇:Oracle数据库删除语句DELETE的一般性用法