oracle10g empty table cannot be exported causes Project error-table or view does not exist

Source: Internet
Author: User
Tags aop jboss

This afternoon, export the data from the remote database and import it to the local database, and after the deployed project is connected to the local database, the following error is compiled after JBoss startup:


Severity: Exception sending context initialized event to listener instance of class Com.dicpsi.mis.contextListener.ContextListe Ner
Org.springframework.dao.InvalidDataAccessResourceUsageException:could not execute query; Nested exception is org.hibernate.exception.SQLGrammarException:could not execute query
caused by:org.hibernate.exception.SQLGrammarException:could not execute query
At Org.hibernate.exception.SQLStateConverter.convert (sqlstateconverter.java:67)
At Org.springframework.transaction.interceptor.TransactionInterceptor.invoke (transactioninterceptor.java:107)
At Org.springframework.aop.framework.ReflectiveMethodInvocation.proceed (reflectivemethodinvocation.java:161)
At Org.springframework.aop.framework.JdkDynamicAopProxy.invoke (jdkdynamicaopproxy.java:202)
At $Proxy 1.find (Unknown Source)
caused by:java.sql.sqlexception:ora-00942: The table or view does not exist.


Find reason: Through the error message table or try not to exist, I tried to use the above information to locate the related non-existent table, but I did not find these non-existent tables. Then I opened the remote database. This user's data table contrasts with the local data tables that I imported, and found that there are 8 fewer tables in the remote data database that have empty data in the table that imported the local database.


Workaround: Finally, I'm re-exporting the table with empty data stored in the remote data server by locating the relevant document with the following SQL statement.



--select fields that are empty
Select ' ALTER TABLE ' | | table_name| | ' Allocate extent (size 64k); ' from tabs t where isn't exists (select Segment_name from User_segments s where S.segment_name=t.table_name);

Indicate:

the new feature of oracle11g is that the number of data bars is 0 o'clock without assigning segment, so it cannot be exported. after executing the above SQL, all tables with empty stored data will be listed in the query content, and the following SQL statement will be generated and then copied and pasted to execute.


--Change the empty table to recognize when exporting the database
ALTER TABLE PBCATVLD allocate extent (size 64k);
ALTER TABLE PBCATTBL allocate extent (size 64k);
ALTER TABLE Pbcatcol allocate extent (size 64k);
ALTER TABLE Mis_wordbookmark allocate extent (size 64k);
ALTER TABLE Mis_chat_spare allocate extent (size 64k);
ALTER TABLE Mis_chart allocate extent (size 64k);
ALTER TABLE As_transresult_checkaccount allocate extent (size 64k);
ALTER TABLE As_transerrlog allocate extent (size 64k);
ALTER TABLE As_banktranscompare allocate extent (size 64k);
ALTER TABLE Ar_customerinfo allocate extent (size 64k);

Note: After the execution of the above SQL statement, the original storage data in the remote database is empty table will be exported, but the data is still empty.

To export a database statement:

EXP username/Password @ DB instance name File=/home/oracle/exp.dmp Log=/home/oracle/exp_smsrun.log

Example of exporting a database statement:

Exp Scpssts/[email protected] File = D:\ora\scpssts.dmp owner = scpssts log=d:\ora\scpssts.log

After the change, restart the JBoss compilation successfully.

oracle10g empty table cannot be exported causes Project error-table or view does not exist

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.