DBA Data[Home] [Help]

APPS.AD_ZD_ADOP dependencies on AD_ADOP_SESSIONS

Line 481: select max(adop_session_id) into l_session_id from ad_adop_sessions

477: l_cutover_status varchar2(1);
478: l_session_id number;
479: begin
480: if ( p_session_id is null) then
481: select max(adop_session_id) into l_session_id from ad_adop_sessions
482: where appltop_id=p_appltop_id and node_name=p_node_name;
483: else
484: l_session_id:=p_session_id;
485: end if;

Line 487: from ad_adop_sessions

483: else
484: l_session_id:=p_session_id;
485: end if;
486: select cutover_status into l_cutover_status
487: from ad_adop_sessions
488: where appltop_id=p_appltop_id
489: and node_name=p_node_name
490: and adop_session_id= l_session_id;
491: return l_cutover_status;

Line 503: lock table ad_adop_sessions in exclusive mode nowait;

499: begin
500:
501: for i in 1..p_num_tries loop
502: begin
503: lock table ad_adop_sessions in exclusive mode nowait;
504: select count(*) into l_is_locked from ad_adop_sessions where adop_session_id=0 and EDITION_NAME='LOCK';
505: if (l_is_locked = 0) then
506: insert into ad_adop_sessions
507:

Line 504: select count(*) into l_is_locked from ad_adop_sessions where adop_session_id=0 and EDITION_NAME='LOCK';

500:
501: for i in 1..p_num_tries loop
502: begin
503: lock table ad_adop_sessions in exclusive mode nowait;
504: select count(*) into l_is_locked from ad_adop_sessions where adop_session_id=0 and EDITION_NAME='LOCK';
505: if (l_is_locked = 0) then
506: insert into ad_adop_sessions
507:
508:

Line 506: insert into ad_adop_sessions

502: begin
503: lock table ad_adop_sessions in exclusive mode nowait;
504: select count(*) into l_is_locked from ad_adop_sessions where adop_session_id=0 and EDITION_NAME='LOCK';
505: if (l_is_locked = 0) then
506: insert into ad_adop_sessions
507:
508:
509: (ADOP_SESSION_ID,PREPARE_STATUS,APPLY_STATUS,FINALIZE_STATUS,CUTOVER_STATUS,CLEANUP_STATUS,ABORT_STATUS,STATUS,EDITION_NAME,NODE_NAME)
510: values (0,'X','X','X','X','X','X','Y','LOCK',p_node_name);

Line 522: log(l_mod_name, 'ERROR', 'ERROR: Unable to acquire lock on ad_adop_sessions table.');

518: when resource_busy then
519: dbms_lock.sleep(p_wait_interval);
520: end;
521: end loop;
522: log(l_mod_name, 'ERROR', 'ERROR: Unable to acquire lock on ad_adop_sessions table.');
523: RAISE_APPLICATION_ERROR(-20010,'ERROR: Unable to acquire lock on ad_adop_sessions table.');
524:
525: end LOCK_SESSIONS_TABLE;
526:

Line 523: RAISE_APPLICATION_ERROR(-20010,'ERROR: Unable to acquire lock on ad_adop_sessions table.');

519: dbms_lock.sleep(p_wait_interval);
520: end;
521: end loop;
522: log(l_mod_name, 'ERROR', 'ERROR: Unable to acquire lock on ad_adop_sessions table.');
523: RAISE_APPLICATION_ERROR(-20010,'ERROR: Unable to acquire lock on ad_adop_sessions table.');
524:
525: end LOCK_SESSIONS_TABLE;
526:
527: PROCEDURE UNLOCK_SESSIONS_TABLE(p_node_name in varchar2,p_wait_interval in number,p_num_tries in number) is

Line 536: lock table ad_adop_sessions in exclusive mode nowait;

532: begin
533:
534: for i in 1..p_num_tries loop
535: begin
536: lock table ad_adop_sessions in exclusive mode nowait;
537: select count(*) into l_is_locked from ad_adop_sessions where adop_session_id=0 and EDITION_NAME='LOCK' and node_name=p_node_name;
538: if (l_is_locked <> 0) then
539: delete from ad_adop_sessions where adop_session_id=0 and EDITION_NAME='LOCK' and node_name=p_node_name;
540: commit;

