background image
<< Generating a Script for Creating Views | Performing the Installation >>
<< Generating a Script for Creating Views | Performing the Installation >>

Exporting the Data

Exporting the Data
7-10 Oracle Database 2 Day Developer's Guide
Storage
: Uncheck, because this does not apply here.
Terminator
: Check. This is necessary because you want to be able run the
resulting script.
Pretty Print
: Check. If you check this option, the output is more readable.
Include BYTE Keyword
: Uncheck, unless you are working with a multibyte
character set, in which case you should check this option.
Add Force to Views
: Check. This will cause your views will be created, even if
they are invalid. If any views are invalid, you can correct problems later and
then compile these views.
Constraints as Alters
: Uncheck, because this does not apply here.
Export Data
: Uncheck, because you will export the data separately for this
example.
Include Drop Statements
: Uncheck. If you want these objects to replace any
existing objects with the same name, you can include this. However, a better
practice is to have a separate drop script that can be run to remove an older
version of your objects before creation. This avoids the chance of accidentally
removing an object you did not intend to drop.
4.
Click the Objects tab.
5.
In the Objects tab:
Select
hr_conn
for the database connection to be used.
For the type of objects to be exported, expand All My Objects. Expand
Synonyms
, and select POSITIONS. Expand Views, and select EMP_
LOCATION
. Uncheck the other object types.
6.
Click Apply to generate the script.
After you have generated the scripts to create the tables, PL/SQL objects, synonym,
and view, you can generate the script that retrieves any data that you want to bring to
the target database.
Exporting the Data
To export the data, you must capture the existing table data for insertion into the
deployed tables. As mentioned in
"Planning for Deployment"
on page 7-2, you have
two options: you can insert data into your target schema if you are confident that all
dependent data exists and there are no validity problems, or you can disable
constraints, load the data, and then enable them again after loading the data.
If you choose to disable and then enable the constraints, then you have the following
options:
Review the tables and constraints using SQL Developer, and disable and enable
them one at a time.
Create a copy of the
2day_tables.sql
file, find the name of each constraint, and
edit the file so that it contains the SQL statements to disable and enable each
constraint.
Find the constraints in the Oracle Database data dictionary, and create a SQL script
with the SQL statements to disable and enable each constraint.