中国IT动力,最新最全的IT技术教程
最新100篇 | 推荐100篇 | 专题100篇 | 排行榜 | 搜索 | 在线API文档
首 页 | 程序开发 | 操作系统 | 软件应用 | 图形图象 | 网络应用 | 精文荟萃 | 教育认证 | 硬件维护 | 未整理篇 | 站长教程
ASP JS PHP工程 ASP.NET 网站建设 UML J2EESUN .NET VC VB VFP 网络维护 数据库 DB2 SQL2000 Oracle Mysql
服务器 Win2000 Office C DreamWeaver FireWorks Flash PhotoShop 上网宝典 CorelDraw 协议大全 网络安全 微软认证
硬件维护  CPU  主板  硬盘  内存  显卡  显示器  键盘鼠标  声卡音箱  打印机  机箱电源  BIOS  网卡  C#  Java  Delphi  vs.net2005
  当前位置:> 操作系统 > Tru64Unix
TRU64 cluster for oracle9i standby 方式安装过程
作者:未知 时间:2005-09-13 15:59 出处:ChinaUnix.net 责编:chinaitpower
              摘要:TRU64 cluster for oracle9i standby 方式安装过程

磁盘规划:


盘/用途 分区 文件系统 大小范围 合计大小
Dsk40
选举盘
Quorum disk H Cnx 实际仅使用1m,给10m即可 200M
dsk33
 Cluster公共盘 a cluster_root#root 2G 15G
g cluster_usr#usr 5-10G
b cluster_var#var 2G
Dsk34
成员1的引导盘 a root1_domain#root 2G 根据内存大小而定
b swap 成员1的内存的三倍
h Cnx 1m
Dsk35
成员2的引导盘 a root1_domain#root 2G 根据内存大小而定
b Swap 成员2的内存的三倍
h Cnx 1m
Dsk36 c advfs 70G  Oracle1 数据库存放空间
Dsk37 C Advfs  70G  Oracle2数据库存放空间
Dsk38 C  Advfs  20G  ORACLE 系统文件
Dsk39 C Advfs  15G  空着



SIZE=20MB      DISK32      (为Quorum disk)             
SIZE=15000MB   DISK33       (为公用文件系统)           
SIZE=8192MB    DISK34       (第一个成员文件系统)      
SIZE=8192MB    DISK35       (第二个成员文件系统)      
SIZE=70000MB   DISK36       (第一个ORACLE 文件系统)   
SIZE=70000MB   DISK37       (第二个ORACLE 文件系统)   
SIZE=20000MB   DISK38       (第一个ORACLE 文件系统二) 
SIZE=16000MB   DISK39       (第二个ORACLE 文件系统二) 
SIZE=200MB     DISK40       (为Quorum disk)            
                                                        



/etc/hosts文件内容:

127.0.0.1     localhost
10.73.2.9     psb110a (第一台主机的IP地址)
10.73.2.10 psb110  (CLUSTER 对外地址)
10.73.2.8     psb110b (第二台主机的IP地址)
10.73.2.7     cx110  (第二个数据库的服务地址)
10.73.2.6     psb110db (第一数据库的服务地址)
192.168.100.2   member2-icstcp0  (lan interconnect  2号机上)
192.168.100.1   member1-icstcp0   (lan interconnect 1号机上)
192.168.10.1   vis01            (虚拟地址1)
192.168.10.2    vis02            (虚拟地址2)




开始创建第一个成员:
#clu_create    
    
clu_create on 'psb110a' begin logging at Mon May 30 22:39:01 HKT 2005
------------------------------------------------------------------------

Do you want to continue creating the cluster? [yes]:yes

*** Info ***
 Memory Channel hardware not found in system; continuing ...

*** Info ***
 This system has both TruCluster Server and Tru64 UNIX patches installed on
  it. It is recommended that you make sure these are the latest patches.
  You can obtain the most recent patch kit from:  
           http://www.support.compaq.com/patches/ 

*** Warning ***
 BIND does not appear to be configured correctly.

Do you want to continue creating the cluster? [yes]:yes

Each cluster has a unique cluster name, which is a hostname
used to identify the entire cluster.

Enter a fully-qualified cluster name []:psb110
Checking cluster name: psb110.

You entered 'psb110' as your cluster name.
Is this correct? [yes]:yes

The cluster alias IP address is the IP address associated with the
default cluster alias.  (192.168.168.1 is an example of an IP address.)

Enter the cluster alias IP address []:10.73.2.10
Checking cluster alias IP address: 10.73.2.10.

You entered '10.73.2.10' as the IP address for the default cluster alias.
Is this correct? [yes]:yes

The cluster root partition is the disk partition (for example, dsk4b)
that will hold the clusterwide root (/) file system.

    Note: The default 'a' partition on most disks is not large
    enough to hold the clusterwide root AdvFS domain.

Enter the device name of the cluster root partition []:/dev/disk/dsk33a
Checking the cluster root partition: /dev/disk/dsk33a.

You entered '/dev/disk/dsk33a' as the device name of the cluster root partition.
Is this correct? [yes]:yes

The cluster usr partition is the disk partition (for example, dsk4g)
that will contain the clusterwide usr (/usr) file system.

    Note: The default 'g' partition on most disks is usually
    large enough to hold the clusterwide usr AdvFS domain.

Enter the device name of the cluster usr partition []:/dev/disk/dsk33g
Checking the cluster usr partition: /dev/disk/dsk33g.

You entered '/dev/disk/dsk33g' as the device name of the cluster usr partition.
Is this correct? [yes]:yes

To use this default value, press Return at the prompt.

The cluster var device is the disk partition (for example, dsk4h)
that will hold the clusterwide var (/var) file system.

    Note: The default 'h' partition on most disks is usually
    large enough to hold the clusterwide var AdvFS domain.

