home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / database / oracle / 1589 < prev    next >
Encoding:
Text File  |  1992-09-15  |  2.8 KB  |  97 lines

  1. Newsgroups: comp.databases.oracle
  2. Path: sparky!uunet!srg!dtrum
  3. From: dtrum@jets.srg.af.mil (David E. Trum x4772)
  4. Subject: Re: Import into a new table space is BROKEN!
  5. Organization: ARINC Research, Corp.
  6. Date: Tue, 15 Sep 92 18:42:21 GMT
  7. Message-ID: <1992Sep15.184221.25014@srg.srg.af.mil>
  8. Sender: news@srg.srg.af.mil (Usenet news user)
  9. Lines: 86
  10.  
  11.  
  12. David Taylor writes:
  13.  
  14. >I created a special tablespace for the data (~200M) on a new disk.
  15. >I created a user and granted resource access to the table space.
  16. >I made the new table space the default for this user.
  17. >
  18. >When I run import it appears to work, but it creates
  19. >the tables in the SYSTEM table space, and falls over eventually
  20. >because there isn't enough space there. The manual clearly states
  21. >that it should load into the default table space for this user.
  22. >It even gives an example of how to use this feature to transfer
  23. >stuff between table spaces.
  24. ....[deleted]
  25.  
  26. ------------------
  27. Yup, Unix (SCO and SunOS) have this problem too.
  28. My way around it is to write a shell script to dump the
  29. names of each table to a file and then create an export
  30. dump script to export the INDIVIDUAL tables.  This creates
  31. a single dump file with each table in it (and data) without
  32. requireing that the target tablespace be of the same name
  33. as the original tablespace.
  34.  
  35. As an illustration of what I mean, perform an ASCII dump
  36. of a regular user dump file 
  37.  (UNIX: cat expdmp.dat |strings >expdmp.text)
  38. and notice the "TABLESPACE" clause in each "CREATE TABLE"
  39. command.  Arggg!
  40.  
  41. piece of shell script:
  42.  
  43. ...[deleted]
  44.   echo "Exporting Tables.......\c"
  45.   echo "userid=$LOGIN"  >./params.exp
  46.   echo "file=tables.dmp">>./params.exp
  47.   echo "grants=Y"       >>./params.exp
  48.   echo "indexes=N"      >>./params.exp
  49.   echo "constraints=Y"  >>./params.exp
  50.   echo "tables=(\c"     >>./params.exp
  51.   sqlplus $LOGIN @$PGM_DIR/get_tb_lst.sql >/dev/null
  52.   OLD_IFS=$IFS
  53.   IFS=$LINE_IFS
  54.   for LINE in `cat tables.all |grep -v "^$"`
  55.   do
  56.         TABLE=`echo $LINE|cut -f1 -d" "`
  57.         echo "$C$TABLE\c" >>./params.exp
  58.         C=", "
  59.   done
  60.   echo ")"  >>./params.exp
  61.   IFS=$OLD_IFS
  62.   $EXP_DIR/exp parfile=./params.exp
  63. ...[deleted]
  64.  
  65. Where 
  66. LINE_IFS='
  67. '
  68. and get_tb_lst.sql is:
  69. REM     This script creates a list of tables to be exported.
  70.  
  71. set heading off
  72. set feedback off
  73. set linesize 35
  74. set pagesize 1000
  75. spool tables.all
  76. select TABLE_NAME from user_tables
  77.         order by 1 ;
  78.  
  79. spool off
  80. exit
  81.  
  82.  
  83. -- 
  84.  
  85. #########################################################
  86. David E. Trum
  87. Database Administrator        Email:  uunet!srg!dtrum
  88. ARINC Research Corporation    Phone:  (410)266-4772
  89. 2551 Riva Road  MS 5-230    Fax:    (410)573-3024
  90. Annapolis, MD  21401-7461
  91. #########################################################
  92. --
  93.  
  94. #########################################################
  95. David E. Trum
  96. Database Administrator        Email:  uunet!srg!dtrum
  97.