Salesforce

How Do I Change the Magic xpi Internal Database? (Magic xpi 4.13)

« Go Back

Information

 
Created BySalesforce Service User
Approval Process StatusPublished
Objective
Description

How Do I Change the Magic xpi Internal Database? (Magic xpi 4.13)

You can change the default Magic xpi internal database, which is installed during the Magic xpi installation, to any other supported database. This topic provides a general overview of the steps that should be followed to change the Magic xpi internal database from one supported database to any other supported database.

Step #1: Create a new Magic xpi internal database

A new Magic xpi internal database needs to be created in the backend database server using the database specific scripts supplied with the Magic xpi installation. For more information, see How Do I Manually Create a Magic xpi Internal Database?.

Step #2: Make changes to the datasource.xml file to refer to Magic xpi’s new internal database

You need to change the datasource.xml file to reflect the new internal database. The file is located at: Magic xpi>\Runtime\Config and examples about how to configure this file appear in the file itself.

  1. Configure the database settings in the datasource.xml file.

  2. For all databases, except MSSQL, copy the JDBC driver jar file to the following folder: <Magic xpi>\Runtime\java\DatabaseDrivers. Only the MSSQL JDBC driver (JAR file) is provided as part of the Magic xpi installation. For any other DBMS, you must provide the JDBC driver JAR file.

  3. Make sure that the driverClassName defined in the datasource.xml is compatible with the JDBC driver.

Step #3: Make changes to the Magic.ini file to refer to Magic xpi’s new internal database

  1. Ensure that the Magic xpi Studio, Magic xpi Server, and Magic xpi Monitor are not running.

  2. Back up the Magic.ini file before making any changes.

  3. In the Magic.ini file's [MAGIC_LOGICAL_NAMES] section, add the following Logical Names:

date_format=YYYY-MM-DD

DB_NAME=<the name of the database you created using the scripts>

DB_SERVER_NAME=<the database server name>

DB_USER=<the name of the user that you created using the scripts>

DB_PASSWORD=<the password of the user that you created using the scripts>

  1. Enable the Gateway entry.

Ensure that the gateway entry in the [MAGIC_GATEWAYS] section of the Magic.ini file is enabled and a full path for the gateway dll file is specified.

If this entry is commented, which means that it has a semicolon (;) before it, remove the comment to enable this gateway. For example:

[MAGIC_GATEWAYS]

MGDB20=D:\Magic xpi\Gateways\mgms7.dll

  1. Save the Magic.ini file and start the Magic xpi services.

If no error messages are displayed (regarding the connection to the database server), then you have successfully changed the Magic xpi internal database.

Step #4: For Oracle databases, update the magicxpi-setenv.bat file

  • Update the GigaSpaces-xpi/bin/magicxpi-setenv.bat > ADDITIONAL_OPTIONS property with the oracle.net.tns_admin jvm argument, which contains the path to the folder containing the TNSNAMES.ORA file.

    For example: set ADDITIONAL_OPTIONS=%ADDITIONAL_OPTIONS% -Dcom.magicsoftware.ibolt.home=%MAGIC_XPI_HOME%\runtime -Doracle.net.tns_admin=$ORACLE_HOME/network/admin

Step #5: For Oracle 12c databases and above, switch the Oracle 12c session to a pluggable database (PDB)

Oracle 12c is a multitenant container database (CDB), which may contain customer-created pluggable databases (PDBs). By running the script for Oracle 12c databases, you will want Magic xpi to create a PDB. Before running the script, you need to switch the Oracle session to that PDB as follows:

  1. Connect to sqlplus as dba. For example: connect system/manager as sysdba

  2. Run the command: SHOW CON_NAME

    You need to see where the current session is running. For example, the following session is running as a root session:

    CON_NAME
    ------------------------------
    CDB$ROOT

  3. To see what types of databases you have on the database server, you need to run the following command: SELECT PDB FROM V$SERVICES;

    Example of output:

    PDB
    ------------------------------
    PDBORCL
    CDB$ROOT
    CDB$ROOT
    CDB$ROOT
    CDB$ROOT

    This means that you have a PDB that is PDBORCL.

  4. Run the command: alter session set container=PDBORCL;

    The output should be: Session altered.

  5. To validate that the session was switched, run the following command again: SHOW CON_NAME

    The output should be:
    CON_NAME
    ------------------------------
    PDBORCL

  6. Now you can run the script for creating the Oracle user.

Troubleshooting

If an error occurs while creating a Magic xpi internal database in a specific RDBMS, refer to the error logs generated during the execution of the SQL scripts. This will help Magic identify the problems related to the specific RDBMS.

Example – MSSQL Database

Check the MSSQL.log file in <Magic xpi installation>\db\MSSQL to see if any errors were reported while connecting or executing SQL statements on the MSSQL server.

Ensure that the Windows operating system PATH environment variable contains an entry for the path: MSSQL\Binn folder. Ensure that you have specified a user name with sufficient rights to create a database and users on the MSSQL server.

Reference
Attachment 
Attachment