Deploying schema changes
Schema changes involve adding or altering tables in the target HCL Commerce database. These actions are typically stored in SQL files. Each database vendor provides a means for running SQL files.
About this task
If you are making schema changes and are using the HCL Commerce workspaces feature, it is important that you also invoke the authoring environment schema update utility when deploying these changes to your authoring environment.
Procedure
-
If you are using the preconfigured Db2 Docker container:
- Start a bash shell by running the following command with the Db2 container name. For example,
docker exec -it <container_name> bash
- Run your SQL script file:
db2 -tvf script_file_name
For example, if the SQL script file is C:\script.sql, run:
db2 -tvf c:\script.sql
- Start a bash shell by running the following command with the Db2 container name. For example,
- If you are using Db2 database other than the preconfigured Db2 Docker
container:
- Db2 From the database node, connect to the database with your user ID and password. As an
example, the database user
johnsmith
with passwordpwd
wants to run the SQL script C:\script.sql :db2 connect to database_name
useruser_name using password
db2 connect to mall user johnsmith using pwd
- Run your SQL script file:
db2 -tvf script_file_name
For example, if the SQL script file is C:\script.sql, run:
db2 -tvf c:\script.sql
- Db2 From the database node, connect to the database with your user ID and password. As an
example, the database user
-
If you are using an Oracle database, running the following command:
sqlplus user_name/ password@ database_name@ script_file_name
As an example, the database user
johnsmith
with passwordpwd
wants to run the SQL script C:\script.sql against the database calledmall
, this would be the command:sqlplus johnsmith/pwd@mall@ c:\script.sql