(Client:Wingate Inn Memphis, TN 38106
Mode of Execution : Part Time
Started : 08/21/02
Ended : 09/18/02
Actual Time Consumed : 30 days
Database Size : 30 gig
Record Time Span : Jan 95 to Aug 02
)
The MigrationWorkbench allows you to:
Before going into the actual migration process. Here 's a briefing that'll help understand the various architectures across databases.
MS Access is based on a file server DBMS technology named “Jet.” Forms, reports,and Basic code in MS Access rely on Jet to manage data stored in the native “mdb”file format.MS Access Architecture
In a single-user MS Access application, the mdb file and MS Access are
located on the same machine. In a multi-user MS Access application, the
mdb file is placed ona file server and shared. Each client runs a copy
of MS Access and the Jet engine. In this configuration, Jet must move a
large amount of data across the network,
including whole tables, to complete its query processing. The Data
Access Objects (DAOs) DLL provides a hierarchy of classes to MS Access
Basic and Visual Basic. The MS Access 2.0 DAO DLL is DA02016.DLL and the
MS Access 95 DAO DLL is DAO350.DLL. DAOs define and expose databases,
workspaces, query definitions, parameters, recordsets, tables, fields,
indexes, relationships, users, and groups from Jet.Jet manages links to
external data sources. Links to dBase, Paradox, and Btrieve are made through
an internal Jet ISAM driver interface. These DLLs are included with MS
Access. Jet also supports a link to ODBC, which allows access to a wide
range of DBMS servers.
When Jet processes a query, it returns a recordset (a cursor) for the resulting set of records. Jet supports two types of recordsets; snapshots and dynasets.Jet Recordsets
Jet handles updates by multiple users by using optimistic and pessimistic locks. Using pessimistic locking, Jet places a hard lock on the data page that contains theJet Multi-User Updates
Jet Enforced Referential Integrity
Jet supports declarative referential integrity. This includes primary
key/foreign key relationships with one-to-one and one-to-many cardinality
with cascading
UPDATEs and DELETES.Jet Query Processor The Jet query processor does
not support a full implementation of SQL. It optimizes queries, especially
when the query references both local and remote tables. Jet can connect
to a wide range of data sources and process queries against all of them.
Transaction support is limited to native file format database tables.
Jet relies on the transaction support of any RDBMS attached via ODBC.
Jet supports an explicit transaction model. Transactions are not started until a BeginTrans statement is executed. Transactions are committed with CommitTrans and aborted with Rollback. In addition to using transactions to group related units of work, developers use transactions to improve performance. If a program makes numerous references to a table, grouping the work in a single transaction will force Jet to perform the operation in memory and then commit all work to disk when the transaction is committed. Be aware that this type of transaction may not map directly to Oracle.Jet Transactions
Oracle8 and Oracle8i are powerful, flexible, and scaleable relational database management system (RDBMS) servers, which run on a range of computer systems,Oracle Architecture
Oracle allows you to write and store code in the DBMS along with data. You can associate trigger code with an UPDATE, INSERT, or DELETE event for each row or for a table as awhole. You can also set a trigger to run before or after the event. For example, you can set a trigger to run after any row is updated.Triggers and Stored Procedures
Sequences
Using Oracle with MS Access can increase the robustness and reliability of a multi-user system. This reduces network traffic because only query requests andJet/ODBC/Oracle Architecture
ODBC is an API that allows client applications to connect to different
RDBMS servers. Jet has been designed to make efficient use of ODBC while
requiring a level
1 ODBC driver.When MS Access uses ODBC to connect to remote RDBMS servers,
Jet continues to function as the DBMS engine for MS Access. MS Access forms,
reports, and Basic code continue to work with Jet as if they were working
with local or shared data in the mdb file format. Jet presents remote Oracle
tables as attached tables. These attached tables are created at design
time and appear to be local tables. Jet requires a primary key on tables
in Oracle in order to support dynasets against those tables. If a remote
table does not have a primary key, Jet only opens a non-updateable snapshot
on the table.
It is possible to define updateable tables in MS Access that do not
have a primary key. When these tables are migrated to Oracle, they do not
have a primary key and MS Access is unable to update them. If you need
the migrated tables to be updateable, you should ensure that either all
updateable MS Access tables have
primary keys before you migrate or that you define a primary key once
the tables are migrated to Oracle. Any updateable tables that do not have
primary keys are
flagged with a warning in the Log Window.
Preparing for Migration
It is imperative that you complete these steps before you run the
Capture Source Wizard:
1. Turn off security.
2. If your application contains linked tables, refresh these links
by opening the application in the MS Access IDE and choosing Tools -> Add
Ins -> Linked
Table Manager.
3. Compact your MS Access database files.
4. Back up your MS Access database files.
Note: Ensure that the database is not a replica database. The MigrationWorkbench
cannot migrate a replica MS Access database.
When you migrate an MS Access database to Oracle, some changes are required to enable your MS Access forms and reports to continue accessing the data. You must select to have your MS Access database modified in order for these changes to be made.Changes Made to the MS Access Database
After migration, app.mdb has two attached tables for each original
table and a mapping query. The original MS Access tables are renamed to
<tablename>_L. The
original table is exported to Oracle where it is called <TABLENAME>.
A table attachment is created to the Oracle table with the name <tablename>_R.
Because the forms, reports, and modules in app.mdb are expecting a table
with the original table name, a mapping query called <tablename> is
created. This mapping
query takes the place of the original table in the application. The
mapping query can refer to either <tablename>_L or <tablename>_R;
you can switch between the
local and remote table as you move your application to Oracle. The
mapping query also helps resolve reserved word conflicts between MS Access
and Oracle. For
example, a column named “Sequence” must be renamed as this is an Oracle
reserved word. The mapping query can remap this Oracle column back to Sequence
for use by the MS Access application. Reserved Words.
All requests for data from the MS Access application are directed to
the mapping query, which retrieves the data from the new Oracle table.
The original table that has been exported to Oracle is retained in
case the data is needed locally and, more importantly, so that any new
MS Access forms created
can be based on this table. This enables a complete set of table properties
to be inherited by the MS Access form. After the MS Access form is
defined, the data
source can be switched to the mapping query so that the data can be
retrieved from Oracle.
If the application opens a table directly (not using a dynaset or snapshot)
it will not work with linked tables. This restriction also applies after
you move the data to
Oracle. If this happens, you might want to leave some tables in the
app.mdb file so that each client has an independent copy. This could be
appropriate for tables with lookup values such as a ‘State’ table. If you
must move a table that is opened directly to the data.mdb file, you must
change the application to use dynasets or
snapshots.
After you move the data management portion of your MS Access application to Oracle, you can rely on Oracle to protect your data and maintain all referentialExtending your Application
The Oracle Objects for OLE and OLEDB/ADO Cookbook provides additional information about how to extend your application. You can find this document on
Another problem commonly encountered , was how to seperate
application and database files. Here some write up I did after doing few
of min from the old access 95 database.They assume that you will start
with a file called app.mdb and end with two files called app.mdb and data.mdb.
1. Make a backup of app.mdb.
2. Start MS Access and use the File -> Compact Database menu to compress
app.mdb.
3. In File Manager, copy app.mdb to data.mdb.
4. Open data.mdb in MS Access, delete all forms, reports, modules,
and macros.
5. In MS Access, open app.mdb and delete all the tables.
6. While still in app.mdb, use the File -> Attach Table menu item to
make an attachment in app.mdb to each table in data.mdb.
Now your application should run as it did before you split it into two
mdb files.
The following steps guide you through the manual conversion process:
1. Make backup copies of app.mdb and data.mdb.
2. Ensure that an ODBC connection exists to your Oracle database.
3. In app.mdb, rename each attached table to be suffixed with “_L”. For example,rename <tablename> to <tablename>_L.
4. Open data.mdb inside MS Access and prepare each table for migration as outlined at the end of this section.
5. Close the data.mdb file.
6. Use File…Compact with data.mdb to recover the space used for the table copies.
7. Open the app.mdb file.
8. Attach each <TABLENAME> table from Oracle to app.mdb as follows:
10. Create a mapping query for each attached Oracle table. The name
of the query will be <tablename>, the original name of the table, as
seen by your application.
Make sure that the name of each column is mapped back to the original
name found in the original tables.
11. Open the attached tables in datasheet view or open a form on the
tables to make sure that the exporting and mapping steps have been successful.
You will notice
that you are unable to update the data in the tables. After you complete
the migration steps and build primary keys, you will be able to modify
your data.
12. Perform the following steps for each column that was derived from an MS Access COUNTER field (COUNTER fields are mapped to NUMBER(10, 0)):
14. Map default value definitions to Oracle.
15. Map row and table validation statements to Oracle CHECK statements.
16. If you have any tables in Oracle that you need to update from MS
Access and which do not have a primary key, you must define one. As in
step 12 above,
you must make the primary key index the first index in alphabetic order
for the table.
17. Finally, use the MS Access Attachment Manager to refresh the attached
table connections. This step insures that Jet caches the latest information
about
primary keys and other table parameters. After you complete this step
you will be able to update your tables.
18. Open the tables in app.mdb in a datasheet or form to ensure that the migration was successful.
The steps outlined below explain how to prepare your tables for migration.Preparing Tables for Migration
During the intramigration phase , where it was important to optimize
the performance of both databases I did use the Application Startup
Performance and Runtime Performance tips given below, although not
all, applied directly to my project . I once again doing a complete
( much as I found on it) write up on this one , tapping my sources across
many manuals and guides.
There are a number of ODBC drivers available for Oracle. In addition to the driver supplied by Oracle, drivers are also available from Microsoft, Visigenic, Intersolve, and others.ODBC Driver Selection
When MS Access first makes a connection to an Oracle database, it checks to see if a special parameter table is present. The table has the following definition:Server-based Parameter Table
The following table illustrates how Config and nValue column values can customize the way MS Access works with Oracle:create table MSysConf(
CONFIG NUMBER,
nValue INTEGER
)
| Config | nValue | Meaning |
| 101 | 0 | Do not allow the user to store the USERID and PASSWORD in attachments. This is important to set for secure installations. |
| 101 | 1 | Allow the user to store the USERID and PASSWORD in table attachments (default). |
| 102 | D | MS Access delays D seconds between each background chunk fetch when managing dynasets. |
| 103 | N | MS Access fetches N rows on each background chunk fetch when populating a dynaset. |
Jet’s Query Processor includes a cost-based optimizer that can make decisions on joining heterogeneous data via an ODBC connection.Jet’s Query Processor
You can tune MS Access to speed up the process of establishing an ODBC connection at application startup time. In the case of MS Access 2.0, you makeApplication Startup Performance
The most important issue related to runtime performance in a client/server configuration is the reduction of network traffic.Runtime Performance
Form Loading Time
Performance is both perceived and actual. You should eliminate any requests
for data from Oracle while a form is loading. You can do this by including
a button that
will retrieve information. You can also cache the last information
that a form displayed locally.
Qualified and Restricted Queries
You can reduce network traffic by requesting only the columns you need
from a table. You should also use the most restrictive qualifications
possible to reduce the
size of the query result set.
Snapshots vs. Dynasets
If possible, use Forward Only Snapshots to work with Oracle data, especially when the result set is small. For larger result sets, and for queries which must be updated, use a dynaset. Even if you are not going to update data, a dynaset will be faster than a snapshot if the result set is large. This is because only the key values are retrieved for the dynaset, not the full set of complete rows.
Drop-Down Lists
MS Access tries to minimize the amount of network traffic when it needs
to populate a drop-down list box.When a snapshot is used to populate a
drop-down
list, MS Access uses the same batch fetching of records that it uses
to populate a grid or a form. MS Access will fetch an initial ‘chunk’ of
data (100 rows) and then
periodically retrieve sets of 100 rows from the server.
This process works smoothly unless you makes an entry that does not
match a row already fetched. In this case, MS Access will begin fetching
records from the server until a match is found or until all records are
retrieved. If the returned set is large,this step can be lengthy and will
freeze the User Interface. MS Access does not share queries for drop-down
lists. You cannot define a snapshot query and reference it from multiple
list boxes and expect to use.information that is retrieved once. Instead,
MS Access will treat each ‘activation’ of a query as independent. If a
drop-down list is short (< 100 records), it is probably sufficient to
have MS
Access perform its normal operations. If the list is long, you may
want to build a synchronized shadow table in MS Access. Store the table
information locally in MS
Access and periodically synchronize the local table with information
from Oracle.