Line 537: select count(*) into l_is_locked from ad_adop_sessions where adop_session_id=0 and EDITION_NAME='LOCK' and node_name=p_node_name;

533:
534: for i in 1..p_num_tries loop
535: begin
536: lock table ad_adop_sessions in exclusive mode nowait;
537: select count(*) into l_is_locked from ad_adop_sessions where adop_session_id=0 and EDITION_NAME='LOCK' and node_name=p_node_name;
538: if (l_is_locked <> 0) then
539: delete from ad_adop_sessions where adop_session_id=0 and EDITION_NAME='LOCK' and node_name=p_node_name;
540: commit;
541: return;

Line 539: delete from ad_adop_sessions where adop_session_id=0 and EDITION_NAME='LOCK' and node_name=p_node_name;

535: begin
536: lock table ad_adop_sessions in exclusive mode nowait;
537: select count(*) into l_is_locked from ad_adop_sessions where adop_session_id=0 and EDITION_NAME='LOCK' and node_name=p_node_name;
538: if (l_is_locked <> 0) then
539: delete from ad_adop_sessions where adop_session_id=0 and EDITION_NAME='LOCK' and node_name=p_node_name;
540: commit;
541: return;
542: else
543: log(l_mod_name, 'WARN', 'WARN: Trying to unlock ad_adop_sessions table when no lock in place.');

Line 543: log(l_mod_name, 'WARN', 'WARN: Trying to unlock ad_adop_sessions table when no lock in place.');

539: delete from ad_adop_sessions where adop_session_id=0 and EDITION_NAME='LOCK' and node_name=p_node_name;
540: commit;
541: return;
542: else
543: log(l_mod_name, 'WARN', 'WARN: Trying to unlock ad_adop_sessions table when no lock in place.');
544: commit;
545: return;
546: end if;
547: exception

Line 552: log(l_mod_name, 'ERROR', 'ERROR: Unable to acquire lock on ad_adop_sessions table.');

548: when resource_busy then
549: dbms_lock.sleep(p_wait_interval);
550: end;
551: end loop;
552: log(l_mod_name, 'ERROR', 'ERROR: Unable to acquire lock on ad_adop_sessions table.');
553: RAISE_APPLICATION_ERROR(-20010,'ERROR: Unable to acquire lock on ad_adop_sessions table.');
554:
555: end UNLOCK_SESSIONS_TABLE;
556:

Line 553: RAISE_APPLICATION_ERROR(-20010,'ERROR: Unable to acquire lock on ad_adop_sessions table.');

549: dbms_lock.sleep(p_wait_interval);
550: end;
551: end loop;
552: log(l_mod_name, 'ERROR', 'ERROR: Unable to acquire lock on ad_adop_sessions table.');
553: RAISE_APPLICATION_ERROR(-20010,'ERROR: Unable to acquire lock on ad_adop_sessions table.');
554:
555: end UNLOCK_SESSIONS_TABLE;
556:
557: /*----------------------------------------------------------------+

Line 565: select max(adop_session_id) into l_session_id from ad_adop_sessions

561: +-----------------------------------------------------------------*/
562: procedure SET_CUTOVER_STATUS(p_appltop_id in number,p_node_name in varchar2,p_status in varchar2) is
563: l_session_id number;
564: begin
565: select max(adop_session_id) into l_session_id from ad_adop_sessions
566: where appltop_id=p_appltop_id and node_name=p_node_name
567: and prepare_status='Y' and apply_status='Y';
568: update ad_adop_sessions set cutover_status=p_status
569: where adop_session_id= l_session_id

Line 568: update ad_adop_sessions set cutover_status=p_status

564: begin
565: select max(adop_session_id) into l_session_id from ad_adop_sessions
566: where appltop_id=p_appltop_id and node_name=p_node_name
567: and prepare_status='Y' and apply_status='Y';
568: update ad_adop_sessions set cutover_status=p_status
569: where adop_session_id= l_session_id
570: and appltop_id=p_appltop_id
571: and node_name=p_node_name;
572: commit;

Line 621: update ad_adop_sessions set status='F'

