Jump to: navigation, search

Manage Advisors Stat Server Instances

35px|link= Starting in release 8.5.1, Stat Server registration is no longer done during deployment. Previously, you input Stat Server connection information in installer screens, which registered the Stat Servers. You now execute dedicated database procedures against the Advisors Platform database to:

  • register or remove Stat Server instances
  • add, edit, or remove Stat Server configuration settings related to Advisors

Performance Management Advisors include two stored procedures that you use to perform the preceding tasks:

  • SPSTATSERVERCONFIG
  • SPCHANGEOBJDISTRIBUTION

Microsoft SQL Server Database Procedures

If you have a Microsoft SQL Server database environment, you can use the spStatServerConfig and spChangeObjDistribution database procedures and parameters as shown in the examples for an Oracle environment, but replace the syntax to execute the stored procedures. MS SQL Server syntax is shown below.

MS SQL Server Syntax for spStatServerConfig

DECLARE @r int,
@m varchar(4000);

EXEC spStatServerConfig
@p_SsPairId = null,
@p_ModuleCode = N'CCAdv',
@p_AdapterId = 1,
@p_StatServerHost = N'statserverhost.company.com',
@p_StatServerPort = 7002,
@p_StatServerName = N'SS812-68',
@p_StatServerDescr = N'CCAdv core stats',
@p_Core = 1,
@p_MultiMedia = 0,
@p_ThirdPartyMedia = 0,
@p_StatServerBackHost = NULL,
@p_StatServerBackPort = NULL,
@p_StatServerBackName = NULL,
@r = @r OUTPUT,
@m = @m OUTPUT;

SELECT @r as N'@r',
@m as N'@m';

MS SQL Server Syntax for spChangeObjDistribution

DECLARE @r int, @m varchar(255);
EXEC spChangeObjDistribution

@p_SsPairId_old = <original stat server pair id>, --from

@p_SsPairId_new = <target stat server pair id>, --to

@p_ModuleCode='CCAdv',

@r = @r OUTPUT,

@m = @m OUTPUT;


SELECT @m;

Oracle Database Example Procedures

Use the SPSTATSERVERCONFIG and SPCHANGEOBJDISTRIBUTION database procedures and parameters as shown in the following examples.

The following examples show you how to use the stored database procedures to manage your Advisors Stat Server configuration if you use an Oracle environment, but the MS SQL Server procedures use the same parameters and processes:

Register a New Stat Server and Link the Stat Server to an Adapter

The following procedure uses CCAdv (Contact Center Advisor) for the module code. For Frontline Advisor, use the same procedure, but enter FA for the module code.

Procedure: Registering a Stat Server and Linking the Stat Server to the CCAdv Adapter

Purpose: In this example, the CCAdv adapter has id=1. The procedure instructs Stat Server to process only core statistics.

Steps

  1. Call the procedure:
    SET SERVEROUTPUT ON
    SET FEEDBACK OFF
    DECLARE
    R NUMBER;
    M VARCHAR2(4000);
    
    BEGIN
    SPSTATSERVERCONFIG(
    P_SSPAIRID => NULL,
    P_MODULECODE => 'CCAdv',
    P_ADAPTERID =>1,
    P_STATSERVERHOST => 'statserverhost.company.com',
    P_STATSERVERPORT => 7002,
    P_STATSERVERNAME => 'SS812-68',
    P_STATSERVERDESCR => 'CCAdv core stats',
    P_CORE => 1,
    P_MULTIMEDIA => 0,
    P_THIRDPARTYMEDIA => 0,
    P_STATSERVERBACKNAME => NULL,
    P_STATSERVERBACKHOST => NULL,
    P_STATSERVERBACKPORT => NULL,
    R => R,
    M => M
    );
    END;
    /

Change the Connection Properties of the Stat Server

Procedure: Changing the Stat Server Connection Properties

Purpose: This example changes the connection properties of the Stat Server added in the first example above.

