Skip to Main Content

SQLcl: MCP Server & SQL Prompt

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

alias problem

RobertOrtelJan 17 2017 — edited Jan 18 2017

Hi,

I want to have an alias for the command "alter database datafile <id> resize <size>". So I created such

alias dfrz=alter database datafile :file_id resize :file_size;

But using this one fails with strange errors:

SQL> dfrz 3 1G;

Error starting at line : 1 File @ /ALIAS/dfrz

In command -

alter database datafile :file_id resize :file_size

Error report -

ORA-02236: Ungültiger Dateiname

02236. 00000 -  "invalid file name"

*Cause:    A character string literal was not used in the filename list

           of a LOGFILE, DATAFILE, or RENAME clause.

*Action:   Use correct syntax.

SQL>

What I imagined was that the parameter may be given as strings instead of numbers, but that would mean that the alias would be translated into

alter database datafile '3' resize '1G';

but this produces ORA-02237 instead of ORA-02236.

So, how to make this alias work? What is wrong with it?

This post has been answered by Gary Graham-Oracle on Jan 17 2017
Jump to Answer
Comments
Post Details
Added on Jan 17 2017
2 comments
488 views