AllExperts > Experts 
Search      

Oracle

Volunteer
Answers to thousands of questions
 Home · More Questions · Answer Library  · Encyclopedia ·
More Oracle Answers
Question Library

Ask a question about Oracle
Volunteer
Experts of the Month
Expert Login

Awards

About Us
Tell friends
Link to Us
Disclaimer

 
 
 
 
About Elliot Mak
Expertise
I can answer questions with regarding to Oracle DB (8i, 9i, 10g) installation, configuration, administration, Data Guard, and SQL.

Experience
I am an Oracle DBA, Senior PA, Project Manager, and Data Architect with 10 years of experience.

Education/Credentials
BS in MIS

 
   

You are here:  Experts > Computing/Technology > Oracle > Oracle > some dba questions

Topic: Oracle



Expert: Elliot Mak
Date: 6/3/2008
Subject: some dba questions

Question
How does one use the import/export utilities?
Can one resize tablespaces and data files?
Can one monitor how fast a table is imported? Can one modify data as it loads into the database?

Answer
Good day Shanthi

I assume that you are using Oracle 10g R2 or above.  

Question #1:
How does one use the import/export utilities?

Answer:
Oracle introduces Data Pump (impdp/expdp) in Oracle 10g, it is a faster and more efficient way to perform an import/export.  The old way (imp/exp) still works but rumor has that it will be deprecated very soon.

For this reason, I will provide you the Oracle Data Pump version of the import and export.

There is a good starter guide from Oracle-base with regarding to Data Pump.  And here is the link
http://www.oracle-base.com/articles/10g/OracleDataPump10g.php

OracleFAQ also has a good learning doc
http://www.orafaq.com/node/65 (Part 1)
http://www.orafaq.com/node/67 (Part 2)
http://www.orafaq.com/node/74 (Part 3)

Question #2:
Can one resize tablespaces and data files?

Answer:
Here is an example
1. Create a temporary tablespace with 1 datafile of 100MB in size
CREATE SMALLFILE TABLESPACE "ALLEXPERT_TMP_TS" DATAFILE 'C:\ORACLE\PRODUCT\10.2.0\ORADATA\TEST\allexpert_ts1' SIZE 100M LOGGING EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO

2. Add a new datafile with 50MB in size
ALTER TABLESPACE "ALLEXPERT_TMP_TS" ADD DATAFILE 'C:\ORACLE\PRODUCT\10.2.0\ORADATA\TEST\allexpert_ts2' SIZE 50M

3. Drop a datafile
ALTER TABLESPACE "ALLEXPERT_TMP_TS" DROP DATAFILE 'C:\ORACLE\PRODUCT\10.2.0\ORADATA\TEST\ALLEXPERT_TS2'

4. Resize the first datafile from 100MB to 75MB
ALTER DATABASE DATAFILE 'C:\ORACLE\PRODUCT\10.2.0\ORADATA\TEST\ALLEXPERT_TS1' RESIZE 75M

You cannot resize the tablespace to a smaller size if the block for those 25 MB are in use.  You will need to do a reorg before you do a resize to a smaller datafile.

By controlling the size of the datafiles within the tablespace, you are effectively resizing the tablespaces.

Question #3:
Can one monitor how fast a table is imported? Can one modify data as it loads into the database?

Let's answer the first question "Can one monitor how fast a table is imported?"
For each import using imp/impdp, you can specify to output a log file.  The logfile contains all the information about the import including start time and end time of the import, but it does not provide timing for each individual table.  

The second question "Can one modify data as it loads into the database?"
I assume that you are using Oracle utilities.  

If you are using imp/impdp, you cannot modify the data as it loads into the database.  

The other way to get around it is to use SQLLOADER.  SQLLOADER will allow you to modify the data content as it loads into the database.  But SQLLOADER will only read flat files.

Hope it helps.  If you have additional questions, please don't hesitate to contact me.

Cheers
Elliot

Add to this Answer    Ask a Question



  Rate this Answer
   Was this answer helpful?
Not at allDefinitely              
   12345  

     
About Us | Advertise on This Site | User Agreement | Privacy Policy | Help
Copyright  © 2008 About, Inc. About and About.com are registered trademarks of About, Inc. The About logo is a trademark of About, Inc. All rights reserved.