How to Resolve ORA-00905: missing keyword

  • by

Tried to add a new data file to a tablespace, but it failed with ORA-00905.

SQL> ALTER TABLESPACE EXAMPLE ADD '/u01/app/oracle/oradata/ORCLCDB/ORCLPDB1/example02.dbf' SIZE 10M AUTOEXTEND ON NEXT 10M MAXSIZE UNLIMITED;
ALTER TABLESPACE EXAMPLE ADD '/u01/app/oracle/oradata/ORCLCDB/ORCLPDB1/example01.dbf' SIZE 10M AUTOEXTEND ON NEXT 10M MAXSIZE UNLIMITED
                             *
ERROR at line 1:
ORA-00905: missing keyword

ORA-00905 means that an expected keyword is missing from the statement in the specific position of statement, usually, it's a syntax error.

It turns out that we miss the keyword DATAFILE in the statement.

SQL> ALTER TABLESPACE EXAMPLE ADD DATAFILE '/u01/app/oracle/oradata/ORCLCDB/ORCLPDB1/example02.dbf' SIZE 10M AUTOEXTEND ON NEXT 10M MAXSIZE UNLIMITED;

Tablespace altered.

Errors like ORA-00905, we don't have to worry about it, it always points out the position where keyword is missing. Similarly, error ORA-02142 could also be thrown by SQL parser if we missed a keyword.

Leave a Reply

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