|
  
- UID
- 5005
- 帖子
- 562
- 精华
- 20
- 积分
- 439
- 人气值
- 55 点
- 努力值
- 1074 点
- 推广注册人数
- 0 个人
- 阅读权限
- 100
- 在线时间
- 170 小时
- 注册时间
- 2006-9-11
- 最后登录
- 2008-11-29
  
|
楼主
发表于 2006-11-3 09:00
| 只看该作者
10G RAC: Tip Collection (转)
Q1. How to configure "listener.ora" and "tnsnames.ora"
A1. Usually, NETCA will launch automatically during the DBCA.
IF you have encountered some errors or want to reconfig
them later, please do the following things:
(1) Launch NETCA ;
(2) Choose the option "Cluster" in the first page;
(3) Choose one type such as "create listener",
"create local net service";
(4) Test the new created listener or local net service until success;
(5) By default, the application "srvctl" can only manage those
listeners with the suffix(host_name),So,please be very carefully
when modifying;
(6) Check and modify the initialization paratemter file if possible;
Steps:
Create a new initialization parameter file 'init.ora' on host (test1),
this file will be shared by each instance.
1. Invoke SQLPLUS, issue the following command:
SQL> create pfile='xxx' from spfile;
2. open "init.ora", add the following lines:
orcl1.local_listener=listener_orcl1
orcl2.local_listener=listener_orcl2
orcl1.remote_listener=listeners_orcl
orcl2.remote_listener=listeners_orcl
remove or comment this line:
*.remote_listener=listeners_orcl
(* represents this parameter will be used by each instance)
save the modification.
3. Invoke SQLPLUS again
SQL> shutdown immediate;
SQL> exit
SQL> startup pfile='xxx'
SQL> create spfile from pfile='xxx'
SQL> shutdown immediate;
SQL> exit
SQL> startup (new spfile will be used this time)
Note:
. If you don't change the listener's default port(1521), It's
unnecessary to add SID's entry in "listener.ora", Oracle
background process PMON will discovery all available
services every 60 seconds.
. If you use listener's default port(1521), It's unnecessary to
config parameter 'instance_name.local_listener=xxx' in
"init.ora" , you also shouldn't add this entry in
"tnsnames.ora" (local_listener_name = ...)
If you changed the listener's port , remember to
execute "emca" to sync all related EM configuration
files. for example:
emca -x: drop the current repository;
emca -r: skip the creation of repositry, only update
related files.
For example, a typical "listener.ora" should be like this:
listener_hostname =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(host=xxx)(port=1521))
(ADDRESS = (PROTOCOL = TCP)(host=your-vip-addr)(port=1521))
)
sid_list_listener_hostname =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = xxx)
(PROGRAM = extproc)
)
(SID_DESC =
(SID_NAME=xxx)
(ORACLE_HOME=xxx)
)
)
For example, a typical "tnsnames.ora" should be like this:
listener_hostname1=(address=(protocol=tcp)(host=test1)(port=1521))
listener_hostname2=(address=(protocol=tcp)(host=test2)(port=1521))
listeners_orcl =
(address_list =
(address=(protocol=tcp)(host=test1-vip)(port=1521))
(address=(protocol=tcp)(host=test2-vip)(port=1521))
)
# database connection: orcl
orcl =
(description =
(load_balance=on)
(address=(protocol=tcp)(host=test1-vip)(port=1521))
(address=(protocol=tcp)(host=test2-vip)(port=1521))
(connect_data =
(service_name=orcl)
)
)
# instance connection: orcl1
orcl1 =
(description =
(address=(protocol=tcp)(host=test1-vip)(port=1521))
(address=(protocol=tcp)(host=test2-vip)(port=1521))
(load_balance = yes)
(connect_data =
(server=dedicated)
(service_name=orcl)
(instance_name=orcl1)
)
)
# instance connection: orcl2
orcl2 =
(description =
(address=(protocol=tcp)(host=test1-vip)(port=1521))
(address=(protocol=tcp)(host=test2-vip)(port=1521))
(load_balance = yes)
(connect_data =
(server=dedicated)
(service_name=orcl2)
(failover_mode =
(type = select)
(method = basic)
(retries=180)
(delay=5)
)
)
)
Q2. How to recofig VIP ?
A2:
(1) delete the database using DBCA;
(2) delete the ASM(if configured) using documented procedure in 10g
Release notes;
(3) delete listeners using NetCA;
(4) delete nodeapps using srvctl as root user for all nodes.
for example:
srvctl stop nodeapps -n <node>
srvctl remove nodeapps -n <node>
Then you rerun vipca to reconfigure the VIPs, run netca to configure
listeners and dbca to create database to arrive at your initial state.
Q3: How to configure EM environment for RAC ?
1. Usually we only need run DBCA again to check the following
things exist:
. Check whether a schema "SYSMAN" has been created
(select username from all_users);
. Check if tablespace "SYSAUX" exists
(select tablespace_name from dba_tablespaces);
. Check if there is a directory <hostname_sid> has been
created under $ORACLE_HOME;
. Issue these commands to check dbconsole's status:
emctl start(stop/status) dbconsole
2. Trouble Shooting:
Q: Target's information is wrong or lost
A:
. Go to directory: $ORACLE_HOME/hostname_sid/emd,
open "targets.xml" to check if all available targets have
been discovered by EM;
. If the file <targets.xml> doesn't include all targets'
information you need, You can try:
emctl stop dbconsole;
remove all files under these directories;
$ORACLE_HOME/hostname_sid/sysman/emd/upload
$ORACLE_HOME/hostname_sid/sysman/emd/state
check file <targets.xml> again, make sure that at least
agent and host's info can be found from this file;
emctl start dbconsole; --wait for the new metic data
to be uploaded into the repository
3. If you've modified some settings of EM and the repository
has been created, you can execute "emca -r " to configure
the EM repository again;
4. Launch "http://host_name: port_number/em" on all nodes and
check them.
[2004-11-04 add]
Q4: How to enable database's archivelog mode in RAC
environment.
A4: 假设有两个instance, rac1 和 rac2.
步骤:
1. 停掉rac2
export ORACLE_SID=rac2
sqlplus /nolog
SQL> conn / as sysdba
SQL> shutdown immediate
2. 因为初始化参数文件放在共享磁盘上,而且是以spfile
的格式存放的, 我们需要先生成 for rac1 的pfile,然后
再停掉rac1:
export ORACLE_SID=rac1
sqlplus /nolog
SQL> conn / as sysdba
SQL> create pfile '...' from spfile;
SQL> shutdown immediate
3. 修改这个生成的pfile, 将参数cluster_database的值
改成false, 如果使用快速恢复区,可以不设置
log_archive_dest_n(n=1,2,,,,9), 并且配置参数:
db_recovery_file_dest= ...
db_recovery_file_dest_size=...
4. 重新启动rac1, 注意只启动到mount 状态
SQL> startup mount pfile ='...'
SQL> alter database archivelog;
下面这一步是可选的:
SQL> alter database flashback on;
5. 关闭实例rac1,将参数cluster_database的值改回true,
再重新启动实例rac1
sql> create spfile from pfile='...';
sql> startup
sql> archive log list
sql> alter system switch logfile;
6. 对于实例rac2 重复这些操作
[2004-11-04 add]
Q5: EM can not detect any cluster target (I can not find any
entry from targets.xml), how to solve this issue?
A5: In EM Grid Control, you should try these steps:
First, You should verify if the agent work normally.
From $AGENT_HOME, there should be <hostname_1>,
<hostname_2>,... under this directory. If you can't find it,
which indicates the agent installation is unsuccessfully,
maybe you need reinstall agent.
Secondly, please make sure that the environment variable
$CRS_HOME is properly set (from this script: $AGENT_HOME/bin/emctl)
Finally, stop the agent then restart it again, If the
communication between oms and agent is successful,
which indicates the metric data can be uploaded to
repository database (type "emctl status agent" to check
the agent's status)
Note: please check firewall's setting carefully before you
start to investigate.
10G RAC: Tip Collection II
今天增加一些关于诊断方面的FAQ.
RAC的许多问题出在安装过程中. 解决了安装的问题后,
诊断就是必不可少的了。最明显的问题就是很多人感
觉安装配置好RAC后系统的性能反而下降了,这就需
要结合相关的日志,脚本和诊断工具去完成了.
Q1: Statspack报告中发现大量的"Class Slave Wait"以及
"ASK Background Timer wait". 怎样去诊断?
A1: 大致上说, "Slave Wait" 可以看成是idle wait event. 因为
它在等待系统发出下一步的指令。MetaLink上可以搜索到
相关的Notes.
"ASK Background Timer wait" 说明数据库 Instance正在等待
ASM Instance的相应,首先需要检查参数配置,然后检查
日志文件看看有没有线索.
Q2: 在CRS安装过程中发生错误"Public Node not available
/Reachable", 怎样诊断?
A2: 从下面几方面考虑一下;
. 对runInstaller程序加上debug选项:
./runInstaller -J-DTRACING.ENABLED=true -J-
DTRACING.LEVEL=2
. 上Metalink搜索, 感觉很可能是SSH配置有问题.
. 如果问题发生在windows平台:
首先用net use 命令检查网络连接;
其次, 检查当前用户是否在"local admin"组内,并且这个
用户在所有需要安装的节点上都存在;
检查用户的权限: "log on as a batch job"是否已经被授予?
|
提供Oracle ERP(EBS 11i/R12)高性能系统架构方案,实施和优化以及Oracle DBA优化和培训
msn:zlc158@hotmail.com |
|