rem Delete instance and configset entries with entryid >= 2000
rem
delete from ct_objectclass where entryid in (select entryid from ct_dn where RDN like '%instance%' AND PARENTDN like '%cn=subregistrysubentry%' AND entryid>=2000);

delete from ds_attrstore where entryid in (select entryid from ct_dn where RDN like '%instance%' AND PARENTDN like '%cn=subregistrysubentry%' AND entryid>=2000);

delete from ct_dn where RDN like '%instance%' AND PARENTDN like '%cn=subregistrysubentry%' AND entryid>=2000;

delete from ct_cn where entryid>=2000 AND PARENTDN like '%cn=subregistrysubentry%' AND ATTRVALUE like '%instance%';

delete from ct_objectclass where entryid in (select entryid from ct_dn where RDN like '%configset%' AND PARENTDN like '%cn=subconfigsubentry%' AND entryid>=2000);

delete from ds_attrstore where entryid in (select entryid from ct_dn where RDN like '%configset%' AND PARENTDN like '%cn=subconfigsubentry%' AND entryid>=2000);

delete from ct_dn where RDN like '%configset%' AND PARENTDN like '%cn=subconfigsubentry%' AND entryid>=2000;

delete from ct_cn where entryid>=2000 AND PARENTDN like '%cn=subconfigsubentry%' AND ATTRVALUE like '%configset%';
rem
COMMIT;
EXIT;
