文档库 最新最全的文档下载
当前位置:文档库 › rac安装手记

rac安装手记

--------------------------------------安装开始 win2008 x64
1、硬盘自动加载卷

cmd〉DISKPART

AUTOMOUNT ENABLE

完成分区工作

如果为多次后安装,请将 表决磁盘等大小重新分配

list disk

select disk 1

create part extende

create partition logical size=150

create partition logical size=350

create partition logical size=850000

create partition logical size=850000

create partition logical size=13133

2、网络、HOST文件处理

10.10.10.2 DBserver1-priv
192.168.40.2 DBserver1
192.168.40.4 DBserver1-vip

10.10.10.3 DBserver2-priv
192.168.40.3 DBserver2
192.168.40.5 DBserver2-vip

3、安装前检查安装条件

cd E:\10204_vista_w2k8_x64_production_crs\clusterware\cluvfy

runcluvfy stage -post hwos -n dbserver1,dbserver2

runcluvfy stage -pre crsinst -n dbserver1,dbserver2

4、win2008 X64位使用7320726补丁程序安装crs

修改解压文件名称为:

ocfs.sys.w2k864
orafencedrv.sys.w28
cd E:\10204_vista_w2k8_x64_production_crs\clusterware
setup.exe New_Driver_Loc="c:\7320726"

集群名称: DBserve_cluster

安装完毕测试

c:\oracle\product\10.2.0\crs\bin\crs_stat -t

gsd\ons\vip应该正常online


5、安装数据库

E:\10204_vista_w2k8_x64_production_db

运行 setup.exe 集群安装 及安装软件

安装完毕
必须在远程站点上执行 \bin\SelectHome.bat,(C:\oracle\product\10.2.0\db_1\bin) 以便激活以下产品:
Oracle Data Provider for .NET
Oracle Provider for OLE DB
Oracle Objects for OLE
Oracle Counters for Windows Performance Monitor
Oracle Administration Assistant

cd c:\oracle\product\10.2.0\db_1\bin

dbca
集群数据库\创建数据库\选择全部节点\一般用途\自动存储管理ASM\创建监听NETCA\启动ASM创建磁盘组
字符列表选择:ZHS16GBK 国家字符集:UTF8

安装数据库结束 会启动各个节点实例。

最后提示需要远程节点处理:

数据库配置文件已经安装到 C:\oracle\product\10.2.0,同时其他选定的安装组件也已经安装到 C:\oracle\product\10.2.0\db_1。
iSQL*Plus URL 为:
http://DBserver2:5560/isqlplus

iSQL*Plus DBA URL 为:
http://DBserver2:5560/isqlplus/dba

必须在远程站点上执行 \bin\SelectHome.bat, 以便激活以下产品:
Oracle Data Provider for .NET
Oracle Provider for OLE DB
Oracle Objects for OLE
Oracle Counters for Windows Performance Monitor
Oracle Administration Assistant



6、 sqlplus提示为?问题解决: 否则无法使用sqlplus 登陆数据库。

1.查询服务器端配置的字符集。在sqlplus中以dba用户执行:

select tab1.aa||'_'||tab2.bb||'.'||https://www.wendangku.net/doc/029905330.html, from (select VALUE$ aa from sys.props$ where name='NLS_LANGUAGE')tab1,(select

VALUE$ bb from sys.props$ where name='NLS_ISO_CURRENCY')tab2,(select VALUE$ cc from sys.props$ where name='NLS_CHARACTERSET')tab3;

2.在客户端的注册表HKEY_LOCAL_MACHINE->SOFTWARE->ORACLE->HOME0中,如无系统变量NLS_LANG,则“新建”->“字符串”,重命名为“NLS_LANG”,并赋值为上述查询变量的值(注意引号内的字符应大写),再查看时不需要重启Oracle。

AMERICAN_AMERICA.ZHS16GBK

最后检查:

c:\oracle\product\10.2.0\crs\bin\crs_stat -t

crs_stat -t -v

应该都是在线状态

检查集群节点
C:\oracle\product\10.2.0\crs\bin\olsnodes -n

srvctl status asm -n DBserver1

srvctl status asm -n DBserver2

sqlplus下面

select * from v$active_instances; 查看实例

简单管理:

停止数据库:
srvctl stop database -d apts
启动数据库:
srvctl start database -d apts
停止数据库实例:
srvctl stop instance -d apts -i apts1,apts2
启动数据库实例:
srvctl start instance -d apts -i apts1,apts2
停止 ASM 实例:
srvctl stop asm -n server4,server5
启动 ASM 实例:
srvctl start asm -n server4,server5
查看 ASM 实例:
srvctl status asm -n server4
查看数据库状态:
srvctl status database -d apts
查看实例状态:
srvctl status instance -d apts -i apts1
srvctl status instance -d apts -i apts2




