- 論壇徽章:
- 0
|
Oracle 9i RAC for single linux安裝文檔 --ZT
安裝完成Oracle 之后, 我們選擇手工創(chuàng)建數(shù)據(jù)庫(kù):
[oracle@appc2 dbs] –這里我們編輯初始化參數(shù), 具體參數(shù)參考下面的附件:
然后我們接著配置Listener 和tnsnames.ora 文件, 來(lái)測(cè)試Transparent Failover, 我們需要配
置兩個(gè)Listener, 分別監(jiān)聽(tīng)同一個(gè)IP 地址的兩個(gè)端口, 同時(shí)配置兩個(gè)Tnsnames.ora 里面的別
名.
分別啟動(dòng)兩個(gè)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
然后我們就可以開(kāi)始創(chuàng)建數(shù)據(jù)庫(kù)了:
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.
我們接著創(chuàng)建相應(yīng)的數(shù)據(jù)字典:
SQL>;@?/rdbms/admin/catalog
SQL>;@?/rdbms/admin/catproc
然后我們?yōu)镽AC 特有的另外那個(gè)實(shí)例創(chuàng)建相應(yīng)的undo tablespace, 創(chuàng)建數(shù)據(jù)庫(kù)的臨時(shí)表空
間, 創(chuàng)建相應(yīng)的第二個(gè)實(shí)例的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.
到現(xiàn)在為止, 我們應(yīng)該就可以成功啟動(dòng)第二個(gè)實(shí)例了:
[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
我們?cè)诳蛻舳伺渲煤肨nsnames.ora, 開(kāi)始測(cè)試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
我們?cè)賳?dòng)第二個(gè)實(shí)例, 然后關(guān)閉第一個(gè)實(shí)例:
[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 客戶端再次發(fā)出查詢:
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 客戶端沒(méi)有斷開(kāi)連接, 而是直接連接到了第二個(gè)實(shí)例上面, 做到
了透明切換.
可能出現(xiàn)的錯(cuò)誤的解決:
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
啟動(dòng)OCM, 機(jī)器重起:
這是由于OCM 沒(méi)有配置好, 典型可能是softdog 這個(gè)內(nèi)護(hù)模塊沒(méi)有安裝, 或者/dev/watchdog
沒(méi)有創(chuàng)建好.
通過(guò)檢查$ORACLE_HOME/oracm/log/wdd.log 可以發(fā)現(xiàn)具體原因,從而具體解決.
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 |
|