Querying Tables in Oracle DB12c

I have installed Oracle DB12 c.
I have created a common user with name starts with C##
I moved all table from  my old Oacle XE11g database to this new 12c user.
I have changed my working Java application connection parameter to new 12c DB from Oracle XE11g
I get following error
java.sql.SQLSyntaxErrorException: ORA-00942: table or view does not exist
  at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:450)
  at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:399)
  at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:1017)
Should I do something special in 12c?

Oracle is not SQL Server. You do not use the same style of temp tables, for a lot of reasons.
In Oracle, you create a Global Temporary Table and then your application simply uses it. Data is not visible to other sessions, and can be automatically cleaned after commit, or just at the end of session.
Suggest you look at Tom Kyte's book, at Apress.com, for a lot more hints about developing in Oracle - such as 'never do DDL (such as create temp tables) in a transaction if you want any performance and scalability', 'use bind variables for performance and scalability', 'commit only when the entire transaction is complete for performance and scalability'. There is a common thread in the book ...

Similar Messages

  • Query to find biggest table in oracle ERP database?

    Hi
    I would like to see the biggest table in Oracle ERP database, can anybody provide me the query?
    Thanks
    Ateeq

    Hi
    Thanks. Actually, last week all of a sudden 1GB growth of database happen in one day. In our Oracle ERP instance, every user is attaching many documents to purchase orders. So our management is interested to know which table or file system directory is having this much of growth? We want to restrict the users for not uploading every document with purchase order as it will fill-up our server hard disk soon.
    Regards
    Ateeq

  • Query DB2 tables from oracle using normal view

    This is with regard to querying db2 tables using oracle views. The view is created using dblink. The querying is not an one time activity.querying will be done once in a day. Can i use normal view (will it work ) or should i use materialised view. will i be able to view the added records in db2 table using normal view?
    thanks,
    vinodh

    Vinodh2 wrote:
    This is with regard to querying db2 tables using oracle views. The view is created using dblink. The querying is not an one time activity.querying will be done once in a day. Can i use normal view (will it work ) or should i use materialised view. will i be able to view the added records in db2 table using normal view?How can the SQL select statement via a dblink not work for a view, but the same SQL select statement work for a materialised view?
    Do you think the database link or remote database care whether the select SQL that hits it, comes from a PL/SQL procedure, a view, a materialised view, a job or whatever else? It has no idea what/who is behind that select SQL - and nor does it care.
    As for the benefits of a view vs. a materialised view - that depends on the requirements for needing to use that foreign database's data in the local database.

  • Querying SQL server table from Oracle database 11g

    Hi all
    We are using oracle database 11g R2 on REL 5 and i have an SQL server database used by one of our application.
    In my Oracle database, i want to query one table in my SQL server database and to link it in a table in Oracle database to compare data.
    Is there a way like database link or something else to do this need>
    Please send a link or pots here step by step the way on how to accomplish my query.
    Thank you.

    Yes, you can set up your SQL Server as an external database link, using Oracle Heterogeneous Services with SQL Server as an ODBC connection (easier to do if your Oracle server is a Windows server, a little more tricky if your Oracle server is *nix based)
    Here's the documentation... for 11gR2
    http://www.oracle.com/pls/db112/search?remark=quick_search&word=heterogeneous+services

  • Query off of Oracle using WinSql - Need help with query

    I am trying to query off of Oracle using program WinSql.
    I have a table(tticpr200110) that has the following sample data:
    ITEM     CODE     T$AMNT
    23500076 ACL     .0049
    23500076 APM     0
    23500076 APO     .0093
    23500076 EXP     .0001
    23500076 RES     .0072
    and what I want it to look like is:
    ITEM     ACL     APM     APO     EXP     RES
    23500076     0.0049     0     0.0093     0.0001     0.0072
    (actually I need the last 2 columns added together to be MATL-but can deal with that down the road).
    Seems simple enough, but I don't know to put into the columns.
    Any help would be GREATLY appreciated as soon as possible would be even better.

    My table - tticpr200110 when it runs I get the following sample data for part number 23500076:
    The first coloumn ITEM is the part number.
    The second column CODE is 1 of 5 different cost codes
    The third column is the cost for that code for that part.
    ITEM CODE AMNT
    23500076 ACL 0.0049
    23500076 APM 0.0000
    23500076 APO 0.0093
    23500076 EXP 0.0001
    23500076 RES 0.0072
    I want to make a query that makes the data look like this:
    ITEM ACL APM APO EXP RES
    23500076 0.0049 0.0000 0.0093 0.0001 0.0072
    (similar to a pivot table in excel or acess)
    I hope this helps better.
    Thanks!

  • Retrieve data from a large table from ORACLE 10g

    I am working with a Microsoft Visual Studio Project that requires to retrieve data from a large table from Oracle 10g database and export the data into the hard drive.
    The problem here is that I am not able to connect to the database directly because of license issue but I can use a third party API to retrieve data from the database. This API has sufficient previllege/license permission on to the database to perform retrieval of data. So, I am not able to use DTS/SSIS or other tool to import data from the database directly connecting to it.
    Here my approach is...first retrieve the data using the API into a .net DataTable and then dump the records from it into the hard drive in a specific format (might be in Excel file/ another SQL server database).
    When I try to retrieve the data from a large table having over 13 lacs records (3-4 GB) in a data table using the visual studio project, I get an Out of memory exception.
    But is there any better way to retrieve the records chunk by chunk and do the export without loosing the state of the data in the table?
    Any help on this problem will be highly appriciated.
    Thanks in advance...
    -Jahedur Rahman
    Edited by: Jahedur on May 16, 2010 11:42 PM

    Girish...Thanks for your reply...But I am sorry for the confusions. Let me explain that...
    1."export the data into another media into the hard drive."
    What does it mean by this line i.e. another media into hard drive???
    ANS: Sorry...I just want to write the data in a file or in a table in SQL server database.
    2."I am not able to connect to the database directly because of license issue"
    huh?? I never heard this question that a user is not able to connect the db because of license. What error / message you are getting?
    ANS: My company uses a 3rd party application that uses ORACLE 10g. And my compnay is licensed to use the 3rd party application (APP+Database is a package) and did not purchased ORACLE license to use directly. So I will not connect to the database directly.
    3.I am not sure which API is you are talking about, but i am running an application of the visual studio data grid or similar kind of controls; in which i can select (select query) as many rows as i needed; no issue.
    ANS: This API is provided by the 3rd party application vendor. I can pass a query to it and it returns a datatable.
    4."better way to retrieve the records chunk by chunk and do the export without loosing the state of the data in the table?"
    ANS: As I get a system error (out of memory) when I select all rows in a datatable at a time, I wanted to retrieve the data in multiple phases.
    E.g: 1 to 20,000 records in 1st phase
    20,001 to 40,000 records in 2nd phase
    40,001 to ...... records in 3nd phase
    and so on...
    Please let me know if this does not clarify your confusions... :)
    Thanks...
    -Jahedur Rahman
    Edited by: user13114507 on May 12, 2010 11:28 PM

  • Unable to retrieve data from a nested table in Oracle 8i from JSP

    How do i retrieve data from a nested table in Oracle 8i from my JSP code?
    When i try to execute the query , a general error is thrown.
    Kindly advice as soon as possible.

    How do i retrieve data from a nested table in Oracle 8i from my JSP code?
    When i try to execute the query , a general error is thrown.
    Kindly advice as soon as possible.

  • Dbms_sql  in a different schema from query table-error  ** ORA-00942

    Oracle Experts,
    I think I am having problems with using DBMS_SQL in which the function was created in one schema and the query table was created in a different schema.
    We have 2 schemas: S1, S2
    We have 2 tables:
    T1 in Schema S1
    T2 in Schema S2
    We have a function F1 created by DBA in schema S1 that uses the dbms_sql as:
    CREATE OR REPLACE FUNCTION S1.F1(v1 in VARCHAR2) return NUMBER IS
    cursor1 INTEGER;
    BEGIN
    cursor1 := dbms_sql.open_cursor;
    dbms_sql.parse(cursor1, v1, dbms_sql.NATIVE);
    dbms_sql.close_cursor(cursor1);
    return (0);
    EXCEPTION
    when others then
    dbms_sql.close_cursor(cursor1);
    return (1) ;
    END;
    I am using jdeveloper 11G. We have an Oracle DB 11g.
    We have a java program which uses jdbc to talk to our Oracle DB.
    Basically, in my java program, I call function F1 to check if the query is valid.
    If it is, it returns 0. Otherwise, returns 1:
    oracle.jdbc.OracleCallableStatement cstmt = (oracle.jdbc.OracleCallableStatement) connection.prepareCall ("begin ? := S1.F1 (?); end;");
    cstmt.registerOutParameter (1, java.sql.Types.INTEGER);
    cstmt.setString(2, "Select * from S2.T2");
    cstmt.execute ();
    Since the table that I run the query is T2, created in different schema than F1 was created in, I have the error:
    ** ORA-00942: table or view does not exist
    So my questions are these:
    - I am using Oracle DB 11g, if I run the query on a table that created in a different schema from the one that the function (which uses dbms_sql) was created in, I would get the error ORA-00942?
    - If I runs the query on table T1 in the same schema as the function F1, would I have the same problem(The reason I ask is I cannot create any table in schema S1 because the DBA has to do it; I am not a DBA)
    - This is not a problem, but a security feature because of SQL injection?
    - How to resolve this issue other than creating the table in the same schema as the function that utilizes DBMS_SQL?
    Regards,
    Binh

    Definer rights (default) stored objects run under owner's security domain and ignore role based privileges. So regardless what user you are logged in as, function S1.F1 always executes as user S1 and ignores user S1 roles. Therefore exeuting statement within S1.F1:
    Select * from S2.T2requires user S1 to have SELECT privilege on S2.T2 granted to S1 directly, not via role.
    SY.

  • How to find out when data was deleted from table in oracle and Who deleted that

    HI Experts,
    Help me for below query:
    how to find out when data was deleted from table in oracle and Who deleted that ?
    I did that to fidn out some data from dba_tab_modifications, but I m not sure that what timestamp shows, wether it shows for update,insert or delete time ?
    SQL> select TABLE_OWNER,TABLE_NAME,INSERTS,UPDATES,DELETES,TIMESTAMP,DROP_SEGMENTS,TRUNCATED from dba_tab_modifications where TABLE_NAME='F9001';
    TABLE_OWNER                    TABLE_NAME                        INSERTS    UPDATES    DELETES     TIMESTAMP         DROP_SEGMENTS TRU
    PRODCTL                        F9001                                                     1683         46       2171            11-12-13 18:23:39             0                   NO
    Audit is enable in my enviroment?
    customer is facing the issue and data missing in the table and I told him that yes there is a delete at 11-12-13 18:23:39 in table after seeing the DELETS column and timestamp in dba_tab_modifications, but not sure I am right or not
    SQL> show parameter audit
    NAME                                 TYPE        VALUE
    audit_file_dest                      string      /oracle/admin/pbowe/adump
    audit_sys_operations                 boolean     TRUE
    audit_syslog_level                   string
    audit_trail                          string      DB, EXTENDED
    please help
    Thanks
    Sam

    LOGMiner --> Using LogMiner to Analyze Redo Log Files
    AUDIT --> Configuring and Administering Auditing

  • How to create table in Oracle 9i of name USER

    To whom so ever forum member,
    Please help me for creating table in Oracle 9i with the table name USER, though i know that it's reserve word for the Oracle DB
    Please give me the query if any for the same.
    Thanks in advance for timely help.
    Kiran.

    CREATE USER user-name IDENTIFY BY password
    user-name
    The name of the user to be created. The name is an identifier with a maximum of 30 characters. Note that if support for delimited identifiers is on and the user name begins with an underscore, you must place the user name in quotation marks.
    various identifiers possible
    simple-identifier ::= identifier-start { identifier-part }
    identifier-start ::= letter | % | _
    identifier-part ::= letter | number | _ | @ | # | $
    delimited-identifier ::= " delimited-identifier-part { delimited-identifier-part } "
    delimited-identifier-part ::= non-double-quote-character | double-quote-symbol
    double-quote-symbol ::= ""
    An identifier cannot be a SQL reserved word.
    An identifier may be either a simple identifier or a delimited identifier.
    password
    The password of the user to be created.
    the reserved words are:
    %AFTERHAVING | %ALPHAUP | %ALTER | %ALTER_USER | %BEGTRANS |
    %CHECKPRIV | %CREATE_ROLE | %CREATE_USER | %DBUGFULL |
    %DELDATA | %DESCRIPTION | %DROP_ANY_ROLE | %DROP_USER |
    %EXACT | %EXTERNAL | %FILE | %FOREACH | %FULL |
    %GRANT_ANY_PRIVILEGE | %GRANT_ANY_ROLE | %INORDER |
    %INTERNAL | %INTEXT | %INTRANS | %INTRANSACTION | %MCODE |
    %NOCHECK | %NODELDATA | %NOINDEX | %NOLOCK | %NOTRIGGER |
    %NUMROWS | %ODBCOUT | %ROUTINE | %ROWCOUNT | %STARTSWITH |
    %STRING | %THRESHOLD | %UPPER |
    ABSOLUTE | ACTION | ADD | ALL | ALLOCATE | ALTER | AND |
    ANY | ARE | AS | ASC | ASSERTION | AT | AUTHORIZATION | AVG |
    BEGIN | BETWEEN | BIT | BIT_LENGTH | BOTH | BY | CASCADE |
    CASE | CAST | CATALOG | CHAR | CHARACTER | CHARACTER_LENGTH |
    CHAR_LENGTH | CHECK | CLOSE | COALESCE | COBOL | COLLATE |
    COLLATION | COLUMN | COMMIT | CONNECT | CONNECTION |
    CONSTRAINT | CONSTRAINTS | CONTINUE | CONVERT |
    CORRESPONDING | COUNT | CREATE | CROSS | CURRENT |
    CURRENT_DATE | CURRENT_TIME | CURRENT_TIMESTAMP |
    CURRENT_USER | CURSOR | DATE | DAY | DEALLOCATE | DEC |
    DECIMAL | DECLARE | DEFAULT | DEFERRABLE | DEFERRED |
    DELETE | DESC | DESCRIBE | DESCRIPTOR | DIAGNOSTICS |
    DISCONNECT | DISTINCT | DOMAIN | DOUBLE | DROP | ELSE |
    END | ENDEXEC | ESCAPE | EXCEPT | EXCEPTION | EXEC |
    EXECUTE | EXISTS | EXTERNAL | EXTRACT | FALSE | FETCH |
    FILE | FIRST | FLOAT | FOR | FOREIGN | FORTRAN | FOUND |
    FROM | FULL | GET | GLOBAL | GO | GOTO | GRANT | GROUP |
    HAVING | HOUR | IDENTITY | IMMEDIATE | IN | INDICATOR |
    INITIALLY | INNER | INPUT | INSENSITIVE | INSERT | INT |
    INTEGER | INTERSECT | INTERVAL | INTO | IS | ISOLATION |
    JOIN | KEY | LANGUAGE | LAST | LEADING | LEFT | LEVEL |
    LIKE | LOCAL | LOWER | MATCH | MAX | MIN | MINUTE |
    MODULE | MONTH | NAMES | NATIONAL | NATURAL | NCHAR |
    NEXT | NO | NOT | NULL | NULLIF | NUMERIC | OCTET_LENGTH |
    OF | ON | ONLY | OPEN | OPTION | OR | ORDER | OUTER |
    OUTPUT | OVERLAPS | PAD | PARTIAL | PASCAL | PLI |
    POSITION | PRECISION | PREPARE | PRESERVE | PRIMARY |
    PRIOR | PRIVILEGES | PROCEDURE | PUBLIC | READ | REAL |
    REFERENCES | RELATIVE | RESTRICT | REVOKE | RIGHT | ROLE |
    ROLLBACK | ROWS | SCHEMA | SCROLL | SECOND | SECTION |
    SELECT | SESSION_USER | SET | SIZE | SMALLINT | SOME |
    SPACE | SQL | SQLCODE | SQLERROR | SQLSTATE | SUBSTRING |
    SUM | SYSTEM_USER | TABLE | TEMPORARY | THEN | TIME |
    TIMESTAMP | TIMEZONE_HOUR | TIMEZONE_MINUTE | TO |
    TRAILING | TRANSACTION | TRANSLATE | TRANSLATION | TRIM |
    TRUE | UNION | UNIQUE | UNKNOWN | UPDATE | UPPER | USAGE |
    <br>
    USER |
    <br>
    USING | VALUE | VALUES | VARCHAR | VARYING | VIEW |
    WHEN | WHENEVER | WHERE | WITH | WORK | WRITE | YEAR |
    ZONE
    hope it helps ...
    roli

  • Query based on Oracle and MS Access connections

    I hope this is in the correct spot.
    I am using Oracle SQL Developer to extract data from some Read Only tables in Oracle.
    What I would like to do it have a list of numbers in a MS Access database to select the same number from Oracle tables, then export the data out to Access or Excel. There may be several thousand numbers at a time.
    I asked if they would give me one table with one column in Oracle I could read/write to but the answer was no.
    I have my connection strings working to both the Oracle tables and to the Access database but i can not figure out how to build a query using both tables.
    If I build a query to the Access table can I use that query somehow in the query of the Oracle table?
    Thanks
    Steve

    Not real sure if this is doable or would help, but perhaps you can load the access table into an Oracle Global Temporary Table? See http://www.oracle-base.com/articles/8i/TemporaryTables.php (and google on it). I think I'm assuming your 11 hour query had something to do with shovelling a bucketload of data to the access side, perhaps if you could show us the plan on the Oracle side that access was generating to get the Oracle data there might be a different answer.
    Oftentimes cross-db tools won't use Oracle features like analytics, or do slow-by-slow row processing where a short procedure could do things within the Oracle sql engine and return data in larger arrays.
    Sometimes mass data cleansings benefit from using server side tools outside of the db. Do you have the data from before it was loaded to Oracle? What Oracle platform are you on?

  • Best way to import data to multiple tables in oracle d.b from sql server

    HI All am newbie to Oracle,
    What is the Best way to import data to multiple tables in Oracle Data base from sql server?
    1)linked server?
    2)ssis ?
    If possible share me the query to done this task using Linked server?
    Regards,
    KoteRavindra.

    check:
    http://www.mssqltips.com/sqlservertip/2011/export-sql-server-data-to-oracle-using-ssis/
          koteravindra     
    Handle:      koteravindra 
    Status Level:      Newbie
    Registered:      Jan 9, 2013
    Total Posts:      4
    Total Questions:      3 (3 unresolved)
    why so many unresolved questions? Remember to close your threads marking them as answered.

  • How to access remote tables on Oracle from Access fron end?

    Note: Access application and access tables are in separate .mdb files.
    I've successfully migrated my Access 2000 tables to Oracle. And there were no errors during the migration. The two original Access tables were renames to tblBOMdetail_L and tblPartInfo_L and two new linked tables were created with the _R name. Mapping queries were created for tblBOMdetail and tblPartInfo.
    However, when I launch my Access application, I get the following error: "The Microsoft Jet database engine cannot find the input table or query 'tblPartInfo'. Make sure that it exists and that its name is spelled correctly."
    Is there something more that I have to do to enable this connection. I already have the necessary ODBC connection set up.
    Thanks.

    Hi ,
    The first thing you need to verify is that you can view the data in the tables with _R appended to their name. This will verify whether the ODBC link is set up correctly and pointing at the correct Oracle table in the Oracle database.
    Another point. Are you still using 2 .mdb files? If so since your data is now in Oracle it may be prudent to use only one .mdb.
    If you need more help then please contact [email protected]
    John

  • Sub-query problem on Oracle 10g

    The following query works on Oracle 10.2.0.1.0 on windows,but doesn't work on Oracle 10.2.0.2.0 on Linux.
    Error report: SQL Error: ORA-00904: "T"."AUDIT_USECS": invalid identifier 00904. 00000 - "%s: invalid identifier"
    It works after i remove the sub-query. I found that if use fields of T in sub-query,then error occurs. Is it saying that sub-query can't access the fields in main query?
    What's the problem?
    Is there any grammar erros?If so,what's the right likes?
    Thanks!
    CREATE TABLE AUDITHISTORY(
    CASENUM numeric(20, 0) NOT NULL,
    AUDIT_DATE date NOT NULL,
    USER_NAME varchar(255) NULL,
    AUDIT_USECS numeric(6, 0) NOT NULL,
    TYPE_ID INT NOT NULL )
    Query:
    SELECT T.CASENUM,
    T.USER_NAME,
    T.AUDIT_DATE AS STARTED,
    (SELECT *
    FROM (SELECT S.AUDIT_DATE
    FROM AUDITHISTORY S
    WHERE S.CASENUM=T.CASENUM AND TYPE_ID=2
    AND S.USER_NAME=T.USER_NAME
    AND (S.AUDIT_DATE > T.AUDIT_DATE OR (S.AUDIT_DATE = T.AUDIT_DATE AND S.AUDIT_USECS > T.AUDIT_USECS))
    ORDER BY S.AUDIT_DATE ASC,S.AUDIT_USECS ASC
    ) WHERE rownum <= 1) AS ENDED
    FROM AUDITHISTORY T WHERE TYPE_ID=1
    BANNER
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Prod PL/SQL Release 10.2.0.1.0 - Production
    CORE 10.2.0.1.0 Production
    TNS for 32-bit Windows: Version 10.2.0.1.0 - Production
    NLSRTL Version 10.2.0.1.0 - Production
    BANNER
    Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - Prod PL/SQL Release 10.2.0.2.0 - Production
    CORE 10.2.0.2.0 Production
    TNS for Linux: Version 10.2.0.2.0 - Production
    NLSRTL Version 10.2.0.2.0 - Production

    Try this way:
    SQL> select * from AUDITHISTORY;
       CASENUM AUDIT_DAT USER_NAME            AUDIT_USECS    TYPE_ID
            10 12-MAR-10 USER                         100          1
            10 14-MAR-10 USER                         100          2
            10 16-MAR-10 USER                         100          2
    SQL> SELECT T.CASENUM,
      2  T.USER_NAME,
      3  T.AUDIT_DATE AS STARTED,
      4  (SELECT max(S.AUDIT_DATE) keep (dense_rank first order by S.AUDIT_DATE ASC,S.AUDIT_USECS ASC)
      5   from AUDITHISTORY S  WHERE S.CASENUM=T.CASENUM AND TYPE_ID=2
      6  AND S.USER_NAME=T.USER_NAME
      7  AND (S.AUDIT_DATE > T.AUDIT_DATE OR
      8       (S.AUDIT_DATE = T.AUDIT_DATE AND S.AUDIT_USECS > T.AUDIT_USECS))
      9  ) as ended
    10  FROM AUDITHISTORY T WHERE TYPE_ID=1;
       CASENUM USER_NAME            STARTED   ENDED
            10 USER                 12-MAR-10 14-MAR-10Max
    http://oracleitalia.wordpress.com

  • How to overwrite a log and bad file in external table in oracle 10g

    Hi,
    I have used external table in oracle 10g.whenever use select query in external table orace internally create one log file in specified directory,
    but this log file is growing.How can i overwrite the log file(old to replace with new).I need overwrite a log and bad file in external table.
    kindly give the solutions.
    By
    Siva

    I don't believe that is possible with the LOGFILE clause, but it may be with the BADFILE clause. Here is an excerpt from the documentation :
    The LOGFILE clause names the file that contains messages generated by the external tables utility while it was accessing data in the datafile. If a log file already exists by the same name, the access driver reopens that log file and appends new log information to the end. This is different from bad files and discard files, which overwrite any existing file. NOLOGFILE is used to prevent creation of a log file.
    If you specify LOGFILE, you must specify a filename or you will receive an error.
    If neither LOGFILE nor NOLOGFILE is specified, the default is to create a log file. The name of the file will be the table name followed by _%p and it will have an extension of .log.

Maybe you are looking for