Yes, you can create the database separately before installing the Gateway. If the Gateway has already been installed you can create the database without reinstalling the Gateway.
DDL scripts for the XCOM Gateway database can be located under "%XCOMWebv12_HOME%\ddl" on Windows or "$XCOMWebv12_HOME/ddl" on Linux.
There will be different subdirectories for each database type and you can use SQL scripts from "DB2_LUW" if you are using DB2 UDB or you can use DB2_zOS if you are using DB2 on zOS.
You need to modify the SQL files to replace "$DB_SCHEMA_OWNER$" with the Database Schema Owner prior to executing the script.
The on line documentation says that it requires the following authorities to create the database, create tables, create triggers, create index, select, update, insert, and delete within the database. Refer to Define the Database