Maintenance of Applications Manager

Maintenance of Applications Manager

Applications Manager with MySQL database

  1. Open services.msc, stop “ManageEngine Applications Manager” service or via command prompt with administrator permission. If using command prompt, navigate to <Applications Manager Home> directory and execute the below commands:
    shutdownApplicationsManager.bat
    shutdownApplicationsManager.bat -force

    In Linux, navigate to <Applications Manager Home> directory and execute the below commands:
    sh shutdownApplicationsManager.sh
    sh shutdownApplicationsManager.sh -force

  2. Execute repairMysqlDB.bat (.sh for Linux) file present under the <Applications Manager Home>/bin directory & then run optimizeMysqlDB.bat (.sh for Linux) file present in the same location via command prompt with administrator permission.

  3. Rename the logs folder under <Appications Manager Home> directory as logs_old and then create a new logs folder.

  4. For Windows, start “ManageEngine Applications Manager” service or via command prompt, navigate to <Applications Manager Home> directory and execute the below command:
    startApplicationsManager.bat

    In Linux, open command prompt, navigate to <Applications Manager Home> directory and execute the below command in Linux:
    nohup sh startApplicationsManager.sh &

If Applications Manager cannot be started even after following the above steps to repair MySQL database, then perform the below steps:

  1. Open the command prompt, go to the location <Applications Manager Home>\working\mysql\data\AMDB folder and execute the below commands one by one:
    DIR *.MYD-*  >> tables.txt
    REN  *.MYD-*  *.MYD  >> tables.txt
    DIR *.MYD-* >> tables.txt

  1. Restart Applications Manager from services and it may fail for the first time. Please wait for a couple of minutes and then restart again.

  2. If you're still unable to start the Applications Manager, send us the support information file and the latest tables.txt file from step 1.

Applications Manager with Microsoft SQL database

Stop Applications Manager and then run the below command in the corresponding MS SQL Database used by Applications Manager:
  • To repair the database:
    DBCC CHECKDB WITH ALL_ERRORMSGS, NO_INFOMSGS;

  • To re-index/reduce size:

    EXEC sp_MSforeachtable @command1="print '?' DBCC DBREINDEX ('?', ' ', 80)";
    EXEC sp_updatestats;


Applications Manager with PostgreSQL database

Windows

Note: Please take complete DB backup using the BackupPGSQLDB.bat (or BackupPGSQLDB.sh) script under <Applications Manager Home>\bin\ directory without fail before following the below steps:

  1. Open services.msc, stop ManageEngine Applications Manager service or via command prompt with administrator permission.
    If you are using the command prompt, go to <Applications Manager Home> directory and execute the below commands:
    shutdownApplicationsManager.bat
    shutdownApplicationsManager.bat -force
    (execute this until you get a message that says 'All processes have been shutdown')

  1. Open command prompt in the administrator mode, go to <Applications Manager Home>\working folder, and execute the below command to start PostgreSQL database:
    .\bin\startPGSQL.bat

Note: Please check if the DB port specified in AMServer.properties file (under <Applications Manager Home>\conf\ directory) is the same as the startPGSQL.bat file (under <Applications Manager Home>\working\bin\ directory).

  1. Once the PostgreSQL database starts, open another command prompt in the administrator mode and connect your Applications Manager DB using the steps provided in the below link:
    https://pitstop.manageengine.com/portal/en/kb/articles/connecting-to-applications-managers-bundled-database 

  1. Once you have connected to the database, execute the below queries one by one:
    VACUUM FULL VERBOSE ANALYZE;

  2. To Re-index:
    Reindex database AMDB;

  1. Now, go to <Applications Manager Home>\working\ folder and execute the below command to stop the PostgreSQL database.
    .\bin\stopPGSQL.bat

  1. Open command prompt in the administrator mode, navigate to <Applications Manager Home> directory, and then execute the below commands:
    shutdownApplicationsManager.bat
    shutdownApplicationsManager.bat -force

    (Execute this until you get a message that says 'All processes have been shutdown')

  1. Go to <Applications Manager Home> directory, rename the logs folder to logs_old, create a new folder, and name it as logs.

  2. Open services.msc, start ManageEngine Applications Manager service.

Linux

Note: Please take complete DB backup using the BackupPGSQLDB.sh script under <Applications Manager Home>/bin/ directory without fail before following the below steps:

  1. Use the command prompt to go to <Applications Manager Home> directory and execute the below commands:
    sh shutdownApplicationsManager.sh
    sh shutdownApplicationsManager.sh -force

  2. Open command prompt in the administrator mode, go to <Applications Manager Home>/working/ folder, and execute the below command to start the PostgreSQL database:
    .\bin\startPGSQL.sh

Note: Please check if the DB port specified in AMServer.properties file (under <Applications Manager Home>\conf\ directory) is the same as the startPGSQL.sh file (under <Applications Manager Home>\working\bin\ directory).

  1. Once the PostgreSQL database starts, open another command prompt in the administrator mode and connect your Applications Manager DB using the steps provided in the below link:
    https://pitstop.manageengine.com/portal/en/kb/articles/connecting-to-applications-managers-bundled-database

  2. Once you have connected to the database, execute the below queries one by one:
    VACUUM FULL VERBOSE ANALYZE;

  3. To Re-index:
    Reindex database AMDB;

  4. Now, go to <Applications Manager Home>/working/ folder and execute the below command to stop the PostgreSQL database.
    ./bin/stopPGSQL.sh

  5. Open command prompt in the administrator mode, go to <Applications Manager Home> directory, and then execute the below commands:
    sh shutdownApplicationsManager.sh
    sh shutdownApplicationsManager.sh -force
    (Execute this until you get a message that says 'All processes have been shutdown')

  1. Go to <Applications Manager Home> directory rename the logs folder to logs_old, create a new folder, and name it as logs.

  2. Go to <Applications Manager Home> directory and execute the below command:
    nohup sh startApplicationsManager.sh &


          • Related Articles

          • Applications Manager DB Maintenance for PGSQL Backend

            Windows Installations Note: Please take complete db backup using the <AppManager Home>\bin\BackupPGSQLDB.bat (or BackupPGSQLDB.sh) script without fail before following the below steps: Open services.msc, stop “ManageEngine Applications ...
          • Prerequisites for upgrading Applications Manager for the version above 14844

            1.Complete the Applications Manager backup for the installation folder & database by referring to the steps in the link below: https://www.manageengine.com/products/applications_manager/help/data-backup.html 2. The required Service Pack should be ...
          • Authentication Methods in Applications Manager

            Authentication involves validating an incoming user to facilitate the access to a specific resource. There are various authentication methods that you can use - based on the requirements and usage. In recent times, numerous organizations are ...
          • Installing Applications Manager in AWS

            Applications manager can be installed in EC2 instances in both Windows and Linux platforms. Applications Manager comes with bundled PostgreSQL. Installing in EC2 - Windows Go to EC2 console and launch an "Windows" instance with "Atleast 16GB" memory. ...
          • Graphs are not displayed in Applications Manager

            Issue: Graphs are not displayed in Applications Manager. Fix: Verify if you have given read/write permissions for AppManager\working\webclient folder. If not, kindly update the permissions, the issue will be resolved.