Enter the device name of the cluster var partition [/dev/disk/dsk33h]:
Checking the cluster var partition: /dev/disk/dsk33h.

You entered '/dev/disk/dsk33h' as the device name of the cluster var partition.
Is this correct? [yes]:yes

Do you want to define a quorum disk device at this time? [yes]:yes
The quorum disk device is the name of the disk (for example, 'dsk5')
that will be used as this cluster quorum disk.

Enter the device name of the quorum disk []:dsk40
Checking the quorum disk device: dsk40.
The device you have selected for the quorum disk must be re-labeled
with new cnx partition data. Performing this operation may cause data
contained on this device to be destroyed.
Do you want to use this device anyway? [yes]:yes

You entered 'dsk40' as the device name of the quorum disk device.
Is this correct? [yes]:yes

By default the quorum disk is assigned '1' vote(s).
To use this default value, press Return at the prompt.

The number of votes for the quorum disk is an integer, usually 0 or 1.
If you select 0 votes then the quorum disk will not contribute votes to the
cluster. If you select 1 vote then the quorum disk must be accessible to
boot and run a single member cluster.

Enter the number of votes for the quorum disk [1]:
Checking number of votes for the quorum disk: 1.

You entered '1' as the number votes for the quorum disk.
Is this correct? [yes]:yes

The default member ID for the first cluster member is '1'.
To use this default value, press Return at the prompt.

A member ID is used to identify each member in a cluster.
Each member must have a unique member ID, which is an integer in
the range 1-63, inclusive.

Enter a cluster member ID [1]:
Checking cluster member ID: 1.

You entered '1' as the member ID.
Is this correct? [yes]:

By default the 1st member of a cluster is assigned '1' vote(s).
Checking number of votes for this member: 1.

Each member has its own boot disk, which has an associated
device name; for example, 'dsk5'.

Enter the device name of the member boot disk []:dsk34
Checking the member boot disk: dsk34.

You entered 'dsk34' as the device name of this member's boot disk.
Is this correct? [yes]:yes

Device 'ics0' is the default virtual cluster interconnect device.
Checking virtual cluster interconnect device: ics0.

The virtual cluster interconnect IP name 'psb110a-ics0' was formed by
appending '-ics0' to the system's hostname.
To use this default value, press Return at the prompt.

Each virtual cluster interconnect interface has a unique IP name (a 
hostname) associated with it.

Each virtual cluster interconnect interface has a unique IP name (a 
hostname) associated with it.

Enter the IP name for the virtual cluster interconnect []:VIS01
Checking virtual cluster interconnect IP name: VIS01.

You entered 'VIS01' as the IP name for the virtual cluster interconnect.
Is this name correct? [yes]:YES

The virtual cluster interconnect IP address '10.0.0.1' was created by
replacing the last byte of the default virtual cluster interconnect network
address '10.0.0.0' with the previously chosen member ID '1'.
To use this default value, press Return at the prompt.

The virtual cluster interconnect IP address is the IP address
associated with the virtual cluster interconnect IP name.  (192.168.168.1 
is an example of an IP address.)

Enter the IP address for the virtual cluster interconnect [10.0.0.1]:192.168.10.1
Checking virtual cluster interconnect IP address: 192.168.10.1.

You entered '192.168.10.1' as the IP address for the virtual cluster interconnect.
Is this address correct? [yes]:yes

The physical cluster interconnect interface device is the name of the
physical device(s) that will be used for low level cluster node
communications. Examples of the physical cluster interconnect interface
device name are: tu0, ee0, and nr0.

Enter the physical cluster interconnect device name(s) []:tu0
Would you like to place this Ethernet device into a NetRAIN set? [yes]:no
Checking physical cluster interconnect interface device name(s): tu0.

You entered 'tu0' as your physical cluster interconnect interface
device name(s). Is this correct? [yes]:yes

The physical cluster interconnect IP name 'member1-icstcp0' was formed by
appending '-icstcp0' to the word 'member' and the member ID.
Checking physical cluster interconnect IP name: member1-icstcp0.

The physical cluster interconnect IP address '10.1.0.1' was created by
replacing the last byte of the default cluster interconnect network address
'10.1.0.0' with the previously chosen member ID '1'.
To use this default value, press Return at the prompt.

The cluster physical interconnect IP address is the IP address
associated with the physical cluster interconnect IP name. (192.168.168.1
is an example of an IP address.)

Enter the IP address for the physical cluster interconnect [10.1.0.1]:192.168.100.1
Checking physical cluster interconnect IP address: 192.168.100.1.

You entered '192.168.100.1' as the IP address for the physical cluster interconnect.
Is this address correct? [yes]:yes


You entered the following information:

    Cluster name:                                            psb110
    Cluster alias IP Address:                                10.73.2.10
    Clusterwide root partition:                              /dev/disk/dsk33a
    Clusterwide usr  partition:                              /dev/disk/dsk33g
    Clusterwide var  partition:                              /dev/disk/dsk33h
    Clusterwide i18n partition:                              Directory-In-/usr
    Quorum disk device:                                      dsk40
    Number of votes assigned to the quorum disk:             1
    First member's member ID:                                1
    Number of votes assigned to this member:                 1
    First member's boot disk:                                dsk34
    First member's virtual cluster interconnect device name: ics0
    First member's virtual cluster interconnect IP name:     VIS01
    First member's virtual cluster interconnect IP address:  192.168.10.1
    First member's physical cluster interconnect devices:    tu0
    First member's NetRAIN device name:                      Not-Applicable
    First member's physical cluster interconnect IP address: 192.168.100.1

If you want to change any of the above information, answer 'n' to the
following prompt. You will then be given an opportunity to change your
selections.
Do you want to continue to create the cluster? [yes]:yes

