Building an ExtraView Test Instance

This process will create a new instance in the same database as your production schema to be used for testing. These instructions are for installations with either an Oracle or Microsoft SQL Server database together with an Apache Tomcat application server. If your installation uses different system software, either adapt these instructions or contact the ExtraView support team for assistance.

STEP 1 - CREATE THE SCHEMA (INSTANCE)

For ORACLE Installations

To create the new schema do the following:

- Log in as the oracle user

- Copy the create_user.sql script to the working directory

- Start SQL*Plus and connect as the system user

- within SQL*PLUS type:

@create_user

The script will prompt for the user (schema) name and password. enter values for these and save them.

For MSSQL installations

Using Enterprise Manager, create a new login for the test instance. Don't worry about choosing a default database, you will do that shortly.

STEP 2 - REFRESH THE TEST SCHEMA FROM PRODUCTION

For ORACLE installations

Note: The commands listed here are intended to reflect a typical setup. File locations may change over time and should be verified if there is any question. Likewise the names of the production user and test user may differ.

The script does the following:

- drop all the objects in the test schema

- makes an export of the production schema

- imports the production schema into the test schema

- updates the application_default table to reflect the test user

You need to have the following three scripts in your directory:

refresh_test.sh - top level shell script

_drop_all.sql - sql script that is called by refresh_test.sh

refresh_test.sql - sql script that is called by refresh_test.sh

Part A - EDITING VARIABLES IN 'REFRESH_TEST.SH'


You must edit/verify the script refresh_test.sh to reflect your actual system values:

- ORACLE_HOME

- ORACLE_SID

- SCRIPTDIR - directory where you put the scripts (refresh_test.sh, _drop_all.sql and refresh_test.sql)

- PRODUCTION_USER - name of the production user

- SYSTEM_PW - database system password

- TEST_USER - name of the test user / schema

- TEST_PW - test user's password

Notes: the ORACLE_HOME and ORACLE_SID values can be found by logging on as the oracle user and typing export.

Part B - RUN THE SCRIPT


To run the script:

- Log in as the oracle user

- Make the script executable: chmod +x refresh_test.sh

- ./refresh_test.sh

Now you have 2 identical databases - your production instance, and your test instance.

For MSSQL installations


Part A - TAKE A BACKUP OF PRODUCTION INSTANCE


Using the Enterprise Manager, right click on the ExtraView production database and choose "Backup Database".

- Save the complete snapshot to a location on the disk.

Part B - RESTORE THE BACKUP AS A NEW DATABASE


- Using Enterprise Manager, right click on the "Databases" folder and choose "Restore Database"

- Browse for the .bak file you just created, and restore as a database with a new name.

- Add the new login you just created to the new database user list.

You can also edit the login directly and make sure that the new user's default database is the newly restored database. The new user needs "dbo" privileges on the newly restored database.

Part C - MIGRATE THE OBJECTS TO THE NEW USER


User Query Analyzer, log in as the "sa" user and choose the newly created database from the drop-down list.


Edit the following command, replacing $OLD_USER with the user who owns the tables and views, and replacing $NEW_USER with the new user you just created:

select 'exec sp_changeobjectowner " $OLD_USER.'+name+'", "$NEW_USER"'
from sysobjects where type in ('U','V')
and name not in ('syssegments','sysconstraints','dtproperties');


Run the sql.

Take the output from the query and run it in Query Analyzer - this makes $NEW_USER own all of the test system's tables and views.

STEP 3 - CREATE THE WEB FILES FOR THE INSTANCE

To create the Web files for the new instance do the following:

- Locate and move to the webapps directory. This should be in the $TOMCAT_HOME, typically:

cd /usr/local/extraview/tomcat/webapps or

cd c:/ExtraView/tomcat/webapps

- copy the existing production:

cp -r evj test

- edit the Configuration file:

cd test/WEB-INF/configuration

edit Configuration.properties to set the following:

DB_USER : set this to the new user / schema name created in the previous step

DB_PASSWORD: set this to the password for the new schema

LOG_FILE_PATH_NAME : set the to the instance name .log

- remove the old log file:

cd /usr/local/extraview/tomcat/webapps/test/WEB-INF/configuration

rm evj.log

STEP 4 - UPDATE THE APACHE CONFIGURATION

Update the Apache configuration file:

- Locate and move to the apache configuration directory. Typically:

cd /usr/local/extraview/apache/conf

cd c:/ExtraView/Apache/conf


- Edit the httpd.conf and locate the JKMount lines for \Extraview. copy the existing entries and create a second set the end replacing the production instance name (ev) with the new instance name (test):

For example, if the Extraview section has:

JkMount /evj/ExtraView/* ajp13

JkMount /evj/ExtraView ajp13

JkMount /evj/IsItEvj ajp13

JkMount /evj/IsItEvj2 ajp13


then add:

JkMount /test/ExtraView/* ajp13

JkMount /test/ExtraView ajp13

JkMount /test/IsItEvj ajp13

JkMount /test/IsItEvj2 ajp13


Note: ajp12 can be found, and there may be additional lines for host aliasing if that is used.

STEP 5 - RESTART THE SERVERS

You must bounce the Apache Server, and the Apache Tomcat server before the changes will take effect. Once this is done, the instance can be accessed by entering:

http://yourserver.yourdomain.com/test/ExtraView