About
This article talk about the installation of the spatial demo set that you need to run the Oracle Maps Tutorial (online demos) listed at the bottom of the MapViewer home page.
After a standard installation of OBIEE (10g or 11g), you can find them on this URL :
- http://mapviewerhost:9704/mapviewer/fsmc/tutorial/index.html (Replace mapviewerhost by the name of your computer)
Articles Related
Installation Process
Download the zip file
Download the mvdemo.zip file. This is a downloadable zip file containing a complete MapViewer demo including sample data and instructions. (Zip 3.9MB)
If you don't have it in the bundled archive, you can find it on the page Oracle Fusion Middleware MapViewer Training. An the end of this page, you have this link MapViewer Demo.
Unzip it in a temp directory (Ex. : C:\temp)
The readme.txt from the zip contain also all the instructions to load properly the data.
Create the user
You can add the data set in any account, you want. For the rest of the article, we will use a special mvdemo account.
In SqlPlus - SqlPlus Command :
SQL> connect / as sysdba;
Connected.
SQL> grant connect, resource, create view to mvdemo identified by mvdemo;
Grant succeeded.
Import the data set
In the command Prompt (assume you have unzipped the demo.zip file in the directory C:\TEMP\mvdemo) :
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
C:\Documents and Settings\Nicolas>cd C:\TEMP\mvdemo
C:\TEMP\mvdemo>set NLS_LANG=American_America.WE8ISO8859P1
C:\TEMP\mvdemo>imp mvdemo/mvdemo@ORCL file=mvdemo.dmp full=y ignore=y
Import: Release 10.2.0.4.0 - Production on Fri Nov 21 15:18:34 2008
Copyright (c) 1982, 2007, Oracle. All rights reserved.
Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Export file created by EXPORT:V09.00.01 via conventional path
import done in WE8MSWIN1252 character set and AL16UTF16 NCHAR character set
. importing MVDEMO's objects into MVDEMO
. importing MVDEMO's objects into MVDEMO
. . importing table "CITIES" 195 rows imported
. . importing table "COUNTIES" 3230 rows imported
. . importing table "EMPLOYEES" 14 rows imported
. . importing table "INTERSTATES" 239 rows imported
. . importing table "MAPS" 4 rows imported
. . importing table "STATES" 56 rows imported
. . importing table "STYLES" 285 rows imported
. . importing table "TERRITORIES" 9 rows imported
. . importing table "TERR_COUNTIES" 3230 rows imported
. . importing table "THEMES" 10 rows imported
Import terminated successfully without warnings.
C:\TEMP\mvdemo>
Cache Map Metadata
If your database has never run the mcsdefinition.sql script before, you will need to run it as DBA role. To verify if this script has been run, you can log into the database (as any user), and execute the following query:
SQL>connect SYS/SysPassword@ORCL as sysdba;
Connected.
SQL>select name from user_sdo_cached_maps;
select name FROM user_sdo_cached_maps
*
ERROR at line 1:
ORA-00942: table or view does not exist
If table or view does not exist is returned and not the statement “no rows selected”
SQL>@mcsdefinition.sql
It will create the view USER_SDO_CACHED_MAPS for all users. This view is used to hold the map tile layer definitions and is required by MapViewer.
Spatial Metadata
Run the mvdemo.sql with the account where you have load the data dump file to fill all the data properly.
After import of the dump file, perform this actions in SqlPlus - SqlPlus Command :
SQL> connect mvdemo/mvdemo@orcl
Connected.
SQL> @mvdemo.sql
Why ?
To make aware spatial that you have spatial data, you must insert geometry metadata by starting the mvdemo.sql script. An spatial index that need Mapviewer to read the data is also created.
Example for the table states :
update states a set a.geom.sdo_srid=8307;
insert into USER_SDO_GEOM_METADATA values (
'STATES',
'GEOM',
MDSYS.SDO_DIM_ARRAY(MDSYS.SDO_DIM_ELEMENT('X', -180, 180, .00000005),
MDSYS.SDO_DIM_ELEMENT('Y', -90, 90, .00000005)),
8307);
create index STATES_SDX on STATES(GEOM)
indextype is mdsys.spatial_index;
In the mvdemo.sql, you can see that the style, the theme and the map are also loaded.
insert into user_sdo_styles select * from styles;
insert into user_sdo_themes select * from themes;
insert into user_sdo_maps select * from maps;
Map DataSource
In order for the MapViewer to find the data you just imported, you need to define a map datasource to the MapViewer. This can be done through the MapViewer home page (typically http://host:port/mapviewer), in the “Add a data source” form.
- Log in as Admin with the Admin button (top right of the window)
- Fill in the credential
If you need to login on OC4J, enter oc4jadmin for the login and its password
- Go to Management Tab , DataSource and fill the form :
Test
You are done with the installation. You will be able to see the demo :
- Go in the Mapviewer Home Page (http://mapviewerhost:9704/mapviewer)
- Click on the bottom url link : Oracle Maps Tutorial
- Go through the link “Running the demo” and play with the first one.
If all work perfectly, you will see a map.
Enjoy !