欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  数据库

关于Oracle RAC的维护

程序员文章站 2022-04-24 19:17:52
...

◆oracle用户的环境设置:$ cat .profile# Created for oracle RAC by ljg, 20091230 --- begin#umask 022ORACLE_BASE=/u01/app/

◆Oracle用户的环境设置:

$ cat .profile

# Created for oracle RAC by ljg, 20091230 --- begin

#

umask 022

ORACLE_BASE=/u01/app/oracle;export ORACLE_BASE

CRS_HOME=/u01/crs/oracle/product/10/app;export CRS_HOME

ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1;export ORACLE_HOME

ORACLE_SID=eoms1;export ORACLE_SID

AIXTHREAD_SCOPE=S;export AIXTHREAD_SCOPE

PATH=/usr/bin:/etc:/usr/sbin:/usr/ucb:$HOME/bin:/usr/bin/X11:/sbin:$ORACLE_HOME/bin:$CRS_HOME/bin:.;export PATH

#

# Created for oracle RAC by ljg, 20091230 --- end

if [ -s "$MAIL" ] # This is at Shell startup. In normal

then echo "$MAILMSG" # operation, the Shell checks

fi # periodically.

◆oracleRAC操作语法(4个层次):

1、服务、实例、数据库:

srvctl status|start|stop service -d eoms -s TAF_EOMS_SERVER

srvctl status|start|stop instance -d eoms -i eoms1

srvctl status|start|stop database -d eoms

2、ASM实例:

srvctl status|start|stop asm -n sdwgrac1

3、nodeapps资源:

srvctl status|start|stop nodeapps -n sdwgrac1

4、crs:

crs_stat -t

crs_start res|-all

crs_stop res|-all

crsctl check|stop|start crs

/etc/init.crs start|stop

◆为ASM增加磁盘的操作步骤:

在盘阵侧为ASM新添加vdisk后,在两个节点执行以下步骤

cfgmgr:扫描硬件改动

lspv:检查是否有新盘

lsattr -El hdiskn:查看新加盘的属性

chdev -l hdiskn -a reserve_policy=no_reserve:把新加的盘设为共享

(如果有pvid,需要如下方式取消:chdev -l hdiskn -a pv=clear)

修改pv的属性为oracle用户使用:

chown oracle:dba /dev/rhdiskn

chmod 660 /dev/rhdiskn

最后在+ASM1实例添加磁盘:

$ export ORACLE_SID=+ASM1

$ sqlplus "/ as sysdba"

alter diskgroup DATA add disk '/dev/rhdiskn';

select group_number, name, TOTAL_MB, FREE_MB from V$asm_disk_stat;

alter diskgroup DATA drop disk DATA_0001;

◆创建表空间的步骤:

create (bigfile) tablespace test_ljg datafile '+DATA0/pm/datafile/test_ljg' size 200m;

alter database datafile '+DATA0/pm/datafile/test_ljg' resize 300m;

drop tablespace test_ljg including contents and datafiles;

关于Oracle RAC的维护