The answer to your question is that it won't let you.
Oracle is stricter than other RDBMSes and you'll get an ORA-00904: invalid identifier
if you try a CREATE TABLE
with a reserved word.
However, you can force it to do so by surrounding the name in quotes, for example:
CREATE TABLE a
(
"date" date
);
... But in doing so, you're essentially admitting you're doing something wrong (plus it makes the name case-sensitive).
Best practice would be to avoid case-sensitive object names, and avoid using reserved words.
Documentation link here, with a list of reserved words, which backs up what I've stated:
You cannot use Oracle SQL reserved words as nonquoted identifiers.
Quoted identifiers can be reserved words, although this is not
recommended
In summary: Just don't.
There is no such one command to do this kind of migration of a schema because as you mentioned, Oracle Express edition doesn't support all the features that are used in the Enterprise edition. However, I tried to collect some of the useful parameters which can be used during expdp/impdp
to modify or include/exclude (un)wanted objects and features.
partition declarations can be omitted.
In that case you can use PARTITION_OPTIONS
parameter in impdp
.
PARTITION_OPTIONS=[NONE | DEPARTITION | MERGE]
.
PARTITION_OPTIONS
storage declarations omitted or simplified (e.g. as little as possible initial space reserved for tables).
TRANSFORM
parameter in impdp
enables you to alter object creation DDL for objects being imported.
TRANSFORM = transform_name:value[:object_type]
TRNASFORM
tablespace declarations omitted or replaced (a single tablespace used in XE).
You can use REMAP_TABLESPACE
parameter during impdp
on Oracle XE instance.
REMAP_TABLESPACE=source_tablespace:target_tablespace
REMAP_TABLESPACE
materialized views with some advanced features can be simplified or replaced with simple views.
I think you need to import DDL of such materialized views into a SQL FILE then create view manually.
jobs can be omitted.
You can use EXCLUDE
parameter to exclude jobs but currently, Data Pump Export/Import can exclude/include jobs which were created with DBMS_JOB
.
Reference
java functions (scarsely used but present in one pl/sql package) can be disabled or imported with compilation errors.
You can use EXCLUDE
to ignore such java classes.
EXCLUDE=JAVA_CLASS
Now you can combine these parameters to form your expdp/impdp
command.
Note: All included reference links are related to Oracle 11g version, please refer to the Oracle documentation related to your version.
Best Answer
You could create a system trigger like this:
BEGIN
However, there are several problems. As user with
ADMINISTER DATABASE TRIGGER
system privilege (e.g. DBA) ignores theRAISE_APPLICATION_ERROR
, it he can do it anyway.Another problem is: What so you consider as "reserved word"? Check this example:
You see
DATE
is clearly reserved, butPASSWORD
has the same attributes likeNAME
which should be no problem, I assume.