Você está na página 1de 7

Oracle Procedure

Importing an Oracle 8i/9i database into 10g Express Edition.


This procedure guides the end user to transfer an Oracle database from an Oracle 8i/9i
database into an Oracle 10g.
Phase I - Export the source database
Close Machine Analyst (normal exit). If in a multi-user environment, please ensure that all
users accessing the source database exit Machine Analyst.

Copy the appropriate files Backup.bat and Backup.txt into a temporary folder.
These can be found in a folder called Tools\Backup in the @ptitude Analyst CD.
Note: Ensure that there is enough free disk space to accommodate your export file a good
rule of thumb, is to have approximately the same or greater amount of free disk space as
your Oracle database folder.
Edit the Backup.bat and Backup.txt file to match your installation. You may edit the files
by right-clicking a file and selecting the Edit command from the right-click-menu.
Below is the content of the Backup.bat. Items that are in Bold and Italics you will need to
edit.
exp system/skf@cmserver parfile=Backup.txt
Note: Here is an explanation of the command

exp= Oracles command line Export utility

system = User that has the rights to attach to the database and run the
Export utility

Skf = Password for the user

Cmserver = this is the name of the database to export the data from

Parfile = file name that has the export parameters


Save the changes to the file.

Last Revised: 8/30/2007 5:20:00 PM

Page 2 of 7

Edit the Backup.txt file. Below is the content of the Backup.txt. Items that are in Bold and
Italics you will need to edit.
Note: Here is an explanation of the parameter file
Compress = Y will cause export to resize the initial extents for all tables so they will
import into one initial extent
File = Name of Export.dmp name of the export file you want to create
Log = Name of Log file specifies the file name to record the screen output and
error messages
Owner = SKFUSER1 specifies one or more usernames whose objects will be exported
in user mode
Record = N (If record is set to YES an incremental or cumulative export updates
the SYS.INCVID, SYS.INCFIL, and SYS.INCEXP tables)
Double click the Backup.batthis will initiate the export application and display a Command
Prompt window from several minutes to a several hours, depending on the size of the
database.

When the Export has finished the screen will close.


Note: Open the Export log file to ensure all your data exported successfully without errors.

Last Revised: 8/30/2007 5:20:00 PM

Page 3 of 7

Phase II Import the destination database


Copy the appropriate files DeleteDB.bat, DeleteDB.sql, Restore.bat, Restore.txt and the
DMP file created in Phase I into a temporary folder.
Note: Contact the Technical Support Group for the Delete.bat and the Deletedb.sql.
Warning: The DeleteDB.bat program permanently deletes Machine Analyst data within the
Oracle database this action is irreversible.
Edit the DeleteDB.bat and DeleteDB.sql file to match your installation. You may edit the
files by right-clicking a file and selecting the Edit command from the right-click-menu.
Below is the content of the DeleteDB.bat. Items that are in Bold and Italics you will need to
edit:
sqlplus skfuser1/cm@XE < deletedb.sql
XE = database name
Save the changes.
Edit the DeleteDB.sql file to match your installation. Below is the content of the
DeleteDB.sql. Items that are in Bold and Italics you will need to edit:
CONNECT SYSTEM/skf@xe;
skf = Password for the system user
XE = database name
Save the changes.
Double click the DeleteDB.bat this will commence the Sqlplus application and it will display
a Command Prompt window for several minutes.
Warning: The DeleteDB.bat program permanently deletes Machine Analyst data within the
Oracle database this action is irreversible.
Note: Upon completion of the DeleteDB.bat program, the Oracle database will be ready to
import the Oracle export file create in Phase I.
The file Restore.bat this application will import the new database (the DMP file created in
Phase I) into the destination database.
Edit the Restore.bat and Restore.txt files to match your installation. You may edit the
files by right-clicking a file and selecting the Edit command from the right-click-menu.
Below is the content of the Restore.bat and Restore.txt. Items that are in Bold and Italics
you will need to edit:
imp skfuser1/cm@xe parfile=Restore.txt

Last Revised: 8/30/2007 5:20:00 PM

Page 4 of 7

Note: Here is an explanation of the command,

imp= Oracles command line Import utility

skfuser1 = User that has the rights to attach to the database and run the
import utility

skf = password for the user

XE = this is the name of the database to import the data in to

Parfile = file name that has the import parameters


Save the changes.
The Restore.txt file. The filename.dmp is the DMP file created in Phase I.
FILE=Filename.dmp
FROMUSER=SKFUSER1
COMMIT=Y
LOG=an_imp.log
Save the changes.
Double click the Restore.bat. The Restore.bat file opens a Command Prompt window and the
import will start:

When the Import has finished the screen will close.


Note: Open the an_imp.log file to ensure all your data imported successfully without errors.
Delete the files DeleteDB.bat and DeleteDB.sql from the temporary folder to avoid
accidentally deleting data from the Oracle database.

Last Revised: 8/30/2007 5:20:00 PM

Page 5 of 7

Phase III
After the import has finished you will need to manually update the database to the current
version.
Copy the database update scripts to a temp folder. The scripts can be found in the Oracle
folder within the application path:
C:\Program Files\SKF-RS\SKF @ptitude Analyst\DBAssist\Oracle
Select all the scripts and paste then into the temp folder.
Running the sysgrant script
From the Start>All Programs menu open the Oracle Database 10g Express Edition, and
then select Run SQL Command Line

The SQL Command Line window will open. Log in as follows:


connect sys/skf@xe as sysdba
See Example below.

Press Enter
Once the sys user is connected in to the database, type the path to the sysgrant script:
@Drive Letter\Folder\sysgrant.sql
Example: @x:\oracle\sysgrant.sql

Last Revised: 8/30/2007 5:20:00 PM

Page 6 of 7

See example below

Press Enter
If the script is executed properly, then two Grant succeeded will be returned.

Running the DBupdate.sql. This file must be executed as skfuser1.


At command prompt type:
connect skfuser1/cm@database
See example below

Press Enter
Once connected as sfkuser1, type the path to the sysgrant script:
@Drive Letter\Folder\sysgrant.sql
Example: @x:\oracle\sysgrant.sql

Last Revised: 8/30/2007 5:20:00 PM

Page 7 of 7

See example below

Press Enter
This will initiate the DBupdate procedure and it will scroll by in the command window.

When the DBupdate has finished the command prompt window will close and you will be
returned to your desktop.
You are now ready to launch @ptitude Analyst running with Oracle 10g Express.

Last Revised: 8/30/2007 5:20:00 PM