还是rac得tns问题

[复制链接]
查看11 | 回复3 | 2008-4-24 10:00:15 | 显示全部楼层 |阅读模式
平台:rh as 3.0 + oracle9.2.0.4
我又重新建了一次库,现在得状态是:
lsnrctl status:
LSNRCTL for Linux: Version 9.2.0.4.0 - Production on 15-JUN-2004 20:00:22
Copyright (c) 1991, 2002, Oracle Corporation.All rights reserved.
Connecting to (ADDRESS=(PROTOCOL=tcp)(PORT=1521))
STATUS of the LISTENER
------------------------
Alias
LISTENER
Version
TNSLSNR for Linux: Version 9.2.0.4.0 - Production
Start Date
15-JUN-2004 18:41:30
Uptime
0 days 1 hr. 18 min. 51 sec
Trace Level
off
Security
OFF
SNMP
OFF
Listener Parameter File /opt/oracle/product/9.2.0/network/admin/listener.ora
Listener Log File /opt/oracle/product/9.2.0/network/log/listener.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=oadbs2.bbi.edu.cn)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=oadbs2.bbi.edu.cn)(PORT=8080))(Presentation=HTTP)(Session=RAW))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=oadbs2.bbi.edu.cn)(PORT=2100))(Presentation=FTP)(Session=RAW))
Services Summary...
Service "oadbs" has 2 instance(s).
Instance "oadbs1", status READY, has 1 handler(s) for this service...
Instance "oadbs2", status READY, has 1 handler(s) for this service...
Service "oadbsXDB" has 2 instance(s).
Instance "oadbs1", status READY, has 1 handler(s) for this service...
Instance "oadbs2", status READY, has 1 handler(s) for this service...
The command completed successfully

但是我在这两台服务器上运行:
tnsping oadbs
tnsping oadbs1
tnsping oadbs2
都得到这样得结果:
Used TNSNAMES adapter to resolve the alias
Attempting to contact (description=(address=(protocol=tcp)(host=202.205.16.71)
ort=1521))
Segmentation fault
我的listener.ora:
lsnr1 =(DESCRIPTION_LIST =(DESCRIPTION =(ADDRESS_LIST =(ADDRESS = (PROTOCOL = TCP)(HOST = 202.205.16.71)(PORT = 1521)))))
lsnr2 =(DESCRIPTION_LIST =(DESCRIPTION =(ADDRESS_LIST =(ADDRESS = (PROTOCOL = TCP)(HOST = 202.205.16.72)(PORT = 1521)))))
我的tnsnames.ora:
oadbs=
(description=(load_balance=on)(failover=on)
(address_list=
(address=(protocol=tcp)(host=202.205.16.71)(port=1521))
(address=(protocol=tcp)(host=202.205.16.72)(port=1521)))
(connect_data=(service_name=oadbs)))
oadbs1=
(description=(address=(protocol=tcp)(host=202.205.16.71)(port=1521))
(connect_data=(service_name=oadbs)
(instance_name=oadbs1)))
oadbs2=
(description=(address=(protocol=tcp)(host=202.205.16.72)(port=1521))
(connect_data=(service_name=oadbs)
(instance_name=oadbs2)))

我的spfileoadbs.ora.:
*.aq_tm_processes=1
*.background_dump_dest='/opt/oracle/admin/oadbs/bdump'
*.cluster_database_instances=2
*.cluster_database=true
*.compatible='9.2.0.0.0'
*.control_files='/var/opt/oracle/oradata/oadbs/control01.ctl','/var/opt/oracle/o
radata/oadbs/control02.ctl','/var/opt/oracle/oradata/oadbs/control03.ctl'
*.core_dump_dest='/opt/oracle/admin/oadbs/cdump'
*.db_block_size=8192
*.db_cache_size=25165824
*.db_domain=''
*.db_file_multiblock_read_count=16
*.db_name='oadbs'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=oadbsXDB)'
*.fast_start_mttr_target=300
*.hash_join_enabled=TRUE
oadbs2.instance_name='oadbs2'
oadbs1.instance_name='oadbs1'
oadbs1.instance_number=1
oadbs2.instance_number=2
*.java_pool_size=83886080
*.job_queue_processes=10
*.large_pool_size=8388608
*.local_listener='LISTENER_OADBS'
oadbs1.local_listener='(address=(protocol=tcp)(host=202.205.16.71)(port=1521))'
oadbs2.local_listener='(address=(protocol=tcp)(host=202.205.16.72)(port=1521))'
*.open_cursors=300
*.pga_aggregate_target=25165824
*.processes=150
*.query_rewrite_enabled='FALSE'
*.remote_listener='LISTENERS_OADBS'
oadbs1.remote_listener='(address=(protocol=tcp)(host=202.205.16.72)(port=1521))'
oadbs2.remote_listener='(address=(protocol=tcp)(host=202.205.16.71)(port=1521))'
*.remote_login_passwordfile='exclusive'
*.shared_pool_size=83886080
*.sort_area_size=524288
*.star_transformation_enabled='FALSE'
oadbs1.thread=1
oadbs2.thread=2
*.timed_statistics=TRUE
*.undo_management='AUTO'
*.undo_retention=10800
oadbs2.undo_tablespace='UNDOTBS2'
oadbs1.undo_tablespace='UNDOTBS1'
*.user_dump_dest='/opt/oracle/admin/oadbs/udump'

