j & # 39; uses oracle12C as a database and using get_ddl to get ddl of database objects. Now, I have two tables Table 1 and Table 2 and Table1 has partition, Table2 uses the main constraint of Table1 as a reference constraint and also uses PARTITIONED BY REFERENCE.For example: –
TABLE1 is: –
create table parent_emp( empno number primary key, job varchar2(20), sal number(7,2), deptno number(2) ) partition by list(job) ( partition p_job_dba values ('DBA'), partition p_job_mgr values ('MGR'), partition p_job_vp values ('VP')
TABLE2 is: –
CREATE TABLE "SECONDARYUSER"."REFERENCE_EMP" ( "ENAME" VARCHAR2(10), "EMP_ID" NUMBER, "EMPNO" NUMBER, CONSTRAINT "FK_EMPNO" FOREIGN KEY ("EMPNO") REFERENCES "SECONDARYUSER"."PARENT_EMP" ("EMPNO") ENABLE ) PARTITION BY REFERENCE ("FK_EMPNO") (PARTITION "P_JOB_DBA" , PARTITION "P_JOB_MGR" , PARTITION "P_JOB_VP" ) "
My problem is that I want to disable the activation constraints of table1 and table2, but when I run the script, I get a tracking error.
alter table parent_emp disable the constraint SYS_C0010720 cascade;
it is used to disable the primary key of Table1 but generating the following error: –
02297. 00000 - "cannot disable constraint (%s.%s) - dependencies exist" *Cause: an alter table disable constraint failed becuase the table has foriegn keys that are dpendent on this constraint. *Action: Either disable the foreign key constraints or use disable cascade
I understand this, so I tried to disable the constraint of table2 and execute the following query.
alter table reference_emp disable FK_EMPNO constraint cascading;
but that gives me the following error: –
alter table reference_emp disable constraint FK_EMPNO cascade Error report: SQL Error: ORA-14650: operation not supported for reference-partitioned tables
Please suggest me how can I disable, activate the constraints.