617: if c_sessions_to_kill%isopen then
618: -- cursor was not already closed
619: CLOSE c_sessions_to_kill;
620: end if;
621: update ad_adop_sessions set status='F'
622: where adop_session_id=p_session_id;
623: commit;
624: raise_application_error(-20001,'Error: while killing old sessions.' || sqlerrm);
625: end KILL_OLD_SESSIONS;

Line 1268: from ad_adop_sessions

1264: '6', --force_startup
1265: 'Y');
1266: begin
1267: select node_name,appltop_id into l_node_name,l_appltop_id
1268: from ad_adop_sessions
1269: where node_type='master' and adop_session_id=p_session_id;
1270: loop
1271: l_cutover_status :=
1272: get_cutover_status(l_appltop_id,l_node_name,p_session_id);

Line 1284: select status into l_status from ad_adop_sessions

1280: then
1281: exit;
1282: end if;
1283: end loop;
1284: select status into l_status from ad_adop_sessions
1285: where node_type='master' and adop_session_id=p_session_id;
1286: if(l_status = 'F') then
1287: RAISE_APPLICATION_ERROR(-20010,'ERROR: Master in failure status');
1288: else

Line 1315: FROM AD_ADOP_SESSIONS

1311: and ( fn.support_cp='Y' or fn.support_forms='Y' or FN.SUPPORT_WEB='Y' or FN.SUPPORT_ADMIN='Y');
1312: begin
1313: SELECT NVL(MAX(ADOP_SESSION_ID),0)
1314: INTO l_adop_session_id
1315: FROM AD_ADOP_SESSIONS
1316: WHERE APPLY_STATUS IN ('P','N')
1317: AND PREPARE_STATUS IN ('Y','X')
1318: AND ABORT_STATUS<> 'Y'
1319: AND CLEANUP_STATUS <> 'Y';

Line 1489: select abort_status into abort_status from ad_adop_sessions

1485: abort_status VARCHAR2(1);
1486: BEGIN
1487:
1488: begin
1489: select abort_status into abort_status from ad_adop_sessions
1490: where prepare_status <> 'X' and node_type='master' and
1491: adop_session_id = (select max(adop_session_id) from ad_adop_sessions where
1492: prepare_status <> 'X' and node_type='master');
1493: exception

