Manually Creating the JasperReports Server Database¶
If you cannot use the js-install scripts to create the JasperReports Server database and the sample databases, you can create them manually. Follow the instructions for your database to create the repository database and optional sample databases:
The commands in these sections have been tested at Jaspersoft, but the commands you need to use on your database instance may be different.
Note
For running the Ant commands, you need to edit the default_master.properties file to add the settings for your database and application server as described in Installing the WAR File Using js-install Scripts.
PostgreSQL¶
To create the JasperReports Server database manually in PostgreSQL:
-
On the Windows, Linux, or Mac command line, enter these commands:
-
Run the following commands to install the JSAudit database:
-
(Optional) Run the following commands if you want to install sample databases:
cd <js-install>/buildomatic/install_resources/sql/postgresql
psql -U postgres -W
postgres=#create database sugarcrm encoding=’utf8’;
postgres=#create database foodmart encoding=’utf8’;
postgres=#\c sugarcrm;
postgres=#\i sugarcrm.sql; (first make sure the file is unzipped)
postgres=#\c foodmart;
postgres=#\i foodmart-postqresql.sql; (first make sure the file is unzipped)
postgres=#\i supermart-update.sql;
postgres=#\q
- If you didn't install the optional sample databases, complete the installation with these commands:
cd <js-install>/buildomatic
js‑ant import-minimal-``pro``
js-ant deploy-webapp-``pro``
If you installed the optional sample databases, complete the installation with these commands:
cd <js-install>/buildomatic
js‑ant import-sample-data-``pro``
js-ant deploy-webapp-``pro``
For more information about executing the Ant scripts, see Installing the WAR File Manually.
-
Set Java JVM Options (required), as described in Setting JVM Options for Application Servers.
-
Set up the JasperReports Server License (required) as described in Setting Up the JasperReports Server License.
MySQL¶
To create the JasperReports Server database manually in MySQL:
You can use the MySQL client software, mysql.exe or mysql, to interact with the MySQL database.
Note
For specific details on connecting to the MySQL database and setting privileges for databases and db users, please refer to the documentation provided with your database.
-
On the Windows, Linux, or Mac command line, enter the following commands to create and initialize the JasperReports Server database.
-
Run these commands to create and initialize the JSAudit database.
-
(Optional) Run these commands to install sample databases:
cd <js-install>/buildomatic/install_resources/sql/mysql
mysql -u root -p
mysql>create database sugarcrm;
mysql>create database foodmart;
mysql>use sugarcrm;
mysql>source sugarcrm.sql;(first make sure the file is unzipped)
mysql>use foodmart;
mysql>source foodmart-mysql.sql; (first make sure the file is unzipped)
mysql>source supermart-update.sql;
mysql>exit
- If you didn't install the optional sample databases, complete the installation with these commands:
cd <js-install>/buildomatic
js‑ant import-minimal-``pro``
js-ant deploy-webapp-``pro``
If you installed the optional sample databases, complete the installation with these commands:
cd <js-install>/buildomatic
js‑ant import-sample-data-``pro``
js-ant deploy-webapp-``pro``
For more information about executing the Ant scripts, see Installing the WAR File Manually.
-
Set Java JVM Options (required), as described in Setting JVM Options for Application Servers.
-
Set up the JasperReports Server License (required) as described in Setting Up the JasperReports Server License.
Oracle¶
To create the JasperReports Server database manually in Oracle:
You can use the Oracle client software, sqlplus.exe or sqlplus, to interact with Oracle.
Note
For specific details on connecting to the Oracle database and setting privileges for databases and db users, please refer to the documentation provided with your database.
-
On the Windows, Linux, or Mac command line, enter the following commands to create and initialize the JasperReports Server database.
cd <js-install>/buildomatic/install_resources/sql/oracle sqlplus /nolog (start sqlplus client) SQL> connect system/password (use your sysUsername and password) (or SQL>connect sys/password as sysdba SQL> create user jasperserver identified by password; (as sys user) SQL> grant connect, resource to jasperserver; (as sys user) SQL> grant unlimited tablespace to jasperserver; (as sys user) SQL> connect jasperserver/password@ORCL (use your password, your SID) SQL> @/opt/jasperreports-server-pro-8.0.0-bin/buildomatic/install_resources/sql/oracle/js-pro-create.ddl SQL> @/opt/jasperreports-server-pro-8.0.0- bin/buildomatic/install_resources/sql/oracle/quartz.ddl or quartz-23onwards.ddl (depending on the oracle db version being used) SQL> exit -
To create and initialize the JSAudit database, enter the following commands.
SQL> create user jsaudit identified by password; (as sys user) SQL> grant connect, resource to jsaudit; (as sys user) SQL> grant unlimited tablespace to jsaudit; (as sys user) SQL> connect jsaudit/password@ORCL SQL> @/opt/jasperreports-server-pro-8.0.0-bin/buildomatic/install_resources/sql/oracle/js-sequence-create.ddl SQL> @/opt/jasperreports-server-pro-8.0.0-bin/buildomatic/install_resources/sql/oracle/js-pro-create-audit.ddl SQL> exit -
Go to the
<js-install>/buildomaticpath and configure thedefault_master.propertiesfile with the required values. For example:
cd <js-install>/buildomatic
dbUsername=jasperserver
dbPassword=password
sysUsername=jasperserver
sysPassword=password
dbHost=localhost
dbPort=1521 sid=ORCLdbVersion=oracleDbVersion(for example, 12, 19c, 21c, 23ai, 26ai and so on)
#audit props
installType=split
audit.dbHost=localhost
audit.dbPort=1521
audit.sid=ORCL
audit.dbUsername=jsaudit
audit.dbPassword=password
audit.dbName=jsaudit
audit.sysUsername=system
audit.sysPassword=passwordYou can set sysUsername and sysPassword the same as dbUsername and dbPassword.
-
Create a server setting with the audit db schema name (auditDB=JSAUDIT), to do so:
-
Go to
<js-install>/buildomatic/binpath and edit thedb-common.xmlfile. -
Add the following target at the end of file and before
</project>:
<target name="import-profile-attributes">
<import-profile-attribute key="auditDB" attrValue="${audit.dbName}"/>
</target> -
Save the file.
-
Run the following command:
./js-ant import-profile-attributesNote
Server setting auditDB=JSAUDIT is needed for audit reports working properly on oracle in case of split installation.
-
-
(Optional) Special edit to the
sugarcrm.sqlscript that creates thesugarcrmsample database. Thesqlpluscommand line tool interprets SQL statements differently than a JDBC call (that is, the way buildomatic runs SQL scripts). Because of this, thesugarcrm.sqlfile must be edited to run usingsqlplus. To make these edits, do the following: -
Unzip the
sugarcrm.zipfile to get thesugarcrm.sqlfile. Opensugarcrm.sqlfor editing:-
Uncomment the
"-- set define off"line to look like this"set define off"(Line 7)- Uncomment the
"--/"line that follows theCREATE TRIGGERstatements (there are 12 of these toward the very end of the file on line 71,282. Just before theCREATE INDEXstatements). Change to be just"/". (This stops the trigger procedure definition insqlplus.) - Save the file.
- Uncomment the
-
Note
If you build and load the sample databases using buildomatic, the NLS_LANG setting is automatically handled via a JDBC driver setting.
If you load the sample databases using buildomatic, you will not need to set any variables or make any script edits.
-
(Optional) Set the
NLS_LANGvariable. Thesugarcrmdatabase has test data that requires a specific NLS_LANG setting to load into Oracle correctly. You need to set this in your shell environment if you are manually loading thesugarcrmdatabase.Windows:
set NLS_LANG=AMERICAN_AMERICA.WE8ISO8859P1Linux:
export NLS_LANG=AMERICAN_AMERICA.WE8ISO8859P1 -
(Optional) Run the following commands if you want to install sample databases:
cd <js-install>/buildomatic/install_resources/sql/oracle
sqlplus /nolog (start sqlplus client)
SQL> connect system/password (use your sysUsername and password)
(or SQL>connect sys/password as sysdba
SQL> create user sugarcrm identified by password;
SQL> create user foodmart identified by password;
SQL> grant connect, resource to sugarcrm;
SQL> grant connect, resource to foodmart;
SQL> connect sugarcrm/password@ORCL
SQL> @sugarcrm.sql (First, make sure file is unzipped)
SQL> connect foodmart/password@ORCL
SQL> @foodmart-oracle.sql (First, make sure file is unzipped)
SQL> @supermart-update.sql
SQL> exit
- If you didn't install the optional sample databases, complete the installation with these commands:
cd <js-install>/buildomatic
js‑ant import-minimal-``pro``
js-ant deploy-webapp-``pro``
If you installed the optional sample databases, complete the installation with these commands:
cd <js-install>/buildomatic
js‑ant import-sample-data-``pro``
js-ant deploy-webapp-``pro``
For more information about executing the Ant scripts, see Installing the WAR File Manually.
-
Set Java JVM Options (required), as described in Setting JVM Options for Application Servers.
-
Set up the JasperReports Server License (required) as described in Setting Up the JasperReports Server License.
DB2¶
To create the JasperReports Server database manually in DB2:
Use the DB2 client software, db2 or db2cmd, to interact with DB2.
Note
For specific details on connecting to the DB2 database and setting privileges for databases and db users, please refer to the documentation provided with your database.
-
Change to the following directory:
cd <js-install>/buildomatic/install_resources/sql/db2 -
Enter these commands in the DB2 command window to create and initialize the repository database called
jsprsrvrin DB2 to conform to the 8-character limitation: -
To create and initialize the JSAudit database, enter the following commands in the DB2 command window:
-
(Optional) Run the following commands in the DB2 command window if you want to install sample databases:
db2 create database sugarcrm
db2 connect to sugarcrm
db2 -tf sugarcrm.sql (first make sure file is unzipped)
db2 create database foodmart
db2 connect to foodmart
db2 -tf foodmart-db2.sql (first make sure file is unzipped)
db2 -tf supermart-update.sql (if script is available)
- If you didn't install the optional sample databases, complete the installation with these commands:
cd <js-install>/buildomatic
js‑ant import-minimal-``pro``
js-ant deploy-webapp-``pro``
If you installed the optional sample databases, complete the installation with these commands:
cd <js-install>/buildomatic
js‑ant import-sample-data-``pro``
js-ant deploy-webapp-``pro``
For more information about executing the Ant scripts, see Installing the WAR File Manually.
-
Set Java JVM Options (required), as described in Setting JVM Options for Application Servers.
-
Set up the JasperReports Server License (required) as described in Setting Up the JasperReports Server License.
Further considerations:
- If JasperReports Server is deployed on the same host as DB2, delete the following file to avoid conflicts:
<db2>/SQLLIB/java/db2jcc.jar
SQL Server¶
Use the sqlcmd utility to build the jasperserver database manually.
Note
For specific details on connecting to the SQL Server database and setting privileges for databases and db users, please refer to the documentation provided with your database.
To create the JasperReports Server database manually in SQL Server:
-
Open a Command Prompt and enter the following commands using the administrator (sa) username and password.
-
From the Windows Start menu, select *Microsoft SQL Server > SQL Server Management Studio*.
-
Connect to SQL Server as the administrative database user, and check that the
jasperserverdatabase appears in the Object Explorer. -
Expand the tables in the
jasperserverdatabase, and check that the tables have been added.To create and initialize the JSAudit database:
-
Run the following commands:
cd <js-install>\buildomatic\install_resources\sql\sqlserver sqlcmd -S ServerName -Usa -Psa 1> CREATE DATABASE [jsaudit] 2> GO 1> USE [jsaudit] 2> GO 1> :r js-pro-create-audit.ddl 2> GOTo create the optional sample databases manually in SQL Server:
-
Extract the files in the
sugarcrm.zipfile to the level above your current directory, placing thesugarcrm.sqlfile in this directory:<js-install>\jasperserver\buildomatic\install_resources\sql\sqlserver -
Enter these commands to create and initialize the
sugarcrmdatabase: -
You cannot initialize the foodmart database manually. Instead, change to the buildomatic directory and use the following buildomatic commands to create and initialize it from the command line:
js-ant create-foodmart-db
js-ant load-foodmart-db
Alternatively, you can replace the first command and create the database manually using the following SQL Server commands, but you still have to use the buildomatic command js-ant load-foodmart-db to load the data:
To complete the manual installation of databases in SQL Server
- If you didn't install the optional sample databases, complete the installation with these commands:
cd <js-install>/buildomatic
js‑ant import-minimal-``pro``
js-ant deploy-webapp-``pro``
If you installed the optional sample databases, complete the installation with these commands:
cd <js-install>/buildomatic
js‑ant import-sample-data-``pro``
js-ant deploy-webapp-``pro``
For more information about executing the Ant scripts, see Installing the WAR File Manually.
-
Set Java JVM Options (required), as described in Setting JVM Options for Application Servers.
-
Set up the JasperReports Server License (required) as described in Setting Up the JasperReports Server License.