- 论坛徽章:
- 0
|
Oracle 9i RAC for single linux安装文档 --ZT
安装完成Oracle 之后, 我们选择手工创建数据库:
[oracle@appc2 dbs] –这里我们编辑初始化参数, 具体参数参考下面的附件:
然后我们接着配置Listener 和tnsnames.ora 文件, 来测试Transparent Failover, 我们需要配
置两个Listener, 分别监听同一个IP 地址的两个端口, 同时配置两个Tnsnames.ora 里面的别
名.
分别启动两个Listener
$lsnrctl start rac1
$lsnrctl start rac2
[oracle@appc2 dbs]$export ORACLE_SID=rac1
[oracle@appc2 dbs]$ sqlplus '/ as sysdba'
SQL*Plus: Release 9.2.0.1.0 - Production on Fri Jul 12 12:51:16 2002
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
Connected to an idle instance.
SQL>; startup nomount
ORACLE instance started.
Total System Global Area 80859356 bytes
Fixed Size 450780 bytes
Variable Size 75497472 bytes
Database Buffers 4194304 bytes
Redo Buffers 716800 bytes
然后我们就可以开始创建数据库了:
SQL>; create database rac
2 maxinstances 3
3 datafile '/home/oracle/oradata/rac/system.dbf' size 300m
4 undo tablespace "undo_tbs" datafile '/home/oracle/oradata/rac/undo_tbs1.dbf' size 100m
5 logfile
6 '/home/oracle/oradata/rac/log1_1.log' size 10m,
7 '/home/oracle/oradata/rac/log_1_2.log' size 10m
8 /
Database created.
我们接着创建相应的数据字典:
SQL>;@?/rdbms/admin/catalog
SQL>;@?/rdbms/admin/catproc
然后我们为RAC 特有的另外那个实例创建相应的undo tablespace, 创建数据库的临时表空
间, 创建相应的第二个实例的log thread 和logfile:
SQL>; create undo tablespace undo_tbs2 datafile '/home/oracle/oradata/rac/undo_tbs2.dbf' size
100m ;
Tablespace created.
SQL>; create temporary tablespace temp tempfile '/home/oracle/oradata/rac/temp.tmp' size 100m;
Tablespace created.
SQL>; alter database add logfile thread 2 '/home/oracle/oradata/rac/redo2_1.log' size 10m;
Database altered.
SQL>; alter database add logfile thread 2 '/home/oracle/oradata/rac/redo2_2.log' size 10m;
Database altered.
SQL>; alter database enable thread 2;
Database altered.
到现在为止, 我们应该就可以成功启动第二个实例了:
[oracle@appc2 oracle]$ export ORACLE_SID=rac2
[oracle@appc2 oracle]$ sqlplus '/ as sysdba'
SQL*Plus: Release 9.2.0.1.0 - Production on Fri Jul 12 13:11:20 2002
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
Connected to an idle instance.
SQL>; startup pfile='/home/oracle/product/ora92/dbs/initrac1.ora'
ORACLE instance started.
Total System Global Area 80859356 bytes
Fixed Size 450780 bytes
Variable Size 75497472 bytes
Database Buffers 4194304 bytes
Redo Buffers 716800 bytes
Database mounted
Database Opened
我们在客户端配置好Tnsnames.ora, 开始测试TAF:
C:\>;sqlplus system/manager@rac
SQL*Plus: Release 8.1.7.0.0 - Production on Fri Jul 12 17:02:27 2002
(c) Copyright 2000 Oracle Corporation. All rights reserved.
Connected to:
Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production
With the Partitioning, Real Application Clusters, OLAP and Oracle Data Mining options
JServer Release 9.2.0.1.0 - Production
SQL>; set time on
17:02:42 SQL>; set timing on
17:02:44 SQL>; select instance_name,status from v$instance;
INSTANCE_NAME STATUS
---------------- ------------
rac1 OPEN
Elapsed: 00:00:00.30
我们再启动第二个实例, 然后关闭第一个实例:
[oracle@eachnettest bdump]$ export ORACLE_SID=rac1
[oracle@eachnettest bdump]$ sqlplus '/ as sysdba'
SQL*Plus: Release 9.2.0.1.0 - Production on Fri Jul 12 17:08:31 2002
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
Connected to:
Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production
With the Partitioning, Real Application Clusters, OLAP and Oracle Data Mining options
JServer Release 9.2.0.1.0 - Production
SQL>; shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
然后我们的SQL*Plus 客户端再次发出查询:
17:06:44 SQL>; select instance_name,status from v$instance;
INSTANCE_NAME STATUS
---------------- ------------
rac2 OPEN
Elapsed: 00:01:65.14
17:10:57 SQL>; select instance_name,status from v$instance;
INSTANCE_NAME STATUS
---------------- ------------
rac2 OPEN
可以看到,我们的SQL*Plus 客户端没有断开连接, 而是直接连接到了第二个实例上面, 做到
了透明切换.
可能出现的错误的解决:
root@appc2 oracle]# ocmstart.sh
ocmstart.sh: Error: Restart is too frequent
ocmstart.sh: Info: Check the system configuration and fix the problem.
ocmstart.sh: Info: After you fixed the problem, remove the timestamp file
ocmstart.sh: Info: "/home/oracle/product/ora92/oracm/log/ocmstart.ts"
[root@appc2 oracle]# rm -rf /home/oracle/product/ora92/oracm/log/ocmstart.ts
启动OCM, 机器重起:
这是由于OCM 没有配置好, 典型可能是softdog 这个内护模块没有安装, 或者/dev/watchdog
没有创建好.
通过检查$ORACLE_HOME/oracm/log/wdd.log 可以发现具体原因,从而具体解决.
This was psoted (not by me on) another list?
Chris Marquez
Oracle DBA S A I C
(202) 261-9454
marquezc@STARS-SMI.com
-----Original Message-----
From: canali.l@libero.it [mailto:canali.l@libero.it]
Sent: Tuesday, September 04, 2001 5:32 PM
To: Multiple recipients of list ORACLE-LINUX-L
Subject: Oracle cluster DB on linux - how to
How to install and deploy Oracle Real Application Clusters on a single
Linux server with a minimal configuration (less than $1000 worth of
hardware):
First of all to install Oracle cluster database you DON'T HAVE to have a
cluster, but a single PC may do as well (of course thi kind of
installation will not be of much use for a production DB). A minimal
server that I HAVE TESTED is:
Celeron 750 MhZ, 512 Mb of RAM, 2 IDE HD, Linux Suse 7.2
This document contains the steps needed to deploy a working Oracle 9i
Database with a minimal comment. For a complete discussion refer to
Oracle documentation, namely:
Oracle 9i administrator's reference part number A90347-02
Oracle 9i Linux release notes part number A90356-01
Oracle 9i Real Application Clusters Administration part numebr A89869-01
1) set up the partitions to user for Oracle software and the ones to
use as raw devices for the cluster DB. Soppose you want to you use an
HD mounted as the 3rd IDE device (/dev/hdc) for the cluster DB. Then
you have to partition it with fdisk with a large extended partition
(say hdc1). Create a large number of logical partitions inside hdc1
(say hdc5 till hdc20) of about 300 Mb in size (all of the same size for
simplicity).
2) Real application clusters wants to store the DB strutures into raw
devices or a cluster filesystem. Create the raw devices using the
following command as superuser):
raw /dev/raw1 /dev/hdc5
raw /dev/raw2 /dev/hdc6 ... etc till /dev/hdc20
you will need to repeat these steps after every reboot
3) Set up the Oracle user (already done with the Suse distribution),
environment variables and mount point.
Install Oracle software enterprise edition
4) Complete the installation with a custom install of the real
application
cluster option. This will add a directory called oracm under your
oracle
home, which contains the cluster manager software
5) edit $ORACLE_HOME/oracm/admin/nmcfg.ora, it contains 3 lines for the
set-up of the cluster manager sofware:
DefinedNodes=localhost
CmDiskFiles=/dev/raw2
CmHostName=localhost
6) edit /var/opt/oracle/srvConfig.loc. It contains 1 line with the
location
of a raw device used to sync the cluster nodes:
srvconfig_loc=/dev/raw1
7) start the cluster manager software (as superuser):
$ORACLE_HOME/oracm/bin/ocmstart.sh
as the oracle user start the global cache service:
gsd
9) you can now create a cluster db. to use the configuration assistant
you
need to set an extra environment variable:
export THREADS_FLAG=native
10) start the configuration assistant: dbca
expect some errors in the script the dbca generates, best is to
review
them before execution
11) after the db creation you'll be able to start two instances on the
same DB,
which means you will have a cluster DB!
12) the environment variable ORACLE_SID will determine the instance to
which you can
connect by means of a special syntax: SID.parameter=value
this is used for example for paramters like instance_number,
thread, etc
also the parameter cluster_database must be set to true
All these problems are normaly handled by the dbca.
NOTE: to set up a multi-node cluster you need to have at least: 2 PC
with
SCSI controllers (one of them must have a BIOS), at least 1 SCSI
HD
which is shared between the 2 PCs (it is connected to the 2
controllers).
Expect some problems with conflicts with SCSI the first time you
set it up.
Once you have the shared scsi disks you can make the raw devices
there and
you them to store the O9i RAC files
The cluster manager must be properly configured and started on
both nodes in
with an extension on step (5)
Luca Canali
OCP-DBA |
|