DBAsupport.com Forums - Powered by vBulletin
Results 1 to 6 of 6

Thread: How to -- Export tables listed in a file..

  1. #1
    Join Date
    Oct 2000
    Posts
    449
    See what I am doing now..

    sxt2708@noascrm001 /home/sxt2708 $ more params.dat

    # Exporting some objects from Schema :
    #
    # way to run this file :
    # exp user/pwd parfile=params.dat
    #
    file=/home/sxt2708/exp1.dmp
    log=/home/sxt2708/exp1.log
    grants=y
    indexes=y
    rows=y
    constraints=y
    compress=n
    tables=(emp,dept,salgrade)

    sxt2708@noascrm001 /home/sxt2708 $

    Now the tables are hard coded in the line tables(...,..,..) Instead I want them to come from a file where the tablenames are mentioned.. If not a scipt that can read a text file and so on.. for the export..

    I have close to 1900 tables and based on priority I would be choosing few tables as per requirement at a time,w hich will be coming to me in a txt file (one table per line)..

    Thanks, ST

  2. #2
    Join Date
    Oct 2000
    Location
    Saskatoon, SK, Canada
    Posts
    3,925
    Why not you use a shell script to build the parfile and then use it with your export.

    Sam
    Thanx
    Sam



    Life is a journey, not a destination!


  3. #3
    Join Date
    Nov 2000
    Location
    greenwich.ct.us
    Posts
    9,092
    Originally posted by st2000
    Now the tables are hard coded in the line tables(...,..,..) Instead I want them to come from a file where the tablenames are mentioned.. If not a scipt that can read a text file and so on.. for the export..
    They don't have to be in the format of tables=(x,y,z) in a parfile. Your parfile can look like
    tables=x,
    y,
    z
    Jeff Hunter

  4. #4
    Join Date
    Oct 2000
    Posts
    449
    Let me rephrase my question..
    Say I have a file called tbls_to_export.txt
    table1,
    table2,
    table3,
    table4,
    table5,
    .....,
    ...,
    table25.
    End of file..
    Now I want to write a scipt to be able to read the text file and export all the tables. How would I do that?
    Thanks, ST

  5. #5
    Join Date
    Oct 2000
    Location
    Saskatoon, SK, Canada
    Posts
    3,925
    You have to rebuild your parfile using a script which would list the table names that you want to exp.

    Sam
    Thanx
    Sam



    Life is a journey, not a destination!


  6. #6
    Join Date
    Feb 2000
    Location
    NJ, United States
    Posts
    250
    What you can do is create a shell script which will have all the parameters from the export in variables and invoke the exp passing the variables as parameters :
    For eg:
    export ORACLE_HOME=/opt/report/oracle/8.1.6
    export exppath=/opt/expdmp
    export tables=`more t1.txt`(t1.txt is the filename where you have the table names)
    echo $tables
    exp tables=$tables file=exppath........etc

    hope this helps
    KN

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width