Creating required disk labels.
  Creating disk label on member disk: dsk34.
  Initializing cnx partition on member disk: dsk34h.
  Creating disk label on quorum disk: dsk40.
  Initializing cnx partition on quorum disk: dsk40h.

Creating AdvFS domains:
  Creating AdvFS domain 'root1_domain#root' on partition '/dev/disk/dsk34a'.
  Creating AdvFS domain 'cluster_root#root' on partition '/dev/disk/dsk33a'.
  Creating AdvFS domain 'cluster_usr#usr' on partition '/dev/disk/dsk33g'.
  Creating AdvFS domain 'cluster_var#var' on partition '/dev/disk/dsk33h'.

Populating clusterwide root, usr, and var file systems:
  Copying root file system to 'cluster_root#root'.
.
  Copying usr file system to 'cluster_usr#usr'.
...............
  Copying var file system to 'cluster_var#var'.
....

Creating Context Dependent Symbolic Links (CDSLs) for file systems:
  Creating CDSLs in root file system.
  Creating CDSLs in usr  file system.
  Creating CDSLs in var  file system.
  Creating links between clusterwide file systems.

Populating member's root file system.

Modifying configuration files required for cluster operation:
  Creating /etc/fstab file.
  Configuring cluster alias.
  Updating member-specific /etc/inittab file with 'cms' entry.
  Updating /etc/hosts - adding IP address '192.168.10.1' and hostname 'vis01'.
  Updating /etc/hosts - associating IP address '192.168.100.1' with hostname 'member1-icstcp0'.
  Updating /etc/rc.config file.
  Updating /etc/sysconfigtab file.
  Retrieving cluster_root major and minor device numbers.
  Creating cluster device file CDSLs.
  Updating /.rhosts - adding hostname 'psb110'.
  Updating /etc/hosts.equiv - adding hostname 'psb110'.
  Updating /.rhosts - adding hostname 'VIS01'.
  Updating /etc/hosts.equiv - adding hostname 'VIS01'.
Configuring /.shosts file for: psb110
  Updating /etc/ifaccess.conf - adding deny entry for 'ee0'.
  Updating /etc/ifaccess.conf - adding deny entry for 'sl0'.
  Updating /etc/ifaccess.conf - adding deny entry for 'tun0'.
  Updating /etc/ifaccess.conf - adding deny entry for 'tun1'.
  Updating /etc/ifaccess.conf - adding deny entry for 'ee0'.
  Updating /etc/ifaccess.conf - adding deny entry for 'sl0'.
  Updating /etc/ifaccess.conf - adding deny entry for 'tun0'.
  Updating /etc/ifaccess.conf - adding deny entry for 'tun1'.
  Updating /etc/cfgmgr.auth - adding hostname 'psb110a'.
  Finished updating member1-specific area.

Building a kernel for this member.
  Saving kernel build configuration.
  The kernel will now be configured using the doconfig program.

*** Warning ***
  File in /usr/sys/BINARY found as a file, expected symlink: GENERIC.mod.

*** Warning ***
  File in /usr/sys/BINARY found as a file, expected symlink: GENERIC_EXTRAS.mod.

*** KERNEL CONFIGURATION AND BUILD PROCEDURE ***

Saving /sys/conf/PSB110A as /sys/conf/PSB110A.bck


*** PERFORMING KERNEL BUILD ***
Working....Mon May 30 22:55:57 HKT 2005

The new kernel is /sys/PSB110A/vmunix
  Finished running the doconfig program.

  The kernel build was successful and the new kernel
   has been copied to this member's boot disk.
  Restoring kernel build configuration.

Updating console variables.
  Setting console variable 'bootdef_dev' to dsk34.
  Setting console variable 'boot_dev' to dsk34.
  Setting console variable 'boot_reset' to ON.
  Saving console variables to non-volatile storage.

clu_create: Cluster created successfully.

To run this system as a single member cluster it must be rebooted.
If you answer yes to the following question clu_create will reboot the
system for you now. If you answer no, you must manually reboot the
system after clu_create exits.
Would you like clu_create to reboot this system now? [yes]:yes
Shutdown at 08:26 (in 0 minutes) [pid 13424]
------------------------------------------------------------------------
clu_create on 'Tue May 31 08:26:13 HKT 2005' end logging at psb110a




然再创建第二个成员:


#clu_add_member 
########################################################################
clu_add_member on 'psb110a' begin logging at Tue May 31 09:03:31 HKT 2005
------------------------------------------------------------------------

Do you want to continue adding this member? [yes]:yes
grep: can't open /etc/resolv.conf

*** Warning ***
 BIND does not appear to be configured correctly.

Do you want to continue adding this member? [yes]:yes

Each cluster member has a hostname, which is assigned to the HOSTNAME
variable in /etc/rc.config.

Enter the new member's fully qualified hostname []:psb110b
Checking member's hostname: psb110b.

You entered 'psb110b' as this member's hostname.
Is this name correct? [yes]:yes

The next available member ID for a cluster member is '2'.
To use this default value, press Return at the prompt.

A member ID is used to identify each member in a cluster.
Each member must have a unique member ID, which is an integer in
the range 1-63, inclusive.

Enter a cluster member ID [2]:
Checking cluster member ID: 2.

You entered '2' as the member ID.
Is this correct? [yes]:

By default, when the current cluster's expected votes are greater than
or equal to 1 each added member is assigned 1 vote(s). Otherwise, each added
member is assigned 0 (zero) votes.
To use this default value, press Return at the prompt.

The number of votes for a member is an integer, usually 0 or 1.
Enter the number of votes for this member [1]:
Checking number of votes for this member: 1.

You entered '1' as the number votes for this member.
Is this correct? [yes]:

Each member has its own boot disk, which has an associated
device name; for example, 'dsk5'.

Enter the device name of the member boot disk []:dsk35
Checking the member boot disk: dsk35.

You entered 'dsk35' as the device name of this member's boot disk.
Is this correct? [yes]:yes