Steps

  1. Determine the Stat Server pair ID:
    SELECT SS_PAIR_ID FROM STAT_SERVER_INSTANCES WHERE NAME='SS812-33';
  2. In this example, assume the Stat Server pair ID is 5. Call the procedure:
    SET SERVEROUTPUT ON
    SET FEEDBACK OFF
    DECLARE
    R NUMBER;
    M VARCHAR2(4000);
    
    BEGIN
    SPSTATSERVERCONFIG(
    P_SSPAIRID => 5,
    P_MODULECODE => 'CCAdv',
    P_ADAPTERID =>1,
    P_STATSERVERHOST => 'statserverhost2.company.com',
    P_STATSERVERPORT => 7003,
    P_STATSERVERNAME => 'SS812-70'
    P_STATSERVERDESCR => 'CCAdv core stats',
    P_CORE => 1,
    P_MULTIMEDIA => 0,
    P_THIRDPARTYMEDIA => 0,
    P_STATSERVERBACKNAME => NULL,
    P_STATSERVERBACKHOST => NULL,
    P_STATSERVERBACKPORT => NULL,
    R => R,
    M => M
    );
    END;
    /

Add New Statistic Types to the Existing Stat Server

Procedure: Adding new Statistic Types to a Registered Stat Server

Purpose: In this example, the procedure adds the multimedia statistic type.

Steps

  1. Determine the Stat Server pair ID:
    SELECT SS_PAIR_ID FROM STAT_SERVER_INSTANCES WHERE NAME='SS812-33';
  2. In this example, assume the Stat Server pair ID is 5. Call the procedure:
    SET SERVEROUTPUT ON
    SET FEEDBACK OFF
    DECLARE
    R NUMBER;
    M VARCHAR2(4000);
    
    BEGIN
    SPSTATSERVERCONFIG(
    P_SSPAIRID => 5,
    P_MODULECODE => 'CCAdv',
    P_ADAPTERID =>1,
    P_STATSERVERHOST => 'statserverhost2.company.com',
    P_STATSERVERPORT => 7003,
    P_STATSERVERNAME => 'SS812-70',
    P_STATSERVERDESCR => 'CCAdv core stats',
    P_CORE => 1,
    P_MULTIMEDIA => 1,
    P_THIRDPARTYMEDIA => 0,
    P_STATSERVERBACKNAME => NULL,
    P_STATSERVERBACKHOST => NULL,
    P_STATSERVERBACKPORT => NULL,
    R => R,
    M => M
    );
    END;
    /

Remove Stat Server Statistic Type Assignments

Procedure: Removing Stat Server Statistic Type Assignments

Purpose: In this example, the procedure removes multimedia and third party media statistic types.

