Oracle database import, running Project report: ORA-00942 table or view does not exist

Source: Internet
Author: User
Tags sql error oracle database

Now do a project that was previously connected to someone else's machine data, and then I'm going to import the data into the local database and run the error, as follows:
Hibernate:select sum (rdb_alert_0_. Event_count) as col_0_0_ from Eapsoft. New_topices rdb_alert_0_
-SQL error:942, sqlstate:42000
-ORA-00942: Table or view does not exist

It is also an error to run the SQL statement in the Plsql develop, "Eapsoft" in the above statement. Delete, the operation is successful;

The analysis of SQL statements in Oracle reveals that:
1). Select SUM (rdb_alert_0_. Event_count) as col_0_0_ from Eapsoft. New_topices rdb_alert_0_
This statement queries the user "Eapsoft" has the data, the prefix represents a user, and in my local, I did not create the name "Eapsoft" user, of course, it does not have the relevant data, so it query failed.

2. Why would hibernate add the "Eapsoft" prefix to this statement?
Analysis found: In the file named NEWTOPICES.hbm.xml, there are the following statements:
<class name= "newtopices" table= "New_topices" lazy= "false" Schema= "Eapsoft" >

..............

</class>
The writer of the file adds the attribute schema= "Eapsoft" in the <class> to a user that it represents in Oracle;

3. This concludes the problem, and the main problem is the use of Hibernate and Oracle in conjunction with the schema attribute.

Delete the schema= "Eapsoft" or change it to your current user.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.