Device 'ics0' is the default virtual cluster interconnect device.
Checking virtual cluster interconnect device: ics0.

The virtual cluster interconnect IP name 'psb110b-ics0' was formed by
appending '-ics0' to the system's hostname.
To use this default value, press Return at the prompt.

Each virtual cluster interconnect interface has a unique IP name (a 
hostname) associated with it.

Enter the IP name for the virtual cluster interconnect [psb110b-ics0]:vis02
Checking virtual cluster interconnect IP name: vis02.

You entered 'vis02' as the IP name for the virtual cluster interconnect.
Is this name correct? [yes]:yes

The virtual cluster interconnect IP address '192.168.10.2' was found in the
/etc/hosts file as the address associated with the cluster virtual
interconnect IP name.
To use this default value, press Return at the prompt.

The virtual cluster interconnect IP address is the IP address
associated with the virtual cluster interconnect IP name.  (192.168.168.1 
is an example of an IP address.)

Enter the IP address for the virtual cluster interconnect [192.168.10.2]:
Checking virtual cluster interconnect IP address: 192.168.10.2.

You entered '192.168.10.2' as the IP address for the virtual cluster interconnect.
Is this address correct? [yes]:YES

The physical cluster interconnect interface device is the name of the
physical device(s) that will be used for low level cluster node
communications. Examples of the physical cluster interconnect interface
device name are: tu0, ee0, and nr0.

Enter the physical cluster interconnect device name(s) []:tu0
Would you like to place this Ethernet device into a NetRAIN set? [yes]:no
Checking physical cluster interconnect interface device name(s): tu0.

You entered 'tu0' as your physical cluster interconnect interface
device name(s). Is this correct? [yes]:

The physical cluster interconnect IP name 'member2-icstcp0' was formed by
appending '-icstcp0' to the word 'member' and the member ID.
Checking physical cluster interconnect IP name: member2-icstcp0.

The physical cluster interconnect IP address '192.168.100.2' was created by
replacing the last byte of the physical cluster interconnect network address
'192.168.100.0' with the previously chosen member ID '2'.
To use this default value, press Return at the prompt.

The cluster physical interconnect IP address is the IP address
associated with the physical cluster interconnect IP name. (192.168.168.1
is an example of an IP address.)

Enter the IP address for the physical cluster interconnect [192.168.100.2]:'
Checking physical cluster interconnect IP address: '.

*** Error ***
 Malformed physical cluster interconnect IP address: '.

The cluster physical interconnect IP address is the IP address
associated with the physical cluster interconnect IP name. (192.168.168.1
is an example of an IP address.)

Enter the IP address for the physical cluster interconnect []:192.168.100.2
Checking physical cluster interconnect IP address: 192.168.100.2.

You entered '192.168.100.2' as the IP address for the physical cluster interconnect.
Is this address correct? [yes]:yes

Each cluster member must have its own registered TruCluster Server
license. The data required to register a new member is typically located on
the License PAK certificate or it may have been previously placed on your
system as a partial or complete license data file. If you are prepared to
enter this license data at this time, clu_add_member can configure the new
member to use this license data. If you do not have the license data at this
time you can enter this data on the new member when it is up and running.
Do you wish to register the TruCluster Server license for this new member at
this time? [yes]:yes

By default the TruCluster Server license data is entered by invoking
the editor that is defined by your EDITOR environment variable. If the
environment variable is undefined, the vi editor will be invoked.
clu_add_member will display a template that includes all the fields on a PAK
and an additional field for your comment. You must transfer the values from
your License Pak certificate to the template, then save and exit the editor.
Do you wish to enter the data using the '/usr/dt/bin/dtpad' editor? [yes]:
Checking TruCluster Server license data.


You entered the following information:

    Member's hostname:                                 psb110b
    Member's ID:                                       2
    Number of votes assigned to this member:           1
    Member's boot disk:                                dsk35
    Member's virtual cluster interconnect devices:     ics0
    Member's virtual cluster interconnect IP name:     vis02
    Member's virtual cluster interconnect IP address:  192.168.10.2
    Member's physical cluster interconnect devices:    tu0
    Member's NetRAIN device name:                      Not-Applicable
    Member's physical cluster interconnect IP address:   192.168.100.2
    Member's cluster license:                          Entered

If you want to change any of the above information, answer 'n' to the
following prompt. You will then be given an opportunity to change your
selections.
Do you want to continue to add this member? [yes]:

Creating required disk labels.
  Creating disk label on member disk: dsk35.
  Initializing cnx partition on member disk: dsk35h.

Creating AdvFS domains:
  Creating AdvFS domain 'root2_domain#root' on partition 'dsk35a'.

Creating cluster member-specific files:
  Creating new member's root member-specific files.
  Creating new member's usr  member-specific files.
  Creating new member's var  member-specific files.
  Creating new member's boot member-specific files.

Modifying configuration files required for new member operation:
  Updating /etc/hosts - associating IP address '192.168.100.2' with hostname 'member2-icstcp0'.
  Updating /etc/rc.config.
  Updating /etc/sysconfigtab.
  Updating member-specific /etc/inittab file with 'cms' entry.
  Updating /etc/securettys - adding ptys entry.
  Updating /.rhosts - adding hostname 'vis02'.
  Updating /etc/hosts.equiv - adding hostname 'vis02'.
  Updating /etc/cfgmgr.auth - adding hostname 'psb110b'.
  Configuring cluster alias.
  Configuring Network Time Protocol for new member.
  Adding interface 'VIS01' as an NTP peer to member 'psb110b'.
  Adding interface 'vis02' as an NTP peer to member 'psb110a'.
  Registering TruCluster Server License.

Configuring automatic subset configuration and kernel build.

