------------------------------------------------
---        The Visual Warehouse Sample       ---
------------------------------------------------

  The data in this scenario is for Corporation XYZ. They
have sales locations in Atlanta, Seattle, Mexico, Tokyo,
Singapore, and Europe. Revenue records from their operations
are stored in the REVENUE operational database.
  They have manufacturing locations in Boston, San Jose,
Pittsburg, and New York. Cost records from their operations
are stored in the COST operational database.
  Since sales take place in different countries, revenue
records store information in local currenct. So, our 
corporation needs access to an external database EXCHANGE, 
that contains exchange rates for major currencies.
  The data warehouse database, FINANCE, gathers data from
the three databases mentioned previously. It creates summary
of cost by machine, summary of revenue by machine in 
dollars; it generates then the net income, and calculates
the profitability per machine. If the total net income for
the month surpasses a fixed amount, then it triggers the 
calculation of corporate awards to be given to countries
that sold a high percentage of the machine types for 
which the profitability is over 250%.

 
 
Pre-installation instructions
==============================

Backup Visual Warehouse Control Database (optional)
  o Stop Visual Warehouse
    - Use Services icon in Control Panel
  o Use DB2 Backup Utility
    NOTE: If backup fails because database connections exist,
          use DB2 FORCE command or reboot the machine.

Set DB2 Default Path
  Make sure the  default database path in the database manager
  configuration file (dftdbpath parameter) is set to where you
  want sample databases to be created:
	db2 get db manager cfg
	db2 update db manager cfg using dftdbpath <Drive>

Start DB2
  Start DB2 Server if not already started.


Installation instructions
=========================
  The Sample Installer Program can be used to install the
Visual Warehouse Sample on a Visual Warehouse Server machine.
The Visual Warehouse Server does not need to be running. See
'vwsample.txt' for more information about the Sample Installer 
Program.

o At the Command prompt, change to the SAMPLE directory
o Enter 
       vwsample.exe finance.scr 
		 
  Note: the metadata for this sample will be imported into the
current control database (the one you specified when you last
run Visual Warehouse Initialization program).

  The Sample Installer Program leaves records the processing in 
the following log files:

o vwsample.log   Informational log file.
o impmsg.log     DB2 import log file.
o demoall.log    Metadata import log file(demoall.TAG is the name
                 of the metadata import file).


Handling Errors
o See the log file for information about any errors and take
  whatever corrective action is necessary.
o Modify Script File
  Make a copy of the script file and remove steps that completed 
  successfully or undo these steps. 
o Restart the installation passing the modified script file.
 

Post-installation instructions
==============================
o Update User and User Groups
  The first time you log into the Visual Warehouse, use the
  userID and password you supplied when initializing the 
  control database.  Once you are in the Visual Warehouse
  DeskTop, select 'Security', then 'Groups'.  Open group
  'Budget' and add the logged-in userID.  This will enable
  you to see the BusinessViews.  You do not need to 
  logoff and login again for the change to take effect.
	
  You can create other users and add them to the group(s) of
  your choice.  Users in the 'Budget' group have access to
  the Finance warehouse. 

o Update Information Resources
  The userID/password for all source and target databases
  must be set to an authorized userID/password.  Change the
  userID/password in the sample to those recognized by the 
  database manager on your machine.
  o Open an Information Resource definition
  o Select the Database page
  o Update the userID/password
  
o Update Business Views
  All imported Business Views will be in Development status. To
  run these BVs, you must first use the Business View dialog to 
  create the target tables.
  o Open imported target warehouse
  o select a BV
  o From menu bar, select Status->'Promote to Test'. The BV
    status should change to Test. 

  Note: You cannot promote a Business View to Test status until
  all its 'contributing' Business Views have been promoted.
  A contributing Business View's output table is used as input
  table for this Business View.  Use the 'Tree' option in the
  'View' menu item of the Business View list window to see the
  hierarchical relationships among the Business Views.

  For example, the Business Views with names like "Manufacturing
  cost in ..." and names like "Revenue - ..." should be promoted
  first ("Revenue - Europe (local currency)" should be promoted
  before "Revenue - Europe"), along with the one named "Rate".
  After this you can promote the ones named "Sum of ... by location"
  followed by "Sum of ... by machine".  You may want to browse the
  SQL statement for each Business View to get an idea of what is
  accomplished by it.   

o About the BusinessView "Award Recipients"
  The select statement for this BV uses the token &cur_edtn to asks 
  Visual Warehouse to find the most recent $$BVEDITION for another 
  BusinessView.  The implementation of the support for this function
  requires that at least one edition of the reference BusinessView 
  already exists (it must have been run at least once), before the 
  referencing BusinessView is promoted.                          
                                                                         
  In the sample scenario, this token is used in the BusinessView named           
  "Award Recipients".  Before you promote this BusinessView, the 
  referenced BusinessView "Corporate Awards" must have been run at 
  least once.  Otherwise the promote will fail with error code 3142, 
  meaning a needed object is not found (in this case the BusinessView 
  run that contains the desired $$BVEDITION).    
                                                                         
  Incidentally, you may want to open the notebook of "Award Recipients"    
  and take a look at the SQL statement.  The use of this token      
  is at the end of the statement.  Its syntax is &cur_edtn.ddd.ttt         
  where "ddd" is the database name (as appears in the Visual Warehouse 
  DeskTop, which maybe an alias name in the DB2 catalog), and "ttt" is the          
  table name (including the prefix).  In this case, the database name       
  name is FINANCE, and table name is FINANCE.CORPORATE_AWARDS.             
  Therefore, the syntax is "&cur_edtn.FINANCE.FINANCE.CORPORATE_AWARDS".   
                                                                     
  Both "ddd" and "ttt" are supposed to be case sensitive (of course,  
  in this case they are both all upper case already).                 

