Operating System - HP-UX
1752305 Members
5393 Online
108786 Solutions
New Discussion юеВ

How do use EXP in oracle?

 

How do use EXP in oracle?

Hi!,
How can I use EXP utility to export tha data whose query is following:
select * from alarma where fecha_llega<'12-DEC-02' and estado='C';

I have Oracle 7.1.6 running over a HP9000 K380 server.

Too, Can I export data from a DB oracle 7.1.6 to a DB oracle 8i?

Thank you!!

Add. data.txt
Christian Aguilar
5 REPLIES 5
F. X. de Montgolfier
Valued Contributor

Re: How do use EXP in oracle?

Hi,

you cannot use exp to do that directly. exp will only export tables, not selections of a table...

However, if you wish to use exp to export such a request, you can:

create a table containing the results:

create table temp_ta as (select * from alarma where fecha_llega<'12-DEC-02' and estado='C');

export the new table:

exp

and use the interactive mode to say that you want to export the temp_ta table.

Don't forget to drop the table afterwards ;-)

I'd be more precise, but don't have the Oracle7 doc, and don't want to give you unsupported options...

Cheers,

FiX

Ian Lochray
Respected Contributor

Re: How do use EXP in oracle?

To answer your second question, provided you use the Oracle 7.1.6 exp utility and the Oracle 8i imp utility, you can export data from the Oracle 7 database and import it into the Oracle 8 database.
Brian Crabtree
Honored Contributor

Re: How do use EXP in oracle?

You can also export the data using the 8i tools, however you will need to load the export views from the 8i version into the 7.1.6 version by connecting from the 8i tools and running the catexp.sql script from the 8i $ORACLE_HOME/rdbms/admin directory.

Brian
Bala_8
Frequent Advisor

Re: How do use EXP in oracle?


You can use query based Export in Oracle ...
Use parameter file option for this... within the parfile u specify the where clause condition .....

i attached a sample parameter file alongwith export script for your reference ...

cheers
-bala-
Yogeeraj_1
Honored Contributor

Re: How do use EXP in oracle?

hi Christian,

To add to the previous replies,

A. Export with a query
=======================
With oracle8i, we can use the QUERY parameter to supply a WHERE clause that will be applied to each exported table. It is recommended to use a PARFILE with the query option (so that you don't have to fight with special characters such as =, >, < that need to be escaped)

E.g. if i have table ALARMA
exp usrid=yd/yd tables=arlarma query=\"where fecha_llega \< to_date('12/12/2002','DD/MM/YYYY') and estado \= 'C'\"


However, if i simply use a parameter file, exp.par containing the following argument:
query="where fecha_llega < to_date('12/12/2002','DD/MM/YYYY') and estado = 'C'"

i can now do:
exp userid=yd/yd tables=t parfile=exp.par

B. IMP/EXP across versions
==========================
You can easily IMP and EXP across different versions of Oracle. You can even EXP and IMP to and from version 7 databases and version 8 databases. However, you have to use the proper version of EXP and IMP when doing so. The rules for picking the version of IMP and EXP are:

- Always use the version of IMP that matches the version of the database. If you are going to import into version 8.0.5, use the 8.0.5 import tool.

- Always use the version of EXP that matches the lowest of the two versions of the database. If you were exporting from version 8.1.6 to 8.1.5, you should use the version 8.1.5 EXP tool, over Net8, against the version 8.1.6 database. If you are exporting from version 8.1.5 to 8.1.6, you would use the version 8.1.5 EXP tool directly against the 8.1.5 database.

Hope this helps!

Best Regards
Yogeeraj
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)