Oracle11g for Windows ADRCI Issue

ADRCI (ADR Command Interpreter) 无疑是DBA在11g中管理数据库跟以前最不一样的地方,当然其实本质上没什么不一样,只是一个崭新的工具进入DBA的日常工作总是让人感到很有兴趣。

但是Windows平台下的ADRCI却有个小陷阱,show alert恐怕是进入ADRCI命令行提示符下大多数DBA第一个会敲上去看一看的命令吧。

D:\Temp>adrci

ADRCI: Release 11.1.0.6.0 – Beta on Sat Nov 17 20:51:49 2007

Copyright (c) 1982, 2007, Oracle. All rights reserved.

ADR base = “d:\oracle”
adrci> show alert

Choose the alert log from the following homes to view:

1: diag\rdbms\orcl11g\orcl11g
2: diag\tnslsnr\leyzhang-cn\listener
Q: to quit

Please select option: 1
Output the results to file: c:\docume~1\leyzhang\locals~1\temp\alert_3108_2324_o
rcl11g_1.ado
‘vi’ is not recognized as an internal or external command,
operable program or batch file.

Please select option:

在windows平台下show alert仍然试图去调用vi命令,而很明显vi并不存在于windows操作系统中,因此show alert命令失败。

Ricky,我知道你是测试Solaris平台下11g的,那也谏言一下,在Windows平台下还是不应该默认去调用vi的吧。。。当然,这不是大问题,毕竟,show alert -tail还是可以用的,呵呵。

解决方法:
在执行adrci之前先设置EDITOR环境变量,比如设置成notepad。
set EDITOR=notepad

备注:
如果想在Windows下使用一系列UNIX下的命令,可以安装MKS Toolkit,很好用的一套程序,包括vi,ls,tail,touch,cat等等。

Update@2008-12-12

如果在show alert -tail之后,遇到以下错误。

adrci> show alert -tail
DIA-48449: Tail alert can only apply to single ADR home

则需要先set home,比如:
adrci> show home
ADR Homes:
diag\clients\user_kenneth_zhang\host_366275074_11
diag\clients\user_system\host_366275074_11
diag\rdbms\orcl11g\orcl11g
diag\tnslsnr\prcsgil00066\listener
adrci> set home diag\rdbms\orcl11g\orcl11g
adrci> show alert -tail
2008-12-12 14:44:33.456000 +08:00
Starting background process SMCO
FBDA started with pid=7, OS id=4212
SMCO started with pid=18, OS id=3084
2008-12-12 14:44:34.628000 +08:00
replication_dependency_tracking turned off (no async multimaster replication fou
nd)
2008-12-12 14:44:37.425000 +08:00
Starting background process QMNC
QMNC started with pid=20, OS id=3412
2008-12-12 14:44:55.974000 +08:00
db_recovery_file_dest_size of 4096 MB is 3.91% used. This is a
user-specified limit on the amount of space that will be used by this
database for recovery-related files, and does not reflect the amount of
space available in the underlying filesystem or ASM diskgroup.
2008-12-12 14:45:28.882000 +08:00
Completed: ALTER DATABASE OPEN
adrci>

3 thoughts on “Oracle11g for Windows ADRCI Issue

Leave a Reply

Your email address will not be published. Required fields are marked *