Weblogic Clustering Replica Session not Recovering

Dear All,
Have One domains with WLS 10.3.4 on two physical machines, each machine hosting one managed server, cluster of the two servers, node manager on both servers and admin server on one of the servers. Using unicast and in-memory replication with replicate if clustered set in the weblogic.xml.
Apache balancing between the two and selected options to allow proxy plugin in the domain.
Question is I bring both servers up,
Log the user into test application.
In the console I can see from Cluster Monitoring that a single user connects on Managed Server 1 and that the session is correctly replicated onto Managed Server 2.
I then fail Managed Server 1 which is hosting the primary session, on manual page refresh the users request goes to the Managed Server 2 with the user staying logged in (as expected).
However when I return the failed Managed Server 1 to service I expected the current session now on Managed Server 2 to be replicated back to the Managed Server 1 (in case Managed Server 2 that is now hosting the primary session fails).
No matter how long I wait this replication does not take place, HOWEVER if after the Managed Server 1 is returned to service I manually refresh the Web Page which connects to Managed Server 2 this kicks the replication into action and creates a session replica back on Managed Server 1.
I don't think this is exected behaviour so any idea what is going wrong?
In the oracle docs it says
"In a two-server cluster, the client would transparently fail over to the server hosting the secondary session state. However, replication of the client’s session state would not continue unless another WebLogic Server became available and joined the cluster. For example, if the original primary server was restarted or reconnected to the network, it would be used to host the secondary session state. "
but in this case the second bit does not seem to host the secondary state unless the web page is actually used again (at which point you see the replica state created, it's almost like it will replicate going forwards but ignores the current state and does not re-sync between the managed servers, leading to a user being logging out if a flip-flop server failure test is carried out.
Thanks
Edited by: user10645195 on 18-Feb-2011 08:46
Edited by: user10645195 on 18-Feb-2011 08:52

HI,
The HttpSession replication happens Only when WebLogic creates a New HttpSession or Container encounters "session.setAttribute(obj,obj)" method...It means the Data is replicated to the Secondary JVM HttpSession only when application calls the setAttribute method of HttpSession. And in this case only the modified part of data is replicated NOT the complete HttpSession data.
So i think u can try adding a Simple temporary attribute in the HttpSession like
session.setAttribute("dummyData",""+new java.util.Date());
Now make sure that the above code is placed in each and every page of your application...sothat whenever a client will request the because of setAttribute() the Session modified data (dummyData) will be replicated...and if there are more setAttribute() on that page then all the those also will be replicated...
Example:
Map map = new HashMap();
session.setAttribute("map", map); <font color=maroon><b> -------> Here Session data Will be replicated to Node-2 (bcoz of setAttribute()) </b></font>
map.put("one", "aaa"); <font color=red>No Replication (Means No Session data Refresh...bcoz setAttribute is not called...)</font>
then from page1.jsp I go to page2.jsp and I do this:
Map map = (Map)session.getAttribute("map");
map.put("two", "bbb"); <font color=red>No Replication (Means No Session data Refresh...bcoz setAttribute is not called...)</font>
and then from page2.jsp I go to page3.jsp and I do this:
Map map = (Map)session.getAttribute("map");
map.put("three", "ccc"); <font color=red>No Replication (Means No Session data Refresh...bcoz setAttribute is not called...)</font>
Now you will see On The node2 the sessioncontains an EMPTY map ! <font color=maroon><b> (That is Correct) because when you executed </b></font><br>
Map map = new HashMap();
session.setAttribute("map", map);
<font color=maroon><b>
At that time The Map was not containing any data in it.
</b></font>
You need to try this:
Map map = new HashMap();
session.setAttribute("map", map);
map.put("one", "aaa"); <font color=green>----><b> Now session.setAttribute("map", map);</b></font> here session data will be refreshed in Node-2
then from page1.jsp I go to page2.jsp and I do this:
Map map = (Map)session.getAttribute("map");
map.put("two", "bbb"); <font color=green>----><b> Now session.setAttribute("map", map);</b></font> here session data will be refreshed in Node-2
and then from page2.jsp I go to page3.jsp and I do this:
Map map = (Map)session.getAttribute("map");
map.put("three", "ccc"); <font color=green>----><b> Now session.setAttribute("map", map);</b></font> here session data will be refreshed in Node-2
It means until u don't call session.setAttribute(---, ---)...The Session Data is not replicated (refreshed) to the Second Node(Secondary JVM).
Thanks
Jay SenSharma
http://middlewaremagic.com/ (Middleware magic Is Here)

Similar Messages

  • Weblogic clustering - Non session objects

    Hi,
    I have an app that doesn't have any HttpSession object or EJBs. We have only one servlet for entire application that works as a controller and we store all the information regarding the user in the servlet instance variable as cache. None of our objects are Serializable. Can i deploy my application on weblogic cluster. Will weblogic support clustering for thsi kind of applications. We have only one servlet and all other classes are normal java classes. No JSP, EJB etc. No HttpSession or ApplicationContext of servlets are being used.
    thanks,
    webbie.

    Hi,
    The There are basically two reasons ...for which we want Clustering:
    <h3><font color=maroon>Reason - 1): Failover</font></h3>
    This feature needs HttpSession replication...Failover means if a Userhas Logged in to our application and accessing some pages ...then his HttpSession Replica will be available in a Secondary WebLogic Server so...even if his Promary WebLogic Server Goes Down ...His Session data will not be lost...and client can interact with the Application without any Interruption. To Enable Failover in your Clustered Application you need to provide the <persistent-store-type>Tag inside your "<Application>/WEB-INF/weblogic.xml"
       <session-descriptor>
          <persistent-store-type>replicated</persistent-store-type>
       </session-descriptor>
    <font color=red><b>NOTE:</b> until u dont put <persistent-store-type> Tag inside your "weblogic.xml" file...by default HttpSession replication will be disabled....because it's default value is "inMemory" means even If your Application has HttpSession ... it wont be replicated on Secondary Server.</font>
    <h3><font color=maroon>Reason - 2): LoadBalancing</font></h3>
    This feature has NOTHING TO DO with HttpSession replication (in general). It means simply different clients request will be processed by different WebLogic Server Instances in a Round-Robin fashion. I Think this is what you want to implement. Because your application is not using any HttpSession .So thet Application willl not have any Failover. But LoadBalancing is the Default Feature of WebLogic Cluster. U need not to do anything additionally to Achieve it.
    <font color=green><b>Note:</b>Means Without Having HttpSession Objects in your Application Still u can have WebLogic Clustering Feature to get the benifit of LoadBalancing.</font>
    To know more about Session Replication and it's related issues : http://weblogic-wonders.com/weblogic/2009/12/08/session-replication-issues/
    Thanks
    Jay SenSharma

  • Session not replicated in WL6.1

              We are having session-not-replicated problem in WL6.1 Clustering.
              We have 3 servers on different machines running WL6.1 sp1, 1 is running the admin
              server and the
              other 2 are running as managed weblogic server.
              We have a web application that has been deployed to the cluster and is set
              for PersistantStoreType equal to replicated.
              We are using a Cisco Local Redirector with "sticky load balancing" infront of
              the servers.
              In our applications, most of JSP pages can modify the session data using session.setAttribute().
              And we use session.removeAttribute() to clean a session data.
              session.setAttribute("mysession1", data1);
              ....some codes......
              if (session.getAttribute("mysession") != null)
                   session.removeAttribute("mysession");
              session.setAttribute("mysession", data2);
              With session.removeAttibute() in our codes, some session data is not replicated
              to secondary server.
              We checked all session data in secondary server after shutting down the primary
              server.
              But if we comment out all session.removeAttribute() methods, failovers tested
              successfully.
              All our session data is serializable. Some are String and Some are Objects.
              Is this a known problems in WL6.1? Anyone has any idea?
              thanks,
              Hong
              

              We are having session-not-replicated problem in WL6.1 Clustering.
              We have 3 servers on different machines running WL6.1 sp1, 1 is running the admin
              server and the
              other 2 are running as managed weblogic server.
              We have a web application that has been deployed to the cluster and is set
              for PersistantStoreType equal to replicated.
              We are using a Cisco Local Redirector with "sticky load balancing" infront of
              the servers.
              In our applications, most of JSP pages can modify the session data using session.setAttribute().
              And we use session.removeAttribute() to clean a session data.
              session.setAttribute("mysession1", data1);
              ....some codes......
              if (session.getAttribute("mysession") != null)
                   session.removeAttribute("mysession");
              session.setAttribute("mysession", data2);
              With session.removeAttibute() in our codes, some session data is not replicated
              to secondary server.
              We checked all session data in secondary server after shutting down the primary
              server.
              But if we comment out all session.removeAttribute() methods, failovers tested
              successfully.
              All our session data is serializable. Some are String and Some are Objects.
              Is this a known problems in WL6.1? Anyone has any idea?
              thanks,
              Hong
              

  • IIS proxy 5.1 and Weblogic 6.1 does not support sticky session

    Dear Sir,
    Our system is migrating from Weblogic 5.1 to Weblogic 6.1. After testing on
    development environment, it is found that IIS proxy for 5.1 plug-in and Weblogic
    6.1 server is perfect match for our case. Since our appliction system hit some
    bugs of IIS proxy for 6.1. In development environment, one IIS match with one
    Weblogic.
    During production launch, another problem found. It seems that IIS proxy 5.1
    plug-in with Weblogic 6.1 does not support the sticky load balancing. A sticky
    service is one where a client sends its requests to the same instance and those
    requests are not redirected to other instances. In production, two IIS match with
    two Weblogic. Below is
    #WebLogicHost=10.0.3.12
    #WebLogicPort=8012
    WebLogicCluster=10.0.3.12:8012,10.0.3.13:8012
    COnnectionTimeoutSecs=10
    ConnectionRetrySecs=2
    ErrorPage=https://www.xxxx.com/eBank/sysnotready.htm
    CookieName=eBankingWebLogicSession
    Anyone have idea on out case?
    Thanks,
    KAI

    My test was with 6.1 SP3.
    The way to tell is by analyzing the cookie(JSESSIONID).
    Perhaps the behaviour changed post SP1. I can't say for sure.
    Eric
    "Gary Rudolph" <[email protected]> wrote in message
    news:[email protected]...
    Is that entirely true concerning you don't need the persistence set to
    replicated in the weblogic.xml to gain sticky load balancing?
    The reason I ask was that in our situation sticky wouldn't work without
    having the persistence set to replicated. This was with NSAPI and WLS 6.1
    SP1. The weblogic servers were configured in a weblogic cluster. So..based
    on this statement we should not have needed to set the persistence, but in
    practice we did for it to work.
    Gary
    "Eric Gross" <[email protected]> wrote in message
    news:[email protected]...
    I just checked, and you are correct. You just need to have clustering
    enabled in 6.1. You do not necessarily need to have persistence set to
    replicated.
    Of course, you won't get failover, but you will get the sticky load
    balancing.
    Regards,
    Eric
    "Ricky Wong" <[email protected]> wrote in message
    news:[email protected]...
    Why do we need to set session persistence to replicate in order to
    perform
    sticky load balancing ? There is no such requirement in WebLogic 5.1.
    As
    far
    as I know, the IIS plugin simply interprets the value of the sessioncookie,
    which should be embedded with the application server address, then
    forward
    the request to that particular application server.
    We didn't use session replication in our environment because not allsession
    variables are serializable.
    "Eric Gross" <[email protected]> wrote in message
    news:[email protected]...
    The problem you mentionned in the other newsgroup post has been
    fixed
    and
    will be in SP4. If you are in production or nearing production and
    need
    a
    resolution now, then please open a case with support.
    You should not need any other parameters to do the load balancing.
    But
    to
    have the sticky load balancing, you must make sure you have session
    persistence set to replicated for the webapp in question.
    I'm not sure I am understanding your 3rd question.
    In any case, my advice is to either wait for SP4 to bereleased(scheduled
    sometime this month) or if you really need to go into production
    soon,
    contact support to obtain the latest IIS plugin.
    Regards,
    Eric
    "Mike" <[email protected]> wrote in message
    news:[email protected]...
    Dear Eric,
    Thanks very much for you kindly information, but we still have thefollowing issues
    regarding the WL IIS proxy:
    1. We have already tried the IIS proxy that comes with WL6.1 SP3.However, the
    result from that version of IIS proxy is not satisfactory, as weexperienced cases
    where the web page is not displayed correctly (as in
    http://newsgroups.bea.com/cgi-bin/dnewsweb?cmd=article&group=weblogic.develo
    per.interest.plug-in&item=994&utag=).
    If there is any IIS proxy released after WL6.1 SP3, Could you
    kindly
    give
    us
    a pointer to the plugin?
    2. In WL5.1 case, we are only required to have "WebLogicCluster"
    parameter
    set
    to two weblogic servers in order use the load balancing features.
    In
    WL6.1, we
    do not come across any additional settings required to support
    load
    balancing.
    Is there any such settings required (e.g. in
    config.xml,weblogic.xml,
    application.xml,
    etc?)
    3. Does WL IIS proxy problem has anything to do with the version
    of
    the
    IIS server/windows
    versions that are using? we have already tried with IIS4 and IIS5
    and
    have
    different
    kinds of issues.
    Thanks in advance for your kind assistance.
    Mike
    "Eric Gross" <[email protected]> wrote:
    Yes, the session format has changed when using clustering and you
    cannot
    use
    the 5.1 plugin to proxy to 6.1.
    What problems did you have using the 6.1 plugin? Maybe you need
    the
    latest
    6.1 plugin.
    Regards,
    Eric
    "KAI" <[email protected]> wrote in message
    news:[email protected]...
    Dear Sir,
    Our system is migrating from Weblogic 5.1 to Weblogic 6.1.
    After
    testing on
    development environment, it is found that IIS proxy for 5.1
    plug-in
    and
    Weblogic
    6.1 server is perfect match for our case. Since our appliction
    system
    hit
    some
    bugs of IIS proxy for 6.1. In development environment, one IIS
    match
    with
    one
    Weblogic.
    During production launch, another problem found. It seems
    that
    IIS
    proxy 5.1
    plug-in with Weblogic 6.1 does not support the sticky load
    balancing.
    A
    sticky
    service is one where a client sends its requests to the same
    instance
    and
    those
    requests are not redirected to other instances. In production,
    two
    IIS
    match with
    two Weblogic. Below is
    #WebLogicHost=10.0.3.12
    #WebLogicPort=8012
    WebLogicCluster=10.0.3.12:8012,10.0.3.13:8012
    COnnectionTimeoutSecs=10
    ConnectionRetrySecs=2
    ErrorPage=https://www.xxxx.com/eBank/sysnotready.htm
    CookieName=eBankingWebLogicSession
    Anyone have idea on out case?
    Thanks,
    KAI

  • Replicated DB & WebLogic Clustering

    Hi All,
              In the documentation I've seen on WebLogic clustering, the individual application servers always connect to a single DB back-end. My
              distributed application is connecting to a replicated DB and I would like each of the application servers to connect to a different DB instance. Is
              this possible with WebLogic? How would I set upt the connection pool/data source to achieve this?
              Thanks.
              Kris
              

    Hi,
    It is depend on what kind of Load Balancer you are using.
    Many H/W Load Balancer has their own server fail detect method.
    Most of them are checking the port is reachable.
    If the port is not reachable, then the L4 send the request to another port.
    Some L7 switchs can detect the URI. and check the index page or other web page.
    You don't need too much care how to set the H/W load balaner exactly act like a plug-in module.
    Best Regards,
    Luke Ham
    Edited by: user2088723 on 2008. 9. 6 오전 1:31

  • Calrification for Weblogic Clustering

    Our J2EE application is multitiered where JSPs&Servlets(Frontend) runs in a weblogic instance and EJBs(Backend) runs in two weblogic instances which are clustered. Here the Frontend weblogic instance and one of the clustered Backend weblogic instance are running in a same machine A and the other clustered Backend weblogic instance is running in another machine B. We had tested the following cases for Failover
    Note :
    please consider "JSPs&Servlets" as Frontend and "EJBs" as Backend.
    Weblogic 9.2 and stateless session beans are used.
    Frontend is not clustered.
    Case 1:
    We are doing a transaction where the request from frontend goes to one of the of the Clustered Backend weblogic instance. Before the transaction gets completed this backend weblogic instance is made to shutdown. The transaction has failed over to the another available Clustered Backend weblogic instance . The transaction had completed successfully and the Failover is working fine.
    Case 2:
    We are doing a transaction where the request from frontend(running in Machine A) goes to the Clustered Backend weblogic instance running in the Machine A itself. Before the transaction gets completed, the machine A is made to shutdown (i.e. both frontend and backend weblogic instance shuts down at the same time). Here the transaction has failed and could not able failover to the other available Backend weblogic instance .
    Please clarify whether weblogic cluster supports the Backend failover when both the Frontend and Backend are brought down at the same time?
    Any weblogic CLustering experts, please clarify...

    Hi Jayesh,
    Thanks very much for your reply.
    I understood that your reply "You might want to consider collapsing front end (servlet & JSP) and back end (EJB) servers into a single WebLogic server for better fail over support." means that JSP&Servlet and EJB should be combined to form a single archive(EAR) which has to be deployed in single weblogic instance.
    Please check whether my assumptions are correct for your suggestion on better failover.
    1.The cluster configuration of JSPs&Servlet(web.xml) and EJBs(ejb-jar.xml) running in single weblogic instance will be similar to the cluster configuration of JSPs&Servlet(web.xml) and EJBs(ejb-jar.xml) running in separate weblogic instances. i.e All the configurations are same, but instead of the application running in separate weblogic instances, it will run in single weblogic instance.
    2.In the URL for specifying the EJB connection from the JSP&Servlet, the cluster IP address should be used.
    You have mentioned that if EJB client is not alive, the failover will not work. Please clarify how the failover will work in this case only(JSP&Servlet and EJB running in single weblogic instance and clustered).
    Thanks,
    Thiyagu

  • NullPointer with Replicated Session

              I'm running on a 2-node Solaris cluster with WLS 8.1 sp1. When testing failover,
              the session is replicated correctly to the secondary server. However, if the
              page being tested with failover uses session.setAttribute, the following error
              is received:
              java.lang.NullPointerException
                   at weblogic.servlet.internal.session.SessionData.setAttribute(SessionData.java:563)
                   at weblogic.servlet.internal.session.ReplicatedSessionData.setAttribute(ReplicatedSessionData.java:438)
              I've checked and everything appears to be serializable (no WLS errors and in a
              non-clustered environment, I'm able to write the session out to file). Is this
              an issue with WLS?
              

              I'm running on a 2-node Solaris cluster with WLS 8.1 sp1. When testing failover,
              the session is replicated correctly to the secondary server. However, if the
              page being tested with failover uses session.setAttribute, the following error
              is received:
              java.lang.NullPointerException
                   at weblogic.servlet.internal.session.SessionData.setAttribute(SessionData.java:563)
                   at weblogic.servlet.internal.session.ReplicatedSessionData.setAttribute(ReplicatedSessionData.java:438)
              I've checked and everything appears to be serializable (no WLS errors and in a
              non-clustered environment, I'm able to write the session out to file). Is this
              an issue with WLS?
              

  • 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

  • OIM installation on RAC DB and Weblogic clusters

    I understand its a very broad question but tell me the links/resource/metalink documents references for installing OIM 9.1.0.1 on Weblogic clusters and Oracle RAC DB clusters ? (either or both)
    Is OIM 9.1.0.1 compatible with Oracle RAC DB 10gR2 ? I have checked the configuration matrix but still not sure on it. Can anybody confirm this ?
    I have gone through the basic installation guide for the same but I still find loopholes in it. If anybody has made any document for his/her purpose, please let me know, very appreciative!
    It does not give information about the schema design needed for OIM on Oracle RAC DB like -
    1.) During installation of OIM, we need to specify the "User Name" and "Password" of the database account that is created for Oracle Identity Manager.
    So is that user needed to be created with all the necessary privileges in RAC DB before starting this installation ?
    Thanks in advance,
    - oidm.
    Edited by: oidm on Aug 3, 2009 12:06 AM

    Hey there,
    I have checked the certification matrix but still just wanted to specifically know about compatibility of OIM 9.1.0.1 with Oracle RAC DB 10.2.0.2 ? Do they go hand in hand ?
    Thanks,
    - oidm.
    Edited by: oidm on Aug 3, 2009 7:52 PM

  • Weblogic clustering with IIS as web server

              Hi,
              I have two IIS servers and two machines for weblogic. I am planning to have
              a weblogic clustering. I have seen the documentation online. But has some questions
              for which dint find any answers.
              Somewhere on the newsgroup I read , if we will be having IIS proxy-plug in we
              do not need the DNS setup. Is that true ?
              How many IPs and other things I need to do this setup ? What is admin server &
              its role ? configuration how to do it is not avaliable in the documentation.
              Could someone help ?
              Thanks and Regards,
              Sheetal
              

    Hi
              you can find the ore information in the following link
              http://bernal.bea.com/stage/wls/docs70/plugins/isapi.html
              Regards,
              Prasanna Yalam

  • Can we configure webserver to loaedbalance multiple weblogic clusters?

    Can we configure webserver to loadbalance to multiple weblogic clusters?
    E.g. Web server X -> Cluster Y & Cluster Z
    In the plugin documentation it is not explicit that you can or can't do so.

    Refer:- http://download.oracle.com/docs/cd/E17904_01/web.1111/e16435/apache.htm#CDEHDGJG
    http://download.oracle.com/docs/cd/E12839_01/web.1111/e13709/failover.htm#i1040344
    -Akshay

  • Classnotfoundexception weblogic.servlet.internal.session.WebLogicSPIFactory

    hi all, it seems that there is not any error in classpath but while deploying the application it says:classnot found exception:weblogic.servlet.internal.session.WebLogicSPIFactory. i have a shared library for this WebLogicSPIFactory class.moreover i added the jar that contains this class into the classpath but it still says "class not found exception"
    please help.

    Hiya,
    Did you manage to fix this problem. I read somwhere is actually a bug in weblogic 610sp2 but 610sp3 has a fix for it. Please confirm.

  • Weblogic.transaction.RollbackException - Could not prepare resource

    Hi All,
    My WLI application transfers data from CrossAccess to Oracle. Once the record is inserted in the Oracle database. A record in another oracle database is updated.
    I am using a session bean to perform this task. With in SessionBean I am using UserTransaction. Once all the data is transfered from CrossAccess to Oracle database, I am commiting the user transaction.
    While commiting the user transaction I am getting the following Exception. The exception occurs very rarely. Once the server is bounced everything works fine.
    The Application server is Weblogic Integeration8.1 SP4 and database is Oralce 9.
    oracle.jdbc.xa.OracleXAException
         at oracle.jdbc.xa.client.OracleXAResource.prepare(Ljavax.transaction.xa.Xid; )I(OracleXAResource.java:558)
         at weblogic.jdbc.wrapper.VendorXAResource.prepare(Ljavax.transaction.xa.Xid; )I(VendorXAResource.java:70)
         at weblogic.jdbc.jta.DataSource.prepare(Ljavax.transaction.xa.Xid; )I(DataSource.java:890)
         at weblogic.transaction.internal.XAServerResourceInfo.prepare(Lweblogic.transaction.internal.ServerTransactionImpl;Ljavax.transaction.xa.Xid; )I(XAServerResourceInfo.java:1234)
         at weblogic.transaction.internal.XAServerResourceInfo.prepare(Lweblogic.transaction.internal.ServerTransactionImpl; )I(XAServerResourceInfo.java:441)
         at weblogic.transaction.internal.ServerSCInfo$1.execute(Lweblogic.kernel.ExecuteThread; )V(ServerSCInfo.java:253)
         at weblogic.kernel.ExecuteThread.execute(Lweblogic.kernel.ExecuteRequest; )V(ExecuteThread.java:219)
         at weblogic.kernel.ExecuteThread.run()V(ExecuteThread.java:178)
         at java.lang.Thread.startThreadFromVM(Ljava.lang.Thread; )V(Unknown Source)
    --------------- nested within: ------------------
    weblogic.transaction.RollbackException: Could not prepare resource 'weblogic.jdbc.jta.DataSource - with nested exception:
    [oracle.jdbc.xa.OracleXAException]
         at weblogic.transaction.internal.TransactionImpl.throwRollbackException()V(TransactionImpl.java:1683)
         at weblogic.transaction.internal.ServerTransactionImpl.internalCommit()V(ServerTransactionImpl.java:325)
         at weblogic.transaction.internal.ServerTransactionImpl.commit()V(ServerTransactionImpl.java:246)
         at weblogic.transaction.internal.TransactionManagerImpl.commit()V(TransactionManagerImpl.java:303)
         at com.xyz.inventory.dcreceipts.ejb.DCReceiptsGOLDBean.perform(Lcom.xyz.integration.framework.TypedMap; )V(DCReceiptsGOLDBean.java:1072)
         at com.xyz.inventory.dcreceipts.ejb.DCReceiptsGOLDBean_zf5z70_EOImpl.perform(Lcom.xyz.integration.framework.TypedMap; )V(DCReceiptsGOLDBean_zf5z70_EOImpl.java:46)
         at com.xyz.inventory.dcreceipts.process.DCReceiptsProcess.perform()V(DCReceiptsProcess.jpd:442)
         at com.xyz.inventory.dcreceipts.process.DCReceiptsProcess_wf$ImplPerform6.invoke(Lcom.bea.wli.bpm.runtime.ProcessState; )V(DCReceiptsProcess_wf.java:68)
         at com.bea.wli.bpm.runtime.Perform.execute(Lcom.bea.wli.bpm.runtime.ProcessState; )Lcom.bea.wli.bpm.runtime.Activity;(Perform.java:32)
         at com.bea.wli.bpm.runtime.Receive.messageDelivery(Lcom.bea.wli.bpm.runtime.ProcessState;[Ljava.lang.Object; )Ljava.lang.Object;(Receive.java:91)
         at com.bea.wli.bpm.runtime.Receive.messageDeliveryAction(Lcom.bea.wli.bpm.runtime.ProcessState;[Ljava.lang.Object; )Ljava.lang.Object;(Receive.java:71)
         at com.bea.wli.bpm.runtime.ProcessState.processMessage(I[Ljava.lang.Object;Z)Ljava.lang.Object;(ProcessState.java:166)
         at com.xyz.inventory.dcreceipts.process.DCReceiptsProcess_wf$_ProcessState.processMessage(I[Ljava.lang.Object;Z)Ljava.lang.Object;(DCReceiptsProcess_wf.java:204)
         at com.xyz.inventory.dcreceipts.process.DCReceiptsProcess_wf.subscription(Ljava.lang.String; )V(DCReceiptsProcess_wf.java:184)
         at jrockit.reflect.NativeMethodInvoker.invoke0(Ljava.lang.Object;ILjava.lang.Object;[Ljava.lang.Object; )Ljava.lang.Object;(Unknown Source)
         at jrockit.reflect.NativeMethodInvoker.invoke(Ljava.lang.Object;[Ljava.lang.Object; )Ljava.lang.Object;(Unknown Source)
         at jrockit.reflect.VirtualNativeMethodInvoker.invoke(Ljava.lang.Object;[Ljava.lang.Object; )Ljava.lang.Object;(Unknown Source)
         at java.lang.reflect.Method.invoke(Ljava.lang.Object;[Ljava.lang.Object;I)Ljava.lang.Object;(Unknown Source)
         at com.bea.wlw.runtime.core.dispatcher.DispMethod.invoke(Ljava.lang.Object;[Ljava.lang.Object; )Ljava.lang.Object;(DispMethod.java:371)
         at com.bea.wlw.runtime.core.container.Invocable.invoke(Ljava.lang.Object;Ljava.lang.String;Lcom.bea.wlw.runtime.core.dispatcher.DispMethod;[Ljava.lang.Object; )Ljava.lang.Object;(Invocable.java:423)
         at com.bea.wlw.runtime.core.container.Invocable.invoke(Lcom.bea.wlw.runtime.core.dispatcher.DispMethod;[Ljava.lang.Object; )Ljava.lang.Object;(Invocable.java:396)
         at com.bea.wlw.runtime.core.container.Invocable.invoke(Lcom.bea.wlw.runtime.core.request.Request; )Lcom.bea.wlw.runtime.core.dispatcher.InvokeResult;(Invocable.java:248)
         at com.bea.wlw.runtime.core.bean.BaseContainerBean.invokeBase(Lcom.bea.wlw.runtime.core.request.Request; )Lcom.bea.wlw.runtime.core.dispatcher.InvokeResult;(BaseContainerBean.java:224)
         at com.bea.wlw.runtime.core.bean.SLSBContainerBean.invoke(Lcom.bea.wlw.runtime.core.request.Request; )Lcom.bea.wlw.runtime.core.dispatcher.InvokeResult;(SLSBContainerBean.java:103)
         at com.bea.wlwgen.DCReceiptsProcessSLSBContImpl.subscription(Lcom.bea.wlw.runtime.core.request.Request; )Lcom.bea.wlw.runtime.core.dispatcher.InvokeResult;(DCReceiptsProcessSLSBContImpl.java:25)
         at com.bea.wlwgen.StatelessContainer_nj08aw_ELOImpl.subscription(Lcom.bea.wlw.runtime.core.request.Request; )Lcom.bea.wlw.runtime.core.dispatcher.InvokeResult;(StatelessContainer_nj08aw_ELOImpl.java:99)
         at com.bea.wlwgen.DCReceiptsProcessSLSBContAdpt.invokeOnBean(Ljava.lang.Object;Lcom.bea.wlw.runtime.core.request.Request; )Lcom.bea.wlw.runtime.core.dispatcher.InvokeResult;(DCReceiptsProcessSLSBContAdpt.java:53)
         at com.bea.wlw.runtime.core.bean.BaseDispatcherBean.runAsInvoke(Lcom.bea.wlw.runtime.core.request.Request; )Lcom.bea.wlw.runtime.core.request.Response;(BaseDispatcherBean.java:153)
         at com.bea.wlw.runtime.core.bean.BaseDispatcherBean.run()Ljava.lang.Object;(BaseDispatcherBean.java:85)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(Lweblogic.security.subject.AbstractSubject;Ljava.security.PrivilegedExceptionAction; )Ljava.lang.Object;(AuthenticatedSubject.java:363)
         at weblogic.security.service.SecurityManager.runAs(Lweblogic.security.acl.internal.AuthenticatedSubject;Lweblogic.security.acl.internal.AuthenticatedSubject;Ljava.security.PrivilegedExceptionAction; )Ljava.lang.Object;(SecurityManager.java:147)
         at com.bea.wlw.runtime.core.bean.BaseDispatcherBean.invoke(Lcom.bea.wlw.runtime.core.request.Request; )Lcom.bea.wlw.runtime.core.request.Response;(BaseDispatcherBean.java:50)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    Satish Chandra wrote:
    Hi All,
    My WLI application transfers data from CrossAccess to Oracle. Once the record is inserted in the Oracle database. A record in another oracle database is updated.
    I am using a session bean to perform this task. With in SessionBean I am using UserTransaction. Once all the data is transfered from CrossAccess to Oracle database, I am commiting the user transaction.
    While commiting the user transaction I am getting the following Exception. The exception occurs very rarely. Once the server is bounced everything works fine.
    The Application server is Weblogic Integeration8.1 SP4 and database is Oralce 9.
    oracle.jdbc.xa.OracleXAException
         at oracle.jdbc.xa.client.OracleXAResource.prepare(Ljavax.transaction.xa.Xid; )I(OracleXAResource.java:558)Hi. This would involve a few steps to debug. I recommend you open
    an official support case to get orchestrated official support.
    Joe
         at weblogic.jdbc.wrapper.VendorXAResource.prepare(Ljavax.transaction.xa.Xid; )I(VendorXAResource.java:70)
         at weblogic.jdbc.jta.DataSource.prepare(Ljavax.transaction.xa.Xid; )I(DataSource.java:890)
         at weblogic.transaction.internal.XAServerResourceInfo.prepare(Lweblogic.transaction.internal.ServerTransactionImpl;Ljavax.transaction.xa.Xid; )I(XAServerResourceInfo.java:1234)
         at weblogic.transaction.internal.XAServerResourceInfo.prepare(Lweblogic.transaction.internal.ServerTransactionImpl; )I(XAServerResourceInfo.java:441)
         at weblogic.transaction.internal.ServerSCInfo$1.execute(Lweblogic.kernel.ExecuteThread; )V(ServerSCInfo.java:253)
         at weblogic.kernel.ExecuteThread.execute(Lweblogic.kernel.ExecuteRequest; )V(ExecuteThread.java:219)
         at weblogic.kernel.ExecuteThread.run()V(ExecuteThread.java:178)
         at java.lang.Thread.startThreadFromVM(Ljava.lang.Thread; )V(Unknown Source)
    --------------- nested within: ------------------
    weblogic.transaction.RollbackException: Could not prepare resource 'weblogic.jdbc.jta.DataSource - with nested exception:
    [oracle.jdbc.xa.OracleXAException]
         at weblogic.transaction.internal.TransactionImpl.throwRollbackException()V(TransactionImpl.java:1683)
         at weblogic.transaction.internal.ServerTransactionImpl.internalCommit()V(ServerTransactionImpl.java:325)
         at weblogic.transaction.internal.ServerTransactionImpl.commit()V(ServerTransactionImpl.java:246)
         at weblogic.transaction.internal.TransactionManagerImpl.commit()V(TransactionManagerImpl.java:303)
         at com.xyz.inventory.dcreceipts.ejb.DCReceiptsGOLDBean.perform(Lcom.xyz.integration.framework.TypedMap; )V(DCReceiptsGOLDBean.java:1072)
         at com.xyz.inventory.dcreceipts.ejb.DCReceiptsGOLDBean_zf5z70_EOImpl.perform(Lcom.xyz.integration.framework.TypedMap; )V(DCReceiptsGOLDBean_zf5z70_EOImpl.java:46)
         at com.xyz.inventory.dcreceipts.process.DCReceiptsProcess.perform()V(DCReceiptsProcess.jpd:442)
         at com.xyz.inventory.dcreceipts.process.DCReceiptsProcess_wf$ImplPerform6.invoke(Lcom.bea.wli.bpm.runtime.ProcessState; )V(DCReceiptsProcess_wf.java:68)
         at com.bea.wli.bpm.runtime.Perform.execute(Lcom.bea.wli.bpm.runtime.ProcessState; )Lcom.bea.wli.bpm.runtime.Activity;(Perform.java:32)
         at com.bea.wli.bpm.runtime.Receive.messageDelivery(Lcom.bea.wli.bpm.runtime.ProcessState;[Ljava.lang.Object; )Ljava.lang.Object;(Receive.java:91)
         at com.bea.wli.bpm.runtime.Receive.messageDeliveryAction(Lcom.bea.wli.bpm.runtime.ProcessState;[Ljava.lang.Object; )Ljava.lang.Object;(Receive.java:71)
         at com.bea.wli.bpm.runtime.ProcessState.processMessage(I[Ljava.lang.Object;Z)Ljava.lang.Object;(ProcessState.java:166)
         at com.xyz.inventory.dcreceipts.process.DCReceiptsProcess_wf$_ProcessState.processMessage(I[Ljava.lang.Object;Z)Ljava.lang.Object;(DCReceiptsProcess_wf.java:204)
         at com.xyz.inventory.dcreceipts.process.DCReceiptsProcess_wf.subscription(Ljava.lang.String; )V(DCReceiptsProcess_wf.java:184)
         at jrockit.reflect.NativeMethodInvoker.invoke0(Ljava.lang.Object;ILjava.lang.Object;[Ljava.lang.Object; )Ljava.lang.Object;(Unknown Source)
         at jrockit.reflect.NativeMethodInvoker.invoke(Ljava.lang.Object;[Ljava.lang.Object; )Ljava.lang.Object;(Unknown Source)
         at jrockit.reflect.VirtualNativeMethodInvoker.invoke(Ljava.lang.Object;[Ljava.lang.Object; )Ljava.lang.Object;(Unknown Source)
         at java.lang.reflect.Method.invoke(Ljava.lang.Object;[Ljava.lang.Object;I)Ljava.lang.Object;(Unknown Source)
         at com.bea.wlw.runtime.core.dispatcher.DispMethod.invoke(Ljava.lang.Object;[Ljava.lang.Object; )Ljava.lang.Object;(DispMethod.java:371)
         at com.bea.wlw.runtime.core.container.Invocable.invoke(Ljava.lang.Object;Ljava.lang.String;Lcom.bea.wlw.runtime.core.dispatcher.DispMethod;[Ljava.lang.Object; )Ljava.lang.Object;(Invocable.java:423)
         at com.bea.wlw.runtime.core.container.Invocable.invoke(Lcom.bea.wlw.runtime.core.dispatcher.DispMethod;[Ljava.lang.Object; )Ljava.lang.Object;(Invocable.java:396)
         at com.bea.wlw.runtime.core.container.Invocable.invoke(Lcom.bea.wlw.runtime.core.request.Request; )Lcom.bea.wlw.runtime.core.dispatcher.InvokeResult;(Invocable.java:248)
         at com.bea.wlw.runtime.core.bean.BaseContainerBean.invokeBase(Lcom.bea.wlw.runtime.core.request.Request; )Lcom.bea.wlw.runtime.core.dispatcher.InvokeResult;(BaseContainerBean.java:224)
         at com.bea.wlw.runtime.core.bean.SLSBContainerBean.invoke(Lcom.bea.wlw.runtime.core.request.Request; )Lcom.bea.wlw.runtime.core.dispatcher.InvokeResult;(SLSBContainerBean.java:103)
         at com.bea.wlwgen.DCReceiptsProcessSLSBContImpl.subscription(Lcom.bea.wlw.runtime.core.request.Request; )Lcom.bea.wlw.runtime.core.dispatcher.InvokeResult;(DCReceiptsProcessSLSBContImpl.java:25)
         at com.bea.wlwgen.StatelessContainer_nj08aw_ELOImpl.subscription(Lcom.bea.wlw.runtime.core.request.Request; )Lcom.bea.wlw.runtime.core.dispatcher.InvokeResult;(StatelessContainer_nj08aw_ELOImpl.java:99)
         at com.bea.wlwgen.DCReceiptsProcessSLSBContAdpt.invokeOnBean(Ljava.lang.Object;Lcom.bea.wlw.runtime.core.request.Request; )Lcom.bea.wlw.runtime.core.dispatcher.InvokeResult;(DCReceiptsProcessSLSBContAdpt.java:53)
         at com.bea.wlw.runtime.core.bean.BaseDispatcherBean.runAsInvoke(Lcom.bea.wlw.runtime.core.request.Request; )Lcom.bea.wlw.runtime.core.request.Response;(BaseDispatcherBean.java:153)
         at com.bea.wlw.runtime.core.bean.BaseDispatcherBean.run()Ljava.lang.Object;(BaseDispatcherBean.java:85)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(Lweblogic.security.subject.AbstractSubject;Ljava.security.PrivilegedExceptionAction; )Ljava.lang.Object;(AuthenticatedSubject.java:363)
         at weblogic.security.service.SecurityManager.runAs(Lweblogic.security.acl.internal.AuthenticatedSubject;Lweblogic.security.acl.internal.AuthenticatedSubject;Ljava.security.PrivilegedExceptionAction; )Ljava.lang.Object;(SecurityManager.java:147)
         at com.bea.wlw.runtime.core.bean.BaseDispatcherBean.invoke(Lcom.bea.wlw.runtime.core.request.Request; )Lcom.bea.wlw.runtime.core.request.Response;(BaseDispatcherBean.java:50)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Error at weblogic.servlet.internal.session.SessionData. init

              I am using weblogic server 6.1sp2 , weblogic can start sucessful , and can work for
              a moment , but after some minutes , error occured:
              java.lang.NullPointerException
              at weblogic.servlet.internal.session.SessionData.<init>
              at weblogic.servlet.internal.session.MemorySessionData.<init>
              I have been distressed about this for serval days , need your help much.
              thanks.
              

    Since the line numbers are not there in your stack trace and there is very
              little info
              I am not 100% sure what the problem is. But my guess is that this is the
              same
              problem as reported in a bug#CR064294. Please ask support for a one off
              patch
              for this with this CR# as reference. If that doesn't solve the problem let
              us know.
              The fix for CR064294 will be available with 610 SP3.
              Thanks,
              --Vinod.
              "chun_lin" <[email protected]> wrote in message
              news:3cce1b2f$[email protected]..
              >
              > I am using weblogic server 6.1sp2 , weblogic can start sucessful , and can
              work for
              > a moment , but after some minutes , error occured:
              > java.lang.NullPointerException
              > at weblogic.servlet.internal.session.SessionData.<init>
              > at weblogic.servlet.internal.session.MemorySessionData.<init>
              >
              >
              > I have been distressed about this for serval days , need your help much.
              > thanks.
              >
              

  • Can not recover table from rman backup

    For testing I want to recover deleted table from rman backup.
    I have make vm of oracle 11g.  the following step i have applied but could not recover the table.
    rman> backup database ;
    On sqlplus create login as scott/tiger
    create table scott.emp1(col1 varchar2(10));
    insert into emp1(col1) value('Yasir ') ;
    commit ;
    select * from emp1 ;
    it shows me one row successfully.
    Now i have login the  sys as sysdba
    sqlplus> alter system switch logfile ;
    after this i have drop the table .
    Now to recover the table i have restored database on same vm.
    rman>restore database ;
    rman> recover database ;
    rman> alter database open ;
    on sqlplus i have issued
    sqlplus> select * from scott.emp1 ;
    table or view does not exist.
    any help how to recover the deleted table from rman backup

    Hi,
    Check this test case
    SQL> create table TEST2 as select * from emp;
    Table created.
    SQL> select count(*) from TEST2;
      COUNT(*)
            15
    SQL> select TO_CHAR(SYSDATE,'DD-MON-YYYY HH24:MI:SS') from dual;
    TO_CHAR(SYSDATE,'DD-
    10-SEP-2013 10:57:05
    SQL> alter system switch logfile;
    System altered.
    SQL> drop table TEST2 purge;
    Table dropped.
    SQL> shu immediate
    [oracle@vnode MYSHELL]$ rman target /
    Recovery Manager: Release 11.2.0.2.0 - Production on Tue Sep 10 10:58:39 2013
    Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.
    connected to target database: DDTEST (DBID=1667776968, not open)
    RMAN> run{
    set until time "to_date('2013 Sep 10 10:57','yyyy mon dd hh24:mi')";
    restore database;
    recover database;
    alter database open resetlogs;
    }2> 3> 4> 5> 6>
    media recovery complete, elapsed time: 00:00:02
    Finished recover at 10-SEP-13
    database opened
    RMAN> exit
    SQL> set lin 200 pages 100
    SQL> select count(*) from test2;
      COUNT(*)
            15
    HTH

Maybe you are looking for

  • Having problems with upgrading or installing 8.0.2 on vista 64? Read me

    After trying to auto update i received a msg to download and do manual install. After doing that it would roll back when its was almost complete with the upgrade. So I uninstalled itunes to do a fresh install and the same thing occured. After working

  • How to Display a PNG Depending on Web Service Response?

    Good Morning, I'm using the Weather.com XML web service to obtain current temperature, "feels like" temperature, and the current condition icon number.  Their service provides numerous (>20 I think) PNG files representing current condition.  How woul

  • Icloud duplicates contacts or events in the calendar when syncs

    having trouble with icloud, it duplictes contacts on the iphone and events in ical on ipad. tried to change settings on the home desktop, on ipad2 and iphone and have no luck. Any suggestions?

  • Submitting Form to Orchestration

    I apologize if this question is incredibly basic. I've looke for answers and can't find them. We've been using Workspace for development, but cannot do so in production now (bummer) for many reasons. So, we are building forms that prepopulate via web

  • Rights needed to manage and create print queues

    On a Netware 5.1 install with eDir 8733, what rights would I need to give a user so that this person would be able to create new print queues, print servers, and print objects? This person is not an admin and I prefer not making him an admin equivale