我以 SYSTEM 用户身份登录 Oracle XE 实例。当我尝试运行创建用户、表和约束的脚本时,ORA-01031
出现错误。脚本如下:
CREATE USER AA IDENTIFIED BY AA DEFAULT TABLESPACE users TEMPORARY TABLESPACE temp;
CREATE USER BB IDENTIFIED BY BB DEFAULT TABLESPACE users TEMPORARY TABLESPACE temp;
GRANT ALL PRIVILEGES TO AA WITH ADMIN OPTION;
GRANT ALL PRIVILEGES TO BB WITH ADMIN OPTION;
...
CREATE TABLE ...
CREATE INDEX ...
...
ALTER TABLE "BB"."B_TABLE" ADD CONSTRAINT "FK_BB_AA" FOREIGN KEY ("AA_ID")
REFERENCES "AA"."A_TABLE" ("ID") ENABLE; -- this line report the error
不能在 Oracle XE 上添加这个约束吗?