7、 em启动时候报错,重新处理报错。

 查询当前数据名 select name from v$database;
查询当前数据库实例名 select instance_name from v$instance;
--查询数据库服务名 select value from v$parameter where name = 'service_name';

集群名称: DBserve_cluster


emca -deconfig dbcontrol db -cluster

emca -deconfig dbcontrol db -repos drop -cluster

emca -config dbcontrol db -repos create -cluster

emctl status dbconsole
C:\oracle\product\10.2.0\db_1\dbserver2_APTS1\sysman\log


-------------------------------------------安装结束




oracle10g rac环境重建em来源:网络 |时间:2010-02-01 22:11 | 点击: 次

1.查看dbconsole的状态
emctl status dbconsole
2.查看RAC数据库 dbcontrol 的配置信息
emca -displayConfig dbcontrol -cluster
3.清除RAC数据库旧的配置信息
emca -deconfig dbcontrol db -repos drop -cluster
4.重新建立RAC数据库的db control的配置信息
emca -config dbcontrol db -repos create -cluster



crs命令用法及offline, unknown 状态处理2010-09-14 15:23$ORA_CRS_HOME/bin/crs_stat -t 查看crs各服务状态 。

$ORA_CRS_HOME/bin/crs_start –all
此命令用来启动所有的集群服务,但是启动的前提是 资源状态State不能是UNKNOWN。
$ORA_CRS_HOME/bin/crs_start 集群服务名(集群服务名可以通过$ORA_CRS_HOME/bin/crs_stat得到)


$ORA_CRS_HOME/bin/crs_stop -all
$ORA_CRS_HOME/bin/crs_stop 集群服务名(集群服务名可以通过$ORA_CRS_HOME/

bin/crs_stat得到)
上面的一组crs命令是用来启动关闭crs服务的


--------------------------------------------------------------------------------------------------------

可以各种原因导致服务呈现unknown 状态,比如两个节点时间差太多,比如1分钟,可能导致这个异常。

那么我们需要首先处理好这个异常,然后去处理unknown状态。

$ORA_CRS_HOME/bin/crs_stop –all只能停掉State为ONLINE的服务(使之变成offline) , 状态为UNKNOWN的资源不能通过这个命令关闭, 因此可以通过 $ORA_CRS_HOME/bin/crs_stop 服务名的方式单独停止那些状态为UNKNOWN的资源。服务名称的获取可以通过 $crs_stat -v 得到 。

[oracle@rac1 ~]$crs_stop -all 停掉状态为online的服务 。

[oracle@rac1 ~]$crs_stop ora.rac1.LISTENER_RAC1.lsnr 停掉状态为unknown 状态的服务 。

例子 :

ecsrac01$crs_stop ora.ecsrac01.ons
ecsrac01$crs_stop ora.ecsrac01.gsd
ecsrac01$crs_stop ora.ecsrac01.vip
ecsrac01$crs_stop ora.ecsrac02.LISTENER_ECSRAC02.lsnr
ecsrac01$crs_stop ora.ecsdb.ecsdb1.inst



再次查看资源状态:


[oracle@rac1 ~]$ $ORA_CRS_HOME/bin/crs_stat -t 所有服务变成offline 状态


此时可以重启所有crs资源了
[oracle@rac1 ~]$ $ORA_CRS_HOME/bin/crs_start -all(注意,这里是在oracle用户下操作)

此时,看到crs所有资源全部启动,问题解决。
其它一些常用命令:
$ORA_CRS_HOME/bin/crsctl check crs用于检查后台进程状态
$ORA_CRS_HOME/bin/crsctl start resources启动crs资源
$ORA_CRS_HOME/bin/crsctl start crs启动crs,需要超级用户操作。
$ORA_CRS_HOME/bin/crsctl stop crs关闭crs,需要超级用户操作。
$ORA_CRS_HOME/bin/crs_unregister取消注册crs
$ORA_CRS_HOME/bin/ocrcheck检查ocr设置信息用ocrcheck
$ORA_CRS_HOME/bin/crsctl query css votedisk检查表决磁盘信息


net use \\192.192.0.1\ipc$ “密码”/user:”administrator”

net use \\192.168.40.2\ipc$ "svr2010@https://www.wendangku.net/doc/029905330.html,"/user:"administrator"

