Search This Blog

Sunday, July 20, 2008

Oracle Reserved Words

During RMAN recovery i faced below problem.

ORA-01157: cannot identify/lock data file 5 - see DBWR trace file

ORA-01110: data file 5: 'F:\ORACLE\PRODUCT\10.1.0\ORADATA\TEST\TEST01.DBF'

Datafile belong to test tablespace is lost so i have to perform recovery, interesting i have valid database backup.

RMAN> run

2> {

3> restore tablespace TEST;
RMAN-00571: ===========================================================

RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============

RMAN-00571: ===========================================================

RMAN-00558: error encountered while parsing input commands

RMAN-01005: syntax error: found "test": expecting one of: "double-quoted-string, identifier, single-quoted-string"

RMAN-01007: at line 3 column 20 file: standard input

NOTE: I am getting above error becuase tablespace name "TEST" is reserved word for RMAN. so i need to use double quotes with tablespace name.

In this post i will show you how we can check oracle reserved words.

In Oracle 9i

SQL> select count(*) from GV$RESERVED_WORDS;
COUNT(*)

----------

775

In Oracle 10g

SQL> select count(*) from GV$RESERVED_WORDS;
COUNT(*)

----------

1063

SQL> select * from GV$RESERVED_WORDS where keyword like 'TEST';

INST_ID KEYWORD LENGTH

---------- ------------------------------ ---------- 1 TEST 4

No comments: