How to delete project using queries in right sequence
Note: Take backup of your database before performing these scripts. Do not attempt to run these delete scripts in production environment.
-- delete history of the project
delete from EPUB_PR_HISTORY where project_id in ('prj213002','prj200001');
--delete history of the process
delete from EPUB_PROC_HISTORY where process_id in
(select process_id from epub_process where project in ('prj213002','prj200001'));
-- delete task information of process
delete from EPUB_PROC_TASKINFO where id in
(select process_id from epub_process where project in ('prj213002','prj200001'));
-- delete states of project
delete from EPUB_IND_WORKFLOW where process_id in
(select process_id from epub_process where project in ('prj213002','prj200001'));
-- delete the process
delete from epub_process where project in ('prj202001','prj213002');
-- Removing locks of the project if any
delete from avm_asset_lock where workspace_id in
(select id from avm_devline where name in
(select workspace from epub_project where project_id in ('prj213002','prj213002')));
-- finally delete the project
delete from epub_project where project_id in ('prj202001','prj213002');
commit;
if project is still not deleted, try execute below queries
----------------------------------------------------------
delete from fl_pub.epub_dep_log where dep_id='122700001';
delete from fl_pub.epub_deploy_proj where deployment_id='122700001';
delete from fl_pub.epub_deployment where deployment_id='122700001';
delete from fl_pub.das_depl_options where deployment_id='122700001'
delete from fl_pub.das_deployment where deployment_id='122700001';
delete from FL_PUB.epub_pr_tg_dp_id where deployment_id='122700001';
delete from FL_PUB.epub_pr_tg_dp_ts where project_id='prj1242002' and TARGET_ID='tar123';
delete from FL_PUB.WB_WBENCH_TILE where project_id not in (select project_id from FL_PUB.epub_project);
delete from FL_PUB.WB_WORKBENCH where project_id not in (select project_id from FL_PUB.epub_project);
delete from FL_PUB.EPUB_INT_PRJ_HIST where project_id not in (select project_id from FL_PUB.epub_project);
delete from FL_PUB.EPUB_PR_TG_AP_TS where project_id not in (select project_id from FL_PUB.epub_project);
delete from FL_PUB.EPUB_PR_TG_STATUS where project_id not in (select project_id from FL_PUB.epub_project);
delete FROM fl_pub.das_depl_repmaps;
delete FROM fl_pub.das_dep_fail_info where deployment_id='122700001'
To find assets locks and remove if any
(select id from avm_devline where name in
(select workspace from epub_project where project_id = 'prj280002'))
To find conflicting projects
select * from epub_project where workspace in
(select name from avm_devline where id in
(select workspace_id from avm_asset_lock))
To give all conflicting projects for a particular asset.
select * from epub_project where workspace in
(select name from avm_devline where id in
(select workspace_id from dcs_category where category_id = 'cat3484800002' and category_id in
(select repository_id from avm_asset_lock where descriptor_name='category')))
Comments
Post a Comment