我试过用windows的客户管理工具去连他们:oadbs1、oadbs2都能分别连上,oadbs由于不知道要连什么ip,所以不会连。
麻烦大家再辛苦指点一下。
Any help will be appreciated!
回复

使用道具 举报

千问 | 2008-4-24 10:00:15 | 显示全部楼层
啊啊啊啊阿~~~
偶对不起大家,对不起党,对不起人民!!对不起各位大侠浪费得时间。
是偶自己没有看仔细:
tnsnames.ora写得不对。改成这样就好了:
oadbs=
(description=

(load_balance=on)

(failover=on)

(address_list=

(address=(protocol=tcp)(host=202.205.16.71)(port=1521))

(address=(protocol=tcp)(host=202.205.16.72)(port=1521))

)

(connect_data=(service_name=oadbs))
)
oadbs1=
(description=

(address_list=

(address=(protocol=tcp)(host=202.205.16.71)(port=1521))

)


(connect_data=(service_name=oadbs)

(instance_name=oadbs1)

)
)
oadbs2=
(description=

(address_list=

(address=(protocol=tcp)(host=202.205.16.72)(port=1521))

)


(connect_data=

(service_name=oadbs)

(instance_name=oadbs2)

)
)
回复

使用道具 举报

千问 | 2008-4-24 10:00:15 | 显示全部楼层
我正在学RPC,把你的心得和大家共享呀,谢谢
回复

使用道具 举报

千问 | 2008-4-24 10:00:15 | 显示全部楼层
这是我安装过程得步骤,由于是在服务器上写的,没有中文,但写得都是些土洋文,应该比较容易看。
我安装的时候主要是按照:piner在本论坛发表的文章和一位叫aman网友写的安装工略,非常谢谢他们的帮助。
Installation of Oracle 9i Real Application Cluster
Platform:
Oracle Version: Oracle 9.2.0.4
Server Nodes: two IBM Server x335

Paltform: RedHat Advanced Server 3.0

Name and Ip address: oadbs1 202.205.16.71

oadbs2 202.205.16.72
San: IBM FastT200

I.Preparation

1.Linux Server (every server node shuold do the following)



a.Oracle 9i patch for Rh AS3.0:

Login as root and download the patch for Rh AS3.0 (p3006854_9204_LINUX.zip)

#tar zxvf p3006854_9204_LINUX.zip

#cd 3006854

#./rhel3_pre_install.sh



b.Install the needed rpms:

#rpm -ivh compat-db-4.0.14-5.i386.rpm

#rpm -ivh compat-gcc-7.3-2.96.122.i386.rpm

#rpm -ivh compat-gcc-c++-7.3-2.96.122.i386.rpm

#rpm -ivh compat-glibc-7.x-2.2.4.32.5.i386.rpm

#rpm -ivh compat-libstdc++-7.3-2.96.122.i386.rpm

#rpm -ivh compat-libstdc++-devel-7.3-2.96.122.i386.rpm

#rpm -ivh ncurses4-5.0-5.i386.rpm



c.Relink the gcc:

#cd /usr/bin

#mv gcc gcc323

#ln -s gcc296 gcc

#mv g++ g++323

#ln -s g++296 g++




d.Edit the server kernel parameters:

#cd /etc/rc.d

#vi root.sh

#!/bin/bash

echo "Configing the kernel parameter for Oracle"

echo 100 256 100 100 > /proc/sys/kernel/sem

echo 2147483648 > /proc/sys/kernel/shmmax

echo 100 > /proc/sys/kernel/shmmni

echo 2097152 > /proc/sys/kernel/shmall

echo 65536 > /proc/sys/fs/file-max

ulimit -n 65536

echo 1024 65000 > /proc/sys/net/ipv4/ip_local_port_range