net use h: \\ip\c$ 登陆后映射对方C:到本地为H:

net use h: \\192.168.40.2\c$

远程重启:

net use \\192.168.40.2 "svr2010@https://www.wendangku.net/doc/029905330.html,"/user:administrator
rsd /n /c:192.168.40.2 /m:”reboot after 3 sec” /r /f /t:3




删除节点信息:

1、删除实例
cd C:\oracle\product\10.2.0\db_1\BIN

dbca

删除实例后

c:\oracle\product\10.2.0\crs\bin\crs_stat -t

2、删除ASM
cd C:\oracle\product\10.2.0\asm_1\BIN

netca

删除ASM
srvctl remove asm -n DBserver1


删除监听器:
crs_unregister ora.dbserver1.LISTENER_DBSERVER1.lsnr


停止节点上的应用程序
srvctl stop nodeapps -n DBserver1


3、更新oracle_home信息
删除节点的oracle文件。 (卸载)

4、删除ONS配置:在任意保留节点中执行racgons命令,删除ON

S配置

cd c:\oracle\product\10.2.0\crs\bin

racgons remove_config DBserver1:端口号

racgons remove_config DBserver1:6200

oifcfg delif -node DBserver1

要查询目标节点的ONS端口号,可以通过下列命令:

c:\oracle\product\10.2.0\crs\opmn\conf\ons.config

localport=6100
remoteport=6200
loglevel=3
useocr=on

5、删除NodeApps
目标节点中包括GSD、ONS、VIP等应用此时已经可以被删除了,
删除这些应用可以通过srvctl命令

cd c:\oracle\product\10.2.0\crs\bin

srvctl remove nodeapps -n DBserver1



6、删除目标节点clusterware软件(卸载)


7、从OCR中删除节点信息

cd c:\oracle\product\10.2.0\crs\bin

olsnodes -n -i

crssetup del -nn DBserver1,1


删除结束;


添加开始:(测试未通过)

1、
cd c:\oracle\product\10.2.0\crs\oui\bin

addnode.bat

racgons add_config DBserver1:6200

c:\oracle\product\10.2.0\crs\opmn\conf\ons.config

2、

cd c:\oracle\product\10.2.0\db_1\oui\bin


addnode.bat

如出现如下错误:

OUI-10009错误:
0OUI-10009 --> There are no new nodes to add

则运行:
addnode.bat -silent "CLUSTER_NEW_NODES={DBserver1}"


3、

在DBserver1 运行
cd c:\oracle\product\10.2.0\db_1\bin
netca


在windows服务器环境中删除oracle RAC 节点和实列 These procedures assume that you are deleting node2 and that you have already successfully installed Oracle Clusterware in the ASM storage system.

1. Deleting Database Instances from Oracle Real Application Clusters Databases.

1.1 Start DBCA on node1. On the DBCA Welcome page select Oracle Real Application Clusters Database, click Next, and DBCA displays the Operations page.

2. Deleting ASM Instances from Oracle Real Application Clusters Databases.

2.1 Run the following command on the node2 to stop asm.
srvctl stop asm -n node2

2.2 Run the following command on the node2 to remove asm configuration from OCR.
srvctl remove asm -n node2

2.3 Run the following command on the node2 to remove instance from node2.
oradim -delete -asmsid +ASMnode_number

2.4 If you are not using a cluster file system for your ASM Oracle home, then run the following commands on the deleted node2:
rd /s /q ORACLE_BASE\admin\+ASM
del Oracle_home\database\*ASM*

3. Deleting Listener from Oracle Real Application Clusters Databases.

3.1 Use the Net Configuration Assistant (NETCA) to delete the Listener on node1.

4. Deleting Nodes from Oracle Real Application Clusters Databases

4.1 On the node that you are deleting, this is node2, run the following command where Oracle_home is the full path location of the Oracle home:
setup.exe -updateNodeList ORACLE_HOME=Oracle_home "CLUSTER_ NODES={node2}"

4.2 For a non-shared Oracle home, run OUI from the Oracle home on node2 and de-install this home. You can run the setu

p.exe command from Oracle_home\oui\bin to start OUI so that you can de-install the Oracle home.

4.3 On node1 or any other nodes that you are not deleting, run the following command from Oracle_home\oui\bin where node_list is a comma-delimited list of nodes that are to remain part of the Oracle RAC installation:
setup.exe –updateNodeList ORACLE_HOME=Oracle_home "CLUSTER_NODES={node_list}"