clu_add_member: Initial member 2 configuration completed successfully.
From the newly added member's console, perform the following steps to
complete the newly added member's configuration:

    1. Set the console variable 'boot_osflags' to 'A'.
    2. Identify the console name of the newly added member's boots device:

       >>>show device

       The newly added member's boot device has the following properties:

       Manufacturer: COMPAQ
       Model: MSA1000 VOLUME
       Target: IDENTIFIER=4
       Lun: UNKNOWN
       Serial Number: SCSI-WWID:01000010:6008-05f3-0011-cde0-0000-0000-35e7-002e

       Note: The SCSI bus number may differ when viewed from different members.

    3. Boot the newly added member using genvmunix:

        >>>boot -file genvmunix <new-member-boot-device>

       During this initial boot the newly added member will:

       o  Configure each installed subset.

       o  Attempt to build and install a new kernel. If the system cannot
          build a kernel, it starts a shell where you can attempt to build
          a kernel manually. If the build succeeds, copy the new kernel to
          /vmunix. When you are finished, exit the shell using ^D or 'exit'.

       o  The newly added member will attempt to set boot related console
          variables and continue to boot to multi-user mode.

       o  After the newly added member boots, you should setup your system 
          default network interface using the appropriate system management
          command.
------------------------------------------------------------------------
clu_add_member on 'Tue May 31 09:29:18 HKT 2005' end logging at psb110a





3  在第一个节点上安装ORACLE 9I 数据库

   选择:RAC ,两个节点。(psb110a ,psb110b)

在选择软件集时,去掉RAC组件。这样就可以在创库时不创建设RAC。


  并建完两个数据库实例。

   

4、配置实例应用:

   2.1 建立IP别名
每一个数据库绑定一个IP地址,两个数据库绑定两个IP地址,这样就可以进行切换。
建设文件名:clua.go
#clua.go
cluamgr -a alias=psb110db,join,rpri=10
cluamgr -r start
      
       文件名:clua.stop
#clua.stop
       cluamgr -a alias=psb110db,leave,rpri=1
  
      文件名:club.go
cluamgr -a alias=cx110,join,rpri=10
cluamgr -r start

      文件名:club.stop
cluamgr -a alias=cx110,leave,rpri=1
  
2.2 建立启动与停止文件
启动oracle  psb110的文件:
#Psb110.go
su - oracle -c /var/cluster/caa/script/app/psb110start
    
       启动ORACLE 的过程:
       #psb110start
####################################################
HOSTNAME=`hostname`
case $HOSTNAME in
psb110a)  PFILE=/oracle/app/oracle/product/9.2.0/dbs/psb110inita.ora
;;
psb110b)  PFILE=/oracle/app/oracle/product/9.2.0/dbs/psb110initb.ora
;;
*)
;;
esac
export PFILE
####################################################
ORACLE_SID=psb110
export ORACLE_SID
lsnrctl start listener
sqlplus /nolog <<eof
connect sys/oracle as sysdba;
startup pfile=$PFILE;
exit
eof


#文件名:psb110stop
停止oracle psb110数据库过程:
ORACLE_SID=psb110
export ORACLE_SID
sqlplus /nolog <<eof
connect sys/oracle as sysdba
shutdown immediate
eof
lsnrctl stop  listener
exit

     另外的一个也是一样的:
Cx110.go
su - oracle -c /var/cluster/caa/script/app/cx110start
      
      cx110start文件:
      
####################################################
HOSTNAME=`hostname`
case $HOSTNAME in
psb110a)  PFILE=/oracle/app/oracle/product/9.2.0/dbs/cx110inita.ora
;;
psb110b)  PFILE=/oracle/app/oracle/product/9.2.0/dbs/cx110initb.ora
;;
*)
;;
esac
export PFILE
####################################################
ORACLE_SID=cx110
export ORACLE_SID
lsnrctl start cx110 
sqlplus /nolog <<eof
connect sys/oracle as sysdba;
startup pfile=$PFILE;
exit
eof



cx110stop 

ORACLE_SID=cx110
export ORACLE_SID
sqlplus /nolog <<eof
connect sys/oracle as sysdba
shutdown immediate
eof
lsnrctl stop  cx110
exit




3 创建应用模板
3.1 产生psb110.cap
     

# caa_profile -create oracle1 -t application -d \
"ORACLE Single-Instance Service" -p favored -h "psb110a psb110b" -a  psb110.scr

产生如下的文件:psb110.cap

NAME=psb110
TYPE=application
ACTION_SCRIPT=psb110.scr
ACTIVE_PLACEMENT=0
AUTO_START=1
CHECK_INTERVAL=60
DESCRIPTION=psb110 oracle
FAILOVER_DELAY=5
FAILURE_INTERVAL=0
FAILURE_THRESHOLD=0
HOSTING_MEMBERS=psb110a psb110b
OPTIONAL_RESOURCES=
PLACEMENT=favored
REBALANCE=
REQUIRED_RESOURCES=
RESTART_ATTEMPTS=1
SCRIPT_TIMEOUT=60


3.2 创建CX110.cap文件
Cx110.cap文件:

NAME=cx110
TYPE=application
ACTION_SCRIPT=cx110.scr
ACTIVE_PLACEMENT=0
AUTO_START=1
CHECK_INTERVAL=60
DESCRIPTION=cx110 oracle instance
FAILOVER_DELAY=5
FAILURE_INTERVAL=0
FAILURE_THRESHOLD=0
HOSTING_MEMBERS=psb110b psb110a
OPTIONAL_RESOURCES=
PLACEMENT=favored
REBALANCE=
REQUIRED_RESOURCES=
RESTART_ATTEMPTS=1
SCRIPT_TIMEOUT=60