Steps

  1. Determine the Stat Server pair ID:
    SELECT SS_PAIR_ID FROM STAT_SERVER_INSTANCES WHERE NAME='SS812-33';
  2. In this example, assume the Stat Server pair ID is 5. Call the procedure; set the parameters to 0 that are associated with statistic types that you want to remove. For example, the following procedure removes multimedia and third party media statistic types:
    SET SERVEROUTPUT ON
    SET FEEDBACK OFF
    DECLARE
    R NUMBER;
    M VARCHAR2(4000);
    
    BEGIN
    SPSTATSERVERCONFIG(
    P_SSPAIRID => 5,
    P_MODULECODE => 'CCAdv',
    P_ADAPTERID =>1,
    P_STATSERVERHOST => 'statserverhost2.company.com',
    P_STATSERVERPORT => 7003,
    P_STATSERVERNAME => 'SS812-70',
    P_STATSERVERDESCR => 'CCAdv core stats',
    P_CORE => 1,
    P_MULTIMEDIA => 0,
    P_THIRDPARTYMEDIA => 0,
    P_STATSERVERBACKNAME => NULL,
    P_STATSERVERBACKHOST => NULL,
    P_STATSERVERBACKPORT => NULL,
    R => R,
    M => M
    );
    END;
    /

    The procedure returns a message depending on the outcome: success, or failure with further instructions.

    The failure to remove a statistic type usually occurs when there are already objects associated with the Stat Server and the corresponding statistic type.

    If the goal is to move the processing of a statistic type to another Stat Server, then you must move all related objects to the corresponding Stat Server. You can move the objects by executing the following procedure:

    SET SERVEROUTPUT ON
    SET FEEDBACK OFF
    DECLARE
    P_SSPAIRID_OLD NUMBER;
    P_SSPAIRID_NEW NUMBER;
    P_MODULECODE VARCHAR2(200);
    R NUMBER;
    M VARCHAR2(4000);
    
    BEGIN
    P_SSPAIRID_OLD := <original Stat Server pair id>; --from
    P_SSPAIRID_NEW := <target Stat Server pair id>; --to
    P_MODULECODE:= NULL;
    
    SPCHANGEOBJDISTRIBUTION(
    P_SSPAIRID_OLD => P_SSPAIRID_OLD,
    P_SSPAIRID_NEW => P_SSPAIRID_NEW,
    P_MODULECODE => P_MODULECODE,
    R => R,
    M => M
    );
    
    COMMIT;
    dbms_output.put_line(M);
    END;
    /
    After the objects are moved, execute the SPSTATSERVERCONFIG procedure again using the same parameters you used initially.

Remove a Stat Server Record

Procedure: Removing a Stat Server Record

Prerequisites

Steps

  1. Execute SPSTATSERVERCONFIG to remove all statistic types as explained in Remove Stat Server Statistic Type Assignments. If the procedure returns a failure, do one of the following:
    1. Move objects to another Stat Server by executing the SPCHANGEOBJDISTRIBUTION procedure as explained in Remove Stat Server Statistic Type Assignments.
      After objects have been moved to another Stat Server, execute SPSTATSERVERCONFIG again using the same parameters you used initially.
    2. Force object deletion. In this case, object distribution will be done automatically by the Advisors Genesys Adapter when it starts or during the overnight update.
      To force object deletion, execute the SPCHANGEOBJDISTRIBUTION procedure with stat type parameters set to -1:
      SET SERVEROUTPUT ON
      SET FEEDBACK OFF
      DECLARE
      R NUMBER;
      M VARCHAR2(4000);
      
      BEGIN
      SPSTATSERVERCONFIG(
      P_SSPAIRID => 5 ,
      P_MODULECODE => 'CCAdv',
      P_ADAPTERID =>1, 
      P_STATSERVERHOST => 'statserverhost2.company.com',
      P_STATSERVERPORT => 7003,
      P_STATSERVERNAME => 'SS812-70',
      P_STATSERVERDESCR => 'CCAdv core stats',
      P_CORE => -1 ,
      P_MULTIMEDIA => -1,
      P_THIRDPARTYMEDIA => -1,
      P_STATSERVERBACKNAME => NULL,
      P_STATSERVERBACKHOST => NULL,
      P_STATSERVERBACKPORT => NULL,
      R => R,
      M => M
      );
      END;
      /
  2. Execute a simple delete statement to remove the Stat Server instance:
    DELETE STAT_SERVER_INSTANCES WHERE SS_PAIR_ID=<the id of the Stat Server to be deleted>;
    
    COMMIT;

Re-distribute the Statistics Load when Stat Servers are Added

The relationship between a statistic and the Stat Server pair against which it is requested is maintained. This means that after a start, restart, or refresh of the adapter, each adapter continues to request statistics from the same Stat Server(s) from which it requested stats before the restart. AGA no longer depends on the value set for the Stat Server old-stats-remove-interval option.

If any additional Stat Servers are added after the initial starting of the adapters, the statistics already requested from existing Stat Servers are not automatically re-distributed to the newly added Stat Server pair. The following procedures describe two scenarios in which you would re-distribute the statistics load on the Advisors Stat Servers. See:


Procedure: Moving Statistics of a Specific Type to a New Stat Server

