ORA-21779: duration not active

Guys, it looks like nobody knows much about this error and Oracle support is no help.
The problem seem to be machine/environment specific.
We get this exception consistently on some of the oracle/intermedia queries on two out of six identical environments. The queries are run from a servlet, only number and varchar2 fields used, no LOBs.
The configuration across all the environments:
WL 8.1
Oracle 9.2.0.7.0
Oracle JDBC 9.2.0.5
Some online sources mention that the ORA-21779 error is fixed by some Oracle patch sets, but we've done a cumulative update a couple of weeks ago, maybe someone knows a specific patch or the reason for the problem?
Thanks,
Vitaly

chernovtsy wrote:
Here's the relevant part of the trace, thanks!
java.sql.SQLException: ORA-21779: duration not active
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:289)
at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:582)
at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1986)
at oracle.jdbc.ttc7.TTC7Protocol.fetch(TTC7Protocol.java:1253)
at oracle.jdbc.driver.OracleResultSetImpl.next(OracleResultSetImpl.java:295)
at com.skila.search.AsynSearchProcessor.getRecordPriority(AsynSearchProcessor.java:747)
at com.skila.search.AsynSearchProcessor.iteratorResulSet(AsynSearchProcessor.java:790)
at com.skila.search.AsynSearchProcessor.fetchByDate(AsynSearchProcessor.java:311)
at com.skila.search.AsynSearchProcessor.getSearchResults(AsynSearchProcessor.java:1069)
at com.skila.search.SearchServlet.doPost(SearchServlet.java:293)
at com.skila.reddog.common.AbstractSkilaServlet.processRequest(AbstractSkilaServlet.java:182)
at com.skila.reddog.common.AbstractSkilaServlet.service(AbstractSkilaServlet.java:160)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)That looks like an ancient version of the driver... Ca you try repeating this with the
latest 10g (10.2) driver? How easily/regularly can you repeat this? Is there anything
fancy about your JDBC code? Can I see it? One main problem people have with
JDBC in servlets is not making all JDBC objects method-level objects, and therefore
risking non-threadsafety.
Regardless, have you shown Oracle support a full JDBC stacktrace of the exception?
thanks
Joe
PS: is there any WebLogic code in the picture? It seems you're making
direct JDBC connections...
Joe

