8 Replies Latest reply on Nov 8, 2003 6:19 AM by 385948

    Dumping table structure to text file.

      Is there any way to dump tables structure without the tablespace information. I have noticed that one users tables created in SYSTEM table space when imported to another database where the user is created in another table space using imp utility all tables were created in SYSTEM table space. I am using Oracle 8i(8.1.7). Or I want to migrate data from one table space to another. This is required in when the application is deployed.

      Anto Paul.
        • 1. Re: Dumping table structure to text file.
          In one occasion for changing the tablespace definition from one to another I edited the dump with a binary editor and it worked.

          Joel P�rez
          • 2. Re: Dumping table structure to text file.
            and other option that I know is to do it with TOAD.
            when you export with TOAD you can control all for the exporting.

            Joel P�rez
            • 3. Re: Dumping table structure to text file.
              If you have an export, you can do an import specifying the indexfile option. This will create an sql script containing all the sql to create the tables and indexes. Note that the table create statements are commented out. You could uncomment them, and edit the tablespace names. Drop the existing tables (if you have an export), run the modified sql to create the tables in the new tablespace. Then, import the data specifying ignore=y which will ignore the error generated by the fact that the table already exists.

              Also, see the command
              alter table move
              • 4. Re: Dumping table structure to text file.
                My dear Karen McSwain , I do not see the indexfile that you are refering

                oracle@ferrari:~> exp help=y

                Export: Release - Production on Fri Nov 7 13:30:27 2003

                Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.

                You can let Export prompt you for parameters by entering the EXP
                command followed by your username/password:

                Example: EXP SCOTT/TIGER

                Or, you can control how Export runs by entering the EXP command followed
                by various arguments. To specify parameters, you use keywords:

                Format: EXP KEYWORD=value or KEYWORD=(value1,value2,...,valueN)
                or TABLES=(T1:P1,T1:P2), if T1 is partitioned table

                USERID must be the first parameter on the command line.

                Keyword Description (Default) Keyword Description (Default)
                USERID username/password FULL export entire file (N)
                BUFFER size of data buffer OWNER list of owner usernames
                FILE output files (EXPDAT.DMP) TABLES list of table names
                COMPRESS import into one extent (Y) RECORDLENGTH length of IO record
                GRANTS export grants (Y) INCTYPE incremental export type
                INDEXES export indexes (Y) RECORD track incr. export (Y)
                DIRECT direct path (N) TRIGGERS export triggers (Y)
                LOG log file of screen output STATISTICS analyze objects (ESTIMATE)
                ROWS export data rows (Y) PARFILE parameter filename
                CONSISTENT cross-table consistency(N) CONSTRAINTS export constraints (Y)

                OBJECT_CONSISTENT transaction set to read only during object export (N)
                FEEDBACK display progress every x rows (0)
                FILESIZE maximum size of each dump file
                FLASHBACK_SCN SCN used to set session snapshot back to
                FLASHBACK_TIME time used to get the SCN closest to the specified time
                QUERY select clause used to export a subset of a table
                RESUMABLE suspend when a space related error is encountered(N)
                RESUMABLE_NAME text string used to identify resumable statement
                RESUMABLE_TIMEOUT wait time for RESUMABLE
                TTS_FULL_CHECK perform full or partial dependency check for TTS
                VOLSIZE number of bytes to write to each tape volume
                TABLESPACES list of tablespaces to export
                TRANSPORT_TABLESPACE export transportable tablespace metadata (N)
                TEMPLATE template name which invokes iAS mode export

                Export terminated successfully without warnings.

                Joel P�rez
                • 5. Re: Dumping table structure to text file.
                  To change tablespaces on import see this thread:


                  It does work all the time provided the object owner has no quota on the old tablespace. This by the way means that he does not have dba or resource roles both of which have quota unlimited on any tablespace. So if the object owner does the you have to revoke the privs before import.

                  So to review:

                  Create the user in the new db with a new default tablespace.
                  Grant quota on the new tablespace.
                  ensure the user does not have quota unlimited on any tablespace (resource, dba roles).
                  Follow the steps in the other thread.
                  • 6. Re: Dumping table structure to text file.
                    Joel, the indexfile option is on import, NOT on export.
                    • 7. Re: Dumping table structure to text file.
                      ah right Thanks Karen McSwain

                      Joel P�rez
                      • 8. Re: Dumping table structure to text file.
                        Thank you for the replies. If from table space is managed by dictionary and target table space is managed locally then any issues ?

                        Anto Paul.