Salesforce

Running the Database Scripts Manually Post Installation (Magic xpi 4.13)

« Go Back

Information

 
Created BySalesforce Service User
Approval Process StatusPublished
Objective
Description

Running the Database Scripts Manually Post Installation (Magic xpi 4.13)

The Magic xpi installation provides an option to execute the scripts for database definition. The installer will copy the scripts under a subfolder called db and within it create nested sub-folders for each database supported by Magic xpi. The user can also opt to install the database definition at a later stage. This can be done using the batch files located under the db folder.

  • Before doing the manual installation, make sure that the references to the database in the Magic.ini file, Datasources.xml and other locations are correct.

  • The migration scripts, if needed, should be executed immediately, before running any projects. Running them later might cause issues with data consistency.

  • The partitioning support can only be added for MSSQL and Oracle databases. Make sure that the database installation is enabled for partitioning.

The batch file for installing the database changes is RunDB.bat and the batch file to rollback the changes is DropDB.bat.

These batch files will run the scripts located under each database. For MS-SQL and Oracle database the scripts will be present under the Enterprise and Standard folders.

MS-SQL Database

The steps given below explain how to use these files to set up the MSSQL database:

  1. Open a Command Prompt.

  2. Change directory (cd) to the <Magic xpi installation>\DB folder.

  3. On the command line, type RunDB.bat, then add the following args:

• %1: Enter the name of the SQL Server

• %2: Enter the database user name of the user with admin privilege

• %3: Enter the password

• %4: DB-Authentication - if the command is for a windows authentication place "1" else place "2"

• %5: Enter MSSQL as the db type. Note that the name is case sensitive.

• %6: DB Partitioning - if your database supports database table partitioning mechanism place "2" else "1".

• %7: DB Name - provide name of your database.

• %8: DB User Name - provide name of the database user.

• %9: Server Port - provide server port, if not available use "".

For example:

RunDB.bat "MAGICXPIMCN\SQL19STD" "sa" "sa@123" "2" "MSSQL" "1" "MGXPI413" "MGXPI413" ""

ORACLE Database

The steps below explain how to use these files to set up the ORACLE database:

  1. Open a Command Prompt.

  2. Change directory (cd) to the <Magic xpi installation>\DB folder.

  3. In the command line, type RunDB.bat, then add the following args:

• %1: Enter the Oracle Service Name[from tnsnames.ora file]

• %2: Enter the database user name of the user with admin privilege

• %3: Enter the password

• %4: Always keep it as ""

• %5: Enter Oracle as the db type. Note that the name is case sensitive.

• %6: DB Partitioning - if your database supports database table partitioning mechanism place "2" else "1".

• %7: DB Name - provide name of your database.

• %8: DB User Name - provide name of the database user.

• %9: Server Port - provide server port, if not available use "".

For example:

RunDB.bat "ORCL" "scott" "tiger" "" "Oracle" "1" "MGXPI413" "MGXPI413" "1521"

DB2 Database

The steps below explain how to use these files to set up the DB2 database:

  1. Open a Command Prompt.

  2. Change directory (cd) to the <Magic xpi installation>\DB folder.

  3. In the command line, type RunDB.bat, then add the following args:

• %1: Enter the name of the DB2 server

• %2: Enter the database user name of the user with admin privilege

• %3: Enter the password

• %4: Database local/remote identification, put 1 for local & 2 for remote

• %5: Enter DB2 as the db type. Note that the name is case sensitive.

• %6: Always keep it as ""

• %7: DB Name - provide name of your database.

• %8: DB User Name - provide name of the database user.

• %9: Server Port - provide server port, generally use default port value as "50000",if not available use "".

For example:

RunDB.bat localhost "db2admin" "Db2@admin" "1" "DB2" "" "MGXPI789" "db2admin" "50000"

DB2400 Database

The steps below explain how to use these files to set up the DB2400 database:

  1. Open a Command Prompt.

  2. Change directory (cd) to the <Magic xpi installation>\DB folder.

  3. In the command line, type RunDB.bat, then add the following args:

• %1: Enter the name of the DB2400 Server

• %2: Enter the database user name of the user with admin privilege

• %3: Enter the password

• %4: Always keep it ""

• %5: Enter DB2400 as the db type. Note that the name is case sensitive.

• %6: DB Partitioning - Always keep it "".

• %7: DB Name - provide name of your database.

• %8: DB User Name - Always keep it "".

• %9: Server Port - Always keep it "".

For example:

RunDB.bat "10.1.4.203" "MXPI413" "MXP@123" "" "DB2400" "" "MGXPI413" "" ""

In case of DB2400, make sure to replace parameterized database name with your desired database name in actual SQL script.

MYSQL Database

The steps below explain how to use these files to set up the MYSQL database:

  1. Open a Command Prompt.

  2. Change directory (cd) to the <Magic xpi installation>\DB folder.

  3. In the command line, type RunDB.bat, then add the following args:

• %1: Enter the name of the MySQL Server

• %2: Enter the database user name of the user with admin privilege

• %3: Enter the password

• %4: Always keep it as ""

• %5: Enter MySQL as the db type. Note that the name is case sensitive.

• %6: Always keep it as ""

• %7: DB Name - provide name of your database.

• %8: DB User Name - provide name of the database user.

• %9: Server Port - provide server port, if not available use "".

For example:

RunDB.bat "localhost" "root" "root" "" "MySQL" "" "MGXPI413" "MGXPI413" ""

  1. Click <enter> to run the batch with its args.

When you run the file, the process creates a log file based on the db type you have selected at location <Magic xpi installation>\DB\<DBType Selected>.

Reference
Attachment 
Attachment