Similar Messages

  • Error while executing the sp ORA-21779: duration not active

    Hi there,
    am using Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 and facing typical type of error
    please find the steps below to reproduce it
    in this basically i will pass a comma seperated values and function will return the
    piped table witheach seperated values as new record
    ex :1,2,3,4
    1
    2
    3
    4
    Types created:
    1) Create Type TPOBJ_Return as Object (tnames varchar2 (2000));
    2) Create Type TPObjT_ReturnColl as Table Of TPOBJ_ReturnTable;
    Function created:
    CREATE OR REPLACE FUNCTION WB_FN_ReturnTable
    tNameString IN VARCHAR2
    RETURN TPObjT_ReturnColl
    PIPELINED
    AS
    iOptionSel INT;
    tOptionSel VARCHAR2 (9);
    iLen INT;
    tName VARCHAR2 (50);
    tTempChar CHAR (1);
    ptNameString VARCHAR2(2000);
    BEGIN
    ptNameString:=tNameString;
    iLen := LENGTH(TRIM(ptNameString));
    iOptionSel := 1;
    tName := '';
    WHILE iOptionSel <= iLen
    LOOP
    tTempChar := SUBSTR(ptNameString, iOptionSel, 1);
    IF tTempChar = ',' THEN
    IF LENGTH(TRIM(tName)) > 0 THEN
    PIPE ROW(TPOBJ_Return(tName));
    END IF;
    tName := '';
    ELSE
    tName := tName || tTempChar;
    END IF;
    iOptionSel := iOptionSel + 1;
    END LOOP;
    IF LENGTH(TRIM(tName)) > 0 THEN
    PIPE ROW(TPOBJ_Return(tName));
    END IF;
    return;
    END;
    Table created:
    Create Table test (id number(16))
    Insert into test values (1)
    Please insert from 1 to 10.
    Stored procedure created:
    Create or replace procedure Sptest
    As
    Titems Varchar2(255);
    pvalue Number(16);
    Begin
    Titems :='5,4,3';
    Select MIN(id) into pvalue from test where id not in
    (select tnames from table(WB_FN_ReturnTable(Titems )));
    End;
    Note:
    while executing the sp for the first time am not getting any error
    only ,if making a repeated call for execution then am gettings the errors specified below
    ORA-21779: duration not active
    ORA-03113: end-of-file on communication channel
    ORA-03114: not connected to ORACLE
    can anyone help me on these issue

    Why a pipeline table function? I would not say that a tokeniser function is something that typically should require working in the SQL engine, piping rows. It can be a very straight forward PL/SQL function that returns a collection of strings.
    E.g.
    SQL> CREATE OR REPLACE function tokenise( line varchar2, separator varchar2 DEFAULT ',' ) return TStrings AUTHID CURRENT_USER is
    2 strList TStrings;
    3 str varchar2(4000);
    4 i integer;
    5 l integer;
    6
    7 procedure AddString( s varchar2 ) is
    8 begin
    9 strList.Extend(1);
    10 strList( strList.Count ) := s;
    11 end;
    12
    13 begin
    14 strList := new TStrings();
    15
    16 str := line;
    17 loop
    18 l := LENGTH( str );
    19 i := INSTR( str, separator );
    20
    21 if i = 0 then
    22 AddString( str );
    23 else
    24 AddString( SUBSTR( str, 1, i-1 ) );
    25 str := SUBSTR( str, i+1 );
    26 end if;
    27
    28 -- if the separator was on the last char of the line, there is
    29 -- a trailing null column which we need to add manually
    30 if i = l then
    31 AddString( null );
    32 end if;
    33
    34 exit when str is NULL;
    35 exit when i = 0;
    36 end loop;
    37
    38 return( strList );
    39 end;
    40 /
    Function created.
    SQL>
    SQL> select * from TABLE(Tokenise('col1,col2,col3,,col5,and so on'));
    COLUMN_VALUE
    col1
    col2
    col3
    col5
    and so on
    6 rows selected.
    SQL>
    PS. The TStrings SQL user type is declared as a table of varchar2(4000).

  • ORA-21779: duration not active error line 25 of MDSYS.AGGRUNION

    I execute the following pl/sql (line 56/57 in
    a procedure called RebuildSMZLabels)....
    v_query := 'SELECT /*+ INDEX ( A BASE_SMZ_A_SHAPE ) NO_INDEX ( A BASE_SMZ_A_RETIREDATE ) */ MDSYS.SDO_AGGR_UNION(MDSYS.SDOAGGRTYPE(a.s
    hape,:1)) FROM &owner.base_smz_a A WHERE MDSYS.SDO_RELATE(a.shape,:2,''mask=ANYINTERACT querytype=window'') = ''TRUE'' and retiredate is
    null';
    EXECUTE IMMEDIATE v_query INTO v_union_shape USING v_diminfo(1).sdo_tolerance, v_trans_shape ;
    And I get...
    Oracle9i Enterprise Edition Release 9.2.0.4.0 - 64bit Production
    With the Partitioning, OLAP and Oracle Data Mining options
    JServer Release 9.2.0.4.0 - Production
    DECLARE
    ERROR at line 1:
    ORA-21779: duration not active
    ORA-06512: at "MDSYS.AGGRUNION", line 25
    ORA-06512: at "MDSYS.AGGRUNION", line 25
    ORA-06512: at line 1
    ORA-06512: at "MDCADM.REBUILDSMZLABELS", line 57
    ORA-06512: at line 5
    Got me beat... anyone got any ideas?
    Simon Greener
    GIS Manager
    Forestry Tasmania

    Dan
    I reverted to the old 8i code (with individual
    UNIONS) and it still fails:
    DECLARE
    ERROR at line 1:
    ORA-21779: duration not active
    ORA-06512: at "MDSYS.SDO_3GL", line 439
    ORA-06512: at "MDSYS.SDO_GEOM", line 3096
    ORA-06512: at "MDCADM.REBUILDSMZLABELS", line 74
    ORA-06512: at line 5
    Line 74 is:
    v_union_shape := MDSYS.SDO_GEOM.SDO_UNION(v_union_shape,v_diminfo,v_shape,v_diminfo);
    Any ideas as I need this to work in 9i ASAP (as it
    doesn't work in 8i)?
    PS Dan, it is the same database/code problem I sent
    to you earlier this year. It is getting to the point
    that I am going to have to rebuild all this database
    centric code (which is where it needs to be in the
    business process) within our GIS (ArcInfo) which is going
    to be far more complex and not sustainable in the medium
    term.
    regards
    Simon

  • SDO_INTERSECTION error: ORA-21779

    Hi.
    I have encountered a problem with sdo_intersection in Oracle 9.2 that somebody may be able to help me with:
    I am trying to intersect two polygons (one is a rectangle that I have created by specifying co-ordinates, the other is a selection from a larger table of polygons). If I specify a tolerance of 0.005 for this function then the relationship between the two is determined to be 'TOUCH', which is incorrect, and the result is a line. If I specify a smaller tolerance (eg 0.0005), then the relationship is determined to be 'OVERLAPBYINTERSECT' but the intersection function results in the error: ORA-21779: duration not active.
    Below is an extract from my work - the last line is the one where the error occurs:
    overlap_region := MDSYS.SDO_GEOMETRY(2003, NULL, NULL, MDSYS.SDO_ELEM_INFO_ARRAY(1, 1003, 1), MDSYS.SDO_ORDINATE_ARRAY(min_x_wc, min_y_wc, max_x_sw, min_y_wc, max_x_sw, max_y_sw, min_x_wc, max_y_sw, min_x_wc, min_y_wc));
    Select GEOLOC into big_wc from base_list_local where name = 'Southwest';
    temp := mdsys.sdo_geom.relate(big_wc, 'DETERMINE', overlap_region, 0.000005);
    dbms_output.put_line(temp);
    small_wc := MDSYS.SDO_GEOM.SDO_INTERSECTION(overlap_region, big_wc, 0.000005);

    Version 9.2.0.1.0
    If this is a bug then does anybody have an idea for a work-around (ie. another way to acheive an intersection, without using the sdo_intersection function)?

  • ORA-16136: Managed Standby Recovery not active

    Hi
    I am trying implement the dataguard in the windows platform. And this is my first time. Right now iam trying on physical standby. i have done everything as per the document. But iam getting some error. After giving the
    SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT FROM SESSION;
    SQL> ALTER SYSTEM SWITCH LOGFILE;
    SQL> recover managed standby database cancel;
    // I am getting error
    ORA-16136: Managed Standby Recovery not active
    When just like that i tried to open the standby database in read only mode, i am getting error
    SQL> alter database open read only;
    alter database open read only
    ERROR at line 1:
    ORA-16004: backup database requires recovery
    ORA-01157: cannot identify/lock data file 1 - see DBWR trace file
    ORA-01110: data file 1: 'C:\ORACLE\PRODUCT\10.2.0\ORADATA\DB1\SYSTEM01.DBF'
    When i checked the alert log file of Primary Database, it shows:
    PING[ARCo]: Heartbeat failed to connect to standby 'db2sby'. Error is 1031.
    Wed Sep 01 14:10:27 2010
    Thread 1 advanced to log sequence 337 (LGWR switch)
    Current log# 2 seq# 337 mem# 0: C:\ORACLE\PRODUCT\10.2.0\ORADATA\DB1\REDO02.LOG
    Wed Sep 01 14:10:28 2010
    Deleted Oracle managed file C:\ORACLE\PRODUCT\10.2.0\FLASH_RECOVERY_AREA\DB1\ARCHIVELOG\2010_02_25\O1_MF_1_224_5RD10Z5V_.ARC
    Wed Sep 01 14:14:53 2010
    Error 1031 received logging on to the standby
    Wed Sep 01 14:14:53 2010
    Errors in file c:\oracle\product\10.2.0\admin\db1\bdump\db1_arco_2156.trc:
    ORA-01031: insufficient privileges
    PING[ARCo]: Heartbeat failed to connect to standby 'db2sby'. Error is 1031.
    Wed Sep 01 14:19:53 2010
    Error 1031 received logging on to the standby
    Wed Sep 01 14:19:53 2010
    Errors in file c:\oracle\product\10.2.0\admin\db1\bdump\db1_arco_2156.trc:
    ORA-01031: insufficient privileges
    And when i checked alert log file of stand by database:
    Wed Sep 01 14:13:19 2010
    Errors in file c:\oracle\product\10.2.0\standbyy\admin\db2\bdump\db2sby_dbw0_3060.trc:
    ORA-01157: cannot identify/lock data file 9 - see DBWR trace file
    ORA-01110: data file 9: 'C:\TSUNDO12.DBF'
    ORA-27086: unable to lock file - already in use
    OSD-00001: additional error information
    O/S-Error: (OS 101) The exclusive semaphore is owned by another process
    --> The above error of Standby was coming for each datafile such as system, users etc.
    Kindly Help me.
    Shiyas M

    here is the pfile of Primary Database:
    db1.__db_cache_size=188743680
    db1.__java_pool_size=4194304
    db1.__large_pool_size=4194304
    db1.__shared_pool_size=83886080
    db1.__streams_pool_size=0
    *.audit_file_dest='C:\oracle\product\10.2.0/admin/db1/adump'
    *.background_dump_dest='C:\oracle\product\10.2.0/admin/db1/bdump'
    *.compatible='10.2.0.1.0'
    *.control_files='C:\oracle\product\10.2.0\oradata\db1\control01.ctl','C:\oracle\product\10.2.0\oradata\db1\control02.ctl','C:\oracle\product\10.2.0\oradata\db1\control03.ctl'
    *.core_dump_dest='C:\oracle\product\10.2.0/admin/db1/cdump'
    *.db_16k_cache_size=4194304
    *.db_block_size=8192
    *.db_domain=''
    *.db_file_multiblock_read_count=16
    *.db_name='db1'
    *.DB_UNIQUE_NAME='db1prim'
    *.LOG_ARCHIVE_CONFIG='DG_CONFIG=(db1,db2sby)'
    *.LOG_ARCHIVE_DEST_1='LOCATION=C:\oracle\product\10.2.0\ARCHIVELOG VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=db1prim'
    *.LOG_ARCHIVE_DEST_2='SERVICE=db2sby LGWR ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=db2sby'
    *.LOG_ARCHIVE_DEST_STATE_1=ENABLE
    *.LOG_ARCHIVE_DEST_STATE_2=ENABLE
    *.LOG_ARCHIVE_FORMAT=%t_%s_%r.arc
    *.LOG_ARCHIVE_MAX_PROCESSES=30
    *.FAL_SERVER=db2sby
    *.FAL_CLIENT=db1
    *.DB_FILE_NAME_CONVERT='C:\oracle\product\10.2.0\Standbyy\oradata\DB2','C:\oracle\product\10.2.0\oradata\db1'
    *.LOG_FILE_NAME_CONVERT='C:\oracle\product\10.2.0\Standbyy\oradata\DB2','C:\oracle\product\10.2.0\oradata\db1'
    *.STANDBY_FILE_MANAGEMENT=AUTO
    *.db_recovery_file_dest='C:\oracle\product\10.2.0/flash_recovery_area'
    *.db_recovery_file_dest_size=2147483648
    *.dispatchers='(PROTOCOL=TCP) (SERVICE=db1XDB)'
    *.job_queue_processes=10
    *.open_cursors=300
    *.pga_aggregate_target=95420416
    *.processes=150
    *.recyclebin='OFF'
    *.remote_login_passwordfile='EXCLUSIVE'
    *.sga_target=287309824
    *.undo_management='AUTO'
    *.undo_tablespace='UNDOTBS1'
    *.user_dump_dest='C:\oracle\product\10.2.0/admin/db1/udump'
    *.utl_file_dir='OCM_CONFIG_HOME/state'
    Here is the Pfile of standby database:
    db1.__db_cache_size=188743680
    db1.__java_pool_size=4194304
    db1.__large_pool_size=4194304
    db1.__shared_pool_size=83886080
    db1.__streams_pool_size=0
    *.audit_file_dest='C:\oracle\product\10.2.0\Standbyy\admin\db2\adump'
    *.background_dump_dest='C:\oracle\product\10.2.0\Standbyy\admin\db2\bdump'
    *.compatible='10.2.0.1.0'
    *.control_files='C:\oracle\product\10.2.0\Standbyy\oradata\db2\control001.ctl','C:\oracle\product\10.2.0\Standbyy\oradata\db2\control002.ctl','C:\oracle\product\10.2.0\Standbyy\oradata\db2\control003.ctl'
    *.core_dump_dest='C:\oracle\product\10.2.0\Standbyy\admin\db2'
    *.db_16k_cache_size=4194304
    *.db_block_size=8192
    *.db_domain=''
    *.db_file_multiblock_read_count=16
    *.db_name='db1'
    *.DB_UNIQUE_NAME='db2sby'
    *.LOG_ARCHIVE_CONFIG='DG_CONFIG=(db1,db2sby)'
    *.LOG_ARCHIVE_DEST_1='LOCATION=C:\oracle\product\10.2.0\ARCHIVELOG VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=db2sby'
    *.LOG_ARCHIVE_DEST_2='SERVICE=db1 LGWR ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=db1'
    *.LOG_ARCHIVE_DEST_STATE_1=ENABLE
    *.LOG_ARCHIVE_DEST_STATE_2=ENABLE
    *.LOG_ARCHIVE_FORMAT=%t_%s_%r.arc
    *.LOG_ARCHIVE_MAX_PROCESSES=30
    *.FAL_SERVER=db1
    *.FAL_CLIENT=db2sby
    *.DB_FILE_NAME_CONVERT='C:\oracle\product\10.2.0\Standbyy\oradata\DB2','C:\oracle\product\10.2.0\oradata\db1'
    *.LOG_FILE_NAME_CONVERT='C:\oracle\product\10.2.0\Standbyy\oradata\DB2','C:\oracle\product\10.2.0\oradata\db1'
    *.STANDBY_FILE_MANAGEMENT=AUTO
    *.db_recovery_file_dest='C:\oracle\product\10.2.0\flash_recovery_area\DB2SBY'
    *.db_recovery_file_dest_size=2147483648
    *.dispatchers='(PROTOCOL=TCP) (SERVICE=db1XDB)'
    *.job_queue_processes=10
    *.open_cursors=300
    *.pga_aggregate_target=95420416
    *.processes=150
    *.recyclebin='OFF'
    *.remote_login_passwordfile='EXCLUSIVE'
    *.sga_target=287309824
    *.undo_management='AUTO'
    *.undo_tablespace='UNDOTBS1'
    *.user_dump_dest='C:\oracle\product\10.2.0\Standbyy\admin\db2\udump'
    *.utl_file_dir='OCM_CONFIG_HOME/state'

  • The Database Link is not active

    try to be more clear, i'm in lack of ideas in this problem.
    I am following guide Oracle Database 2 Day + Data Replication and Integration Guide.
    I defined global_names parameter of remote database as true.In the step of "creation database link" i am getting error.(oracle enterprise manager 11g-->schema-->database links-->create)
    When i query on remote database(select * from global_name), I got orcl.
    So,In "Name" and "Net service name" field i specified orcl.Check radio button "Fixed user." and Username and password of remote database, and i got message "Database Link STRMADMIN.ORCL has been created successfully."
    But when i clicked on database link Name i got error, saying that
    "The Database Link is not active.ORA-02084: database name is missing a component "
    (Both dbs are oracle 11g.)
    Please reply.

    I think I am confused, "what should be Name and Net Service Name" while creating database link in context of "Database Replication." when global_names parameter is true in both database. I read somewhere "If the value of the GLOBAL_NAMES initialization parameter is TRUE, then the database link must have the same name as the database to which it connects." so what should database link name " should it be remote database name? db_domain?( or outtput of select * from global_name).......
    my tnsnames.ora on source db is
    ORCL.a.ernet.in =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = a.b.c.d)(PORT = 1521))
    (CONNECT_DATA =
    (SERVER = DEDICATED)
    (SERVICE_NAME = ORCL.a.ernet.in)
    when i connect user of remote database(a.b.c.d) from sqlpuls then it is connected.
    command which i give : sqlplus remoteUser/[email protected]

  • Dynamic call for a ref cursor: ORA-21779

    Hi,
    Here is an environment:
    create or replace
    PACKAGE PKG_GETDATA AS
    TYPE cursor_type IS REF CURSOR;
    Procedure SimpleGet (cData In Out Cursor_type);
    Procedure DynamicGet (cData In Out Cursor_type);
    END PKG_GETDATA;
    create or replace
    PACKAGE BODY "PKG_GETDATA" AS
    Procedure SimpleGet (cData In Out Cursor_type) As
    Begin
    Open cData For
    Select 1 from Dual;
    End SimpleGet;
    Procedure DynamicGet (cData In Out Cursor_type) As
    Begin
    Execute Immediate 'Begin PKG_GETDATA.SIMPLEGET(:1); End;'
    Using In Out cData;
    End DynamicGet;
    END PKG_GETDATA;
    So- first simple get works fine:
    Declare
    cData PKG_GETDATA.Cursor_type;
    aNumber Number;
    Begin
    PKG_GETDATA.SimpleGet (cData);
    LOOP
    FETCH cData INTO aNumber;
    EXIT WHEN cData%ROWCOUNT > 5 OR cData%NOTFOUND;
    dbms_output.put_line (aNumber);
    END LOOP;
    close cData;
    End;
    BUT dynamic call does not works at all!:
    Declare
    cData PKG_GETDATA.Cursor_type;
    aNumber Number;
    Begin
    PKG_GETDATA.DynamicGet (cData);
    LOOP
    FETCH cData INTO aNumber;
    EXIT WHEN cData%ROWCOUNT > 5 OR cData%NOTFOUND;
    dbms_output.put_line (aNumber);
    END LOOP;
    close cData;
    End;
    It throws ORA-21779 exception; what is more- it does work on 10.2 db version but does not work on 11.2 version! Could anyone explain that?
    Regards
    Bartlomiej D.

    Hi,
    Believe me, it may be very handful while working with handlers.
    Anyway- could anyone help me on that?
    Regards
    Bartlomiej D.

  • Dispatcher not active

    Hi Experts,
    Please check this Developer Trace of Dispatcher, this is stopped, when I am restarting my server, it is giving errors  :
    running but not connected to message server,
    and
    running but dialog queue standstill, J2EE service unavilable.
    trc file: "dev_disp", trc level: 1, release: "700"
    sysno      01
    sid        XID
    systemid   560 (PC with Windows NT)
    relno      7000
    patchlevel 0
    patchno    52
    intno      20050900
    make:      multithreaded, Unicode, optimized
    pid        1412
    Fri Sep 21 10:19:59 2007
    kernel runs with dp version 210000(ext=109000) (@(#) DPLIB-INT-VERSION-210000-UC)
    length of sys_adm_ext is 572 bytes
    SWITCH TRC-HIDE on ***
    ***LOG Q00=> DpSapEnvInit, DPStart (01 1412) [dpxxdisp.c   1231]
         shared lib "dw_xml.dll" version 52 successfully loaded
         shared lib "dw_xtc.dll" version 52 successfully loaded
         shared lib "dw_stl.dll" version 52 successfully loaded
         shared lib "dw_gui.dll" version 52 successfully loaded
    rdisp/softcancel_sequence :  -> 0,5,-1
    use internal message server connection to port 3901
    Fri Sep 21 10:20:04 2007
    WARNING => DpNetCheck: NiAddrToHost(1.0.0.0) took 5 seconds
    ***LOG GZZ=> 1 possible network problems detected - check tracefile and adjust the DNS settings [dpxxtool2.c  5233]
    MtxInit: 30000 0 0
    DpSysAdmExtInit: ABAP is active
    DpSysAdmExtInit: VMC (JAVA VM in WP) is not active
    DpIPCInit2: start server >inggnh002sap_XID_01                     <
    DpShMCreate: sizeof(wp_adm)          12672     (1408)
    DpShMCreate: sizeof(tm_adm)          3954072     (19672)
    DpShMCreate: sizeof(wp_ca_adm)          24000     (80)
    DpShMCreate: sizeof(appc_ca_adm)     8000     (80)
    DpCommTableSize: max/headSize/ftSize/tableSize=500/8/528056/528064
    DpShMCreate: sizeof(comm_adm)          528064     (1048)
    DpFileTableSize: max/headSize/ftSize/tableSize=0/0/0/0
    DpShMCreate: sizeof(file_adm)          0     (72)
    DpShMCreate: sizeof(vmc_adm)          0     (1452)
    DpShMCreate: sizeof(wall_adm)          (38456/34360/64/184)
    DpShMCreate: sizeof(gw_adm)     48
    DpShMCreate: SHM_DP_ADM_KEY          (addr: 06510040, size: 4607512)
    DpShMCreate: allocated sys_adm at 06510040
    DpShMCreate: allocated wp_adm at 06511E28
    DpShMCreate: allocated tm_adm_list at 06514FA8
    DpShMCreate: allocated tm_adm at 06514FD8
    DpShMCreate: allocated wp_ca_adm at 068DA570
    DpShMCreate: allocated appc_ca_adm at 068E0330
    DpShMCreate: allocated comm_adm at 068E2270
    DpShMCreate: system runs without file table
    DpShMCreate: allocated vmc_adm_list at 06963130
    DpShMCreate: allocated gw_adm at 06963170
    DpShMCreate: system runs without vmc_adm
    DpShMCreate: allocated ca_info at 069631A0
    DpShMCreate: allocated wall_adm at 069631A8
    MBUF state OFF
    EmInit: MmSetImplementation( 2 ).
    MM diagnostic options set: 0
    <ES> client 0 initializing ....
    <ES> InitFreeList
    <ES> block size is 1024 kByte.
    Using implementation flat
    <EsNT> Memory Reset disabled as NT default
    <ES> 511 blocks reserved for free list.
    ES initialized.
    J2EE server info
      start = TRUE
      state = STARTED
      pid = 1324
      argv[0] = D:\usr\sap\XID\DVEBMGS01\exe\jcontrol.EXE
      argv[1] = D:\usr\sap\XID\DVEBMGS01\exe\jcontrol.EXE
      argv[2] = pf=D:\usr\sap\XID\SYS\profile\XID_DVEBMGS01_inggnh002sap
      argv[3] = -DSAPSTART=1
      argv[4] = -DCONNECT_PORT=2009
      argv[5] = -DSAPSYSTEM=01
      argv[6] = -DSAPSYSTEMNAME=XID
      argv[7] = -DSAPMYNAME=inggnh002sap_XID_01
      argv[8] = -DSAPPROFILE=D:\usr\sap\XID\SYS\profile\XID_DVEBMGS01_inggnh002sap
      argv[9] = -DFRFC_FALLBACK=ON
      argv[10] = -DFRFC_FALLBACK_HOST=localhost
      start_lazy = 0
      start_control = SAP J2EE startup framework
    DpJ2eeStart: j2ee state = STARTED
    rdisp/http_min_wait_dia_wp : 1 -> 1
    ***LOG CPS=> DpLoopInit, ICU ( 3.0 3.0 4.0.1) [dpxxdisp.c   1617]
    Fri Sep 21 10:20:05 2007
    ***LOG Q0K=> DpMsAttach, mscon ( inggnh002sap) [dpxxdisp.c   11414]
    DpStartStopMsg: send start message (myname is >inggnh002sap_XID_01                     <)
    DpStartStopMsg: start msg sent
    CCMS: AlInitGlobals : alert/use_sema_lock = TRUE.
    CCMS: Initalizing shared memory of size 60000000 for monitoring segment.
    Fri Sep 21 10:20:06 2007
    CCMS: start to initalize 3.X shared alert area (first segment).
    DpJ2eeLogin: j2ee state = CONNECTED
    DpMsgAdmin: Set release to 7000, patchlevel 0
    MBUF state PREPARED
    MBUF component UP
    DpMBufHwIdSet: set Hardware-ID
    ***LOG Q1C=> DpMBufHwIdSet [dpxxmbuf.c   1050]
    DpMsgAdmin: Set patchno for this platform to 52
    Release check o.K.
    Fri Sep 21 10:20:41 2007
    ***LOG Q0I=> NiIRead: recv (10054: WSAECONNRESET: Connection reset by peer) [nixxi.cpp 4235]
    ERROR => NiIRead: SiRecv failed for hdl 4 / sock 1492
         (SI_ECONN_BROKEN; I4; ST; 127.0.0.1:2014) [nixxi.cpp    4235]
    DpJ2eeMsgProcess: j2ee state = CONNECTED (NIECONN_BROKEN)
    DpIJ2eeShutdown: send SIGINT to SAP J2EE startup framework (pid=1324)
    ERROR => DpProcKill: kill failed [dpntdisp.c   371]
    DpIJ2eeShutdown: j2ee state = SHUTDOWN
    Fri Sep 21 10:20:45 2007
    ERROR => W0 (pid 2804) died [dpxxdisp.c   14021]
    ERROR => W1 (pid 1484) died [dpxxdisp.c   14021]
    ERROR => W2 (pid 2708) died [dpxxdisp.c   14021]
    ERROR => W3 (pid 1464) died [dpxxdisp.c   14021]
    my types changed after wp death/restart 0xbf --> 0xbe
    ERROR => W4 (pid 860) died [dpxxdisp.c   14021]
    my types changed after wp death/restart 0xbe --> 0xbc
    ERROR => W5 (pid 2964) died [dpxxdisp.c   14021]
    my types changed after wp death/restart 0xbc --> 0xb8
    ERROR => W6 (pid 2508) died [dpxxdisp.c   14021]
    my types changed after wp death/restart 0xb8 --> 0xb0
    ERROR => W7 (pid 3840) died [dpxxdisp.c   14021]
    my types changed after wp death/restart 0xb0 --> 0xa0
    ERROR => W8 (pid 1072) died [dpxxdisp.c   14021]
    my types changed after wp death/restart 0xa0 --> 0x80
    DP_FATAL_ERROR => DpWPCheck: no more work processes
    DISPATCHER EMERGENCY SHUTDOWN ***
    increase tracelevel of WPs
    NiWait: sleep (10000ms) ...
    NiISelect: timeout 10000ms
    NiISelect: maximum fd=1601
    NiISelect: read-mask is NULL
    NiISelect: write-mask is NULL
    Fri Sep 21 10:20:55 2007
    NiISelect: TIMEOUT occured (10000ms)
    dump system status
    Workprocess Table (long)               Fri Sep 21 04:50:55 2007
    ========================
    No Ty. Pid      Status  Cause Start Err Sem CPU    Time  Program  Cl  User         Action                    Table
    0 DIA     2804 Ended         no      1   0             0                                                             
    1 DIA     1484 Ended         no      1   0             0                                                             
    2 DIA     2708 Ended         no      1   0             0                                                             
    3 DIA     1464 Ended         no      1   0             0                                                             
    4 UPD      860 Ended         no      1   0             0                                                             
    5 ENQ     2964 Ended         no      1   0             0                                                             
    6 BTC     2508 Ended         no      1   0             0                                                             
    7 SPO     3840 Ended         no      1   0             0                                                             
    8 UP2     1072 Ended         no      1   0             0                                                             
    Dispatcher Queue Statistics               Fri Sep 21 04:50:55 2007
    ===========================
    --------++++--
    +
    Typ
    now
    high
    max
    writes
    reads
    --------++++--
    +
    NOWP
    0
    2
    2000
    6
    6
    --------++++--
    +
    DIA
    5
    5
    2000
    5
    0
    --------++++--
    +
    UPD
    0
    0
    2000
    0
    0
    --------++++--
    +
    ENQ
    0
    0
    2000
    0
    0
    --------++++--
    +
    BTC
    0
    0
    2000
    0
    0
    --------++++--
    +
    SPO
    0
    0
    2000
    0
    0
    --------++++--
    +
    UP2
    0
    0
    2000
    0
    0
    --------++++--
    +
    max_rq_id          12
    wake_evt_udp_now     0
    wake events           total     8,  udp     7 ( 87%),  shm     1 ( 12%)
    since last update     total     8,  udp     7 ( 87%),  shm     1 ( 12%)
    Dump of tm_adm structure:               Fri Sep 21 04:50:55 2007
    =========================
    Term    uid  man user    term   lastop  mod wp  ta   a/i (modes)
    Workprocess Comm. Area Blocks               Fri Sep 21 04:50:55 2007
    =============================
    Slots: 300, Used: 1, Max: 0
    --------++--
    +
    id
    owner
    pid
    eyecatcher
    --------++--
    +
    0
    DISPATCHER
    -1
    WPCAAD000
    NiWait: sleep (5000ms) ...
    NiISelect: timeout 5000ms
    NiISelect: maximum fd=1601
    NiISelect: read-mask is NULL
    NiISelect: write-mask is NULL
    Fri Sep 21 10:21:00 2007
    NiISelect: TIMEOUT occured (5000ms)
    DpHalt: shutdown server >inggnh002sap_XID_01                     < (normal)
    DpJ2eeDisableRestart
    DpModState: buffer in state MBUF_PREPARED
    NiBufSend starting
    NiIWrite: hdl 3 sent data (wrt=110,pac=1,MESG_IO)
    MsINiWrite: sent 110 bytes
    MsIModState: change state to SHUTDOWN
    DpModState: change server state from STARTING to SHUTDOWN
    Switch off Shared memory profiling
    ShmProtect( 57, 3 )
    ShmProtect(SHM_PROFILE, SHM_PROT_RW
    ShmProtect( 57, 1 )
    ShmProtect(SHM_PROFILE, SHM_PROT_RD
    DpWakeUpWps: wake up all wp's
    Stop work processes
    Stop gateway
    killing process (776) (SOFT_KILL)
    Stop icman
    killing process (2780) (SOFT_KILL)
    Terminate gui connections
    wait for end of work processes
    wait for end of gateway
    [DpProcDied] Process lives  (PID:776  HANDLE:1572)
    waiting for termination of gateway ...
    NiWait: sleep (1000ms) ...
    NiISelect: timeout 1000ms
    NiISelect: maximum fd=1601
    NiISelect: read-mask is NULL
    NiISelect: write-mask is NULL
    Fri Sep 21 10:21:01 2007
    NiISelect: TIMEOUT occured (1000ms)
    [DpProcDied] Process died  (PID:776  HANDLE:1572)
    wait for end of icman
    [DpProcDied] Process lives  (PID:2780  HANDLE:1576)
    waiting for termination of icman ...
    NiWait: sleep (1000ms) ...
    NiISelect: timeout 1000ms
    NiISelect: maximum fd=1601
    NiISelect: read-mask is NULL
    NiISelect: write-mask is NULL
    Fri Sep 21 10:21:02 2007
    NiISelect: TIMEOUT occured (1000ms)
    [DpProcDied] Process lives  (PID:2780  HANDLE:1576)
    waiting for termination of icman ...
    NiWait: sleep (1000ms) ...
    NiISelect: timeout 1000ms
    NiISelect: maximum fd=1601
    NiISelect: read-mask is NULL
    NiISelect: write-mask is NULL
    Fri Sep 21 10:21:03 2007
    NiISelect: TIMEOUT occured (1000ms)
    [DpProcDied] Process lives  (PID:2780  HANDLE:1576)
    waiting for termination of icman ...
    NiWait: sleep (1000ms) ...
    NiISelect: timeout 1000ms
    NiISelect: maximum fd=1601
    NiISelect: read-mask is NULL
    NiISelect: write-mask is NULL
    Fri Sep 21 10:21:04 2007
    NiISelect: TIMEOUT occured (1000ms)
    [DpProcDied] Process lives  (PID:2780  HANDLE:1576)
    waiting for termination of icman ...
    NiWait: sleep (1000ms) ...
    NiISelect: timeout 1000ms
    NiISelect: maximum fd=1601
    NiISelect: read-mask is NULL
    NiISelect: write-mask is NULL
    Fri Sep 21 10:21:05 2007
    NiISelect: TIMEOUT occured (1000ms)
    [DpProcDied] Process lives  (PID:2780  HANDLE:1576)
    waiting for termination of icman ...
    NiWait: sleep (1000ms) ...
    NiISelect: timeout 1000ms
    NiISelect: maximum fd=1601
    NiISelect: read-mask is NULL
    NiISelect: write-mask is NULL
    Fri Sep 21 10:21:06 2007
    NiISelect: TIMEOUT occured (1000ms)
    [DpProcDied] Process lives  (PID:2780  HANDLE:1576)
    waiting for termination of icman ...
    NiWait: sleep (1000ms) ...
    NiISelect: timeout 1000ms
    NiISelect: maximum fd=1601
    NiISelect: read-mask is NULL
    NiISelect: write-mask is NULL
    Fri Sep 21 10:21:07 2007
    NiISelect: TIMEOUT occured (1000ms)
    [DpProcDied] Process lives  (PID:2780  HANDLE:1576)
    waiting for termination of icman ...
    NiWait: sleep (1000ms) ...
    NiISelect: timeout 1000ms
    NiISelect: maximum fd=1601
    NiISelect: read-mask is NULL
    NiISelect: write-mask is NULL
    Fri Sep 21 10:21:08 2007
    NiISelect: TIMEOUT occured (1000ms)
    [DpProcDied] Process lives  (PID:2780  HANDLE:1576)
    waiting for termination of icman ...
    NiWait: sleep (1000ms) ...
    NiISelect: timeout 1000ms
    NiISelect: maximum fd=1601
    NiISelect: read-mask is NULL
    NiISelect: write-mask is NULL
    Fri Sep 21 10:21:09 2007
    NiISelect: TIMEOUT occured (1000ms)
    [DpProcDied] Process lives  (PID:2780  HANDLE:1576)
    waiting for termination of icman ...
    NiWait: sleep (1000ms) ...
    NiISelect: timeout 1000ms
    NiISelect: maximum fd=1601
    NiISelect: read-mask is NULL
    NiISelect: write-mask is NULL
    Fri Sep 21 10:21:10 2007
    NiISelect: TIMEOUT occured (1000ms)
    [DpProcDied] Process lives  (PID:2780  HANDLE:1576)
    waiting for termination of icman ...
    NiWait: sleep (1000ms) ...
    NiISelect: timeout 1000ms
    NiISelect: maximum fd=1601
    NiISelect: read-mask is NULL
    NiISelect: write-mask is NULL
    Fri Sep 21 10:21:11 2007
    NiISelect: TIMEOUT occured (1000ms)
    [DpProcDied] Process lives  (PID:2780  HANDLE:1576)
    waiting for termination of icman ...
    NiWait: sleep (1000ms) ...
    NiISelect: timeout 1000ms
    NiISelect: maximum fd=1601
    NiISelect: read-mask is NULL
    NiISelect: write-mask is NULL
    Fri Sep 21 10:21:12 2007
    NiISelect: TIMEOUT occured (1000ms)
    [DpProcDied] Process died  (PID:2780  HANDLE:1576)
    [DpProcDied] Process died  (PID:1324  HANDLE:1556)
    DpStartStopMsg: send stop message (myname is >inggnh002sap_XID_01                     <)
    NiIMyHostName: hostname = 'inggnh002sap'
    AdGetSelfIdentRecord: >                                                                           <
    AdCvtRecToExt: opcode 60 (AD_SELFIDENT), ser 0, ex 0, errno 0
    AdCvtRecToExt: opcode 4 (AD_STARTSTOP), ser 0, ex 0, errno 0
    DpConvertRequest: net size = 189 bytes
    NiBufSend starting
    NiIWrite: hdl 3 sent data (wrt=562,pac=1,MESG_IO)
    MsINiWrite: sent 562 bytes
    send msg (len 110+452) to name                    -, type 4, key -
    DpStartStopMsg: stop msg sent
    NiIRead: hdl 3 received data (rcd=274,pac=1,MESG_IO)
    NiBufIIn: NIBUF len=274
    NiBufIIn: packet complete for hdl 3
    NiBufReceive starting
    MsINiRead: received 274 bytes
    MSG received, len 110+164, flag 1, from MSG_SERVER          , typ 0, key -
    DpHalt: received 164 bytes from message server
    NiIRead: hdl 3 received data (rcd=274,pac=1,MESG_IO)
    NiBufIIn: NIBUF len=274
    NiBufIIn: packet complete for hdl 3
    NiBufReceive starting
    MsINiRead: received 274 bytes
    MSG received, len 110+164, flag 1, from MSG_SERVER          , typ 0, key -
    DpHalt: received 164 bytes from message server
    NiIRead: hdl 3 received data (rcd=274,pac=1,MESG_IO)
    NiBufIIn: NIBUF len=274
    NiBufIIn: packet complete for hdl 3
    NiBufReceive starting
    MsINiRead: received 274 bytes
    MSG received, len 110+164, flag 1, from MSG_SERVER          , typ 0, key -
    DpHalt: received 164 bytes from message server
    NiIRead: hdl 3 received data (rcd=274,pac=1,MESG_IO)
    NiBufIIn: NIBUF len=274
    NiBufIIn: packet complete for hdl 3
    NiBufReceive starting
    MsINiRead: received 274 bytes
    MSG received, len 110+164, flag 1, from MSG_SERVER          , typ 0, key -
    DpHalt: received 164 bytes from message server
    NiIRead: hdl 3 received data (rcd=274,pac=1,MESG_IO)
    NiBufIIn: NIBUF len=274
    NiBufIIn: packet complete for hdl 3
    NiBufReceive starting
    MsINiRead: received 274 bytes
    MSG received, len 110+164, flag 1, from MSG_SERVER          , typ 0, key -
    DpHalt: received 164 bytes from message server
    NiIRead: hdl 3 received data (rcd=274,pac=1,MESG_IO)
    NiBufIIn: NIBUF len=274
    NiBufIIn: packet complete for hdl 3
    NiBufReceive starting
    MsINiRead: received 274 bytes
    MSG received, len 110+164, flag 1, from MSG_SERVER          , typ 0, key -
    DpHalt: received 164 bytes from message server
    NiIRead: hdl 3 received data (rcd=274,pac=1,MESG_IO)
    NiBufIIn: NIBUF len=274
    NiBufIIn: packet complete for hdl 3
    NiBufReceive starting
    MsINiRead: received 274 bytes
    MSG received, len 110+164, flag 1, from MSG_SERVER          , typ 0, key -
    DpHalt: received 164 bytes from message server
    NiIRead: hdl 3 recv would block (errno=EAGAIN)
    NiIRead: read for hdl 3 timed out (0ms)
    DpHalt: no more messages from the message server
    DpHalt: send keepalive to synchronize with the message server
    NiBufSend starting
    NiIWrite: hdl 3 sent data (wrt=114,pac=1,MESG_IO)
    MsINiWrite: sent 114 bytes
    send msg (len 110+4) to name           MSG_SERVER, type 0, key -
    MsSndName: MS_NOOP ok
    Send 4 bytes to MSG_SERVER
    NiIRead: hdl 3 received data (rcd=114,pac=1,MESG_IO)
    NiBufIIn: NIBUF len=114
    NiBufIIn: packet complete for hdl 3
    NiBufReceive starting
    MsINiRead: received 114 bytes
    MSG received, len 110+4, flag 3, from MSG_SERVER          , typ 0, key -
    Received 4 bytes from MSG_SERVER                             
    Received opcode MS_NOOP from msg_server, reply MSOP_OK
    MsOpReceive: ok
    MsSendKeepalive : keepalive sent to message server
    NiIRead: hdl 3 recv would block (errno=EAGAIN)
    Fri Sep 21 10:21:13 2007
    NiIPeek: peek for hdl 3 timed out (r; 1000ms)
    NiIRead: read for hdl 3 timed out (1000ms)
    DpHalt: no more messages from the message server
    DpHalt: sync with message server o.k.
    detach from message server
    ***LOG Q0M=> DpMsDetach, ms_detach () [dpxxdisp.c   11698]
    NiBufSend starting
    NiIWrite: hdl 3 sent data (wrt=110,pac=1,MESG_IO)
    MsINiWrite: sent 110 bytes
    MsIDetach: send logout to msg_server
    MsIDetach: call exit function
    DpMsShutdownHook called
    NiBufISelUpdate: new MODE -- (r-) for hdl 3 in set0
    SiSelNSet: set events of sock 1516 to: ---
    NiBufISelRemove: remove hdl 3 from set0
    SiSelNRemove: removed sock 1516 (pos=3)
    SiSelNRemove: removed sock 1516
    NiSelIRemove: removed hdl 3
    MBUF state OFF
    AdGetSelfIdentRecord: >                                                                           <
    AdCvtRecToExt: opcode 60 (AD_SELFIDENT), ser 0, ex 0, errno 0
    AdCvtRecToExt: opcode 40 (AD_MSBUF), ser 0, ex 0, errno 0
    AdCvtRecToExt: opcode 40 (AD_MSBUF), ser 0, ex 0, errno 0
    blks_in_queue/wp_ca_blk_no/wp_max_no = 1/300/9
    LOCK WP ca_blk 1
    make DISP owner of wp_ca_blk 1
    DpRqPutIntoQueue: put request into queue (reqtype 1, prio LOW, rq_id 15)
    MBUF component DOWN
    NiICloseHandle: shutdown and close hdl 3 / sock 1516
    NiBufIClose: clear extension for hdl 3
    MsIDetach: detach MS-system
    cleanup EM
    EsCleanup ....
    EmCleanup() -> 0
    Es2Cleanup: Cleanup ES2
    ***LOG Q05=> DpHalt, DPStop ( 1412) [dpxxdisp.c   10087]
    Good Bye .....
    Please Help, it is urgent,
    Regards,
    Study SAP

    Hi Kaushal,
    Thanks for your reply, there are many files with dev*.
    Please check the log from file dev_w0 :
    trc file: "dev_w0", trc level: 1, release: "700"
    ACTIVE TRACE LEVEL           1
    ACTIVE TRACE COMPONENTS      all, MJ

    B Fri Sep 21 10:37:39 2007
    B  create_con (con_name=R/3)
    B  Loading DB library 'D:\usr\sap\XID\DVEBMGS01\exe\dboraslib.dll' ...
    B  Library 'D:\usr\sap\XID\DVEBMGS01\exe\dboraslib.dll' loaded
    B  Version of 'D:\usr\sap\XID\DVEBMGS01\exe\dboraslib.dll' is "700.08", patchlevel (0.46)
    B  New connection 0 created
    M sysno      01
    M sid        XID
    M systemid   560 (PC with Windows NT)
    M relno      7000
    M patchlevel 0
    M patchno    52
    M intno      20050900
    M make:      multithreaded, Unicode, optimized
    M pid        3588
    M
    M  kernel runs with dp version 210000(ext=109000) (@(#) DPLIB-INT-VERSION-210000-UC)
    M  length of sys_adm_ext is 572 bytes
    M  ***LOG Q0Q=> tskh_init, WPStart (Workproc 0 3588) [dpxxdisp.c   1293]
    I  MtxInit: 30000 0 0
    M  DpSysAdmExtCreate: ABAP is active
    M  DpSysAdmExtCreate: VMC (JAVA VM in WP) is not active

    M Fri Sep 21 10:37:40 2007
    M  DpShMCreate: sizeof(wp_adm)          12672     (1408)
    M  DpShMCreate: sizeof(tm_adm)          3954072     (19672)
    M  DpShMCreate: sizeof(wp_ca_adm)          24000     (80)
    M  DpShMCreate: sizeof(appc_ca_adm)     8000     (80)
    M  DpCommTableSize: max/headSize/ftSize/tableSize=500/8/528056/528064
    M  DpShMCreate: sizeof(comm_adm)          528064     (1048)
    M  DpFileTableSize: max/headSize/ftSize/tableSize=0/0/0/0
    M  DpShMCreate: sizeof(file_adm)          0     (72)
    M  DpShMCreate: sizeof(vmc_adm)          0     (1452)
    M  DpShMCreate: sizeof(wall_adm)          (38456/34360/64/184)
    M  DpShMCreate: sizeof(gw_adm)     48
    M  DpShMCreate: SHM_DP_ADM_KEY          (addr: 06510040, size: 4607512)
    M  DpShMCreate: allocated sys_adm at 06510040
    M  DpShMCreate: allocated wp_adm at 06511E28
    M  DpShMCreate: allocated tm_adm_list at 06514FA8
    M  DpShMCreate: allocated tm_adm at 06514FD8
    M  DpShMCreate: allocated wp_ca_adm at 068DA570
    M  DpShMCreate: allocated appc_ca_adm at 068E0330
    M  DpShMCreate: allocated comm_adm at 068E2270
    M  DpShMCreate: system runs without file table
    M  DpShMCreate: allocated vmc_adm_list at 06963130
    M  DpShMCreate: allocated gw_adm at 06963170
    M  DpShMCreate: system runs without vmc_adm
    M  DpShMCreate: allocated ca_info at 069631A0
    M  DpShMCreate: allocated wall_adm at 069631A8
    X  EmInit: MmSetImplementation( 2 ).
    X  MM diagnostic options set: 0
    X  <ES> client 0 initializing ....
    X  Using implementation flat
    M  <EsNT> Memory Reset disabled as NT default
    X  ES initialized.
    M  ThInit: running on host inggnh002sap

    M Fri Sep 21 10:37:41 2007
    M  calling db_connect ...
    C  Prepending D:\usr\sap\XID\DVEBMGS01\exe to Path.

    C Fri Sep 21 10:37:47 2007
    C  Client NLS settings: AMERICAN_AMERICA.UTF8
    C  Logon as OPS$-user to get SAPSR3's password
    C  Connecting as /@XDI on connection 0 (nls_hdl 0) ... (dbsl 700 240106)
    C  Nls CharacterSet                 NationalCharSet              C      EnvHp      ErrHp ErrHpBatch
    C    0 UTF8                                                      1   06AAFCF8   06AB5294   06AB4B1C
    C  Attaching to DB Server XDI (con_hdl=0,svchp=06AB4A68,svrhp=06AC6334)

    C Fri Sep 21 10:37:48 2007
    C  Starting user session (con_hdl=0,svchp=06AB4A68,srvhp=06AC6334,usrhp=06ADB0D8)
    C  *** ERROR => OCI-call 'OCISessionBegin' failed: rc = 1033
    [dboci.c      4345]
    C  Detaching from DB Server (con_hdl=0,svchp=06AB4A68,srvhp=06AC6334)
    C  *** ERROR => CONNECT failed with sql error '1033'
    [dbsloci.c    10704]
    C  Try to connect with default password
    C  Connecting as SAPSR3/<pwd>@XDI on connection 0 (nls_hdl 0) ... (dbsl 700 240106)
    C  Nls CharacterSet                 NationalCharSet              C      EnvHp      ErrHp ErrHpBatch
    C    0 UTF8                                                      1   06AAFCF8   06AB5294   06AB4B1C
    C  Attaching to DB Server XDI (con_hdl=0,svchp=06AB4A68,svrhp=06AC6334)

    C Fri Sep 21 10:37:49 2007
    C  Starting user session (con_hdl=0,svchp=06AB4A68,srvhp=06AC6334,usrhp=06ADB0D8)
    C  *** ERROR => OCI-call 'OCISessionBegin' failed: rc = 1033
    [dboci.c      4345]
    C  Detaching from DB Server (con_hdl=0,svchp=06AB4A68,srvhp=06AC6334)
    C  *** ERROR => CONNECT failed with sql error '1033'
    [dbsloci.c    10704]
    B  ***LOG BV3=> severe db error 1033      ; work process is stopped [dbsh#2 @ 1199] [dbsh    1199 ]
    B  ***LOG BY2=> sql error 1033   performing CON [dblink#3 @ 431] [dblink  0431 ]
    B  ***LOG BY0=> ORA-01033: ORACLE initialization or shutdown in progress [dblink#3 @ 431] [dblink  0431 ]
    M  ***LOG R19=> ThInit, db_connect ( DB-Connect 000256) [thxxhead.c   1403]
    M  in_ThErrHandle: 1
    M  *** ERROR => ThInit: db_connect (step 1, th_errno 13, action 3, level 1) [thxxhead.c   10019]

    M  Info for wp 0

    M    stat = 4
    M    reqtype = 1
    M    act_reqtype = -1
    M    rq_info = 0
    M    tid = -1
    M    mode = 255
    M    len = -1
    M    rq_id = 65535
    M    rq_source = 255
    M    last_tid = 0
    M    last_mode = 0
    M    semaphore = 0
    M    act_cs_count = 0
    M    control_flag = 0
    M    int_checked_resource(RFC) = 0
    M    ext_checked_resource(RFC) = 0
    M    int_checked_resource(HTTP) = 0
    M    ext_checked_resource(HTTP) = 0
    M    report = >                                        <
    M    action = 0
    M    tab_name = >                              <
    M    vm = V-1

    M  *****************************************************************************
    M  *
    M  *  LOCATION    SAP-Server inggnh002sap_XID_01 on host inggnh002sap (wp 0)
    M  *  ERROR       ThInit: db_connect
    M  *
    M  *  TIME        Fri Sep 21 10:37:49 2007
    M  *  RELEASE     700
    M  *  COMPONENT   Taskhandler
    M  *  VERSION     1
    M  *  RC          13
    M  *  MODULE      thxxhead.c
    M  *  LINE        10204
    M  *  COUNTER     1
    M  *
    M  *****************************************************************************

    M  PfStatDisconnect: disconnect statistics
    M  Entering TH_CALLHOOKS
    M  ThCallHooks: call hook >ThrSaveSPAFields< for event BEFORE_DUMP
    M  *** ERROR => ThrSaveSPAFields: no valid thr_wpadm [thxxrun1.c   720]
    M  *** ERROR => ThCallHooks: event handler ThrSaveSPAFields for event BEFORE_DUMP failed [thxxtool3.c  260]
    M  Entering ThSetStatError
    M  ThIErrHandle: do not call ThrCoreInfo (no_core_info=0, in_dynp_env=0)
    M  Entering ThReadDetachMode
    M  call ThrShutDown (1)...
    M  ***LOG Q02=> wp_halt, WPStop (Workproc 0 3588) [dpnttool.c   327]
    Regards,
    Study SAP

  • DB Link is not Active

    Hi DBAs,
    I have 2 DBs in 2 different servers and trying to create DB link from dbA(serverA) to dbB(serverB). I've created the DB link using OEM in dbA but when test the link I'm prompted with "The Database Link is not Active".
    I've disabled the "NAMES.DEFAULT_DOMAIN" entry in sqlnet.ora files of both servers. The db_domain of both DBs are equal to "WORLD". And global_name of dbA is DBA.WORLD and dbB is DBB.WORLD. Meanwhile the global_names in pfile = FALSE. My tnsping to dbB from serverA is working fine and even I can connect to the dbB using sqlplus with the same login credentials that I've used to create the DB link in OEM.
    Hope you guys will help me to resolve my problem.
    Thanks,
    Nesan
    Edited by: BinaryNesan on Mar 18, 2011 3:02 PM

    "The Database Link is not Active". Is that an Oracle Error Message with an ORA- error number ? Or a message returned by the front-end tool that you used (OEM ?).
    Did you configure the tnsnames.ora entry for the remote database in the database server's ORACLE_HOME -- which may be different from your client / OEM ORACLE_HOME ? A DBLink uses the ORACLE_HOME that is used to start the database instance.
    Hemant K Chitale

  • Database Link not Active

    I am trying to create a database link from Oracle 7.3.4 to Oracle 8i. When I click the "Test" button in OEM ( after entering the relevant data) I am getting an error that reads "Database Link not Active". What am I doing wrong? can someone help?

    Hi ,
    Thanks again for your quick and extremely helpful response.
    As you have guessed this is my clients tnsname.ora file. From your response i believe i need to check the tnsnames.ora file of the database itself ( i assume it resides in the server box).
    I used the same exact systax for creating the link and the link was successfully created. But i was not able to access any table and was getting the error "TNS: could not resolve service name." Now i understand that the 7.3 server is not able to connect to the 8i, as it does not know of its existence (as there is no information available in its own tnsnames.ora file). Am i right?
    Thank you once more.
    You will make my day (assuming i understood you right.)

  • Managed Standby Recovery not active

    Dear All,
    My database version is:
    SQL> select banner from v$version;
    BANNER
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Prod
    PL/SQL Release 10.2.0.1.0 - Production
    CORE 10.2.0.1.0 Production
    TNS for Linux: Version 10.2.0.1.0 - Production
    NLSRTL Version 10.2.0.1.0 - Production
    OS:RedHat 5.5
    My current configuration is:
    We have two node RAC primary database and a local standby database.
    And TWO NODE RAC DR (REMOTE)STANDBY DATABASE
    while checking (REMOTE WHICH IS TWO NODE RAC)dr synchronization we found archive since yesterday has not been applied.
    But local dr is fully sinc with the primary database.
    When i have executed 'ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL' it says
    SQL> alter database recover managed standby database cancel;
    alter database recover managed standby database cancel
    ERROR at line 1:
    ORA-16136: Managed Standby Recovery not active
    I manually copied the archive log which where missing in the remote standby database and then register those archive log.
    after that when i manually tried to recover the standby database it has given me following error.
    sql>recover automatic standby database;
    ORA-00283: recovery session canceled due to errors
    ORA-01124: cannot recover data file 1 - file is in use or recovery
    ORA-01110:data file 1: '/database/ctmis/system01.dbf'
    please please help me to resolve the issue.
    Thanks and Regards
    Monoj Das

    according to my understand
    Node1,Node2 is having node1-standby node2-standby in RAC environment right?
    on which node logs ur trying to apply on which node standby? (node1 ==>node1-standby or node2 ==>node2-standby)
    check it...hope it will work or not sure :)
    standby side...
    rman target /
    RMAN>crosscheck archivelog all
    then try to recover..will see ..
    if not
    check with support.oracle.com through SR.

  • Help with WITH clause (ORA-24374: define not done before fetch or execute)

    Hi all
    I am uising with clause in SQL and getting this error. Please help ORA-24374: define not done before fetch or execute and fetch
    with dea as
    (SELECT MAX (idnt_value_cd) dea_num_cd,
    MAX (xtl_bpa_idnt_value_eff_dt)dea_eff_dt,
    MAX (idnt_value_cd_term_dt)dea_exp_dt,bpa_id
    FROM xtl_bpa_idnt_value
    WHERE xtl_bpa_idnt_id = 1
    AND merci_util.is_date_range_active
    (xtl_bpa_idnt_value_eff_dt,
    idnt_value_cd_term_dt
    ) = 0
    GROUP BY bpa_id)
    SELECT 'IPLAN' src_sys_name, bp.bp_id src_bp_id, 'INDV' bp_type_cd,
    CAST (NULL AS VARCHAR2 (10)) src_bp_clsfn_cd,
    CAST (NULL AS VARCHAR2 (10)) src_bp_sub_clsfn_cd,
    CAST (NULL AS VARCHAR2 (100)) bp_name, hcp.first_nm first_nm,
    hcp.middle_nm midl_nm, hcp.last_nm last_nm,
    hcp.name_pfx_dcd salu_txt, hcp.name_sufx_dcd sfx_txt,
    birth_yr_cd || birth_mth_cd || birth_day_cd birth_dt,
    gender_dcd gndr_cd, mpro_type.mpro_cd src_pfsnl_dgntn_cd,
    (SELECT spty_nm
    FROM specialty
    WHERE spty_id =
    (SELECT spty_id
    FROM bp_specialty
    WHERE bp_id = bp.bp_id
    AND bp_specialty_id =
    (SELECT MAX (bp_specialty_id)
    FROM bp_specialty
    WHERE bp_id = bp.bp_id)))
    src_prim_mdcl_spty_cd,
    (SELECT spty_nm
    FROM specialty
    WHERE spty_id =
    (SELECT spty_id
    FROM bp_specialty
    WHERE bp_id = bp.bp_id
    AND bp_specialty_id =
    (SELECT MAX (bp_specialty_id) - 1
    FROM bp_specialty
    WHERE bp_id = bp.bp_id)))
    src_sec_mdcl_spty_cd,
    (SELECT spty_nm
    FROM specialty
    WHERE spty_id =
    (SELECT spty_id
    FROM bp_specialty
    WHERE bp_id = bp.bp_id
    AND bp_specialty_id =
    (SELECT MAX (bp_specialty_id) - 2
    FROM bp_specialty
    WHERE bp_id = bp.bp_id)))
    src_tert_mdcl_spty_cd,
    lic.lic_num_cd src_st_lic_num, vhcp.state_cd src_sln_state_cd,
    lic.lic_eff_dt src_st_lic_eff_dt,
    lic.lic_expr_dt src_st_lic_exprn_dt,
    bp_status.bp_status_type_dcd src_bp_actv_ind,
    bp_status.bp_status_eff_dt src_bp_sta_chg_dt,
    mpro_type.mpro_type_dcd titl_txt,
    CAST (NULL AS VARCHAR2 (10)) src_cmeh_bp_id,
    (SELECT xtl_bp_idnt_value_cd
    FROM xtl_bp_idnt_value
    WHERE bp_id = vhcp.hcp_id AND xtl_bp_idnt_id = 6)
    callmax_cust_id,
    CAST (NULL AS VARCHAR2 (10)) wk_num,
    (SELECT xtl_bp_idnt_value_cd
    FROM xtl_bp_idnt_value
    WHERE bp_id = vhcp.hcp_id AND xtl_bp_idnt_id = 26) ims_psbr_num,
    (SELECT xtl_bp_idnt_value_cd
    FROM xtl_bp_idnt_value
    WHERE bp_id = vhcp.hcp_id AND xtl_bp_idnt_id = 22) ama_num,
    (SELECT xtl_bp_idnt_value_cd
    FROM xtl_bp_idnt_value
    WHERE bp_id = vhcp.hcp_id AND xtl_bp_idnt_id = 3) aoa_num,
    (SELECT xtl_bp_idnt_value_cd
    FROM xtl_bp_idnt_value
    WHERE bp_id = vhcp.hcp_id AND xtl_bp_idnt_id = 21) ada_num,
    CAST (NULL AS VARCHAR2 (10)) vet_num,
    (SELECT xtl_bp_idnt_value_cd
    FROM xtl_bp_idnt_value
    WHERE bp_id = vhcp.hcp_id AND xtl_bp_idnt_id = 23) np_num,
    (SELECT xtl_bp_idnt_value_cd
    FROM xtl_bp_idnt_value
    WHERE bp_id = vhcp.hcp_id AND xtl_bp_idnt_id = 20) pa_num,
    CAST (NULL AS VARCHAR2 (10)) pod_num,
    CAST (NULL AS VARCHAR2 (10)) opt_num,
    (SELECT xtl_bp_idnt_value_cd
    FROM xtl_bp_idnt_value
    WHERE bp_id = vhcp.hcp_id AND xtl_bp_idnt_id = 7) tax_id,
    CAST (NULL AS VARCHAR2 (10)) hin_num,
    CAST (NULL AS VARCHAR2 (10)) npi_num,
    vhcp.phone_num_cd bp_off_phn_num, vhcp.fax_num_cd bp_fax_num,
    CAST (NULL AS VARCHAR2 (10)) bp_cell_phn_num,
    CAST (NULL AS VARCHAR2 (10)) bp_pager_num,
    CAST (NULL AS VARCHAR2 (10)) bp_home_phn_num,
    CAST (NULL AS VARCHAR2 (10)) bp_vmail_num,
    vhcp.e_mail_cd bp_email_addr_txt,
    CAST (NULL AS VARCHAR2 (10)) bp_url, vhcp.bpa_id src_bpa_id,
    vhcp.addr_1_ds addr_ln_1_txt, addr_2_ds addr_ln_2_txt,
    CAST (NULL AS VARCHAR2 (10)) addr_ln_3_txt,
    CAST (NULL AS VARCHAR2 (10)) addr_ln_4_txt, city_nm,
    state_nm state_cd, postal_cd zip_5,
    CAST (NULL AS VARCHAR2 (10)) zip_4,
    vhcp.pfrd_ctac_loc_ind pfr_locn_ind,
    DECODE
    (merci_util.is_date_range_active ((SELECT bp_address.eff_dt
    FROM bp_address
    WHERE bpa_id = vhcp.bpa_id),
    (SELECT bp_address.end_dt
    FROM bp_address
    WHERE bpa_id = vhcp.bpa_id)
    0, 'ACTIVE',
    'INACTIVE'
    ) src_bpa_actv_ind,
    TO_CHAR (vhcp.bpa_updt_dtm, ' YYYYMMDD') src_bpa_sta_chg_dt,
    vhcp.prac_loc_ind bpa_off_addr_ind,
    vhcp.ship_to_loc_ind bpa_ship_addr_ind,
    vhcp.pfrd_fncl_loc_ind bpa_bill_addr_ind,
    (SELECT bp_address.mail_loc_ind
    FROM bp_address
    WHERE bpa_id = vhcp.bpa_id) bpa_mail_addr_ind,
    CAST (NULL AS VARCHAR2 (10)) bpa_sm_addr_ind,
    (SELECT bp_address.home_loc_ind
    FROM bp_address
    WHERE bpa_id = vhcp.bpa_id) bpa_home_addr_ind,
    CAST (NULL AS VARCHAR2 (10)) bpa_hdqtr_addr_ind,
    vhcp.affiliation_ind bpa_affl_addr_ind,
    CAST (NULL AS VARCHAR2 (10)) bpa_prov_addr_ind,
    CAST (NULL AS VARCHAR2 (10)) bpa_other_addr_ind,
    dea.dea_num_cd,
    dea.dea_eff_dt,
    dea.dea_exp_dt,
    CAST (NULL AS VARCHAR2 (10)) schd_clas_cd,
    (SELECT MAX (idnt_value_cd) affl_id_cd
    FROM xtl_bpa_idnt_value
    WHERE 1 = 1
    AND xtl_bpa_idnt_id = 3
    AND merci_util.is_date_range_active
    (xtl_bpa_idnt_value_eff_dt,
    idnt_value_cd_term_dt
    ) = 0
    AND xtl_bpa_idnt_value.bpa_id = vhcp.bpa_id
    GROUP BY bpa_id) ims_outlet_num,
    (SELECT MAX (idnt_value_cd) affl_id_cd
    FROM xtl_bpa_idnt_value
    WHERE 1 = 1
    AND xtl_bpa_idnt_id = 6
    AND merci_util.is_date_range_active
    (xtl_bpa_idnt_value_eff_dt,
    idnt_value_cd_term_dt
    ) = 0
    AND xtl_bpa_idnt_value.bpa_id = vhcp.bpa_id
    GROUP BY bpa_id) callmax_afln_id,
    CAST (NULL AS VARCHAR2 (10)) src_cmeh_bpa_id,
    vhcp.bpa_id src_addr_id, vhcp.phone_num_cd bpa_off_num,
    vhcp.fax_num_cd bpa_fax_num,
    CAST (NULL AS VARCHAR2 (10)) bpa_cell_phn_num,
    CAST (NULL AS VARCHAR2 (10)) bpa_pager_num,
    CAST (NULL AS VARCHAR2 (10)) bpa_home_phn_num,
    CAST (NULL AS VARCHAR2 (10)) bpa_vmail_num,
    vhcp.e_mail_cd bpa_email_addr_txt,
    CAST (NULL AS VARCHAR2 (10)) bpa_url,
    CAST (NULL AS VARCHAR2 (10)) bp_filler_1,
    CAST (NULL AS VARCHAR2 (10)) bp_filler_2,
    CAST (NULL AS VARCHAR2 (10)) bp_filler_3,
    CAST (NULL AS VARCHAR2 (10)) bp_filler_4,
    CAST (NULL AS VARCHAR2 (10)) bp_filler_5,
    CAST (NULL AS VARCHAR2 (10)) bpa_filler_1,
    CAST (NULL AS VARCHAR2 (10)) bpa_filler_2,
    CAST (NULL AS VARCHAR2 (10)) bpa_filler_3,
    CAST (NULL AS VARCHAR2 (10)) bpa_filler_4,
    CAST (NULL AS VARCHAR2 (10)) bpa_filler_5,
    max_date (max_date (vhcp.bpa_updt_dtm, vhcp.hcp_updt_dtm),
    bp_status.updt_dtm
    ) updt_dtm,
    SYSDATE refresh_dtm
    FROM business_party bp,
    hcp,
    (SELECT hcp_id, lic_num_cd, MIN (lic_eff_dt) lic_eff_dt,
    MAX (lic_expr_dt) lic_expr_dt
    FROM mpro_govt_org_license
    WHERE 1 = 1
    AND merci_util.is_date_range_active (lic_eff_dt, lic_expr_dt) =
    0
    GROUP BY hcp_id, mpro_type_dcd, geoa_id, lic_num_cd) lic,
    (SELECT code_type_nm, code_value_cd mpro_type_dcd,
    xtl_src_obj_cd mpro_cd
    FROM xtl_src_code_value
    WHERE 1 = 1 AND code_type_nm = 'MPRO_TYPE') mpro_type,
    vm_hcp_address vhcp,
    bp_status,
    dea
    WHERE bp.bp_id = hcp.hcp_id
    AND hcp.hcp_id = lic.hcp_id(+)
    AND dea.bpa_id(+) = vhcp.bpa_id
    AND bp.hcp_ind = 'Y'
    AND hcp.mpro_type_1_dcd = mpro_type.mpro_type_dcd(+)
    AND hcp.hcp_id = vhcp.hcp_id
    AND hcp.srch_ctac_bpa_id = vhcp.bpa_id
    AND hcp.hcp_id = bp_status.bp_id
    and hcp.hcp_id=2200970

    Do you have an Oracle version? Trick question, you do, we just have no idea what it is.
    select * from v$version;Also, do you have a line number where this error occurs? Another trick question, you do, but you haven't posted it :(
    And finally, what are you using to run this query (SQLPLUS, SQLDEVELOPER, TOAD, etc....).
    And finally finally, please use the code tags .... { code } with no spaces so that your code doesn't look like a dictionary vomiting.
    Thanks.

  • Install OLAPTRAIN  cause ORA-00439: fonction non activée : Partitioning

    hello,
    i try to install olaptrain in database 11GR2 64 bits
    http://www.oracle.com/technetwork/database/enterprise-edition/readme-098894.html
    Import: Release 11.2.0.1.0 - Production on Jeu. Sept. 9 18:08:10 2010
    Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
    ConnectÚ Ó : Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit P
    roduction
    With the OLAP option
    Table ma¯tre "OLAPTRAIN"."SYS_IMPORT_FULL_01" chargÚe/dÚchargÚe avec succÞs
    DÚmarrage de "OLAPTRAIN"."SYS_IMPORT_FULL_01" : olaptrain/******** dumpfile=OLAP
    TRAIN12232009.DMP directory=OLAPTRAIN_INSTALL
    Traitement du type d'objet SCHEMA_EXPORT/PRE_SCHEMA/PROCACT_SCHEMA
    Traitement du type d'objet SCHEMA_EXPORT/SEQUENCE/SEQUENCE
    Traitement du type d'objet SCHEMA_EXPORT/TABLE/TABLE
    ORA-39083: Echec de la crÚation du type d'objet TABLE:"OLAPTRAIN"."SALES_FACT" a
    vec erreur :
    ORA-00439: fonction non activÚe : Partitioning
    Partitioning is necessary ?
    if yes , how to install it ?
    regards
    JM

    Tables in the OLAPTRAIN schema are partitioned. Also note that partitioning and OLAP require Oracle Enterprise Edition. I don't know how to enable partitioning, but I'm sure it's in the documentation. You could also try the general Oracle database forum. (General Database Discussions

  • BACKUP LOG suddenly failed with Msg 35250, Level 16, State 11 The connection to the primary replica is not active. The command cannot be processed.

    I have AlwaysOn SQL 2012 Enterprise set-up using Windows Failover Clustering Services (not FCI), and have 1 Primary node (P), 1 Synchronous Commit Auto Failover (SC), and 1 Asynchronous Commit Manual Failover (AC) node.  It is set up to prefer secondary,
    with the highest priority given to AC node.
    I am using Ola Hollengren's scripts for Database Maintenance jobs, including a native BACKUP LOG job for the transaction logs of all user databases on a 1 minute schedule.  His scripts already consider AlwaysOn, and although the job is set-up on all
    3 nodes, only ever runs on AC node.
    The job has been running successfully since initial set-up almost 1 year ago, but suddenly yesterday morning started to fail with the following error, only on 1 of the 13 databases in my availability group:
    Date and time: 2014-06-08 09:36:11
    Command: BACKUP LOG [my_db] TO DISK = N'E:\MSSQL\\Transaction Dumps\my_db\MySQLCL$MySQLAG_my_db_20140608_093610_U_LOG.trn' WITH CHECKSUM, COMPRESSION
    Msg 35250, Level 16, State 11, Server AC, Line 1
    The connection to the primary replica is not active.  The command cannot be processed.
    Msg 3013, Level 16, State 1, Server AC, Line 1
    BACKUP LOG is terminating abnormally.
    Outcome: Failed
    Duration: 00:01:00
    The other 12 databases continued to backup successfully.
    Checking the Availability Group dashboard, windows event logs, and SQL Server error logs, including Failover Cluster events showed no issues.
    However, monitoring software (Idera SQLdm) showed blocked sessions on P node.  When I ran sp_who2, it showed that a background process was being blocked by another background process with an HADR BACKUP LOCK.
    Since both processes were background processes, I was unable to kill either process.  I temporarily disabled the transaction log backup job, but the blocked process was still active.
    I ran DBCC CHECKDB (my_db) WITH all_errormsgs, no_infomsgs, data_purity on both P and AC nodes, with no errors.  However, on AC node, it also showed 1 transaction rolled forward and 0 transactions rolled back.  This also had the effect of releasing
    the blocked background process, but another background process was now blocking with the same HADR BACKUP LOCK.
    I tried to restart SQL Server Agent on AC node, which did not immediately seem to work.  However, after a few minutes, I noticed that the block had disappeared.  I re-enabled the transaction log backup job on AC and it started working normally
    again.  The error has not occurred again, but I am at a loss as to what happened, and how to prevent it from happening again.
    Any help would be greatly appreciated.
    Diane

    And here is part 2 of the stored procedure:
    --// Execute backup commands //--
    WHILE EXISTS (SELECT * FROM @tmpDatabases WHERE Selected = 1 AND Completed = 0)
    BEGIN
    SELECT TOP 1 @CurrentDBID = ID,
    @CurrentDatabaseName = DatabaseName,
    @CurrentDatabaseNameFS = DatabaseNameFS,
    @CurrentDatabaseType = DatabaseType
    FROM @tmpDatabases
    WHERE Selected = 1
    AND Completed = 0
    ORDER BY ID ASC
    SET @CurrentDatabaseID = DB_ID(@CurrentDatabaseName)
    IF DATABASEPROPERTYEX(@CurrentDatabaseName,'Status') = 'ONLINE'
    BEGIN
    IF EXISTS (SELECT * FROM sys.database_recovery_status WHERE database_id = @CurrentDatabaseID AND database_guid IS NOT NULL)
    BEGIN
    SET @CurrentIsDatabaseAccessible = 1
    END
    ELSE
    BEGIN
    SET @CurrentIsDatabaseAccessible = 0
    END
    END
    ELSE
    BEGIN
    SET @CurrentIsDatabaseAccessible = 0
    END
    SELECT @CurrentDifferentialBaseLSN = differential_base_lsn
    FROM sys.master_files
    WHERE database_id = @CurrentDatabaseID
    AND [type] = 0
    AND [file_id] = 1
    -- Workaround for a bug in SQL Server 2005
    IF @Version >= 9 AND @Version < 10
    AND EXISTS(SELECT * FROM sys.master_files WHERE database_id = @CurrentDatabaseID AND [type] = 0 AND [file_id] = 1 AND differential_base_lsn IS NOT NULL AND differential_base_guid IS NOT NULL AND differential_base_time IS NULL)
    BEGIN
    SET @CurrentDifferentialBaseLSN = NULL
    END
    SELECT @CurrentDifferentialBaseIsSnapshot = is_snapshot
    FROM msdb.dbo.backupset
    WHERE database_name = @CurrentDatabaseName
    AND [type] = 'D'
    AND checkpoint_lsn = @CurrentDifferentialBaseLSN
    IF DATABASEPROPERTYEX(@CurrentDatabaseName,'Status') = 'ONLINE'
    BEGIN
    SELECT @CurrentLogLSN = last_log_backup_lsn
    FROM sys.database_recovery_status
    WHERE database_id = @CurrentDatabaseID
    END
    SET @CurrentBackupType = @BackupType
    IF @ChangeBackupType = 'Y'
    BEGIN
    IF @CurrentBackupType = 'LOG' AND DATABASEPROPERTYEX(@CurrentDatabaseName,'Recovery') <> 'SIMPLE' AND @CurrentLogLSN IS NULL AND @CurrentDatabaseName <> 'master'
    BEGIN
    SET @CurrentBackupType = 'DIFF'
    END
    IF @CurrentBackupType = 'DIFF' AND @CurrentDifferentialBaseLSN IS NULL AND @CurrentDatabaseName <> 'master'
    BEGIN
    SET @CurrentBackupType = 'FULL'
    END
    END
    IF @CurrentBackupType = 'LOG'
    BEGIN
    SELECT @CurrentLatestBackup = MAX(backup_finish_date)
    FROM msdb.dbo.backupset
    WHERE [type] IN('D','I')
    AND is_damaged = 0
    AND database_name = @CurrentDatabaseName
    END
    IF @Version >= 11 AND @Cluster IS NOT NULL
    BEGIN
    SELECT @CurrentAvailabilityGroup = availability_groups.name,
    @CurrentAvailabilityGroupRole = dm_hadr_availability_replica_states.role_desc
    FROM sys.databases databases
    INNER JOIN sys.availability_databases_cluster availability_databases_cluster ON databases.group_database_id = availability_databases_cluster.group_database_id
    INNER JOIN sys.availability_groups availability_groups ON availability_databases_cluster.group_id = availability_groups.group_id
    INNER JOIN sys.dm_hadr_availability_replica_states dm_hadr_availability_replica_states ON availability_groups.group_id = dm_hadr_availability_replica_states.group_id AND databases.replica_id = dm_hadr_availability_replica_states.replica_id
    WHERE databases.name = @CurrentDatabaseName
    END
    IF @Version >= 11 AND @Cluster IS NOT NULL AND @CurrentAvailabilityGroup IS NOT NULL
    BEGIN
    SELECT @CurrentIsPreferredBackupReplica = sys.fn_hadr_backup_is_preferred_replica(@CurrentDatabaseName)
    END
    SELECT @CurrentDatabaseMirroringRole = UPPER(mirroring_role_desc)
    FROM sys.database_mirroring
    WHERE database_id = @CurrentDatabaseID
    IF EXISTS (SELECT * FROM msdb.dbo.log_shipping_primary_databases WHERE primary_database = @CurrentDatabaseName)
    BEGIN
    SET @CurrentLogShippingRole = 'PRIMARY'
    END
    ELSE
    IF EXISTS (SELECT * FROM msdb.dbo.log_shipping_secondary_databases WHERE secondary_database = @CurrentDatabaseName)
    BEGIN
    SET @CurrentLogShippingRole = 'SECONDARY'
    END
    -- Set database message
    SET @DatabaseMessage = 'Date and time: ' + CONVERT(nvarchar,GETDATE(),120) + CHAR(13) + CHAR(10)
    SET @DatabaseMessage = @DatabaseMessage + 'Database: ' + QUOTENAME(@CurrentDatabaseName) + CHAR(13) + CHAR(10)
    SET @DatabaseMessage = @DatabaseMessage + 'Status: ' + CAST(DATABASEPROPERTYEX(@CurrentDatabaseName,'Status') AS nvarchar) + CHAR(13) + CHAR(10)
    SET @DatabaseMessage = @DatabaseMessage + 'Standby: ' + CASE WHEN DATABASEPROPERTYEX(@CurrentDatabaseName,'IsInStandBy') = 1 THEN 'Yes' ELSE 'No' END + CHAR(13) + CHAR(10)
    SET @DatabaseMessage = @DatabaseMessage + 'Updateability: ' + CAST(DATABASEPROPERTYEX(@CurrentDatabaseName,'Updateability') AS nvarchar) + CHAR(13) + CHAR(10)
    SET @DatabaseMessage = @DatabaseMessage + 'User access: ' + CAST(DATABASEPROPERTYEX(@CurrentDatabaseName,'UserAccess') AS nvarchar) + CHAR(13) + CHAR(10)
    SET @DatabaseMessage = @DatabaseMessage + 'Is accessible: ' + CASE WHEN @CurrentIsDatabaseAccessible = 1 THEN 'Yes' ELSE 'No' END + CHAR(13) + CHAR(10)
    SET @DatabaseMessage = @DatabaseMessage + 'Recovery model: ' + CAST(DATABASEPROPERTYEX(@CurrentDatabaseName,'Recovery') AS nvarchar) + CHAR(13) + CHAR(10)
    IF @CurrentAvailabilityGroup IS NOT NULL SET @DatabaseMessage = @DatabaseMessage + 'Availability group: ' + @CurrentAvailabilityGroup + CHAR(13) + CHAR(10)
    IF @CurrentAvailabilityGroup IS NOT NULL SET @DatabaseMessage = @DatabaseMessage + 'Availability group role: ' + @CurrentAvailabilityGroupRole + CHAR(13) + CHAR(10)
    IF @CurrentAvailabilityGroup IS NOT NULL SET @DatabaseMessage = @DatabaseMessage + 'Is preferred backup replica: ' + CASE WHEN @CurrentIsPreferredBackupReplica = 1 THEN 'Yes' WHEN @CurrentIsPreferredBackupReplica = 0 THEN 'No' ELSE 'N/A' END + CHAR(13) + CHAR(10)
    IF @CurrentDatabaseMirroringRole IS NOT NULL SET @DatabaseMessage = @DatabaseMessage + 'Database mirroring role: ' + @CurrentDatabaseMirroringRole + CHAR(13) + CHAR(10)
    IF @CurrentLogShippingRole IS NOT NULL SET @DatabaseMessage = @DatabaseMessage + 'Log shipping role: ' + @CurrentLogShippingRole + CHAR(13) + CHAR(10)
    SET @DatabaseMessage = @DatabaseMessage + 'Differential base LSN: ' + ISNULL(CAST(@CurrentDifferentialBaseLSN AS nvarchar),'N/A') + CHAR(13) + CHAR(10)
    SET @DatabaseMessage = @DatabaseMessage + 'Differential base is snapshot: ' + CASE WHEN @CurrentDifferentialBaseIsSnapshot = 1 THEN 'Yes' WHEN @CurrentDifferentialBaseIsSnapshot = 0 THEN 'No' ELSE 'N/A' END + CHAR(13) + CHAR(10)
    SET @DatabaseMessage = @DatabaseMessage + 'Last log backup LSN: ' + ISNULL(CAST(@CurrentLogLSN AS nvarchar),'N/A') + CHAR(13) + CHAR(10)
    SET @DatabaseMessage = REPLACE(@DatabaseMessage,'%','%%') + ' '
    RAISERROR(@DatabaseMessage,10,1) WITH NOWAIT
    IF DATABASEPROPERTYEX(@CurrentDatabaseName,'Status') = 'ONLINE'
    AND NOT (DATABASEPROPERTYEX(@CurrentDatabaseName,'UserAccess') = 'SINGLE_USER' AND @CurrentIsDatabaseAccessible = 0)
    AND DATABASEPROPERTYEX(@CurrentDatabaseName,'IsInStandBy') = 0
    AND NOT (@CurrentBackupType = 'LOG' AND (DATABASEPROPERTYEX(@CurrentDatabaseName,'Recovery') = 'SIMPLE' OR @CurrentLogLSN IS NULL))
    AND NOT (@CurrentBackupType = 'DIFF' AND @CurrentDifferentialBaseLSN IS NULL)
    AND NOT (@CurrentBackupType IN('DIFF','LOG') AND @CurrentDatabaseName = 'master')
    AND NOT (@CurrentAvailabilityGroup IS NOT NULL AND @CurrentBackupType = 'FULL' AND @CopyOnly = 'N' AND (@CurrentAvailabilityGroupRole <> 'PRIMARY' OR @CurrentAvailabilityGroupRole IS NULL))
    AND NOT (@CurrentAvailabilityGroup IS NOT NULL AND @CurrentBackupType = 'FULL' AND @CopyOnly = 'Y' AND (@CurrentIsPreferredBackupReplica <> 1 OR @CurrentIsPreferredBackupReplica IS NULL))
    AND NOT (@CurrentAvailabilityGroup IS NOT NULL AND @CurrentBackupType = 'DIFF' AND (@CurrentAvailabilityGroupRole <> 'PRIMARY' OR @CurrentAvailabilityGroupRole IS NULL))
    AND NOT (@CurrentAvailabilityGroup IS NOT NULL AND @CurrentBackupType = 'LOG' AND @CopyOnly = 'N' AND (@CurrentIsPreferredBackupReplica <> 1 OR @CurrentIsPreferredBackupReplica IS NULL))
    AND NOT (@CurrentAvailabilityGroup IS NOT NULL AND @CurrentBackupType = 'LOG' AND @CopyOnly = 'Y' AND (@CurrentAvailabilityGroupRole <> 'PRIMARY' OR @CurrentAvailabilityGroupRole IS NULL))
    AND NOT ((@CurrentLogShippingRole = 'PRIMARY' AND @CurrentLogShippingRole IS NOT NULL) AND @CurrentBackupType = 'LOG')
    BEGIN
    -- Set variables
    SET @CurrentDate = GETDATE()
    IF @CleanupTime IS NULL OR (@CurrentBackupType = 'LOG' AND @CurrentLatestBackup IS NULL) OR @CurrentBackupType <> @BackupType
    BEGIN
    SET @CurrentCleanupDate = NULL
    END
    ELSE
    IF @CurrentBackupType = 'LOG'
    BEGIN
    SET @CurrentCleanupDate = (SELECT MIN([Date]) FROM(SELECT DATEADD(hh,-(@CleanupTime),@CurrentDate) AS [Date] UNION SELECT @CurrentLatestBackup AS [Date]) Dates)
    END
    ELSE
    BEGIN
    SET @CurrentCleanupDate = DATEADD(hh,-(@CleanupTime),@CurrentDate)
    END
    SELECT @CurrentFileExtension = CASE
    WHEN @BackupSoftware IS NULL AND @CurrentBackupType = 'FULL' THEN 'bak'
    WHEN @BackupSoftware IS NULL AND @CurrentBackupType = 'DIFF' THEN 'bak'
    WHEN @BackupSoftware IS NULL AND @CurrentBackupType = 'LOG' THEN 'trn'
    WHEN @BackupSoftware = 'LITESPEED' AND @CurrentBackupType = 'FULL' THEN 'bak'
    WHEN @BackupSoftware = 'LITESPEED' AND @CurrentBackupType = 'DIFF' THEN 'bak'
    WHEN @BackupSoftware = 'LITESPEED' AND @CurrentBackupType = 'LOG' THEN 'trn'
    WHEN @BackupSoftware = 'SQLBACKUP' AND @CurrentBackupType = 'FULL' THEN 'sqb'
    WHEN @BackupSoftware = 'SQLBACKUP' AND @CurrentBackupType = 'DIFF' THEN 'sqb'
    WHEN @BackupSoftware = 'SQLBACKUP' AND @CurrentBackupType = 'LOG' THEN 'sqb'
    WHEN @BackupSoftware = 'HYPERBAC' AND @CurrentBackupType = 'FULL' AND @Encrypt = 'N' THEN 'hbc'
    WHEN @BackupSoftware = 'HYPERBAC' AND @CurrentBackupType = 'DIFF' AND @Encrypt = 'N' THEN 'hbc'
    WHEN @BackupSoftware = 'HYPERBAC' AND @CurrentBackupType = 'LOG' AND @Encrypt = 'N' THEN 'hbc'
    WHEN @BackupSoftware = 'HYPERBAC' AND @CurrentBackupType = 'FULL' AND @Encrypt = 'Y' THEN 'hbe'
    WHEN @BackupSoftware = 'HYPERBAC' AND @CurrentBackupType = 'DIFF' AND @Encrypt = 'Y' THEN 'hbe'
    WHEN @BackupSoftware = 'HYPERBAC' AND @CurrentBackupType = 'LOG' AND @Encrypt = 'Y' THEN 'hbe'
    WHEN @BackupSoftware = 'SQLSAFE' AND @CurrentBackupType = 'FULL' THEN 'safe'
    WHEN @BackupSoftware = 'SQLSAFE' AND @CurrentBackupType = 'DIFF' THEN 'safe'
    WHEN @BackupSoftware = 'SQLSAFE' AND @CurrentBackupType = 'LOG' THEN 'safe'
    END
    INSERT INTO @CurrentDirectories (ID, DirectoryPath, CreateCompleted, CleanupCompleted)
    SELECT ROW_NUMBER() OVER (ORDER BY ID), DirectoryPath + CASE WHEN RIGHT(DirectoryPath,1) = '\' THEN '' ELSE '\' END + CASE WHEN @CurrentBackupType = 'LOG' THEN '\Transaction Dumps\' + @CurrentDatabaseNameFS ELSE '' END, 0, 0
    FROM @Directories
    ORDER BY ID ASC
    SET @CurrentFileNumber = 0
    SET @CurrentMirrorFilePath = NULL
    WHILE @CurrentFileNumber < @NumberOfFiles
    BEGIN
    SET @CurrentFileNumber = @CurrentFileNumber + 1
    SELECT @CurrentDirectoryPath = DirectoryPath
    FROM @CurrentDirectories
    WHERE @CurrentFileNumber >= (ID - 1) * (SELECT @NumberOfFiles / COUNT(*) FROM @CurrentDirectories) + 1
    AND @CurrentFileNumber <= ID * (SELECT @NumberOfFiles / COUNT(*) FROM @CurrentDirectories)
    SET @CurrentFilePath = @CurrentDirectoryPath + '\' + CASE WHEN @CurrentAvailabilityGroup IS NOT NULL THEN @Cluster + '$' + @CurrentAvailabilityGroup ELSE REPLACE(CAST(SERVERPROPERTY('servername') AS nvarchar),'\','$') END + '_' + @CurrentDatabaseNameFS + '_' + REPLACE(REPLACE(REPLACE((CONVERT(nvarchar,@CurrentDate,120)),'-',''),' ','_'),':','') + CASE WHEN @NumberOfFiles > 1 AND @NumberOfFiles <= 9 THEN '_' + CAST(@CurrentFileNumber AS nvarchar) WHEN @NumberOfFiles >= 10 THEN '_' + RIGHT('0' + CAST(@CurrentFileNumber AS nvarchar),2) ELSE '' END + '_' + @CurrentDatabaseType + '_' + UPPER(@CurrentBackupType) + CASE WHEN @ReadWriteFileGroups = 'Y' THEN '_PARTIAL' ELSE '' END + CASE WHEN @CopyOnly = 'Y' THEN '_COPY_ONLY' ELSE '' END + '.' + @CurrentFileExtension
    IF LEN(@CurrentFilePath) > 257
    BEGIN
    SET @CurrentFilePath = @CurrentDirectoryPath + '\' + CASE WHEN @CurrentAvailabilityGroup IS NOT NULL THEN @Cluster + '$' + @CurrentAvailabilityGroup ELSE REPLACE(CAST(SERVERPROPERTY('servername') AS nvarchar),'\','$') END + '_' + LEFT(@CurrentDatabaseNameFS,CASE WHEN (LEN(@CurrentDatabaseNameFS) + 257 - LEN(@CurrentFilePath) - 3) < 20 THEN 20 ELSE (LEN(@CurrentDatabaseNameFS) + 257 - LEN(@CurrentFilePath) - 3) END) + '...' + '_' + REPLACE(REPLACE(REPLACE((CONVERT(nvarchar,@CurrentDate,120)),'-',''),' ','_'),':','') + CASE WHEN @NumberOfFiles > 1 AND @NumberOfFiles <= 9 THEN '_' + CAST(@CurrentFileNumber AS nvarchar) WHEN @NumberOfFiles >= 10 THEN '_' + RIGHT('0' + CAST(@CurrentFileNumber AS nvarchar),2) ELSE '' END + '_' + @CurrentDatabaseType + '_' + UPPER(@CurrentBackupType) + CASE WHEN @ReadWriteFileGroups = 'Y' THEN '_PARTIAL' ELSE '' END + CASE WHEN @CopyOnly = 'Y' THEN '_COPY_ONLY' ELSE '' END + '.' + @CurrentFileExtension
    END
    IF @CurrentFileNumber = 1 AND LEN(@MirrorDirectory) > 0
    BEGIN
    SET @CurrentMirrorFilePath = @MirrorDirectory + CASE WHEN RIGHT(@MirrorDirectory,1) = '\' THEN '' ELSE '\' END + CASE WHEN @CurrentBackupType = 'LOG' THEN '\Transaction Dumps\' + @CurrentDatabaseNameFS ELSE '' END + '\' + CASE WHEN @CurrentAvailabilityGroup IS NOT NULL THEN @Cluster + '$' + @CurrentAvailabilityGroup ELSE REPLACE(CAST(SERVERPROPERTY('servername') AS nvarchar),'\','$') END + '_' + @CurrentDatabaseNameFS + '_' + REPLACE(REPLACE(REPLACE((CONVERT(nvarchar,@CurrentDate,120)),'-',''),' ','_'),':','') + CASE WHEN @NumberOfFiles > 1 AND @NumberOfFiles <= 9 THEN '_' + CAST(@CurrentFileNumber AS nvarchar) WHEN @NumberOfFiles >= 10 THEN '_' + RIGHT('0' + CAST(@CurrentFileNumber AS nvarchar),2) ELSE '' END + '_' + @CurrentDatabaseType + '_' + UPPER(@CurrentBackupType) + CASE WHEN @ReadWriteFileGroups = 'Y' THEN '_PARTIAL' ELSE '' END + CASE WHEN @CopyOnly = 'Y' THEN '_COPY_ONLY' ELSE '' END + '.' + @CurrentFileExtension
    IF LEN(@CurrentFilePath) > 257
    BEGIN
    SET @CurrentMirrorFilePath = @MirrorDirectory + CASE WHEN RIGHT(@MirrorDirectory,1) = '\' THEN '' ELSE '\' END + CASE WHEN @CurrentBackupType = 'LOG' THEN '\Transaction Dumps\' + @CurrentDatabaseNameFS ELSE '' END + '\' + CASE WHEN @CurrentAvailabilityGroup IS NOT NULL THEN @Cluster + '$' + @CurrentAvailabilityGroup ELSE REPLACE(CAST(SERVERPROPERTY('servername') AS nvarchar),'\','$') END + '_' + LEFT(@CurrentDatabaseNameFS,CASE WHEN (LEN(@CurrentDatabaseNameFS) + 257 - LEN(@CurrentFilePath) - 3) < 20 THEN 20 ELSE (LEN(@CurrentDatabaseNameFS) + 257 - LEN(@CurrentFilePath) - 3) END) + '...' + '_' + REPLACE(REPLACE(REPLACE((CONVERT(nvarchar,@CurrentDate,120)),'-',''),' ','_'),':','') + CASE WHEN @NumberOfFiles > 1 AND @NumberOfFiles <= 9 THEN '_' + CAST(@CurrentFileNumber AS nvarchar) WHEN @NumberOfFiles >= 10 THEN '_' + RIGHT('0' + CAST(@CurrentFileNumber AS nvarchar),2) ELSE '' END + '_' + @CurrentDatabaseType + '_' + UPPER(@CurrentBackupType) + CASE WHEN @ReadWriteFileGroups = 'Y' THEN '_PARTIAL' ELSE '' END + CASE WHEN @CopyOnly = 'Y' THEN '_COPY_ONLY' ELSE '' END + '.' + @CurrentFileExtension
    END
    END
    INSERT INTO @CurrentFiles (CurrentFilePath)
    SELECT @CurrentFilePath
    SET @CurrentDirectoryPath = NULL
    SET @CurrentFilePath = NULL
    END
    -- Create directory
    WHILE EXISTS (SELECT * FROM @CurrentDirectories WHERE CreateCompleted = 0)
    BEGIN
    SELECT TOP 1 @CurrentDirectoryID = ID,
    @CurrentDirectoryPath = DirectoryPath
    FROM @CurrentDirectories
    WHERE CreateCompleted = 0
    ORDER BY ID ASC
    SET @CurrentCommandType01 = 'xp_create_subdir'
    SET @CurrentCommand01 = 'DECLARE @ReturnCode int EXECUTE @ReturnCode = [master].dbo.xp_create_subdir N''' + REPLACE(@CurrentDirectoryPath,'''','''''') + ''' IF @ReturnCode <> 0 RAISERROR(''Error creating directory.'', 16, 1)'
    EXECUTE @CurrentCommandOutput01 = [dbo].[CommandExecute] @Command = @CurrentCommand01, @CommandType = @CurrentCommandType01, @Mode = 1, @DatabaseName = @CurrentDatabaseName, @LogToTable = @LogToTable, @Execute = @Execute
    SET @Error = @@ERROR
    IF @Error <> 0 SET @CurrentCommandOutput01 = @Error
    IF @CurrentCommandOutput01 <> 0 SET @ReturnCode = @CurrentCommandOutput01
    UPDATE @CurrentDirectories
    SET CreateCompleted = 1,
    CreateOutput = @CurrentCommandOutput01
    WHERE ID = @CurrentDirectoryID
    SET @CurrentDirectoryID = NULL
    SET @CurrentDirectoryPath = NULL
    SET @CurrentCommand01 = NULL
    SET @CurrentCommandOutput01 = NULL
    SET @CurrentCommandType01 = NULL
    END
    -- Perform a backup
    IF NOT EXISTS (SELECT * FROM @CurrentDirectories WHERE CreateOutput <> 0 OR CreateOutput IS NULL)
    BEGIN
    IF @BackupSoftware IS NULL
    BEGIN
    SELECT @CurrentCommandType02 = CASE
    WHEN @CurrentBackupType IN('DIFF','FULL') THEN 'BACKUP_DATABASE'
    WHEN @CurrentBackupType = 'LOG' THEN 'BACKUP_LOG'
    END
    SELECT @CurrentCommand02 = CASE
    WHEN @CurrentBackupType IN('DIFF','FULL') THEN 'BACKUP DATABASE ' + QUOTENAME(@CurrentDatabaseName)
    WHEN @CurrentBackupType = 'LOG' THEN 'BACKUP LOG ' + QUOTENAME(@CurrentDatabaseName)
    END
    IF @ReadWriteFileGroups = 'Y' SET @CurrentCommand02 = @CurrentCommand02 + ' READ_WRITE_FILEGROUPS'
    SET @CurrentCommand02 = @CurrentCommand02 + ' TO'
    SELECT @CurrentCommand02 = @CurrentCommand02 + ' DISK = N''' + REPLACE(CurrentFilePath,'''','''''') + '''' + CASE WHEN ROW_NUMBER() OVER (ORDER BY CurrentFilePath ASC) <> @NumberOfFiles THEN ',' ELSE '' END
    FROM @CurrentFiles
    ORDER BY CurrentFilePath ASC
    SET @CurrentCommand02 = @CurrentCommand02 + ' WITH '
    IF @CheckSum = 'Y' SET @CurrentCommand02 = @CurrentCommand02 + 'CHECKSUM'
    IF @CheckSum = 'N' SET @CurrentCommand02 = @CurrentCommand02 + 'NO_CHECKSUM'
    IF @Compress = 'Y' SET @CurrentCommand02 = @CurrentCommand02 + ', COMPRESSION'
    IF @Compress = 'N' AND @Version >= 10 SET @CurrentCommand02 = @CurrentCommand02 + ', NO_COMPRESSION'
    IF @CurrentBackupType = 'DIFF' SET @CurrentCommand02 = @CurrentCommand02 + ', DIFFERENTIAL'
    IF @CopyOnly = 'Y' SET @CurrentCommand02 = @CurrentCommand02 + ', COPY_ONLY'
    IF @BlockSize IS NOT NULL SET @CurrentCommand02 = @CurrentCommand02 + ', BLOCKSIZE = ' + CAST(@BlockSize AS nvarchar)
    IF @BufferCount IS NOT NULL SET @CurrentCommand02 = @CurrentCommand02 + ', BUFFERCOUNT = ' + CAST(@BufferCount AS nvarchar)
    IF @MaxTransferSize IS NOT NULL SET @CurrentCommand02 = @CurrentCommand02 + ', MAXTRANSFERSIZE = ' + CAST(@MaxTransferSize AS nvarchar)
    IF @Description IS NOT NULL SET @CurrentCommand02 = @CurrentCommand02 + ', DESCRIPTION = N''' + REPLACE(@Description,'''','''''') + ''''
    END
    IF @BackupSoftware = 'LITESPEED'
    BEGIN
    SELECT @CurrentCommandType02 = CASE
    WHEN @CurrentBackupType IN('DIFF','FULL') THEN 'xp_backup_database'
    WHEN @CurrentBackupType = 'LOG' THEN 'xp_backup_log'
    END
    SELECT @CurrentCommand02 = CASE
    WHEN @CurrentBackupType IN('DIFF','FULL') THEN 'DECLARE @ReturnCode int EXECUTE @ReturnCode = [master].dbo.xp_backup_database @database = N''' + REPLACE(@CurrentDatabaseName,'''','''''') + ''''
    WHEN @CurrentBackupType = 'LOG' THEN 'DECLARE @ReturnCode int EXECUTE @ReturnCode = [master].dbo.xp_backup_log @database = N''' + REPLACE(@CurrentDatabaseName,'''','''''') + ''''
    END
    SELECT @CurrentCommand02 = @CurrentCommand02 + ', @filename = N''' + REPLACE(CurrentFilePath,'''','''''') + ''''
    FROM @CurrentFiles
    ORDER BY CurrentFilePath ASC
    SET @CurrentCommand02 = @CurrentCommand02 + ', @with = '''
    IF @CheckSum = 'Y' SET @CurrentCommand02 = @CurrentCommand02 + 'CHECKSUM'
    IF @CheckSum = 'N' SET @CurrentCommand02 = @CurrentCommand02 + 'NO_CHECKSUM'
    IF @CurrentBackupType = 'DIFF' SET @CurrentCommand02 = @CurrentCommand02 + ', DIFFERENTIAL'
    IF @CopyOnly = 'Y' SET @CurrentCommand02 = @CurrentCommand02 + ', COPY_ONLY'
    IF @BlockSize IS NOT NULL SET @CurrentCommand02 = @CurrentCommand02 + ', BLOCKSIZE = ' + CAST(@BlockSize AS nvarchar)
    SET @CurrentCommand02 = @CurrentCommand02 + ''''
    IF @ReadWriteFileGroups = 'Y' SET @CurrentCommand02 = @CurrentCommand02 + ', @read_write_filegroups = 1'
    IF @CompressionLevel IS NOT NULL SET @CurrentCommand02 = @CurrentCommand02 + ', @compressionlevel = ' + CAST(@CompressionLevel AS nvarchar)
    IF @BufferCount IS NOT NULL SET @CurrentCommand02 = @CurrentCommand02 + ', @buffercount = ' + CAST(@BufferCount AS nvarchar)
    IF @MaxTransferSize IS NOT NULL SET @CurrentCommand02 = @CurrentCommand02 + ', @maxtransfersize = ' + CAST(@MaxTransferSize AS nvarchar)
    IF @Threads IS NOT NULL SET @CurrentCommand02 = @CurrentCommand02 + ', @threads = ' + CAST(@Threads AS nvarchar)
    IF @Throttle IS NOT NULL SET @CurrentCommand02 = @CurrentCommand02 + ', @throttle = ' + CAST(@Throttle AS nvarchar)
    IF @Description IS NOT NULL SET @CurrentCommand02 = @CurrentCommand02 + ', @desc = N''' + REPLACE(@Description,'''','''''') + ''''
    IF @EncryptionType IS NOT NULL SET @CurrentCommand02 = @CurrentCommand02 + ', @cryptlevel = ' + CASE
    WHEN @EncryptionType = 'RC2-40' THEN '0'
    WHEN @EncryptionType = 'RC2-56' THEN '1'
    WHEN @EncryptionType = 'RC2-112' THEN '2'
    WHEN @EncryptionType = 'RC2-128' THEN '3'
    WHEN @EncryptionType = '3DES-168' THEN '4'
    WHEN @EncryptionType = 'RC4-128' THEN '5'
    WHEN @EncryptionType = 'AES-128' THEN '6'
    WHEN @EncryptionType = 'AES-192' THEN '7'
    WHEN @EncryptionType = 'AES-256' THEN '8'
    END
    IF @EncryptionKey IS NOT NULL SET @CurrentCommand02 = @CurrentCommand02 + ', @encryptionkey = N''' + REPLACE(@EncryptionKey,'''','''''') + ''''
    SET @CurrentCommand02 = @CurrentCommand02 + ' IF @ReturnCode <> 0 RAISERROR(''Error performing LiteSpeed backup.'', 16, 1)'
    END
    IF @BackupSoftware = 'SQLBACKUP'
    BEGIN
    SET @CurrentCommandType02 = 'sqlbackup'
    SELECT @CurrentCommand02 = CASE
    WHEN @CurrentBackupType IN('DIFF','FULL') THEN 'BACKUP DATABASE ' + QUOTENAME(@CurrentDatabaseName)
    WHEN @CurrentBackupType = 'LOG' THEN 'BACKUP LOG ' + QUOTENAME(@CurrentDatabaseName)
    END
    IF @ReadWriteFileGroups = 'Y' SET @CurrentCommand02 = @CurrentCommand02 + ' READ_WRITE_FILEGROUPS'
    SET @CurrentCommand02 = @CurrentCommand02 + ' TO'
    SELECT @CurrentCommand02 = @CurrentCommand02 + ' DISK = N''' + REPLACE(CurrentFilePath,'''','''''') + '''' + CASE WHEN ROW_NUMBER() OVER (ORDER BY CurrentFilePath ASC) <> @NumberOfFiles THEN ',' ELSE '' END
    FROM @CurrentFiles
    ORDER BY CurrentFilePath ASC
    SET @CurrentCommand02 = @CurrentCommand02 + ' WITH '
    IF @CheckSum = 'Y' SET @CurrentCommand02 = @CurrentCommand02 + 'CHECKSUM'
    IF @CheckSum = 'N' SET @CurrentCommand02 = @CurrentCommand02 + 'NO_CHECKSUM'
    IF @CurrentBackupType = 'DIFF' SET @CurrentCommand02 = @CurrentCommand02 + ', DIFFERENTIAL'
    IF @CopyOnly = 'Y' SET @CurrentCommand02 = @CurrentCommand02 + ', COPY_ONLY'
    IF @CompressionLevel IS NOT NULL SET @CurrentCommand02 = @CurrentCommand02 + ', COMPRESSION = ' + CAST(@CompressionLevel AS nvarchar)
    IF @Threads IS NOT NULL SET @CurrentCommand02 = @CurrentCommand02 + ', THREADCOUNT = ' + CAST(@Threads AS nvarchar)
    IF @MaxTransferSize IS NOT NULL SET @CurrentCommand02 = @CurrentCommand02 + ', MAXTRANSFERSIZE = ' + CAST(@MaxTransferSize AS nvarchar)
    IF @Description IS NOT NULL SET @CurrentCommand02 = @CurrentCommand02 + ', DESCRIPTION = N''' + REPLACE(@Description,'''','''''') + ''''
    IF @EncryptionType IS NOT NULL SET @CurrentCommand02 = @CurrentCommand02 + ', KEYSIZE = ' + CASE
    WHEN @EncryptionType = 'AES-128' THEN '128'
    WHEN @EncryptionType = 'AES-256' THEN '256'
    END
    IF @EncryptionKey IS NOT NULL SET @CurrentCommand02 = @CurrentCommand02 + ', PASSWORD = N''' + REPLACE(@EncryptionKey,'''','''''') + ''''
    SET @CurrentCommand02 = 'DECLARE @ReturnCode int EXECUTE @ReturnCode = [master].dbo.sqlbackup N''-SQL "' + REPLACE(@CurrentCommand02,'''','''''') + '"''' + ' IF @ReturnCode <> 0 RAISERROR(''Error performing SQLBackup backup.'', 16, 1)'
    END
    IF @BackupSoftware = 'HYPERBAC'
    BEGIN
    SET @CurrentCommandType02 = 'BACKUP_DATABASE'
    SELECT @CurrentCommand02 = CASE
    WHEN @CurrentBackupType IN('DIFF','FULL') THEN 'BACKUP DATABASE ' + QUOTENAME(@CurrentDatabaseName)
    WHEN @CurrentBackupType = 'LOG' THEN 'BACKUP LOG ' + QUOTENAME(@CurrentDatabaseName)
    END
    IF @ReadWriteFileGroups = 'Y' SET @CurrentCommand02 = @CurrentCommand02 + ' READ_WRITE_FILEGROUPS'
    SET @CurrentCommand02 = @CurrentCommand02 + ' TO'
    SELECT @CurrentCommand02 = @CurrentCommand02 + ' DISK = N''' + REPLACE(CurrentFilePath,'''','''''') + '''' + CASE WHEN ROW_NUMBER() OVER (ORDER BY CurrentFilePath ASC) <> @NumberOfFiles THEN ',' ELSE '' END
    FROM @CurrentFiles
    ORDER BY CurrentFilePath ASC
    SET @CurrentCommand02 = @CurrentCommand02 + ' WITH '
    IF @CheckSum = 'Y' SET @CurrentCommand02 = @CurrentCommand02 + 'CHECKSUM'
    IF @CheckSum = 'N' SET @CurrentCommand02 = @CurrentCommand02 + 'NO_CHECKSUM'
    IF @CurrentBackupType = 'DIFF' SET @CurrentCommand02 = @CurrentCommand02 + ', DIFFERENTIAL'
    IF @CopyOnly = 'Y' SET @CurrentCommand02 = @CurrentCommand02 + ', COPY_ONLY'
    IF @BlockSize IS NOT NULL SET @CurrentCommand02 = @CurrentCommand02 + ', BLOCKSIZE = ' + CAST(@BlockSize AS nvarchar)
    IF @BufferCount IS NOT NULL SET @CurrentCommand02 = @CurrentCommand02 + ', BUFFERCOUNT = ' + CAST(@BufferCount AS nvarchar)
    IF @MaxTransferSize IS NOT NULL SET @CurrentCommand02 = @CurrentCommand02 + ', MAXTRANSFERSIZE = ' + CAST(@MaxTransferSize AS nvarchar)
    IF @Description IS NOT NULL SET @CurrentCommand02 = @CurrentCommand02 + ', DESCRIPTION = N''' + REPLACE(@Description,'''','''''') + ''''
    END
    IF @BackupSoftware = 'SQLSAFE'
    BEGIN
    SET @CurrentCommandType02 = 'xp_ss_backup'
    SET @CurrentCommand02 = 'DECLARE @ReturnCode int EXECUTE @ReturnCode = [master].dbo.xp_ss_backup @database = N''' + REPLACE(@CurrentDatabaseName,'''','''''') + ''''
    SELECT @CurrentCommand02 = @CurrentCommand02 + ', ' + CASE WHEN ROW_NUMBER() OVER (ORDER BY CurrentFilePath ASC) = 1 THEN '@filename' ELSE '@backupfile' END + ' = N''' + REPLACE(CurrentFilePath,'''','''''') + ''''
    FROM @CurrentFiles
    ORDER BY CurrentFilePath ASC
    IF @CurrentMirrorFilePath IS NOT NULL SET @CurrentCommand02 = @CurrentCommand02 + ', @mirrorfile = N''' + @CurrentMirrorFilePath + ''''
    SET @CurrentCommand02 = @CurrentCommand02 + ', @backuptype = ' + CASE WHEN @CurrentBackupType = 'FULL' THEN '''Full''' WHEN @CurrentBackupType = 'DIFF' THEN '''Differential''' WHEN @CurrentBackupType = 'LOG' THEN '''Log''' END
    IF @ReadWriteFileGroups = 'Y' SET @CurrentCommand02 = @CurrentCommand02 + ', @readwritefilegroups = 1'
    SET @CurrentCommand02 = @CurrentCommand02 + ', @checksum = ' + CASE WHEN @CheckSum = 'Y' THEN '1' WHEN @CheckSum = 'N' THEN '0' END
    SET @CurrentCommand02 = @CurrentCommand02 + ', @copyonly = ' + CASE WHEN @CopyOnly = 'Y' THEN '1' WHEN @CopyOnly = 'N' THEN '0' END
    IF @CompressionLevel IS NOT NULL SET @CurrentCommand02 = @CurrentCommand02 + ', @compressionlevel = ' + CASE WHEN @CompressionLevel = 5 THEN N'ispeed' WHEN @CompressionLevel = 6 THEN N'isize' ELSE CAST(@CompressionLevel AS nvarchar) END
    IF @RetryWrites IS NOT NULL SET @CurrentCommand02 = @CurrentCommand02 + ', @retrywrites = N''' + @RetryWrites + ''''
    IF @Threads IS NOT NULL SET @CurrentCommand02 = @CurrentCommand02 + ', @threads = ' + CAST(@Threads AS nvarchar)
    IF @Description IS NOT NULL SET @CurrentCommand02 = @CurrentCommand02 + ', @desc = N''' + REPLACE(@Description,'''','''''') + ''''
    IF @EncryptionType IS NOT NULL SET @CurrentCommand02 = @CurrentCommand02 + ', @encryptiontype = N''' + CASE
    WHEN @EncryptionType = 'AES-128' THEN 'AES128'
    WHEN @EncryptionType = 'AES-256' THEN 'AES256'
    END + ''''
    IF @EncryptionKey IS NOT NULL SET @CurrentCommand02 = @CurrentCommand02 + ', @encryptedbackuppassword = N''' + REPLACE(@EncryptionKey,'''','''''') + ''''
    SET @CurrentCommand02 = @CurrentCommand02 + ' IF @ReturnCode <> 0 RAISERROR(''Error performing SQLsafe backup.'', 16, 1)'
    END
    EXECUTE @CurrentCommandOutput02 = [dbo].[CommandExecute] @Command = @CurrentCommand02, @CommandType = @CurrentCommandType02, @Mode = 1, @DatabaseName = @CurrentDatabaseName, @LogToTable = @LogToTable, @Execute = @Execute
    SET @Error = @@ERROR
    IF @Error <> 0 SET @CurrentCommandOutput02 = @Error
    IF @CurrentCommandOutput02 <> 0 SET @ReturnCode = @CurrentCommandOutput02
    END
    -- Verify the backup
    IF @CurrentCommandOutput02 = 0 AND @Verify = 'Y'
    BEGIN
    IF @BackupSoftware IS NULL
    BEGIN
    SET @CurrentCommandType03 = 'RESTORE_VERIFYONLY'
    SET @CurrentCommand03 = 'RESTORE VERIFYONLY FROM'
    SELECT @CurrentCommand03 = @CurrentCommand03 + ' DISK = N''' + REPLACE(CurrentFilePath,'''','''''') + '''' + CASE WHEN ROW_NUMBER() OVER (ORDER BY CurrentFilePath ASC) <> @NumberOfFiles THEN ',' ELSE '' END
    FROM @CurrentFiles
    ORDER BY CurrentFilePath ASC
    SET @CurrentCommand03 = @CurrentCommand03 + ' WITH '
    IF @CheckSum = 'Y' SET @CurrentCommand03 = @CurrentCommand03 + 'CHECKSUM'
    IF @CheckSum = 'N' SET @CurrentCommand03 = @CurrentCommand03 + 'NO_CHECKSUM'
    END
    IF @BackupSoftware = 'LITESPEED'
    BEGIN
    SET @CurrentCommandType03 = 'xp_restore_verifyonly'
    SET @CurrentCommand03 = 'DECLARE @ReturnCode int EXECUTE @ReturnCode = [master].dbo.xp_restore_verifyonly'
    SELECT @CurrentCommand03 = @CurrentCommand03 + ' @filename = N''' + REPLACE(CurrentFilePath,'''','''''') + '''' + CASE WHEN ROW_NUMBER() OVER (ORDER BY CurrentFilePath ASC) <> @NumberOfFiles THEN ',' ELSE '' END
    FROM @CurrentFiles
    ORDER BY CurrentFilePath ASC
    SET @CurrentCommand03 = @CurrentCommand03 + ', @with = '''
    IF @CheckSum = 'Y' SET @CurrentCommand03 = @CurrentCommand03 + 'CHECKSUM'
    IF @CheckSum = 'N' SET @CurrentCommand03 = @CurrentCommand03 + 'NO_CHECKSUM'
    SET @CurrentCommand03 = @CurrentCommand03 + ''''
    IF @EncryptionKey IS NOT NULL SET @CurrentCommand03 = @CurrentCommand03 + ', @encryptionkey = N''' + REPLACE(@EncryptionKey,'''','''''') + ''''
    SET @CurrentCommand03 = @CurrentCommand03 + ' IF @ReturnCode <> 0 RAISERROR(''Error verifying LiteSpeed backup.'', 16, 1)'
    END
    IF @BackupSoftware = 'SQLBACKUP'
    BEGIN
    SET @CurrentCommandType03 = 'sqlbackup'
    SET @CurrentCommand03 = 'RESTORE VERIFYONLY FROM'
    SELECT @CurrentCommand03 = @CurrentCommand03 + ' DISK = N''' + REPLACE(CurrentFilePath,'''','''''') + '''' + CASE WHEN ROW_NUMBER() OVER (ORDER BY CurrentFilePath ASC) <> @NumberOfFiles THEN ',' ELSE '' END
    FROM @CurrentFiles
    ORDER BY CurrentFilePath ASC
    SET @CurrentCommand03 = @CurrentCommand03 + ' WITH '
    IF @CheckSum = 'Y' SET @CurrentCommand03 = @CurrentCommand03 + 'CHECKSUM'
    IF @CheckSum = 'N' SET @CurrentCommand03 = @CurrentCommand03 + 'NO_CHECKSUM'
    IF @EncryptionKey IS NOT NULL SET @CurrentCommand03 = @CurrentCommand03 + ', PASSWORD = N''' + REPLACE(@EncryptionKey,'''','''''') + ''''
    SET @CurrentCommand03 = 'DECLARE @ReturnCode int EXECUTE @ReturnCode = [master].dbo.sqlbackup N''-SQL "' + REPLACE(@CurrentCommand03,'''','''''') + '"''' + ' IF @ReturnCode <> 0 RAISERROR(''Error verifying SQLBackup backup.'', 16, 1)'
    END
    IF @BackupSoftware = 'HYPERBAC'
    BEGIN
    SET @CurrentCommandType03 = 'RESTORE_VERIFYONLY'
    SET @CurrentCommand03 = 'RESTORE VERIFYONLY FROM'
    SELECT @CurrentCommand03 = @CurrentCommand03 + ' DISK = N''' + REPLACE(CurrentFilePath,'''','''''') + '''' + CASE WHEN ROW_NUMBER() OVER (ORDER BY CurrentFilePath ASC) <> @NumberOfFiles THEN ',' ELSE '' END
    FROM @CurrentFiles
    ORDER BY CurrentFilePath ASC
    SET @CurrentCommand03 = @CurrentCommand03 + ' WITH '
    IF @CheckSum = 'Y' SET @CurrentCommand03 = @CurrentCommand03 + 'CHECKSUM'
    IF @CheckSum = 'N' SET @CurrentCommand03 = @CurrentCommand03 + 'NO_CHECKSUM'
    END
    IF @BackupSoftware = 'SQLSAFE'
    BEGIN
    SET @CurrentCommandType03 = 'xp_ss_verify'
    SET @CurrentCommand03 = 'DECLARE @ReturnCode int EXECUTE @ReturnCode = [master].dbo.xp_ss_verify @database = N''' + REPLACE(@CurrentDatabaseName,'''','''''') + ''''
    SELECT @CurrentCommand03 = @CurrentCommand03 + ', ' + CASE WHEN ROW_NUMBER() OVER (ORDER BY CurrentFilePath ASC) = 1 THEN '@filename' ELSE '@backupfile' END + ' = N''' + REPLACE(CurrentFilePath,'''','''''') + ''''
    FROM @CurrentFiles
    ORDER BY CurrentFilePath ASC
    SET @CurrentCommand03 = @CurrentCommand03 + ' IF @ReturnCode <> 0 RAISERROR(''Error verifying SQLsafe backup.'', 16, 1)'
    END
    EXECUTE @CurrentCommandOutput03 = [dbo].[CommandExecute] @Command = @CurrentCommand03, @CommandType = @CurrentCommandType03, @Mode = 1, @DatabaseName = @CurrentDatabaseName, @LogToTable = @LogToTable, @Execute = @Execute
    SET @Error = @@ERROR
    IF @Error <> 0 SET @CurrentCommandOutput03 = @Error
    IF @CurrentCommandOutput03 <> 0 SET @ReturnCode = @CurrentCommandOutput03
    END
    -- Delete old backup files
    IF (@CurrentCommandOutput02 = 0 AND @Verify = 'N' AND @CurrentCleanupDate IS NOT NULL)
    OR (@CurrentCommandOutput02 = 0 AND @Verify = 'Y' AND @CurrentCommandOutput03 = 0 AND @CurrentCleanupDate IS NOT NULL)
    BEGIN
    WHILE EXISTS (SELECT * FROM @CurrentDirectories WHERE CleanupCompleted = 0)
    BEGIN
    SELECT TOP 1 @CurrentDirectoryID = ID,
    @CurrentDirectoryPath = DirectoryPath
    FROM @CurrentDirectories
    WHERE CleanupCompleted = 0
    ORDER BY ID ASC
    IF @BackupSoftware IS NULL
    BEGIN
    SET @CurrentCommandType04 = 'xp_delete_file'
    SET @CurrentCommand04 = 'DECLARE @ReturnCode int EXECUTE @ReturnCode = [master].dbo.xp_delete_file 0, N''' + REPLACE(@CurrentDirectoryPath,'''','''''') + ''', ''' + @CurrentFileExtension + ''', ''' + CONVERT(nvarchar(19),@CurrentCleanupDate,126) + ''' IF @ReturnCode <> 0 RAISERROR(''Error deleting files.'', 16, 1)'
    END
    IF @BackupSoftware = 'LITESPEED'
    BEGIN
    SET @CurrentCommandType04 = 'xp_slssqlmaint'
    SET @CurrentCommand04 = 'DECLARE @ReturnCode int EXECUTE @ReturnCode = [master].dbo.xp_slssqlmaint N''-MAINTDEL -DELFOLDER "' + REPLACE(@CurrentDirectoryPath,'''','''''') + '" -DELEXTENSION "' + @CurrentFileExtension + '" -DELUNIT "' + CAST(DATEDIFF(mi,@CurrentCleanupDate,GETDATE()) + 1 AS nvarchar) + '" -DELUNITTYPE "minutes" -DELUSEAGE'' IF @ReturnCode <> 0 RAISERROR(''Error deleting LiteSpeed backup files.'', 16, 1)'
    END
    IF @BackupSoftware = 'SQLBACKUP'
    BEGIN
    SET @CurrentCommandType04 = 'sqbutility'
    SET @CurrentCommand04 = 'DECLARE @ReturnCode int EXECUTE @ReturnCode = [master].dbo.sqbutility 1032, N''' + REPLACE(@CurrentDatabaseName,'''','''''') + ''', N''' + REPLACE(@CurrentDirectoryPath,'''','''''') + ''', ''' + CASE WHEN @CurrentBackupType = 'FULL' THEN 'D' WHEN @CurrentBackupType = 'DIFF' THEN 'I' WHEN @CurrentBackupType = 'LOG' THEN 'L' END + ''', ''' + CAST(DATEDIFF(hh,@CurrentCleanupDate,GETDATE()) + 1 AS nvarchar) + 'h'', ' + ISNULL('''' + REPLACE(@EncryptionKey,'''','''''') + '''','NULL') + ' IF @ReturnCode <> 0 RAISERROR(''Error deleting SQLBackup backup files.'', 16, 1)'
    END
    IF @BackupSoftware = 'HYPERBAC'
    BEGIN
    SET @CurrentCommandType04 = 'xp_delete_file'
    SET @CurrentCommand04 = 'DECLARE @ReturnCode int EXECUTE @ReturnCode = [master].dbo.xp_delete_file 0, N''' + REPLACE(@CurrentDirectoryPath,'''','''''') + ''', ''' + @CurrentFileExtension + ''', ''' + CONVERT(nvarchar(19),@CurrentCleanupDate,126) + ''' IF @ReturnCode <> 0 RAISERROR(''Error deleting files.'', 16, 1)'
    END
    IF @BackupSoftware = 'SQLSAFE'
    BEGIN
    SET @CurrentCommandType04 = 'xp_ss_delete'
    SET @CurrentCommand04 = 'DECLARE @ReturnCode int EXECUTE @ReturnCode = [master].dbo.xp_ss_delete @filename = N''' + REPLACE(@CurrentDirectoryPath,'''','''''') + '\*.' + @CurrentFileExtension + ''', @age = ''' + CAST(DATEDIFF(mi,@CurrentCleanupDate,GETDATE()) + 1 AS nvarchar) + 'Minutes'' IF @ReturnCode <> 0 RAISERROR(''Error deleting SQLsafe backup files.'', 16, 1)'
    END
    EXECUTE @CurrentCommandOutput04 = [dbo].[CommandExecute] @Command = @CurrentCommand04, @CommandType = @CurrentCommandType04, @Mode = 1, @DatabaseName = @CurrentDatabaseName, @LogToTable = @LogToTable, @Execute = @Execute
    SET @Error = @@ERROR
    IF @Error <> 0 SET @CurrentCommandOutput04 = @Error
    IF @CurrentCommandOutput04 <> 0 SET @ReturnCode = @CurrentCommandOutput04
    UPDATE @CurrentDirectories
    SET CleanupCompleted = 1,
    CleanupOutput = @CurrentCommandOutput04
    WHERE ID = @CurrentDirectoryID
    SET @CurrentDirectoryID = NULL
    SET @CurrentDirectoryPath = NULL
    SET @CurrentCommand04 = NULL
    SET @CurrentCommandOutput04 = NULL
    SET @CurrentCommandType04 = NULL
    END
    END
    END
    -- Update that the database is completed
    UPDATE @tmpDatabases
    SET Completed = 1
    WHERE Selected = 1
    AND Completed = 0
    AND ID = @CurrentDBID
    -- Clear variables
    SET @CurrentDBID = NULL
    SET @CurrentDatabaseID = NULL
    SET @CurrentDatabaseName = NULL
    SET @CurrentBackupType = NULL
    SET @CurrentFileExtension = NULL
    SET @CurrentFileNumber = NULL
    SET @CurrentDifferentialBaseLSN = NULL
    SET @CurrentDifferentialBaseIsSnapshot = NULL
    SET @CurrentLogLSN = NULL
    SET @CurrentLatestBackup = NULL
    SET @CurrentDatabaseNameFS = NULL
    SET @CurrentDatabaseType = NULL
    SET @CurrentDate = NULL
    SET @CurrentCleanupDate = NULL
    SET @CurrentIsDatabaseAccessible = NULL
    SET @CurrentAvailabilityGroup = NULL
    SET @CurrentAvailabilityGroupRole = NULL
    SET @CurrentIsPreferredBackupReplica = NULL
    SET @CurrentDatabaseMirroringRole = NULL
    SET @CurrentLogShippingRole = NULL
    SET @CurrentCommand02 = NULL
    SET @CurrentCommand03 = NULL
    SET @CurrentCommandOutput02 = NULL
    SET @CurrentCommandOutput03 = NULL
    SET @CurrentCommandType02 = NULL
    SET @CurrentCommandType03 = NULL
    DELETE FROM @CurrentDirectories
    DELETE FROM @CurrentFiles
    END
    --// Log completing information //--
    Logging:
    SET @EndMessage = 'Date and time: ' + CONVERT(nvarchar,GETDATE(),120)
    SET @EndMessage = REPLACE(@EndMessage,'%','%%')
    RAISERROR(@EndMessage,10,1) WITH NOWAIT
    IF @ReturnCode <> 0
    BEGIN
    RETURN @ReturnCode
    END
    END
    GO
    ALTER AUTHORIZATION ON [dbo].[DatabaseBackup] TO SCHEMA OWNER
    GO
    Diane

  • My apple is not activating,Asking for Apple ID &p.word, I have entered the apple ID which i was using to download all apps,but it wont work, Now system is saying that your apple Id is wrong, My question is Can there be two apple IDs?

    My apple is not activating,Asking for Apple ID &p.word, I have entered the apple ID which i was using to download all apps,but it wont work, Now system is saying that your apple Id is wrong, My question is Can there be two apple IDs? My apple ID is my Yahoo mail it self, but not able to log in to  Icloud, Can any body guide, Why, I can not.

    Hi dip_kinu,
    I apologize, I'm a bit unclear on exactly what device you are trying to set up and what is happening when you try to do so. If you are having issues remembering your Apple ID, or feel like you may have set up multiple Apple ID's, you may find the following page helpful:
    Apple - My Apple ID: Find your Apple ID
    https://iforgot.apple.com/appleid
    Regards,
    - Brenden

Maybe you are looking for