Re: Help deleting a database
Posted in 1999
Topics: Error Codes & Troubleshooting, Migration, Import/Export & Data Conversion
Hi,
I want to thank everyone that responded to my question. The reason I
couldn't delete the database was because there were already too many
records. When I spoke with our vendor they said that I needed to delete
some tables first etc....
Problem solved.
Thanks again,
-Keith
"Keith R. Kearnan" wrote:
> Hi,
>
> I'm a total Informix novice, I have been asked to move our production
> database to our test system. The dbexport went well from the production
> box but I can't dbimport it into our test box because of the following
> error:
>
> 330 - Cannot create database.
>
> 100 - ISAM error: duplicate value for a record with unique key.
>
> I have no clue how to remove the existing test database and the doc set
> is at my other office accross the city. I think the version of Informix
> is 5.08.
>
> -Thanks in advance
>
> -Keith Kearnan
> mailto:Keith_Kearnan@dfci.harvard.edu
If you cannot just drop the database, there is a rather neat trick I've
used in the past to perform table-by-table operations on a database (SE
7.2). Output the results of the following query (using the Output | New
File option under isql or dbaccess). Make sure you add a ".sql"
extension to the output file, for example, drop_tabs.sql:
SELECT "DROP TABLE " || tabname || ";"
FROM systables
WHERE tabtype = "T"; # just drop tables, not views
Choose the file you used for output (drop_tabs.sql) and delete
everything above the first DROP TABLE statement. Run the resulting
query, and you will wind up deleting every table in the databse. Please
not that you must log in as either the owner of the tables (assuming
they are all owned by the same user), or as DBA.
This solution may not be terribly pretty, but it should work just fine.
Oh, make sure you run this on the correct database! ;-)
Hope this helps.
Michael S. Milom
Query Master/Programmer
Ingram Periodicals, Inc.
michael.milom@ingramperiodicals.com
"Keith R. Kearnan" wrote:
>
> Hi,
>
> I want to thank everyone that responded to my question. The reason I
> couldn't delete the database was because there were already too many
> records. When I spoke with our vendor they said that I needed to delete
> some tables first etc....
>
> Problem solved.
>
> Thanks again,
>
> -Keith
>
> "Keith R. Kearnan" wrote:
>
> > Hi,
> >
> > I'm a total Informix novice, I have been asked to move our production
> > database to our test system. The dbexport went well from the production
> > box but I can't dbimport it into our test box because of the following
> > error:
> >
> > 330 - Cannot create database.
> >
> > 100 - ISAM error: duplicate value for a record with unique key.
> >
> > I have no clue how to remove the existing test database and the doc set
> > is at my other office accross the city. I think the version of Informix
> > is 5.08.
> >
> > -Thanks in advance
> >
> > -Keith Kearnan
> > mailto:Keith_Kearnan@dfci.harvard.edu