Saturday, 30 April 2016

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: 'u01/app/oracle/oradata/testdb/test.dbf’

Note: My tablespace name is ‘TEST’

Datafile belong to ‘test tablespace ‘is lost so i have to perform recovery,
And I have valid database backup too.

RMAN>  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 because 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:

Post a Comment