3.3 修改psb110.scr
#!/usr/bin/ksh -p
#
# *****************************************************************
# *                                                               *
# *    Copyright (c) Digital Equipment Corporation, 1991, 1999    *
# *                                                               *
# *   All Rights Reserved.  Unpublished rights  reserved  under   *
# *   the copyright laws of the United States.                    *
# *                                                               *
# *   The software contained on this media  is  proprietary  to   *
# *   and  embodies  the  confidential  technology  of  Digital   *
# *   Equipment Corporation.  Possession, use,  duplication  or   *
# *   dissemination of the software and media is authorized only  *
# *   pursuant to a valid written license from Digital Equipment  *
# *   Corporation.                                                *
# *                                                               *
# *   RESTRICTED RIGHTS LEGEND   Use, duplication, or disclosure  *
# *   by the U.S. Government is subject to restrictions  as  set  *
# *   forth in Subparagraph (c)(1)(ii)  of  DFARS  252.227-7013,  *
# *   or  in  FAR 52.227-19, as applicable.                       *
# *                                                               *
# *                                                               *
# *****************************************************************
#
#
# @(#)$RCSfile: template.scr,v $ $Revision: 1.1.16.1 $ (DEC) $Date: 2001/09/26 14:26:21 $
#
#
#
####################################################################
#
# The following section contains variables that can be set to best
# suit your application. 
#
# Please review each variable and set as needed.
#
# Set CAA_SCRIPT_DEBUG when invoking the script from command line 
# for testing. This will cause all output events to go to the terminal,
# rather than being sent to EVM.
#
####################################################################
#
# Application name - set this variable to a name that describes this
# (mandatory)        application.  Enclose the name in double quotes.
#                    Examples: "apache", "netscape"

SERVICE_NAME="psb110"

# Associated Processes - the application configured may consist of 
# (mandatory         single or multiple processes.  Specifying the names
#                    of the processes here allows CAA to monitor that they
#                    are running and allows CAA to completely clean up when
#                    stopping the application.
#                    Ex:  "proc1 proc2"
   
PROBE_PROCS=""

# Application Startup Command - CAA will invoke this command when starting
# (mandatory)        the application.  Include the command to execute along
#                    with any flags and arguments needed.  Use this
#                    variable along with START_APPCMD2 (see below) when
#                    dealing with a simple application start procedure.
#
#                    If the start procedure is complicated and/or involves
#                    many commands, you may find it easier to disregard
#                    this variable and manually code the commands needed
#                    in the "Start" section of this script (see below).
#                   
#                    Another alternative for a complicated start procedure
#                    is to create a separate script containing those
#                    commands and specifying that script in this variable.
#
#                    Ex: "/cludemo/avs/avsetup -s"
#
#                    NOTE: if not set, you must manually code the commands
#                    to start the application in the "Start" section of
#                    this script.

START_APPCMD="/var/cluster/caa/script/app/clua.go"

# Secondary Application Startup Command - used in conjunction with the 
# (optional)         Application Startup Command just described above.  Use
#                    if desired to implement a two-step startup process for
#                    your application, if needed.

START_APPCMD2="/var/cluster/caa/script/app/psb110.go"

# Application Stop Command - CAA will invoke this command when stopping
# (optional)         the application.  Include the command to execute along
#                    with any flags and arguments needed.  Use this
#                    variable along with STOP_APPCMD2 (see below) when
#                    dealing with a simple application stop procedure.
#
#                    If the stop procedure is complicated and/or involves
#                    many commands, you may find it easier to disregard
#                    this variable and manually code the commands needed
#                    in the "Stop" section of this script (see below).
#                   
#                    Another alternative for a complicated stop procedure
#                    is to create a separate script containing those
#                    commands and specifying that script in this variable.
#
#                    Ex: "/cludemo/avs/avsetup -k"
#
#                    NOTE: if not set, you should manually code the commands
#                    to stop the application in the "Stop" section of
#                    this script.  Otherwise, this script will not stop the
#                    application in a graceful manner.

STOP_APPCMD="/var/cluster/caa/script/app/clua.stop"

# Secondary Application Stop Command - used in conjunction with the 
# (optional)         Application Stop Command just described above.  Use
#                    if desired to implement a two-step stop process for
#                    your application, if needed.

STOP_APPCMD2="/var/cluster/caa/script/app/psb110.stop"

# Application Directory - If set, this script will change to this directory
# (optional)         prior to executing the start process.  This may allow 
#                    you to not have to specify full path names for 
#                    commands or files in this directory. 
#
#                    Ex:  "/var/opt/product1"

APPDIR="/var/cluster/caa/script/app"

export SERVICE_NAME START_APPCMD START_APPCMD2
export APPDIR PROBE_PROCS STOP_APPCMD STOP_APPCMD2

#################################################################
#
# The following section contains variables used by CAA.  We recommend
# leaving them defined as is.
#
#################################################################

DEBUG_PRIORITY=100
INFO_PRIORITY=200
ERROR_PRIORITY=500

SCRIPT=$0
ACTION=$1                     # Action (start, stop or check)

EVMPOST="/usr/bin/evmpost"    # EVM command to post events
DEBUG=0

if [[ "$CAA_SCRIPT_DEBUG" != "" ]]; then
    DEBUG=1
    EVMPOST="/usr/bin/evmpost -r | /usr/bin/evmshow -d"
fi      

export EVMPOST ACTION SCRIPT

###################################################################
#
# The following section contains procedures that are available to
# be used from the start, stop, and check portions of this script.
#
###################################################################

#
# postevent - Posts EVM event with specified parameters
#
# Argument:  $1 - priority (optional)
#            $2 - message  (optional)
#            
#

postevent () {
    typeset pri=$1
    typeset msg=${2:-failed}

    typeset evt='event { name sys.unix.clu.caa.action_script '

    if [ ! -z "$pri" ]; then
evt="$evt priority $pri "
    fi

    evt="$evt var {name name value \\\"$SERVICE_NAME\\\" } "
    evt="$evt var {name script value \\\"$SCRIPT\\\" } "
    evt="$evt var {name action value \\\"$ACTION\\\" } "
    evt="$evt var {name message value \\\"$msg\\\" }"

    evt="$evt }"

    evt="echo $evt | $EVMPOST"

    eval $evt
}

