ITPub博客

首页 > 数据库 > Oracle > 有关oracle高可靠性的一些讨论和想法(6)

有关oracle高可靠性的一些讨论和想法(6)

原创 Oracle 作者:jss001 时间:2009-02-25 09:48:54 0 删除 编辑
附件5:oracle9ir2 setup ( lijun )

oracle 9i rac step by step

by lijun at 2003-1-5 create.

environment:
oracle9i database 9.2.0.1.0 enterprise
redhat advance server 2.1
rac1 and rac2 server
rac1: 211.68.29.61 1.1.1.1
rac2: 211.68.29.62 1.1.1.2

IFT3102 disk array 90G RAID5 + 140G RAID0



0. get all the soft and exact or setup it.
downloaded on rac1 :

rpm -ivh cpp-2.96-108.1.i386.rpm
glibc-devel-2.2.4-26.i386.rpm
kernel-headers-2.4.9-e.3.i386.rpm
gcc-2.96-108.1.i386.rpm
binutils-2.11.90.0.8-12.i386.rpm

{ #####
{ not install jdk , had IBM JDK and JRE)
Install JDK
Download JDK 1.3.1 or Blackdown 1.1.8_v3: (I always use Blackdown)
http://www.blackdown.org
http://java.sun.com
According to JDK documentation, install JDK under /usr/local .
Then create a symbolic link to the JDK under /usr/local/java :
As root:
bzip2 -dc jdk118_v3-glibc-2.1.3.tar.bz2 | tar xf - -C /usr/local
ln -s /usr/local/jdk118_v3 /usr/local/java
( can get from ftp://192.168.100.44/pub/oracle/oracle9i.linux/ )
} #####




at rac1 and rac2 node as root run setup command:



zcat lnx_920_disk1.cpio.gz | cpio -idmv
zcat lnx_920_disk2.cpio.gz | cpio -idmv
zcat lnx_920_disk3.cpio.gz | cpio -idmv


1. install the shared disk array .
rpm -ivh pdksh-5.2.14-13.i386.rpm
rpm -ivh ncurses4-5.0-5.i386.rpm (cdrom 2 )


2. for partition
It seems that without LVM, Linux can only
support 16 partitions per disk.(3 primary partition,
1 extend partition. And you can get only 12
partitions from the extend partition). It is very
difficult to get a big rac system installed.Is there
really that kind of limit on Linux?

/dev/sdc5-16
/dev/sdd5-16


mkdir /dev/raw
mknod /dev/raw/rawctl c 162 0


/bin/chmod 600 /dev/raw/raw1
/bin/chmod 600 /dev/raw/raw2
/bin/chmod 600 /dev/raw/raw3
/bin/chmod 600 /dev/raw/raw4
/bin/chmod 600 /dev/raw/raw5
/bin/chmod 600 /dev/raw/raw6
/bin/chmod 600 /dev/raw/raw7
/bin/chmod 600 /dev/raw/raw8
/bin/chmod 600 /dev/raw/raw9
/bin/chmod 600 /dev/raw/raw10
/bin/chmod 600 /dev/raw/raw11
/bin/chmod 600 /dev/raw/raw12
/bin/chmod 600 /dev/raw/raw13
/bin/chmod 600 /dev/raw/raw14
/bin/chmod 600 /dev/raw/raw15
/bin/chmod 600 /dev/raw/raw16

/bin/chmod 600 /dev/raw/raw17

as root run at rac2:
mknod /dev/raw/raw.. ....
/bin/chmod 600 ...


3. Installing Cluster Interconnect and Public Network Hardware
cat rac1 /etc/hosts
127.0.0.1 rac1 localhost.localdomain localhost
211.68.29.61 rac1
211.68.29.62 rac2
1.1.1.1 int-rac1
1.1.1.2 int-rac2

cat rac2 /etc/hosts
127.0.0.1 rac2 localhost.localdomain localhost
211.68.29.61 rac1
211.68.29.62 rac2
1.1.1.1 int-rac1
1.1.1.2 int-rac2

ping all ip ok.


4. create users and group for oracle and chown attrib.

Create an oracle account on each node so that the account:
Is a member of the osdba group
Is used only to install and update Oracle software
user /home/httpd/ only for it has enough disk space.
A typical command would look like the following:
As root at rac1:
groupadd dba
groupadd oinstall
useradd -G dba,oinstall -u 101 -m -d /home/oracle -s /bin/bash oracle
passwd oracle
mkdir /var/oracle9i
chown -R oracle.oinstall /var/oracle9i
chmod -R ug=rwx,o=rx /var/oracle9i
ln -s /var/oracle9i /oracle

As root at rac2:
groupadd dba
groupadd oinstall
useradd -G dba,oinstall -u 101 -m -d /home/oracle -s /bin/bash oracle
passwd oracle
mkdir /var/oracle9i
chown -R oracle.oinstall /var/oracle9i
chmod -R ug=rwx,o=rx /var/oracle9i
ln -s /var/oracle9i /oracle


As root at rac1 and rac2:
/bin/chown -R oracle.dba /dev/raw
/bin/chown oracle.dba /dev/raw/rawctl
/bin/chown oracle.dba /dev/raw/raw1
/bin/chown oracle.dba /dev/raw/raw2
/bin/chown oracle.dba /dev/raw/raw3
/bin/chown oracle.dba /dev/raw/raw4
/bin/chown oracle.dba /dev/raw/raw5
/bin/chown oracle.dba /dev/raw/raw6
/bin/chown oracle.dba /dev/raw/raw7
/bin/chown oracle.dba /dev/raw/raw8
/bin/chown oracle.dba /dev/raw/raw9
/bin/chown oracle.dba /dev/raw/raw10
/bin/chown oracle.dba /dev/raw/raw11
/bin/chown oracle.dba /dev/raw/raw12
/bin/chown oracle.dba /dev/raw/raw13
/bin/chown oracle.dba /dev/raw/raw14
/bin/chown oracle.dba /dev/raw/raw15
/bin/chown oracle.dba /dev/raw/raw16

/bin/chown oracle.dba /dev/raw/raw17

at rac1 and rac2:
mkdir /var/opt/oracle
chown oracle.oinstall /var/opt/oracle
Make sure you unset LANG, JRE_HOME and JAVA_HOME in your .profile(.bashrc).


5. cluster software install and create dbora
as root at rac1:
mknod /dev/watchdog c 10 130
chmod 600 /dev/watchdog
chown oracle /dev/watchdog
/sbin/insmod softdog soft_margin=60 ( also added to startoracle_root.sh )

as root at system startup in a file called dbora
I put dbora to /etc/init.d/
add add a line : /etc/rc.d/dbora
to /etc/init.d/rc.local
chmod 755 /etc/init.d/dbora
ln -s /etc/init.d/dbora /etc/rc5.d/S78dbora
ln -s /etc/init.d/dbora /etc/rc3.d/S78dbora


as root at rac2:
mknod /dev/watchdog c 10 130
chmod 600 /dev/watchdog
chown oracle /dev/watchdog
/sbin/insmod softdog soft_margin=60 ( also added to startoracle_root.sh )

as root at system startup in a file called dbora
I put dbora to /etc/init.d/
add add a line : /etc/rc.d/dbora
to /etc/init.d/rc.local
chmod 755 /etc/init.d/dbora
ln -s /etc/init.d/dbora /etc/rc5.d/S78dbora
ln -s /etc/init.d/dbora /etc/rc3.d/S78dbora


add below lines to dbora ( same at rac1 and rac2 )
/usr/bin/raw /dev/raw/raw1 /dev/sdc5
/usr/bin/raw /dev/raw/raw2 /dev/sdc6
/usr/bin/raw /dev/raw/raw3 /dev/sdc7
/usr/bin/raw /dev/raw/raw4 /dev/sdc8
/usr/bin/raw /dev/raw/raw5 /dev/sdc9
/usr/bin/raw /dev/raw/raw6 /dev/sdc10
/usr/bin/raw /dev/raw/raw7 /dev/sdc11
/usr/bin/raw /dev/raw/raw8 /dev/sdc12
/usr/bin/raw /dev/raw/raw9 /dev/sdc13
/usr/bin/raw /dev/raw/raw10 /dev/sdc14
/usr/bin/raw /dev/raw/raw11 /dev/sdc15
/usr/bin/raw /dev/raw/raw12 /dev/sdd5
/usr/bin/raw /dev/raw/raw13 /dev/sdd6
/usr/bin/raw /dev/raw/raw14 /dev/sdd7
/usr/bin/raw /dev/raw/raw15 /dev/sdd8
/usr/bin/raw /dev/raw/raw16 /dev/sdd9

/usr/bin/raw /dev/raw/raw17 /dev/sdd10


6. preinstall rlogin . ( on rac1 and rac2 node )
because you have installed rsh-server and rsh, so you can do:
ntsysv
add * to rexec, rawdevices, rsh,rlogin
or chkconfig --add rsh ;chkconfig --add rexec ;chkconfig --add rlogin;

you must edit this files:
/etc/hosts.equiv
$ORACLEHOME/.rhosts (/home/httpd/oracle/.rhosts su oracle to touch this file )
this files contain the information for the hosts and trusted hosts(for rlogin, rcmd, rcp, etc)

cat hosts.equiv
rac1
rac2
int-rac1
int-rac2

then
service restart xinetd

Note: If you are prompted for a password, you have not given the oracle account the same attributes on all nodes. You must correct this because the Oracle Universal Installer cannot use the rcp command to copy Oracle products to the remote node's directories without user equivalence.
On AS2.1 you can't rlogin under root.


7. setting networking and system kernel parameters ( add to rac1 and rac2 /etc/init.d/rhas_ossetup.sh )
chmod 755 /etc/init.d/rhas_ossetup.sh
ln -s /etc/init.d/rhas_ossetup.sh /etc/rc5.d/S77rhas_ossetup
ln -s /etc/init.d/rhas_ossetup.sh /etc/rc3.d/S77rhas_ossetup

echo 65535 > /proc/sys/net/core/rmem_default
export SEMMSL=250
export SEMMNS=32000
export SEMOPM=100
export SEMMNI=128
echo $SEMMSL $SEMMNS $SEMOPM $ SEMMNI > /proc/sys/kernel/sem
#echo 250 32000 100 128 > /proc/sys/kernel/sem
export SHMMAX=2147483648
echo $SHMMAX > /proc/sys/kernel/shmmax
# Set file handles and process limits
echo 65536 > /proc/sys/fs/file-max
ulimit -n 65536

8. establish system environment variables

# Oracle Environment
su - oracle;
cat .bashrc
export ORACLE_BASE=/oracle
export ORACLE_HOME=/oracle/product/9.2.0
#export ORACLE_SID=coredata
export ORACLE_TERM=xterm
export NLS_LANG=AMERICAN;
#export NLS_LANG=american_america.ZHS16GBK
export ORA_NLS33=$ORACLE_HOME/ocommon/nls/admin/data
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$ORACLE_HOME/oracm/lib:/lib:/usr/lib:/usr/local/lib
export PATH=$PATH:$ORACLE_HOME/bin
CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
CLASSPATH=$CLASSPATH:$ORACLE_HOME/network/jlib
export CLASSPATH
unset LC_MESSAGES
unset LC_TIME
unset LC_NUMERIC
unset LC_CTYPE
unset LC_MONETARY
unset LC_COLLATE
unset LANG

As user oracle do this on rac1 and rac2 ( racdb is db_name )
mkdir /oracle/oradata
mkdir /oracle/oradata/racdb
ln -s /dev/raw/raw1 /oracle/oradata/racdb/db_name_raw_system
ln -s /dev/raw/raw2 /oracle/oradata/racdb/db_name_raw_users
ln -s /dev/raw/raw3 /oracle/oradata/racdb/db_name_raw_temp
ln -s /dev/raw/raw4 /oracle/oradata/racdb/db_name_raw_undotbs
ln -s /dev/raw/raw5 /oracle/oradata/racdb/db_name_raw_undotbs2
ln -s /dev/raw/raw6 /oracle/oradata/racdb/db_name_raw_indx
ln -s /dev/raw/raw7 /oracle/oradata/racdb/db_name_raw_controlfile1
ln -s /dev/raw/raw8 /oracle/oradata/racdb/db_name_raw_controlfile2
ln -s /dev/raw/raw9 /oracle/oradata/racdb/db_name_raw_rdo_1_1
ln -s /dev/raw/raw10 /oracle/oradata/racdb/db_name_raw_rdo_1_2
ln -s /dev/raw/raw11 /oracle/oradata/racdb/db_name_raw_rdo_2_1
ln -s /dev/raw/raw12 /oracle/oradata/racdb/db_name_raw_rdo_2_2
ln -s /dev/raw/raw13 /oracle/oradata/racdb/db_name_raw_spfile
ln -s /dev/raw/raw16 /oracle/oradata/racdb/db_name_raw_tools

ln -s /dev/raw/raw17 /oracle/oradata/racdb/dawndata.dbf

On the node from which you run the Oracle Universal Installer, create an ASCII file identifying the raw volume objects as shown above. The DBCA requires that these objects exist during installation and database creation. When creating the ASCII file content for the objects, name them using the format:
database_object=raw_device_file_path or database_object=soft_link
When you create the ASCII file, separate the database objects from the paths with equals (=) signs as shown in the example below:-
cat /home/oracle/raw_config
system=/oracle/oradata/racdb/db_name_raw_system
users=/oracle/oradata/racdb/db_name_raw_users
temp=/oracle/oradata/racdb/db_name_raw_temp
undotbs1=/oracle/oradata/racdb/db_name_raw_undotbs
undotbs2=/oracle/oradata/racdb/db_name_raw_undotbs2
control1=/oracle/oradata/racdb/db_name_raw_controlfile1
control2=/oracle/oradata/racdb/db_name_raw_controlfile2
redo1_1=/oracle/oradata/racdb/db_name_raw_rdo_1_1
redo1_2=/oracle/oradata/racdb/db_name_raw_rdo_1_2
redo2_1=/oracle/oradata/racdb/db_name_raw_rdo_2_1
redo2_2=/oracle/oradata/racdb/db_name_raw_rdo_2_2
spfile=/oracle/oradata/racdb/db_name_raw_spfile
indx=/oracle/oradata/racdb/db_name_raw_indx
tools=/oracle/oradata/racdb/db_name_raw_tools

dawndata=/oracle/oradata/racdb/dawndata.dbf


and You must specify that Oracle should use this file to determine the raw device volume names by setting the following environment variable where filename is the name of the ASCII file that contains the entries shown in the example above:
setenv DBCA_RAW_CONFIG filename
or
export DBCA_RAW_CONFIG=/home/oracle/raw_config
add to .bashrc


9. run oracle9i universal installer as oracle at rac1

next,
ok, input oinstall, next,
An instruction to run /tmp/orainstRoot.sh appears. Run this as root and click Continue.
select oracle cluster manager 9.2.0.1.0 , select production language add simplified chinese, next,
input public node1,2 : rac1 ,rac2 , press next.
input private node1,2 : int-rac1,int-rac2, press next.
see 60000, press next.
enter the quorum disk information , input /dev/raw/raw14 (equal /dev/oracle/nm_raw) ,press next.
press install and next.
click exit and confirm by clicking yes.

on rac2 as oracle:
mkdir $ORACLE_HOME/oracm/log
su root
$ORACLE_HOME/oracm/bin/ocmstart.sh

on rac1 as oracle:
su root
$ORACLE_HOME/oracm/bin/ocmstart.sh

if start ocmstart.sh failed then
rm -f $ORACLE_HOME/oracm/log/*


Run the installer again at rac1,
Custer Node Selection Screen. Select nodes(rac1 and rac2). Press Next.
At the file location screen, press Next.
Select the Products to install. In this example, select the Oracle9i Database , select production language add simplified chinesethen click Next.
Select the installation type. Choose the Custom option. The selection on this screen refers to the installation operation, not the database configuration. Click Next.
Select database components, make sure you include the Real Application Clusters option (i also installed partitioning and netlistener ).
(comment:I self delete: data mining,oracle managent server 9.2.0.1.0 ,enterprise manager web site 9.2.0.1.0 ,oracle http server 9.2.0.1.0, legato networker single server 6.1.0.0.0 ) Click Next.
Component Locations, accept defaults and press Next.
You are prompted for the pathname of the shared configuration file : enter the pathname of the raw device you used for the srvconf file (ex: /dev/raw15) and click Next.
Privileged operating system groups. Click Next.
Create database, check no. Click Next.
Summary screen. Click Install.
Install screen shows the progress.
Insert (umount + mount ) CD2,3 when asked. Press ok. ( if you exact lnx_920.cpio to same dir, don't need )
You will get a popup indicating to run $ORACLE_HOME/root.sh as root.
at on all nodes su root and Do so and answer the questions (just press return) Then press OK.
Configuration tools window appears and starts cluster configuration assistant - net configuration assistant
Net Configuration assistant - Do not configure this now.Click Cancel and confirm by clicking Yes.
Accept the error indicating that one or more tools have failed. This is because we cancelled net configuration. Click Ok. Click Next.
End of installation screen. Press Exit and confirm by clicking Yes.

Make sure the directory $ORACLE_HOME/rdbms/audit exists on all nodes, create it if not.
Make sure the directory $ORACLE_HOME/rdbms/log exists on all nodes, create it if not.
Make sure the directory $ORACLE_HOME/network/log exists on all nodes, create it if not.


10. Configure the Cluster Manager, Node Monitor .
The installation has created the configuration file for you in $ORACLE_HOME/oracm/admin/cmcfg.ora. The file should look like:
cat $ORACLE_HOME/oracm/admin/cmcfg.ora
HeartBeat=15000
ClusterName=Oracle Cluster Manager, version 9i
PollInterval=1000
MissCount=20
PrivateNodeNames=int-rac1 int-rac2
PublicNodeNames=rac1 rac2
ServicePort=9998
WatchdogSafetyMargin=5000
WatchdogTimerMargin=60000
CmDiskFile=/dev/raw/raw14
HostName=int-rac1

put this command in a startup script (/etc/rc.d/startoracle_root.sh=/etc/init.d/dbora ) run as root at all nodes.
ORACLE_HOME=/oracle/product/9.2.0
$ORACLE_HOME/bin/gsdctl start


11. configure the listeners.
Before creating our database, we will configure the listeners, this avoids errors during the database creation.
make sure the LANG environment variable is not set
$unset LANG
start the network configuration assistant as oracle user:
$netca
On the welcome screen, select cluster configuration and click Next.
On the nodes screen, select all nodes and click Next.
On this screen, select listener configuration and click Next.
You get the listener configuration screen. Select add and click Next.
Accept the default name listener by clicking Next.
This is the protocol selection screen. TCPIP should already be selected. Add IPC (click IPC then > and click Next.
Accept the default port number (1521) on the screen by clicking Next.
On the IPC configuration screen, enter your database name as key and click Next.
Do not configure anything else and exit netca unless you want to use Oracle intelligent agent. You will have to statically add the service names to allow automatic detection of your database by the agent. The instances will register themselves with the listener.

12. Create a RAC Database using the Oracle Database Configuration Assistant
The Oracle Database Configuration Assistant (DBCA) will create a database for you (for an example of manual database creation see Database Creation in Oracle9i RAC). The DBCA creates your database using the optimal flexible architecture (OFA). This means the DBCA creates your database files, including the default server parameter file, using standard file naming and file placement practices. The primary phases of DBCA processing are:-
sugget you run dbca to create database, not by manual database creation.

dbca
Start DBCA by executing the command dbca. The RAC Welcome Page displays.
Choose Oracle Cluster Database option and select Next.
The Operations page is displayed. Choose the option Create a Database and click Next.
The Node Selection page appears. Select the nodes that you want to configure as part of the RAC database and click Next. If nodes are missing from the Node Selection then perform clusterware diagnostics by executing the $ORACLE_HOME/bin/lsnodes -v command and analyzing its output. Resolve the problem and then restart the DBCA.
The Database Templates page is displayed. The templates other than New Database include datafiles. Choose New Database and then click Next.
DBCA now displays the Database Identification page. Enter the Global Database Name and Oracle System Identifier (SID). The Global Database Name is typically of the form name.domain, for example mydb.us.oracle.com while the SID is used to uniquely identify an instance (DBCA should insert a suggested SID, equivalent to name1 where name was entered in the Database Name field). In the RAC case the SID specified will be used as a prefix for the instance number. For example, MYDB, would become MYDB1, MYDB2 for instance 1 and 2 respectively.
input racdb.coredata as name and input racdb as sid prefix.


The Database Options page is displayed. Deselect all options (also click additional / standard database configuration) and accept the tablespaces to be dropped as well, then choose Next. Note: If you did not choose New Database from the Database Template page, you will not see this screen.

Select the dedicated server mode option from the Database Connection Options page. Note: If you did not choose New Database from the Database Template page, you will not see this screen. Click Next.

DBCA now displays the Initialization Parameters page. This page comprises a number of Tab fields. Modify the Memory settings if desired and then select the File Locations tab. The option Create persistent initialization parameter file is selected by default. The file name should point to the correct database link. Otherwise you didn't set the DBCA_RAW_CONFIG correctly or the file contains errors. The button All Initialization Parameters... displays the Initialization Parameters dialog box. This box presents values for all initialization parameters and indicates whether they are to be included in the spfile to be created through the check box, included (Y/N). Instance specific parameters have an instance value in the instance column. Complete entries in the All Initialization Parameters (especially check/correct the remote_listener entry, should read LISTENER) page and select Close. Note: There are a few exceptions to what can be altered via this screen. Ensure all entries in the Initialization Parameters page are complete. You might want to select an 8 bit character set in the db Sizing section and select Next.
shared pool 128M
large pool 16M
java pool 16M
select zhs16gbk for character sets


DBCA now displays the Database Storage Window. This page allows you to enter file names for each tablespace in your database. They should be pointing to the correct raw device or database link. Make sure to correct the datafile sizes to what you have planned and remember that the datafile should be somewhat smaller than the raw device. Click Next.
The Database Creation Options page is displayed. Ensure that the option Create Database is checked and click Finish.
The DBCA Summary window is displayed. Review this information and then click OK.
Once the Summary screen is closed using the OK option, DBCA begins to create the database according to the values specified.

You will get the password management window, complete as desired and click Exit.
A new database now exists. It can be accessed via Oracle SQL*PLUS or other applications designed to work with an Oracle RAC database. You should make sure to execute the startoracle_root.sh script at system startup as root and the startoracle.sh script as user oracle.

sys pass: sys123 12345 ? 123456?
system pass: system123


For Oracle RAC V9.2.0.1:
Please install patch Patch 2417903 available via MetaLink. This resolves an issue with slow startup of your instances.

# Pre Patch Installation tasks:
# -----------------------------
# Currently running CM processes i.e oracm and watchdogd
# have to be stopped(kill -9 ). This should be done
# on all the nodes on which CM for Real Application Clusters
# is running.
unzip 2417903.zip
cd 2417903
OPatch/opatch apply
# Patch Special Instructions:
# ---------------------------
# Make sure that all instances running under the ORACLE_HOME being
# patched are cleanly shutdown before installing this patch. Also
# ensure that the tool used to terminate the instance(s) has been
# exited cleanly.

# Post Patch Installation Tasks:
# ------------------------------
# Once the patch is installed on all the nodes, you need to start
# the Cluster Manager processes, i.e oracm and watchdogd. The
# script $ORACLE_HOME/oracm/admin/ocmstart.sh does the job. This
# should be done on all the nodes that needs to be part of the cluster.
#

su - oracle at and
rac1
export ORACLE_SID=racdb1
rac2
export ORACLE_SID=racdb2

can add to .bashrc.


su - oracle
srvctl config database -d racdb


srvctl start database -d racdb
srvctl status database -d racdb

srvctl stop database -d racdb


srvctl start instance -d racdb -i racinst1

srvctl status instance -d racdb -i racinst1

srvctl stop instance -d racdb -i racinst1



SQL> select machine,failover_type,failover_method,failed_over,count(*) from v$se
ssion group by machine,failover_type,failover_method,failed_over;


#below can't use!!!!
#at rac1 and rac2:
#echo > listener.ora
#the instance would register lisenter auto.

#below can't use!!!!
#sqplus '/ as sysdba' at rac1 and rac2
#alter system register

at /etc/init.d/dbora or /etc/rc.d/rc.local ( if you want to start soft auto)
you must copy env at .bashrc
before to start
/oracle/product/9.2.0/oracm/bin/ocmstart.sh
/oracle/product/9.2.0/bin/gsdctl start




at client ( run sqlplus )
this mode can be used: when rac1's instance and listener is shutdown ,it will connect to rac2.
cat tnsname.ora
RACDB1 =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 211.68.29.61)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = RACDB )
)
)

RACDB2 =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 211.68.29.62)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = RACDB )
)
)
RACDB =
(DESCRIPTION =
(LOAD_BALANCE = off)
(failover = on)
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 211.68.29.61)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = 211.68.29.62)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = racdb)
)
)



another mode is TAF ( transparent application failover. )
TAF can enables the user to continue working by usering the new connection as
if the original connection had never failed. (means a connect would't broke )
还有就是应用程序必须定制,所以这个很少真正有用到的,毕竟没有人用sqlplus来当作应用程序跑,
所以TAF的实际使用还是很少。

cat tnsname.ora

rac1=
(DESCRIPTION =
(failover = on)
(load_balance = off)
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 211.68.29.61)(PORT = 1521))
# (ADDRESS = (PROTOCOL = TCP)(HOST = 211.68.29.62)(PORT = 1521))
)
(CONNECT_DATA =
(service_name = racdb)
(failover_mode = (type = select) (method = basic)
(backup=rac2)(retries=20)(delay=15))
)
)
rac2=
(DESCRIPTION =
(failover = on)
(load_balance = on)
(ADDRESS_LIST =
# (ADDRESS = (PROTOCOL = TCP)(HOST = 211.68.29.61)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = 211.68.29.62)(PORT = 1521))
)
(CONNECT_DATA =
(service_name = racdb)
(failover_mode = (type = select) (method = basic)
(backup=rac1)(retries=20)(delay=15))
)
)



to enable startup database at boot.
ln -s /oracle/admin/racdb/pfile/init.ora /oracle/product/9.2.0/dbs/initracdb.ora
vi /etc/oratab N to Y


















comment:
A.
Please verify that your Linux version and the version or Oracle RDBMS is listed below as certified
together:
OS VERSION ORACLE VERSION Certified
---------- -------------- ---------
RedHat 7.0 9.0.1.x Yes
RedHat 7.1 9.0.1.x Yes
RedHat AS 2.1 9.0.1.x, 9.2.x Yes
SuSE 7.1 9.0.1.x Yes
SuSE 7.2 9.0.1.x Yes
SuSE SLE57 9.0.1.x, 9.2.x Yes
Note: RedHat 7.2, 7.3 or 8.x is not certified with any Oracle version!!

B.
http://download-west.oracle.com/ ... pf_ocm.htm#CHDFGHAI

Watchdog Daemon
The Watchdog daemon (watchdogd) uses the standard Linux Watchdog timer to monitor selected system resources to prevent database corruption.

The Watchdog daemon monitors the Node Monitor and the Cluster Manager and passes notifications to the Watchdog timer at defined intervals. The behavior of the Watchdog timer is partially controlled by the CONFIG_WATCHDOG_NOWAYOUT kernel configuration parameter.

Oracle9i Real Application Clusters requires that you set the value of the CONFIG_WATCHDOG_NOWAYOUT configuration parameter to Y (disable watchdog shutdown on close). When the Watchdog timer detects an Oracle instance or service failure, it resets the server to avoid possible corruption of the database. If the value of the CONFIG_WATCHDOG_NOWAYOUT parameter is N and a failure is detected, the Watchdog timer does not reset the server.

Oracle9i Real Application Clusters uses the software implementation of the Watchdog timer provided by the Linux kernel.

C.
If for any reason the Oracle installation didn't finish successfully, you might want to clean up the following files and directories before you restart over again:
rm -rf /etc/oraInst.loc /etc/oratab /tmp/OraInstall
/tmp/
$ORACLE_BASE/*


D.
核心参数需要设置shmmax,必须设置为内存的一般,不然就会在编译的时候出错,当然就不能正常建库了,解决办法是将核心参数设置好,然后在oracle用户下执行relink all 命令,清除temp目录内容,接着就可以建库了


E. fix oui bug. for java vm
Install of 9.2.0.2 Patchset on RAC and Linux Doesn't Finish

cd /oracle/oui/bin/linux
ln -s libclntsh.so.9.0 libclntsh.so

F. TAF test
from client :
sqlplus thtf/thtf@rac1
select instance_name from v$instance;
racdb1

from rac1 server:
select username,sid,serial# from GV$SESSION where username='THTF';
alter system disconnect session '19,49' post_transaction;


from client :
select instance_name from v$instance;
racdb2

from rac2 server:
select username,sid,serial# from GV$SESSION where username='THTF';
alter system disconnect session '10,39' post_transaction;

from client :
select instance_name from v$instance;
racdb1[@more@]

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/18921899/viewspace-1016886/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论
  • 博文量
    306
  • 访问量
    871797