I need to take a backup of a selected number of rows from an Oracle table. I thought of doing a create table ... as select from. However, the source table consists of a LONG type field. How can I back this up?
How can I take an export of the table? Can you provide me with the appropriate script? It will be great if I can create a temporary table.
The CREATE TABLE AS SELECT will not work if the table contains a LONG or LONG RAW column as you have found out. To take an export of just this table, use the Oracle export utility similar to the following:
exp userid=system/manager file=exp.dmp tables=scott.emp
The above example exports just the SCOTT.EMP table. You can export selected rows of data using the QUERY clause. This parameter lets you specify the equivalent of a WHERE clause on your table. An example might look like the following:
exp userid=system/manager file=exp.dmp tables=scott.emp query="empno=1001"
Dig Deeper on Oracle database backup and recovery
Related Q&A from Brian Peasland
Oracle expert Brian Peasland answers one reader's question about common pitfalls when connecting Oracle to outside programs. Continue Reading
One reader asks expert Brian Peasland a question about datafile sizes with the Oracle RMAN duplicate 10g command. Continue Reading
Managing parent table-child table relations in Oracle SQL environments is key to efficient programming. Continue Reading
Have a question for an expert?
Please add a title for your question
Get answers from a TechTarget expert on whatever's puzzling you.