#
# getpid - list PIDs of all processes with supplied name
#
# Modified /sbin/init.d/bin/getpid to list all matches
#
# Arguments:  process name
#

getpid () {
    if [ -n "$1" ]; then
        GETMYPID=$1
        shift 
        /bin/ps -e -o pid,command $* | while read mypid command args
        do
    if [ "$command" = "$GETMYPID" ]; then
                echo "$mypid"
            fi
        done
    fi
}

#
# checkdaemon - return the number of instances of a daemon
#
# Argument:  process name
# Return:    number of instances of the user specified daemon currently running
#

checkdaemon () {
    R=`getpid $1 | wc -l`
    return $R
}

#
# zapdaemon - kill a given process using brutal force (i.e. -9)
#
# Argument:  list of processes to kill
# Return:    1 - failed to kill some process
#            0 - killed all processes
#

zapdaemon () {
    typeset ret=0

    for i in ${1}
    do
checkdaemon ${i}
if [ $? -ne 0 ]; then
            kill `getpid ${i}`
    checkdaemon ${i}
    if [ $? -ne 0 ]; then
kill -9 `getpid ${i}`
checkdaemon ${i}
if [ $? -ne 0 ]; then
    postevent $ERROR_PRIORITY "${i}: stuck - could not kill -KILL"
    ret=1
else
    postevent $ERROR_PRIORITY "${i}: killed with -KILL"
fi
    else
        postevent "" "${i}: killed"
    fi
fi
    done
    return $ret
}


#
# probeapp - Probe process to see if in process list.
#
# This simple form of process probing searches the process list for an
# entry corresponding to the specified process.  If found, all is assumed
# to be well.
#
# More accurate process probing may be available depending upon the nature
# of your application.  For instance, you might invoke a test command that
# the process should respond to and check the returned results.  You should
# consider adding this type of probing to this script, if possible.
#
# Argument:  process name
#
# Return:    1 - process not running
#            0 - process running
#

probeapp () {
    checkdaemon $1
    if [ $? -ne 0 ]; then
postevent $DEBUG_PRIORITY "$1 check OK"
return 0
    else
postevent $DEBUG_PRIORITY "$1 check failed"
return 1
    fi
}

#########################################################################
#
# Main section of Action Script - starts, stops, or checks an application
#        
# This script is invoked by CAA when managing the application associated
# with this script.
#
# Argument:  $1 - start | stop | check
#
# Returns:   0 - successful start, stop, or check
#            1 - error
#
#########################################################################

#
# Start section - start the process and report results
#
# If the Application Startup Commands (see description above) were used,
# little, if any modifications are needed in this section.  If not used,
# you may replace most of the contents in this section with your own
# start procedure code.
#
# For improved serviceability, preserve the commands below that log
# messages or posts events.
#


case $1 in
'start')
    tmpfile=/var/cluster/caa/tmp/cmd_output.$$
    postevent $DEBUG_PRIORITY "trying to start"
    cd $APPDIR
    if [ "$START_APPCMD" != "" ]; then
$START_APPCMD >$tmpfile 2>&1
if [ $? -ne 0 ]; then
    postevent $ERROR_PRIORITY "start: `cat $tmpfile`"
    /bin/rm $tmpfile
    exit 1
fi
    fi

    if [ "$START_APPCMD2" != "" ]; then
$START_APPCMD2 >$tmpfile 2>&1
if [ $? -ne 0 ]; then
    postevent $ERROR_PRIORITY "start 2: `cat $tmpfile`"
    /bin/rm $tmpfile
    exit 1
fi
    fi
    /bin/rm $tmpfile
    ;;

#
# Stop section - stop the process and report results
#
# If the Application Stop Commands or Associated Processes (see descriptions
# above) were used, little (if any) modifications are needed in this section.
# If not used, you may replace most of the contents in this section with 
# your own stop procedure code.
#
# For improved serviceability, preserve the commands below that log
# messages or posts events.
#

'stop')
    tmpfile=/var/cluster/caa/tmp/cmd_output.$$
    postevent $DEBUG_PRIORITY "trying to stop"
    cd $APPDIR
    if [ "$STOP_APPCMD" != "" ]; then
$STOP_APPCMD >$tmpfile 2>&1
if [ $? -ne 0 ]; then
    postevent $ERROR_PRIORITY "stop: `cat $tmpfile`"
    /bin/rm $tmpfile
    exit 1
fi
    fi

    if [ $STOP_APPCMD2 != "" ]; then
$STOP_APPCMD2 >$tmpfile 2>&1
if [ $? -ne 0 ]; then
    postevent $ERROR_PRIORITY "stop 2: `cat $tmpfile`"
    /bin/rm $tmpfile
    exit 1
fi
    fi
    /bin/rm $tmpfile
#
# Kill stubborn processes and applications that don't have a stop command
#

    for i in ${PROBE_PROCS}; do
zapdaemon ${i}
    done

    ;;

#
# Check section - check the process and report results
#
# If you specified $PROBE_PROCS (see earlier description), very little,
# if any, changes are needed to have simple process checking.
#
# Your application might allow you to implement more accurate process
# checking.  If so, you may choose to implement that code here.  See the 
# description for the probeapp function earlier in this script.
#
'check')
    for i in ${PROBE_PROCS}; do
postevent $DEBUG_PRIORITY "trying to check $i"
probeapp $i
if [ $? -ne 0 ]; then
    postevent "" "check failed for $i"
    exit 1
fi
    done

    ;;

*)
    postevent $ERROR_PRIORITY "usage: $0 {start|stop|check}"
    exit 1

    ;;
