Professional Documents
Culture Documents
DB Import Export
DB Import Export
MetricStream, Inc.
October August 2004
Copyright Notices
Page ii
Guide
Document Control
This page should be erased in released document. Do not delete
page since that will impact numbering simply leave the page
empty
Draft copy not to be distributed to anyone outside MetricStream
Change Record
Date
Author
Version
Change Reference
Aug 4,
2003
Aug 30,
2003
Bhaskar
Vasudevan
Bhaskar
Vasudevan
Version
1.1
Version
1.2
Created
Mar 18,
2004
Ashok Kumar
Sutradhar
Version
1.4
Dec 14,
2004
Oct 25,
2005
Joseph George
Version
1.5
Version
1.9
Gagan Arora
Signatures
Date
Name
Signature
Table of Contents
1. EXPORTING AND IMPORTING METRICSTREAM DATABASE
REPOSITORY...................................................................................................................4
ASSUMPTIONS...................................................................................................................4
STEPS TO EXPORT.............................................................................................................4
STEPS TO IMPORT WHEN THE SAME USER NAME USED TO EXPORT THE DATABASE IS
USED DURING THE IMPORT...............................................................................................4
STEPS TO IMPORT WHEN THE USER NAME USED TO EXPORT IS DIFFERENT FROM THE
USERNAME USED TO IMPORT............................................................................................4
STEPS TO BE EXECUTED AFTER IMPORTING THE DATABASE.............................................4
Page iv
Guide
QMSGOLD_IDX
Note: This has to be the same during export/import operation. If
the database instance from where you did the export, had the
index tablespace name as QMSGOLD_IDX, the same tablespace
name should be created where the database will be imported.
4. User (name of the user that you would create and setup prior
to importing a database. This user name can be different from
the user specified during export, but in this case you should do
a full import of the database exported. In any case once a user
export has been done, it is always safe to do a full import when
compared to user import. Steps to import the database for
same user and different users is covered separately in this
document in a later section) MYUSER
5. Password - MYUSER
6. Directory where the MetricStream application is installed
(<INSTALLATION_DIRECTORY>) C:\MetricStream
7. DB Version Oracle 8.1.7
Note: If the Oracle repository version is Oracle 8.1.7, make sure
you use EXP client (supplied with Oracle installation) of same or
higher version to do the export. Once the export has been done, to
import the db, make sure you use the same or higher version of
MetricStream Database Export/Import Guide
Page 5
Steps to Export
Export the database as system/manager. From the DOS
prompt use the following command:
exp system/manager@dbname
For example, with the above mentioned assumptions we can use
the following expression
exp system/manager@devindia
1.
2.
Page 6
Guide
Drop the user QMSGOLD (In case a user with the name
QMSGOLD already exists and the exported database has to be
imported into the same user/schema)
drop user QMSGOLD cascade;
6. Drop the tablespace (In case a tablespace already exists with
the same name and can be replaced with incoming imported
data.)
drop tablespace QMSGOLD_IDX including contents
cascade constraints;
drop tablespace QMSGOLD_DATA including contents
cascade constraints;
Note: If any other schema is sharing the same tablespace, it is
recommended not to use these drop statements. Dropping sub
tablespaces will result in other users/schemas losing the data.
7. Remove the data files from the location obtained in step #4.
Note: If any other schema is sharing the same tablespace, it is
recommended not to use step #6 and #7. Doing so will result in
other users/schemas losing the data.
8. Create tablespace for data file and index file
Run the following command from sqlplus. This will execute the
file containing commands to create a data tablespace and
index tablespace.
@create_tablespace.sql;
5.
Page 8
Guide
Logout of sqlplus
7. Import the DMP file as QMSGOLD. From the DOS Prompt use
the following command:
imp QMSGOLD/QMSGOLD@dbname.
For example, with the above assumptions we can use the following
expression: imp QMSGOLD/QMSGOLD@albdms2.
6.
import
1.
2.
3.
Login to sqlplus as
sqlplus system/manager@devindia
4.
Drop the user MYUSER (In case a user with the name MYUSER
already exists and the exported database has to be imported in
the same user/schema)
drop user MYUSER cascade;
Run the following command from sqlplus. This will execute the
file containing commands to create a data tablespace and
index tablespace.
@create_tablespace.sql;
3.
Page 12
Guide
ql
We use the following statement to compile invalid database
objects:
Alter <object_type> <object_name> compile
Or alternatively you can do the following
Exec compile_all_invalid_objects
4.
5.
6.
2.
3.
4.
5.
6.
From the list of Existing Enterprises choose the one for which
you want to modify the DB URL, and click the manage
application link.
Usually it is the MetricStream application that should be
modified.
7.
In the Edit application page change the following: Database URL (to point to the system and repository in which
you have imported the Database.)
Modify the database login which you provided at the time of
importing database, i.e. QMSGOLD or myuser
7.
Run
<INSTALLATION_DIRECTORY>\SYSTEMi\Systemi\database\alter_
seq.sql
Make sure there are no invalid objects or views by re-running
the query mentioned in step 2 above (if some objects are
invalid, check if there are any bugs with the same object by
recompiling the object (Alter <object_type>
<object_name> compile). If the object doesnt get compiled,
contact MetricStream support).
If there are more invalid objects, Run
<INSTALLATION_DIRECTORY>\SYSTEMi\Systemi\database\db_u
pgrade_patch.sql once again to clear these out.
8.
9.
Page 14
Guide