Creating a backup of a table that contains a LONG type field
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? Can I use export?
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"