esac

postevent "" success
exit 0

 同样,修改cx110.scr 文件

1.1 修改listener.ora 

# LISTENER.ORA Network Configuration File: /oracle/app/oracle/product/9.2.0/network/admin/listener.ora
# Generated by Oracle configuration tools.

LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS_LIST =
        (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))
      )
      (ADDRESS_LIST =
        (ADDRESS = (PROTOCOL = TCP)(HOST = 10.73.2.6)(PORT = 1521))
      )
    )
  )

SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (SID_NAME = PLSExtProc)
      (ORACLE_HOME = /oracle/app/oracle/product/9.2.0)
      (PROGRAM = extproc)
    )
    (SID_DESC =
      (GLOBAL_DBNAME = psb110)
      (ORACLE_HOME = /oracle/app/oracle/product/9.2.0)
      (SID_NAME = psb110)
    )
  )

 
cX110 =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS_LIST =
        (ADDRESS = (PROTOCOL = TCP)(HOST = 10.73.2.7)(PORT = 1522))
      )
    )
  )

SID_LIST_cx110 =
  (SID_LIST =
    (SID_DESC =
      (GLOBAL_DBNAME = cx110)
      (ORACLE_HOME = /oracle/app/oracle/product/9.2.0)
      (SID_NAME = cx110)
    )
)



1.2  修改TNSNAMES.ORA文件
# TNSNAMES.ORA Network Configuration File: /oracle/app/oracle/product/9.2.0/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.

PSB110 =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 10.73.2.6)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = psb110)
    )
  )

CX110 =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 10.73.2.7)(PORT = 1522))
    )
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = cx110)
    )
  )

INST1_HTTP =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = psb110)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVER = SHARED)
      (SERVICE_NAME = MODOSE)
      (PRESENTATION = http://HRService)
    )
  )

EXTPROC_CONNECTION_DATA =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))
    )
    (CONNECT_DATA =
      (SID = PLSExtProc)
      (PRESENTATION = RO)
    )
  )

   

3.4 测试
#  ./psb110.scr  start
#  ./psb110.scr  stop
如果测试成功,就可以对数据库进行注册:
 #caa_register  psb110
  #caa_register cx110

4 应用管理操作

4.1 启动服务:
#caa_start psb110 
#caa_start cx110    

4.2 停止服务:
#caa_stop psb110
#caa_stop cx110

4.3 切换到另一台机器:
#caa_relocate  psb110  -c psb110b
#caa_relocate  cx110   -c psb110a


4.4 指定到一台机器上启动:
#caa_start  psb110 –c psb110a
#caa_start  cx110 –c psb110b


5 应用切换测试
   首先分配两个数据库分别运行到两台机器上。然后再进行如下测试:
(1) 直接关一台机器的电源:
这一台机器上的ORACLE服务会自动切换到另一台机器上。
(2) 手功进行切换:测试是否成功。
(3) 拔网线测试(外部网络):没有反应
(4) 拔心跳线:
后启动的那一台机器会重启。
这一台机器上的所有的应用,会全部切换到另一台机器上了。

 starmoon2003 回复于:2005-06-05 15:32:54
两台机器的配置不一样,内存有一个台是2G,有一台只有1G。

 吹拂的晨风 回复于:2005-06-05 19:14:31
楼主怎么两台服务器配置不一样啊,呵呵!
不过总结的不错,帮你顶,斑竹应该考虑加精哦!

 starmoon2003 回复于:2005-06-05 19:32:41
客户没钱,所以只好做两台高低配置。

 prettyhs 回复于:2005-06-05 22:38:30
谢谢你!我的帖子终于得到回复了!版主一定要给加精呀!
你说compaq的人都做不了,那真是人才呀!
21世纪什么最贵,人才~~~~!
对了,你这是两个数据库的standby 吗?
如果是一个数据库的standby 和你的做法有什么不同吗?

 starmoon2003 回复于:2005-06-06 09:18:52
也是一样的, 我是两台机上,各自运行一个数据库,同时两个数据可以相互进行切换。

 prettyhs 回复于:2005-06-07 00:07:42
好的,回头按照你介绍我去试试,呵呵,试成了我也算和你学会的东西了!谢谢啊!

 prettyhs 回复于:2005-06-07 18:05:20
对了,我看了一下,你上面是不是有笔误呀,我是菜鸟,不太懂呀,你前面说的你的cluster 的虚拟主机名是psb110,第一个数据库主机名是psb110db,可在后面描述里第一数据库的描述一直是psb110,不知道是不是笔误呀!是不是应该是psb110db 呢?

 starmoon2003 回复于:2005-06-07 22:12:36
不是笔误,是对的.

 prettyhs 回复于:2005-06-08 11:36:20
嗯,我点不明白,为什么在后面里psb110db没有体现 出来呢?只看到有cx110,能帮着给解释一下吗?对不起我是菜鸟

 starmoon2003 回复于:2005-06-08 14:47:11
其实也可以让他出现,只是我用他的IP地址代替了.

 netkey 回复于:2005-06-08 20:29:39
谢谢!
已经加精。

 quchenghua 回复于:2005-06-11 11:48:20
大哥好厉害, 我想安装单个的, DS15  TRu64 5.1B,请给予一点指导好吗??具体的步骤和环境参数设置等,谢谢啦  chenghuaqu@163.com

 starmoon2003 回复于:2005-06-13 23:37:27
安装tru64 十分容易,看一下install doc吧, 随机光盘有现成的资料,对着一步一步走下去就可以了.

关闭本页
 
首页 | 投资与合作 | 服务条款 | 隐私政策 | 收藏本站 | 设为首页 | 新用户注册 | 免责声明 | 使用帮助
Copyright ©2005-2008 chinaitpower.com All rights reserved. www.chinaitpower.com 版权所有