ulimit -u 16384



#chmod 755 root.sh

#./root.sh

To use these parameters on every system bootup, add this line to rc.sysinit

#vi rc.sysinit

#!/bin/bash

......

......

/etc/rc.d/root.sh



e.Add Oracle user and group:

#groupadd dba

#useradd oracle -g dba -G dba

Attention: make sure that the oracle id and dba gid should be same in every server node.



f.Configure the network properties:

add resolv name to /etc/hosts

#vi /etc/hosts

......

202.205.16.71 oadbs1.bbi.edu.cn oadbs1

202.205.16.72 oadbs2.bbi.edu.cn oadbs2



add the following lines to /etc/sysctl.conf

#vi /etc/sysctl.conf

.......

.......

net.core.rmem_default=262144

net.core.wmem_default=262144

net.core.rmem_max=262144

net.core.wmem_max=262144



g.Configure the env variable

Add the following lines to /etc/profile

#vi /etc/profile

ORACLE_OWNER=oracle

ORACLE_BASE=/opt/oracle

ORACLE_HOME=/opt/oracle/product/9.2.0

OACLE_DOC=/opt/oracle/doc

ORACLE_SID=oadbs0

ORACLE_TERM=vt100

export ORACLE_OWNER ORACLE_BASE ORACLE_HOME ORACLE_DOC ORACLE_SID ORACLE_TERM

LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib

LD_ASSUME_KERNEL=2.4.1

export LD_LIBRARY_PATH LD_ASSUME_KERNEL

PATH=$PATH:$ORACLE_HOME/bin:/usr/bin:/bin:/usr/bin/X11:/usr/local/bin:/usr/sbin:/sbin

ORA_NLS33=$ORACLE_HOME/ocommon/nls/admin/data

NLS_LIBRARY_PATH=$ORACLE_HOME/lib

NLS_LANG=american_america.ZHS16GBK

THREADS_FLAG=native

CLASSPATH=$CLASSPATH:$ORACLE_HOME/network/jlib:$ORACLE_HOME/rdbms/jlib

TMPDIR=/tmp

ORACLE_SID=oadbs1

export PATH ORA_NLS33 NLS_LIBRARY_PATH NLS_LANG CLASSPATH TMPDIR THREADS_FLAG ORACLE_SID

Then reload the server to check the env taken effect.





2.Using ocfs

a.load hangcheck-timer:

add this line to /etc/modules.conf

options hangcheck-timer hangcheck_tick=30 hangcheck_margin=180



#insmod hangcheck-timer hangcheck_tick=30 hangcheck_margin=180



b.rpm the the packages(on every server node):

#rpm -ivh ocfs-2.4.21-EL-smp-1.0.12-1.i686.rpm

#rpm -ivh ocfs-tools-1.0.10-1.i386.rpm

#rpm -ivh ocfs-support-1.0.10-1.i386.rpm

#rpm -ivh ocfs-tools-debuginfo-1.0.10-1.i386.rpm

#ocfs_uid_gen -c



Then the /etc/ocfs.conf will be like this:

#

# ocfs config

# Ensure this file exists in /etc

#

node_name = oadbs1.bbi.edu.cn

ip_address = 202.205.16.71

ip_port = 7000

comm_voting = 1

guid = 5F52CFCE80E8FAA70C25000D601B1D46

#/sbin/load_ocfs



c.Mounting filesystem(on one node):

Make sure the SAN is correctly connect the every server node.

#fdisk /dev/sdb

make /dev/sdb1 to be a logical disk

#mkfs.ocfs -F -b 128 -L oradata -m /var/opt/oracle/oradata/ \
-u `id -u oracle` -g `id -g oracle` -p 0775 /dev/sdb1



add this line to /etc/fstab on every server node:

#mkdir -p /var/opt/oracle/oradata

#chown -R oracle:dba /var/opt/oracle

#vi /etc/fstab

.....

/dev/sdb1 /var/opt/oracle/oradata ocfs_netdev 0 0



reload the server to check if the filesystem mounted correctly.



3.Set up the rsh server(on every server node):

Install the rpm package:

#rpm -ivh rsh-server-0.17-17.i386.rpm

#vi /etc/xinetd.d/rsh

....

disable = no

....



#vi /home/oracle/.rhost

oadbs1 oracle

oadbs2 oracle



#/etc/init.d/xinetd restart



use this command to check the rsh server run correctly:

[oracle@oadbs1 compat]$rsh oadbs2 ls /




II.Installing the Oracle Cluster Manager(on one server node)

#mkdir -p /opt/oracle/product/9.2.0