4.4 From CRS_home\bin on any existing node,node1 in this example, run the following command where remote_port is the number of the remote port:
racgons remove_config node2:remote_port
You can determine the remote port by viewing the contents of the file, CRS_home\opmn\conf\ons.config.

4.5 Run SRVCTL to stop and remove the node applications from node2. From CRS_home\bin run the following commands on node1:
srvctl stop nodeapps –n node2
srvctl remove nodeapps –n node2

4.6 On node1, or on any node that you are not deleting, run the following command from CRS_home\bin
crssetup del –nn node_name,node_number

4.7 On the node or nodes that you are deleting, node2 in this example, run the
following command from CRS_home\oui\bin:
setup.exe –updateNodeList ORACLE_HOME=CRS_home "CLUSTER_NODES={node2}" CRS=TRUE –local

4.8 On node2, using OUI setup.exe from CRS_home\oui\bin to remove oracle RAC home.

4.9 On node1,run the following command from CRS_home\oui\bin where node_list is a comma-delimited list of nodes that are to remain part of the Oracle RAC database:
setup.exe –updateNodeList ORACLE_HOME=CRS_home "CLUSTER_NODES={node_list}" CRS=TRUE

select instance_name from v$instance;

select * from sys.nls_database_parameters; --查看数据库参数
select * from sys.nls_instance_parameters; --查看客户端参数
select * from sys.nls_session_parameters; --查看会话的参数

select * from v$nls_parameters;

==============

停止数据库:
srvctl stop database -d apts
启动数据库:
srvctl start database -d apts
停止数据库实例:
srvctl stop instance -d apts -i apts1,apts2
启动数据库实例:
srvctl start instance -d apts -i apts1,apts2
停止 ASM 实例:
srvctl stop asm -n server4,server5
启动 ASM 实例:
srvctl start asm -n server4,server5
查看 ASM 实例:
srvctl status asm -n server4
查看数据库状态:
srvctl status database -d apts
查看实例状态:
srvctl status instance -d apts -i apts1
srvctl status instance -d apts -i apts2


SELECT * FROM NLS__PARAMETERS;

 $sqlplus /nolog

SQL>conn / as sysdba;

若此时数据库服务器已启动,则先执行SHUTDOWN IMMEDIATE命令关闭数据库服务器,然后执行以下命令:

SQL>STARTUP MOUNT;

SQL>ALTER SYSTEM ENABLE RESTRICTED SESSION;

SQL>ALTER SYSTEM SET JOB_QUEUE_PROCESSES=0;

SQL>ALTER SYSTEM SET AQ_TM_PROCESSES=0;

SQL>ALTER DATABASE OPEN;

SQL>ALTER DATABASE CHARACTER SET ZHS16GBK;

SQL>ALTER DATABASE national CHARACTER SET ZHS16GBK;

SQL>SHUTDOWN IMMEDIATE;

SQL>STARTUP


ALTER DATABASE national CHARACTER SET AL16UTF16;


B. 修改dmp文件字符集


察看系统字符集
SQL> SELECT * FROM NLS_DATABASE_PARAMETERS;
看NLS_CHARACTERSET的值为多少,如果为ZHS16GBK则说明改动成功。
如果执行正常,则按照下一节进行测试操作。
10.3 更改成功后的测试


alter database apts national character set AL16UTF16 ;





1、完全关闭另一个节点

srvctl stop nodeapps -n DBSERVER1 节点名称
保险一点,把crs也停掉(关闭节点上执行)
c:\oracle/product/10.2.0/crs/bin/crsctl stop crs

crs_stat -t -v DBSERVER1 资源全部offline

2、在未关闭一个节点进行操作

把RAC节点设置为单节点,设置spfile中cluster_database为false


SQL> create pfile='c:/p.ora' from spfile;

p.ora修改cluster_database为false后,从新的pfile启动

SQL> host c:/p.ora

SQL> create spfile from pfile='c:/p.ora';

SQL> SHUTDOWN IMMEDIATE;

CMD> srvctl start instance -d apts -i apts1


SQL> startup pfile=c:/p.ora
srvctl start instance -d apts -i apts1

ALTER SYSTEM ENABLE RESTRICTED SESSION;

SQL>ALTER SYSTEM SET JOB_QUEUE_PROCESSES=0;

SQL>ALTER SYSTEM SET AQ_TM_PROCESSES=0;

SQL>ALTER DATABASE OPEN;

SQL>ALTER DATABASE CHARACTER SET ZHS16GBK;

SQL>ALTER DATABASE national CHARACTER SET ZHS16GBK;

SQL>SHUTDOWN IMMEDIATE;

SQL>STARTUP





相关文档