Deploying schema changes
Schema changes involve adding or altering tables in the target WebSphere 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 WebSphere Commerce workspaces feature, it is important that you also invoke the authoring server schema update utility when deploying these changes to your authoring server environment.
Procedure
-
From a command prompt, connect to the database with proper user ID and password by running:
-
db2 connect to database_name
useruser_name using password
For example, if the database user "johnsmith" with password "pwd" wants to run the SQL script C:\script.sql against the database called "mall", this would be the command: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
-
-
sqlplus user_name/ password@ database_name@ script_file_name
For example, if the database user "johnsmith" with password is "pwd" wants to run the SQL script file "c:\script.sql" against the database called "mall", this would be the command:
sqlplus johnsmith/pwd@mall@ c:\script.sql
-
- Copy the SQL file to your database machine.
- Sign on to your target database machine using your WebSphere Commerce Instance profile.
- Start a Qshell session.
- Run your SQL script file:
db2 -tvf script_file_name
For example, if the SQL script file is script.sql, run:
db2 -tvf script.sql