Line 1491: adop_session_id = (select max(adop_session_id) from ad_adop_sessions where

1487:
1488: begin
1489: select abort_status into abort_status from ad_adop_sessions
1490: where prepare_status <> 'X' and node_type='master' and
1491: adop_session_id = (select max(adop_session_id) from ad_adop_sessions where
1492: prepare_status <> 'X' and node_type='master');
1493: exception
1494: when no_data_found then
1495: return FALSE;

Line 1517: select max(adop_session_id) into session_id from ad_adop_sessions

1513:
1514: BEGIN
1515: --get the latest normal patching cycle session id
1516: begin
1517: select max(adop_session_id) into session_id from ad_adop_sessions
1518: where prepare_status <> 'X' and node_type='master' and cleanup_status <> 'Y' ;
1519: exception
1520: when no_data_found then
1521: return 0;

Line 1524: for rec in (select node_name from ad_adop_sessions where adop_session_id = session_id) loop

1520: when no_data_found then
1521: return 0;
1522: end;
1523:
1524: for rec in (select node_name from ad_adop_sessions where adop_session_id = session_id) loop
1525: node_map(rec.node_name) := 1;
1526: end loop;
1527:
1528: if (phase = 'prepare') then

Line 1529: select count(1) into cnt from ad_adop_sessions where adop_session_id = session_id

1525: node_map(rec.node_name) := 1;
1526: end loop;
1527:
1528: if (phase = 'prepare') then
1529: select count(1) into cnt from ad_adop_sessions where adop_session_id = session_id
1530: and prepare_status <> 'Y';
1531:
1532: if ( cnt > 0 ) then
1533: for rec in (select node_name from ad_adop_sessions where adop_session_id

Line 1533: for rec in (select node_name from ad_adop_sessions where adop_session_id

1529: select count(1) into cnt from ad_adop_sessions where adop_session_id = session_id
1530: and prepare_status <> 'Y';
1531:
1532: if ( cnt > 0 ) then
1533: for rec in (select node_name from ad_adop_sessions where adop_session_id
1534: = session_id and prepare_status <> 'Y') loop
1535: node_map(rec.node_name) := 0;
1536: end loop;
1537: end if;

Line 1543: select count(1) into cnt from ad_adop_sessions where adop_session_id =

1539: end if;
1540:
1541: if (phase = 'apply') then
1542: if node is not NULL then
1543: select count(1) into cnt from ad_adop_sessions where adop_session_id =
1544: session_id and node_name = node and ((apply_status = 'N') or
1545: (apply_status='P' and status in ('F','R')));
1546:
1547: if (cnt > 0 ) then

Line 1551: select count(1) into cnt from ad_adop_sessions where adop_session_id = session_id

1547: if (cnt > 0 ) then
1548: node_map(node) := 0;
1549: end if;
1550: else
1551: select count(1) into cnt from ad_adop_sessions where adop_session_id = session_id
1552: and ((apply_status = 'N' and status in ('C','N')) or (apply_status ='P' and
1553: status = 'F'));
1554:
1555: select count(1) into cnt1 from ad_adop_sessions where adop_session_id =

Line 1555: select count(1) into cnt1 from ad_adop_sessions where adop_session_id =

1551: select count(1) into cnt from ad_adop_sessions where adop_session_id = session_id
1552: and ((apply_status = 'N' and status in ('C','N')) or (apply_status ='P' and
1553: status = 'F'));
1554:
1555: select count(1) into cnt1 from ad_adop_sessions where adop_session_id =
1556: session_id and apply_status in ('P','Y') and status='C';
1557:
1558: if(cnt <> 0 and cnt1 > 0) then
1559: for rec in (select node_name from ad_adop_sessions where adop_session_id

Line 1559: for rec in (select node_name from ad_adop_sessions where adop_session_id

1555: select count(1) into cnt1 from ad_adop_sessions where adop_session_id =
1556: session_id and apply_status in ('P','Y') and status='C';
1557:
1558: if(cnt <> 0 and cnt1 > 0) then
1559: for rec in (select node_name from ad_adop_sessions where adop_session_id
1560: = session_id and ((apply_status = 'N' and status in ('C','N')) or
1561: (apply_status ='P' and status = 'F'))) loop
1562: node_map(rec.node_name) := 0;
1563: end loop;

Line 1569: select count(1) into cnt from ad_adop_sessions where adop_session_id =

1565: end if;
1566: end if;
1567:
1568: if (phase = 'cutover') then
1569: select count(1) into cnt from ad_adop_sessions where adop_session_id =
1570: session_id and cutover_status not in ('X','Y');
1571:
1572: if ( cnt > 0 ) then
1573: for rec in (select node_name from ad_adop_sessions where adop_session_id

Line 1573: for rec in (select node_name from ad_adop_sessions where adop_session_id

1569: select count(1) into cnt from ad_adop_sessions where adop_session_id =
1570: session_id and cutover_status not in ('X','Y');
1571:
1572: if ( cnt > 0 ) then
1573: for rec in (select node_name from ad_adop_sessions where adop_session_id
1574: = session_id and cutover_status not in ('X','Y')) loop
1575: node_map(rec.node_name) := 0;
1576: end loop;
1577: end if;

Line 1581: select count(1) into cnt from ad_adop_sessions where adop_session_id =

1577: end if;
1578: end if;
1579:
1580: if (phase = 'abort') then
1581: select count(1) into cnt from ad_adop_sessions where adop_session_id =
1582: session_id and abort_status not in ('X','Y');
1583:
1584: if ( cnt > 0 ) then
1585: for rec in (select node_name from ad_adop_sessions where adop_session_id

Line 1585: for rec in (select node_name from ad_adop_sessions where adop_session_id

1581: select count(1) into cnt from ad_adop_sessions where adop_session_id =
1582: session_id and abort_status not in ('X','Y');
1583:
1584: if ( cnt > 0 ) then
1585: for rec in (select node_name from ad_adop_sessions where adop_session_id
1586: = session_id and abort_status not in ('X','Y')) loop
1587: node_map(rec.node_name) := 0;
1588: end loop;
1589: end if;

Line 1600: for rec in (select node_name from ad_adop_sessions where adop_session_id = session_id) loop

1596: return 2;
1597: end if;
1598: end if;
1599:
1600: for rec in (select node_name from ad_adop_sessions where adop_session_id = session_id) loop
1601: if ((node_map(rec.node_name)) = 1) then
1602: node_list := node_list || ',' || rec.node_name;
1603: else
1604: succ_flag := FALSE;

Line 1629: from ad_adop_sessions

1625:
1626: BEGIN
1627:
1628: select max(adop_session_id) into l_session_id
1629: from ad_adop_sessions
1630: where node_type='master' and prepare_status <> 'X';
1631:
1632: select abandon_flag into l_abandon_flag
1633: from ad_adop_sessions

Line 1633: from ad_adop_sessions

1629: from ad_adop_sessions
1630: where node_type='master' and prepare_status <> 'X';
1631:
1632: select abandon_flag into l_abandon_flag
1633: from ad_adop_sessions
1634: where adop_session_id = l_session_id and node_name = node;
1635:
1636: if (l_abandon_flag <> l_session_id) then
1637: return 2;

Line 1639: select count(1) into l_cnt from ad_adop_sessions slave, ad_adop_sessions master

1635:
1636: if (l_abandon_flag <> l_session_id) then
1637: return 2;
1638: else
1639: select count(1) into l_cnt from ad_adop_sessions slave, ad_adop_sessions master
1640: where
1641: (slave.prepare_status <> master.prepare_status or
1642: slave.apply_status <> master.apply_status or
1643: slave.cutover_status <> master.cutover_status or

Line 1664: from ad_adop_sessions

1660:
1661: BEGIN
1662:
1663: select max(adop_session_id) into l_session_id
1664: from ad_adop_sessions
1665: where node_type='master' and prepare_status <> 'X';
1666:
1667: if (p_mode = 'ABANDONED') then
1668: for rec in (select node_name from ad_adop_sessions where

Line 1668: for rec in (select node_name from ad_adop_sessions where

1664: from ad_adop_sessions
1665: where node_type='master' and prepare_status <> 'X';
1666:
1667: if (p_mode = 'ABANDONED') then
1668: for rec in (select node_name from ad_adop_sessions where
1669: adop_session_id=l_session_id and
1670: abandon_flag <> l_session_id)
1671: loop
1672: if l_node_list is NULL then

Line 1680: select slave.node_name node_name from ad_adop_sessions slave,ad_adop_sessions master

1676: end if;
1677: end loop;
1678: else
1679: for rec in (
1680: select slave.node_name node_name from ad_adop_sessions slave,ad_adop_sessions master
1681: where
1682: (slave.prepare_status <> master.prepare_status or
1683: slave.apply_status <> master.apply_status or
1684: slave.cutover_status <> master.cutover_status or

Line 1705: update ad_adop_sessions set abandon_flag = NULL

1701:
1702: PROCEDURE CLEAR_ABANDON_FLAG(dest_node in varchar2) IS
1703: BEGIN
1704:
1705: update ad_adop_sessions set abandon_flag = NULL
1706: where node_name=dest_node and abandon_flag is not null and
1707: adop_session_id = (select max(adop_session_id) from ad_adop_sessions where
1708: ((prepare_status='Y' and apply_status='Y' and cutover_status='Y') or
1709: (abort_status='Y')) and node_type='master');

Line 1707: adop_session_id = (select max(adop_session_id) from ad_adop_sessions where

1703: BEGIN
1704:
1705: update ad_adop_sessions set abandon_flag = NULL
1706: where node_name=dest_node and abandon_flag is not null and
1707: adop_session_id = (select max(adop_session_id) from ad_adop_sessions where
1708: ((prepare_status='Y' and apply_status='Y' and cutover_status='Y') or
1709: (abort_status='Y')) and node_type='master');
1710: commit;
1711:

Line 1720: from ad_adop_sessions

1716: PROCEDURE GET_ACTIV_PATCHING_SES_DETAILS(id out NOCOPY NUMBER) IS
1717: begin
1718: select max(adop_session_id)
1719: into id
1720: from ad_adop_sessions
1721: where prepare_status <> 'X'
1722: and node_type='master'
1723: and cutover_status = 'N'
1724: and abort_status='N';