暂无图片
暂无图片
暂无图片
暂无图片
暂无图片

遭遇SP2-0734的尴尬

原创 Roger 2011-09-29
2422

今天去给某金融客户做数据库节前巡检,在执行 healthcheck.sql 以及 dba_snapshot_database_9i.sql
的时候,发现执行报错 sp2-0734,该报错无法识别,怪了。当时我怀疑可能是跟环境变量或shell有关系,
经过测试,我发现手工 vi test.sh 加入如下信息:


sqlplus "/as sysdba"
@ ?/rdbms/admin/spreport.sql 后,发现 @ 是无法显示的,这是何解?

当时使用了如下方式暂时解决了此问题:

stty kill ^U

然后再次执行脚本即正常了。

晚上回家查了下MOS,发现了几个相关的文档,其中一个文档就提到了 stty kill ^U 的方法。

下面是相关的几个MOS文档:


文档1:

SP2-0734 and/or SP2-0042 Error Immediately When Attempting To Run catpatch.sql [ID 336920.1]

Symptoms

After applying a patchset, the post install documentation instructs you to run the
$ORACLE_HOME/rdbms/admin/catpatch.sql script. The script does not run and instead
produces the error below:

SQL> @catpatch.sql

SP2-0734: unknown command begining "catpatch.s..." ....

Cause

This is due to the display terminal keyboard configuration of the kill character.

Solution

The problem is with the display terminal keyboard settings. The sqlplus session had trouble
interpreting the "@" sign, because it was assigned in the terminal to the "kill" setting.
The catpatch.sql script was supposed to be run as "@catpatch.sql" and since the "@" sign had
a completely different meaning for this OS session, sqlplus only saw "catpatch.sql".

The solution is to change the display terminal keyboard setting of the kill character to something else.
For example:

# stty kill ^u

After making this change the script is interpreted correctly and runs as it should.


文档2:

Error SP2-0734 "Unknown Command Beginning ..." When Using SQL*Plus to Connect to Database [ID 823374.1]

Symptoms

Trying to connect to database with SQL*Plus fails with the following error:

Error

SP2-0734: unknown command beginning "yyy..." rest of line ignored.
Even the command "sqlplus /nolog" fails with same error.

Changes

This error may occur if there are:

* Recent changes to glogin.sql script.
* Any corruption of this glogin.sql file.

Cause

Any invalid entries in glogin.sql file causes this issue. The glogin.sql script gets executed
when users invoke sqlplus, even with nolog option.

Solution

Check if there any invalid commands defined in glogin.sql (which usually resides in $ORACLE_HOME/sqlplus/admin).

If not, then check if there is any issue with this file itself. To do that, rename this file to bkp_glogin.sql
and try invoking sqlplus again.


文档3:

SP2-0734 Calling PL/SQL Procedure from SQL*Plus [ID 119299.1]

Problem Description
-------------------

You are trying to call a PL/SQL stored procedure from SQL*Plus but you get the following error:

SP2-0734: unknown command beginning "..." - rest of line ignored

Your call looks something like:

SQL> myprocedure ('some literal parameter');

Solution Description
--------------------

When calling a PL/SQL stored procedure from SQL*plus you must call it using the EXECUTE
(or EXEC) command or via a PL/SQL BEGIN-END block as follows:

1) EXEC myprocedure ('some literal parameter');

or

2) BEGIN
myprocedure('some literal parameter');
END;
/

Explanation
-----------

EXECUTE is a SQL*plus command and is used for the following purpose:

Executes a single PL/SQL statement. The EXECUTE command is often useful when you want to execute
a PL/SQL statement that references a stored procedure.

Additional Search Words
-----------------------
SP2-734

「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论