Restoring backup files for Oracle
Use the scripts that are installed with TM1® to quickly and conveniently restore backup files for sample databases in Oracle.
About this task
To set up the sample database, you must extract the GS_DB_ORA.tar.gz, file, customize a configuration file, and run the setup script.
Procedure
- Go to the tm1_location/webcontent/samples/datasources.
- Extract the GS_DB_ORA.tar.gz file and retain the original directory structure.
- On Linux® and UNIX operating systems, modify the
file permissions on the setupGSDB.sh file so
that it is executable:
chmod u+x setupGSDB.sh
- Ensure that the user ID used to set up the Oracle database has authority to create users and run the import utility.
- Optional - If you want to change the sample configuration
file to use settings other than the default values, edit the GOSalesConfig file.
The configuration file on Windows is GOSalesConfig.bat. The configuration file on UNIX is GOSalesConfig.sh.
The GOSalesConfig configuration file contains the default configuration options that are used when creating the GOSALES data. The default configuration settings are listed in the following table
Table 1. Default configuration settings for GOSALES data Configuration Setting
Default
Description
GOSALES_IMP_CMD
imp
If necessary can be modified to specify the complete path to the correct version of the import utility.
GOSALES_INST
Oracle host string.
GOSALES_TS
GOSALES_TS
If users are created by scripts, used to enter the tablespace name to assign to users.
GOSALES_CREATE_TS
Optional: Used to create the default tablespace for users.
GOSALES_TEMP_TS
If users are created by scripts, used to name a temporary tablespace to assign to users. Leave blank to use the default temporary tablespace.
GOSALES_SCHEMA
GOSALES_SCHEMA_PW
GOSALES
GOSALESPW
Used to enter the username and password for the GOSALES user. You will be prompted for a password if not entered.
GOSALESHR_SCHEMA
GOSALESHR_SCHEMA_PW
GOSALESHR
GOSALESHRPW
Used to enter the username and password for the GOSALESHR user. You will be prompted for a password if not entered.
GOSALESMR_SCHEMA
GOSALESMR_SCHEMA_PW
GOSALESMR
GOSALESMRPW
Used to enter the username and password for the GOSALESMR user. You will be prompted for a password if not entered.
GOSALESSRT_SCHEMA
GOSALESRT_SCHEMA_PW
GOSALESRT
GOSALESRTPW
Used to enter the username and password for the GOSALESRT user. You will be prompted for a password if not entered.
GOSALESDW_SCHEMA
GOSALESDW_SCHEMA_PW
GOSALESDW
GOSALESDWPW
Used to enter the username and password for the GOSALESDW user. You will be prompted for a password if not entered.
GOSALES_GRANTEES
GOSALES
Used to enter the users that will have SELECT, INSERT, DELETE, UPDATE, and ALTER permissions for GOSALES, GOSALESHR, GOSALESMR and GOSALESRT schemas.
Note: The owner of the GOSALES_SCHEMA will always be granted SELECT, INSERT, DELETE, UPDATE and ALTER privilege on all schemas.
GOSALESDW_GRANTEES
GOSALESDW
Used to enter the users that will have SELECT, INSERT, DELETE, UPDATE and ALTER permissions for GOSALESDW schema.
- To run the setupGSDB script in interactive
mode, run following command:
- On Windows computers, in a DOS command window, change to the GS_DB_ORA\win directory and run the setupGSDB.bat script.
- On UNIX computers, from a shell prompt, change to the GS_DB_ORA/unix directory, and run the setupGSDB.sh script.
Press Enter to proceed. The script displays a summary of your choices before you commit to changes to your environment. If you approve the choices, press Enter and the script makes the changes
- To run the setupGSDB script from the
command line, run the following command:
- On Windows computers, run the setupGSDB.bat script.
- On UNIX computers, run the setupGSDB.sh script.
You can run the setupGSDB script with the following options:
Table 2. setupGSDB options Option
Description
-createdb Creates the database. This option drops any existing database with the same name. It creates the required buffer pool and table space.
-database database name Specifies the name of the database. This value overrides the default value of GS_DB.
-userid administration_user_ID Specifies the name of the Db2® administrator user ID that is used to create the database.
-password administration_user_ID Specifies the password for the Db2 administrator user ID.
-noprompt Indicates that no prompt will display. This option runs the script in silent mode. Any missing information causes the script to fail. You will not be prompted for any confirmations.
For example, if you are an Oracle administrator and want to create the default sample database schemas, run the following command:setupGSDB -createDB -noprompt
You want to create the tables in the existing schemas specified in the configuration file, and you want to use the administrator user ID sys. run the following command:
setupGSDB -YourOracleInstance-userid sys -sysdba
The script prompts you for the password when it connects to the Oracle instance. The script deletes any existing tables or views in the specified schemas and replaces them.