Purpose: In this example, you have a Stat Server configured to process core and multimedia statistics. You decide to add a Stat Server to handle only multimedia statistics. You will move all multimedia processing to the new Stat Server.

Steps

  1. Stop the Advisors server, all Advisors Genesys Adapters, and XML Generator.
  2. Register a new Stat Server.
  3. Detemine the SS_PAIR_ID of each Stat Server:
    P_SSPAIRID_OLD,P_SSPAIRID_NEW
    SELECT SS_PAIR_ID,NAME FROM STAT_SERVER_INSTANCES;
  4. Execute the SPCHANGEOBJDISTRIBUTION procedure:
    SET SERVEROUTPUT ON
    SET FEEDBACK OFF
    DECLARE
    P_SSPAIRID_OLD NUMBER;
    P_SSPAIRID_NEW NUMBER;
    P_MODULECODE VARCHAR2(200);
    R NUMBER;
    M VARCHAR2(4000);
    
    BEGIN
    P_SSPAIRID_OLD := <original stat server pair id>; --from
    P_SSPAIRID_NEW := <target stat server pair id>; --to
    P_MODULECODE := NULL;
    
    SPCHANGEOBJDISTRIBUTION(
    P_SSPAIRID_OLD => P_SSPAIRID_OLD,
    P_SSPAIRID_NEW => P_SSPAIRID_NEW,
    P_MODULECODE => P_MODULECODE,
    R => R,
    M => M
    );
    
    COMMIT;
    dbms_output.put_line(M);
    END;
    /
  5. To ensure that no multimedia statistics are ever distributed to your original Stat Server again, disassociate the multimedia statistic type from that Stat Server:
    SET SERVEROUTPUT ON
    SET FEEDBACK OFF
    DECLARE
    R NUMBER;
    M VARCHAR2(4000);
    
    BEGIN
    SPSTATSERVERCONFIG(
    P_SSPAIRID => 5 ,
    P_MODULECODE => 'CCAdv', --mandatory if P_ADAPTERID is not supplied
    P_ADAPTERID =>1, --mandatory if P_MODULECODE is not supplied
    P_STATSERVERHOST => 'statserverhost2.company.com',
    P_STATSERVERPORT => 7003,
    P_STATSERVERNAME => 'SS812-70',
    P_STATSERVERDESCR => 'CCAdv core stats',
    P_CORE => 1 ,
    P_MULTIMEDIA => 0,
    P_THIRDPARTYMEDIA => 0,
    P_STATSERVERBACKNAME => NULL,
    P_STATSERVERBACKHOST => NULL,
    P_STATSERVERBACKPORT => NULL,
    R => R,
    M => M
    );
    END;
    /
  6. Start all Advisors Genesys Adapters, XML Generator, and the Advisors server.


Procedure: Evenly Distributing Stats Load After Adding a New Stat Server

Purpose: In this example, you have a Stat Server configured to process one or more statistic types. You decide to add another Stat Server to process the same statistic types. You will distribute the statistics load evenly between the two Stat Servers and not separate the statistic type processing.

In this scenario, it is best to initiate the automatic statistic load distribution.

Steps

  1. Stop the FA Server, all Advisors Genesys Adapters, and, for CCAdv, XML Generator.
  2. Connect to the platform database.
  3. Remove all entries from STAT_GROUP_OBJ_MAPPING, and commit the changes:
    • Oracle:
      DELETE STAT_GROUP_OBJ_MAPPING;
      COMMIT;
    • MSSQL:
      BEGIN TRANSACTION;
      DELETE STAT_GROUP_OBJ_MAPPING;
      COMMIT TRANSACTION;
  4. Restart all stopped components:
    • For CCAdv: Restart all CCAdv adapter servers and XML Generator.
    • For FA adapters: Restart all FA adapter servers and the FA Server.
This page was last edited on September 13, 2017, at 21:40.
Comments or questions about this documentation? Contact us for support!