Insert statement of a subset of data

Team, need to create a test table from PROD, having 91,386,900 rows, for testing purpose, requires only 1000 rows and can't use expdp, because of access, can use Toad/sql developer & sql plus too.

Need some assistance, thanks in advance.
Mushfique KhanDirector OperationsAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

slightwv (䄆 Netminder) Commented:
Quickest way is in PROD, create a 'test' table with the 1000 rows then export/import:

create table my_test_table as select * from prod_table where rownum<1001;

Second way, create a CSV then use sql loader.
Alexander Eßer [Alex140181]Software DeveloperCommented:
create table my_test_table as select * from prod_table where rownum<1001;

when going for CTAS (see post above), consider using NOLOGGING and (if possible) PARALLEL options...
1) TOAD -> Database -> Export -> Data Subset Wizard
2) SQL Developer -> Tools -> Database Copy -> ....etc ....
3) SQL*Plus -> Use sql script

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

slightwv (䄆 Netminder) Commented:
>>and can't use expdp, because of access

What access is preventing this?

If you can select from the table, you should be able to use classic exp/imp.
Mushfique KhanDirector OperationsAuthor Commented:
expdp can be used from where ... sqlplus or toad or sql developer or os ... I think os and no os access ... is this understood or still requires more clarification ...?
What slightwv suggest is to use "clasic" exp/imp which you can execute from your desktop through a network alias,  and . . . you can restrict the subset with the "query" option:
exp scott@orcl TABLES=emp QUERY=\"WHERE job=\'SALESMAN\' and sal \<1600\"

Open in new window

slightwv (䄆 Netminder) Commented:
Yes.  Classic exp.

It will export to a local file system on the client machine.  No database server OS access needed.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Oracle Database

From novice to tech pro — start learning today.