#chown -R oracle:dba /opt/oracle/

#dd if=/dev/zero of=/var/opt/oracle/oradata/CMQuorumFile bs=1024 count=1024

#chown oracle:dba /var/opt/oracle/oradata/CMQuorumFile

#su oracle

$export DISPLAY=10.192.1.155:0

$cd /export/home0/oracle/Disk1/

$./runInstaller

choose " Oracle Cluster Manager 9.2.0.4.0"

Public Node Information:

public node1: oadbs1

public node2: oadbs2

Private Node Information:

private node1: oadbs1

private node2: oadbs2

Quorum Disk Information: /var/opt/oracle/oradata/orcl/CMQuorumFile



when installation is completed, every server node will have the ocm,then run the following on every server node:

$cd $ORACLE_HOME/oracm/admin/

$vi cmcfg.ora

ClusterName=Oracle Cluster Manager, version 9i

MissCount=210

PrivateNodeNames=oadbs1 oadbs2

PublicNodeNames=oadbs1 oadbs2

ServicePort=9998

KernelModuleName=hangcheck-timer

CmDiskFile=/var/opt/oracle/oradata/CMQuorumFile

HostName=oadbs1

run the ocm as root on every node:

$su

#cd $ORACLE_HOME/oracm/bin

#./ocmstart.sh

use `ps -ef` to check if the oracm is running on every server node.
III.Installing the Real Application Clusters(on one sever node)

#su oracle

$vi /var/opt/oracle/srvConfig.loc

srvconfig_loc=/var/opt/oracle/oradata/SharedSrvctlConfigFile



$cd /export/home0/oracle/Disk1

$export DISPLAY=10.192.1.155:0

$./runInstaller

Welcome Screen: "Click Next"

Cluster Node Selection: select all the nodes then click next.

if not all the nodes you want to install display on this screen,

you should abort to check if all the nodes run the oracm correctly.

select "Enterprise Edition"

select "Software Only"

and then start install
IV. Installing Data base:

$srvconfig -init

$gsdctl start (on every server node)

$vi $ORACLE_HOME/network/admin/listener.ora

lsnr1 =

(DESCRIPTION_LIST =

(DESCRIPTION =

(ADDRESS_LIST =

(ADDRESS = (PROTOCOL = TCP)(HOST = 202.205.16.71)(PORT = 1521))

)

)

)



lsnr2 =

(DESCRIPTION_LIST =

(DESCRIPTION =

(ADDRESS_LIST =

(ADDRESS = (PROTOCOL = TCP)(HOST = 202.205.16.72)(PORT = 1521))

)

)

)

$vi $ORACLE_HOME/network/admin/tnsnames.ora

oadbs=

(description=

(failover=on)

(load_balance=on)

(address_list=

(address=(protocol=tcp)(host=202.205.16.71)(port=1521))

(address=(protocol=tcp)(host=202.205.16.72)(port=1521))

)

(connect_data=(service_name=oadbs))

)



oadbs1=

(description=

(address_list=

(address=(protocol=tcp)(host=202.205.16.71)(port=1521))

)

(connect_data=(service_name=oadbs)

(instance_name=oadbs1)

)

)



oadbs2=

(description=

(address_list=

(address=(protocol=tcp)(host=202.205.16.72)(port=1521))

)

(connect_data=

(service_name=oadbs)

(instance_name=oadbs2)

)

)



$dbca -datafileDestination /var/opt/oracle/oradata

select all the nodes you want to install.

"new database"

....

create database.


V.test the Rac server.

1.mount the database on every server node:

$sqlplus /nolog as sysdba

SQL>startup



2.start listener on every server node:

$lsnrctl start



3.test the server

$lsnrctl status

Services Summary...

Service "oadbs" has 2 instance(s).

Instance "oadbs1", status READY, has 1 handler(s) for this service...

Instance "oadbs2", status READY, has 1 handler(s) for this service...

Service "oadbsXDB" has 2 instance(s).

Instance "oadbs1", status READY, has 1 handler(s) for this service...

Instance "oadbs2", status READY, has 1 handler(s) for this service...

The command completed successfully


$tnsping oadbs

Used TNSNAMES adapter to resolve the alias

Attempting to contact (description= (failover=on) (load_balance=on) (address_list= (address=(protocol=tcp)(host=202.205.16.71)(port=1521)) (address=(protocol=tcp)(host=202.205.16.72)(port=1521))) (connect_data=(service_name=oadbs)))

OK (0 msec)


Installation Complete! Good Luck!
安装的时候一定要在前期工作做好。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行