A DBA question

Hi,
This is a database question.
I am using JDeveloper 10.1.3.4 and got an error when entering a WHERE clause in the definition of a view object:
SQL Query Error Message: ORA-00904: "LDAPUID": invalid identifierI figure the cause of this problem lies in the database tables because I can connect to the database schema from the Connection Navigator, and can see the table descriptions of all the three tables in the Structure tab, but can not see any rows in any of the three tables on the Data tab. (I can query the tables and get expected returns in sqlplus, though).
I have three tables in the schema, with foreign key constraints. When inserting rows into the empty tables, I use saved scripts that contain the INSERT command lines, such as
INSERT INTO BILL VALUES ('LDAP_UID', 'FIRST_NAME', 'LAST_NAME', ....);The saved scripts contain up to more than 20,000 lines. When these scripts are run (such as SQL> @fill_bill.sql), in addition to the "1 row created" lines, I also saw long lines flashing by on the screen. These must be some error messages. But they flashed by too fast I could not catch any of them.
Is there any way to capture the messages in a log file so I can examine them afterwards. Or somehow have the execution of the sql script halted automatically upon encountering a culprit INSERT statement in the script so that I can see which line has what problem?
Thanks a lot!
Newman

Hi, Shay:
The column name in the table is LDAP_UID. In the entity object the name of the attribute for the column is LdapUid. The WHERE clause I used is: LdapUid=lower(:TheCurrentUser). I clicked Test button to test the WHERE clause. When the error pops up, I clicked the Help button and the explanation is:
View Object SQL Query Statement
    This area displays the view object SQL, to the line where the error occurred. For view objects,
    this is the view object's query. For view links, it is the destination view object's query, as
    modified by the view link's WHERE clause. In either case, null is passed in for all parameters
    (such as WHERE clause parameters in a view object or source attributes in a view link). This explanation made me think that the test query did not receive any return.
Again, is there a way to capture the errors in a log file when executing the sql INSERT statements?
Thanks!
Newman

Similar Messages

  • DBA Question - User stats

    Greetings,
    So I am sitting at my desk when PHB (that's Pointy Haired Boss for the non-Dilbert people out there) comes in and asks - "so is anyone really using that database they told us to set up?"
    "Uhh, gee, I don't know. I haven't gotten any phone calls..."
    So, I pull out the books, only to discover that I have no clue how to ask the database for historical informatio like is anyone actually using the database.
    So, can anyone help me out - what tables store that sort of information - such as logins, number of requests etc? Anyone have a quick SQL script that will pull that sort of information. I am not interested in the "database" just the user tables.
    Thanks,
    DAVID
    David A. Lane, CNE
    Technical Director
    [email protected]
    "DBA? I can spell Oracle..."

    For table access and logins, you can enable auditing. To activate auditing at the database level, you need to set the AUDIT_TRAIL init.ora parameter (set it to DB). This allows the database to audit. Then you need to turn on auditing for the objects you want to audit (logins included). Be carefull, auditing has overhead associated with it. Audit the smallest amount to achieve your goals.
    As far as activity is concerned. Oracle does not generate historical information about activity. It does have a cumulative table, V$SYSSTAT, which stores some usefull information. You can query this table to get some of your information. You may want to query V$SESSION periodically and store the output in a file. You can see how much activity is occuring, say, every 30 minutes.
    e.g. Select count(*)
    From v$session
    where status = 'ACTIVE';
    This may help some.
    -Jim Wartnick
    [email protected]

  • Urgent! DBA question

    Hello,
    I just upgraded our database from Oracle8i to 9i (903 and applied patch 9034) on Solaris (2.8). I am getting ORA-07445 error in alert log quite often. Here is the typical error:
    Sun Jan 4 20:19:12 2004
    Errors in file /u01/app/oracle/admin/terawatt9/udump/terawatt_ora_12709.trc:
    ORA-07445: exception encountered: core dump [0000000101D471A8] [SIGBUS] [Object
    specific hardware error] [0xFFFFFFFF7CD1AEE0] [] []
    I had not applied the latest Solaris 8 patches recommended by the manual before upgrading to 9i. But now I got the latest patchs applied to the OS. Could this be the cause for errors? Can anything be done to fix it without a need for reinstallation of 9i software? This is a production database and I can't get another large downtime.
    Another problem we are having is, oracle processes are growing in large numbers. We are using dedicated server and Oracle 9iAS server (Servlets) is opening a large number of connection instead of reusing the old ones. Is there a database configuration parameter that I can set to kill the old unused sessions after 5 minutes or so? For now I want to fix this on database side. Later I will fix the application.
    Any help is greatly appreciated.
    Thanks!

    Hi,
    here is some material for u from Oracleadvice.com.
    Thanks to Oracleadvice.com.
    Regards
    Padmanaban
    BUGBUSTER - V$SQL_PLAN causes ORA-07445
    Affects Versions: 9.2.0.1.0, 9.2.0.2.0, 9.2.0.3.0
    Fixed in: 9.2.0.4.0
    BUG# (if recognised) 2754611, 2451928, 2791172
    This info. correct on: 18-SEP-2003
    Symptoms
    Using a WHERE clause on queries against the V$SQL_PLAN table causes sessions to disconnect.
    SQL> select * from v$sql_plan where address='000000038DAEB370';
    select * from v$sql_plan where address='000000038DAEB370'
    ERROR at line 1:
    ORA-03113: end-of-file on communication channel
    A glance in the alert.log shows an ORA-07445 error and a trace file left in user_dump_dest. Here is an extract from the trace file:
    *** 2003-09-16 11:35:57.019
    *** SESSION ID:(25.3760) 2003-09-16 11:35:57.010
    Exception signal: 11 (SIGSEGV), code: 1 (Address not mapped to object), addr: 0x1f8, PC: [0x101648efc, 0000000101648EFC]
    *** 2003-09-16 11:35:57.024
    ksedmp: internal or fatal error
    ORA-07445: exception encountered: core dump [0000000101648EFC] [SIGSEGV] [Address not mapped to object] [0x0000001F8] [] []
    Current SQL statement for this session:
    select * from v$sql_plan where address='000000038DAEB370'
    Workaround
    You can workaround this problem by creating a view based on the V$SQL_PLAN table and excluding the FILTER_PREDICATES column which is a VARCHAR2(4000). Cut and paste the code provided here and use the view MY$SQL_PLAN in place of V$SQL_PLAN.
    create or replace view MY$SQL_PLAN as
    as
    select
    kqlfxpl_phad ADDRESS,
    kqlfxpl_hash HASH_VALUE,
    kqlfxpl_chno CHILD_NUMBER,
    substr(kqlfxpl_oper, 1, 30) OPERATION,
    substr(kqlfxpl_oopt, 1, 30) OPTIONS,
    substr(kqlfxpl_tqid, 1, 10) OBJECT_NODE,
    to_number(decode(kqlfxpl_objn, 0 , NULL, kqlfxpl_objn)) OBJECT#,
    case when kqlfxpl_objname is not null
    then 'SYS'
    else u.name
    end OBJECT_OWNER,
    nvl(p.kqlfxpl_objname, o.name) OBJECT_NAME,
    substr(kqlfxpl_opti, 1, 20) OPTIMIZER,
    kqlfxpl_opid ID,
    to_number(decode(kqlfxpl_opid, 0, NULL, kqlfxpl_paid)) PARENT_ID,
    kqlfxpl_depth DEPTH,
    kqlfxpl_pos POSITION,
    kqlfxpl_scols SEARCH_COLUMNS,
    to_number(decode(kqlfxpl_cost, 0, NULL, kqlfxpl_cost)) COST,
    to_number(decode(kqlfxpl_card, 0, NULL, kqlfxpl_card)) CARDINALITY,
    to_number(decode(kqlfxpl_size, 0, NULL, kqlfxpl_size)) BYTES,
    substr(kqlfxpl_otag, 1, 35) OTHER_TAG,
    substr(kqlfxpl_psta, 1, 5) PARTITION_START,
    substr(kqlfxpl_psto, 1, 5) PARTITION_STOP,
    to_number(decode(kqlfxpl_pnid, 0, NULL, kqlfxpl_pnid)) PARTITION_ID,
    kqlfxpl_other OTHER,
    substr(kqlfxpl_dist, 1, 20) DISTRIBUTION,
    to_number(decode(kqlfxpl_cpuc, 0, NULL, kqlfxpl_cpuc)) CPU_COST,
    to_number(decode(kqlfxpl_ioct, 0, NULL, kqlfxpl_ioct)) IO_COST,
    to_number(decode(kqlfxpl_temp, 0, NULL, kqlfxpl_temp)) TEMP_SPACE,
    kqlfxpl_keys ACCESS_PREDICATES,
    'FILTER PREDICATES UNAVAILABLE DUE TO BUG' FILTER_PREDICATES
    from
    x$kqlfxpl p, obj$ o , user$ u
    where
    p.kqlfxpl_hadd != p.kqlfxpl_phad
    and p.kqlfxpl_objn = o.obj#(+)
    and o.owner# = u.user#(+);

  • DBA question

    I have oracle database on linux.I also have another oracle database in another city.
    I export everything from my database and import to my remote database.
    What I want to know is, is it possible to add redolods or archive logs from my current database to my remote database everyday, so that both have same data.

    You may want to configure a Data Guard environment, please check Oracle® Data Guard Concepts and Administration
    10g Release 2 (10.2)
    Part Number B14239-04
    ~ Madrid

  • DBA Question User Deletion

    If I delete a User from the Database, will it also delete (Automatically) all the Tables, Views, etc associated with the user?
    If it does not delete the tables, etc what would be the best tool to use such that I get rid of all the objects under the User.
    FYI, I am using Oracle 8.1.7

    If I delete a User from the Database, will it also delete (Automatically) all the Tables, Views, etc associated with the user?Yes it will but you need use "cascade" clause.
    So command should look:
    drop user <username> cascade;

  • DBA question: "sticky" statistic?

    Hi,
    what is it a "sticky" statistic? In DBACOCKPIT I see several message as:
    Column SETNAME is sticky on histogram steps, partial hashing
    What can I do to solve it?
    PS: of course, Number of Tables with Incomplete Index Statistics = 0
    Thank you.

    Careful.   The concept of "stickiness" is not necessarily a problem that needs solved.   What "sticky" means from index statistics is that certain statistics attributes are retained vs. the defaults when update statistics is run without any attribute values specified.    For example, 'histogram steps' - not sure what your values are - but let's say they are 100 (a good value for SAP applications) for a table such as COVP.   If I then run:
    update index statistics "SAPSR3"."COVP"
    I retain the 100 value for histogram steps even though the default for the server likely is 20.   However, if you remove the stickiness, then run the above command, you will reset the number of histogram steps to 20 - which could lead to query issues with large IN() clauses, etc.   Another way to reset/override the value is to do something like:
    update index statistics "SAPSR3"."COVP" using 50 values
    ....which then sets the 'histogram steps' for all column histograms to use 50 values instead of the previous 100 (or whatever).
    Point I am making is that you would not normally remove 'stickiness' from index statistics unless you have a VERY good reason and you fully understand what it is that you are changing and how it will impact query optimization.

  • Dba....

    Can you help me answer a dba question. I want to know if the system tablespace should be dictionary or locally managed. And also if which tablespaces should be locally managed such as Rollback segment or Temp tablespaces.
    Furthermore, I want to know if it is necessary to manage extents in the system tablespace.

    Hi
    To display the current "configuration" you can use the following statement:
    SELECT tablespace_name, extent_management, allocation_type FROM dba_tablespaces
    If possible use only locally managed tablespaces. This is very important for RBS and TEMP. Notice that only with 9iR2 is possible to have a locally managed system tablespace.
    Usually no extent management is performed on the system tablespace.
    Chris

  • Using a variable in a view?

    I know that it may not be possible to use a variable within a view, but I'm wondering if there isn't a work-around? If there is a single value---pulled from another table---you wish to reuse in a view that does not use dynamic SQL, how do you do so? I've been toying around with WITH statements, but that's getting me nowhere. I'm using 11r2.
    BTW, please do not ask me the standard litany of angry-dba questions (why are you doing this? your database is f*****, RTFM, etc.), this is just for my own curiosity. :)
    Thank you
    Example for demo purposes only (I know it's not syntactically correct):
    variable var_value varchar2(30)
    begin
    select this_is_just_one_value
    int :var_value
    from tableX where column1 = 'BOB';
    end;
    select
    numerous_columns
    from tableY
    where
    column5 = :var_value;

    893968 wrote:
    BTW, please do not ask me the standard litany of angry-dba questions (why are you doing this? your database is f*****, RTFM, etc.), this is just for my own curiosity. :)Why are you doing this? your database is f*****! RTFM! Etc!! ;-)
    SQL is not a procedural language - so you cannot create a view for example that has a parameter signature. E.g. this is possible in a procedural language:
    declare
            cursor c( deptID number ) is
                    select * from emp where deptno = deptID;
    begin
            open c( 1234 ); --// open SQL cursor using a parameter/variable
            --// etc..
            close c;
    end;This is not possible using a SQL object like a view. As a view is not a procedure. So the same approach as the above using SQL (silly example, but do demonstrates the basics):
    // define
    create or replace view emp_view as select * from emp;
    // use
    select * from emp_view where deptno = 1234;The CBO is clever - and it will likely push such a predicate into the emp_view SQL statement.
    To parameterise such a view, is ugly. And should only be considered when dealing with issues such as security and data restrictions. A context is created - this can contain a number of name-values. The view can then use a name-value from the context. Oracle's data dictionary views use this approach.

  • Using a TSA in own signature handler

    Good day,
    Can someone help me with the steps involve in creating using a TSA inside a custom signature handler api?
    When I set the TSA as my default time server as sign my signature field with the normal Adobe Default handler, it uses the TSA and the signature properties reflects this. I wnat to know how I can use a TSA with my custom handler. I sign signature fields using the PROP_PSENG_SignFormatPKCS7DetachedDigest. How can I include a TSA? I've tried adding a TimeStamp dictionary to my SV dictionary of the signature field, but it does not seem to have any affect on the signature...
    Any help would be greatly appreciated.
    Regards,
    Magda

    893968 wrote:
    BTW, please do not ask me the standard litany of angry-dba questions (why are you doing this? your database is f*****, RTFM, etc.), this is just for my own curiosity. :)Why are you doing this? your database is f*****! RTFM! Etc!! ;-)
    SQL is not a procedural language - so you cannot create a view for example that has a parameter signature. E.g. this is possible in a procedural language:
    declare
            cursor c( deptID number ) is
                    select * from emp where deptno = deptID;
    begin
            open c( 1234 ); --// open SQL cursor using a parameter/variable
            --// etc..
            close c;
    end;This is not possible using a SQL object like a view. As a view is not a procedure. So the same approach as the above using SQL (silly example, but do demonstrates the basics):
    // define
    create or replace view emp_view as select * from emp;
    // use
    select * from emp_view where deptno = 1234;The CBO is clever - and it will likely push such a predicate into the emp_view SQL statement.
    To parameterise such a view, is ugly. And should only be considered when dealing with issues such as security and data restrictions. A context is created - this can contain a number of name-values. The view can then use a name-value from the context. Oracle's data dictionary views use this approach.

  • Create New user with ...

    Hi all
    I need to create new user with the following privileges :
    1- access any table data (read only)
    2- access the tables structure (read only)
    3- access the tables relations (read only)
    thanx in advance

    Hi,
    giggs11 wrote:
    I did the following :
    create user youruser identified by yourpassword;
    grant connect to youruser;
    grant SELECT_CATALOG_ROLE to username;
    but I cann't see my tables
    there is no erroExample :-
    Step 1:-
    sql> Conn system/manager@orcl;
    connected.
    step 2:-
    SQL> create user trial identified by trial;
    User created.
    Step 3:-
    SQL> grant connect to trial;
    Grant succeeded.
    SQL>grant SELECT_CATALOG_ROLE to trial;
    Grant succeeded.
    SQL> grant select any table to trial;
    Grant succeeded.
    Step 4:
    SQL> conn trial/trial@orcl;
    Connected.
    SQL> select * from tab;
    no rows selected
    Step 5:
    SQL> select * from scott.dept;
    DEPTNO DNAME LOC
    10 ACCOUNTING NEW YORK
    20 RESEARCH DALLAS
    30 SALES CHICAGO
    40 OPERATIONS BOSTON
    Step 6:
    SQL> desc scott.dept;
    Name Null? Type
    DEPTNO NOT NULL NUMBER(2)
    DNAME VARCHAR2(14)
    LOC VARCHAR2(13)
    you must read about privileges..
    http://download.oracle.com/docs/cd/B10501_01/server.920/a96521/privs.htm
    Regards
    S.Azar
    DBA
    "Question is Unquestionable"
    Edited by: azarmohds on Aug 15, 2009 6:28 AM
    Edited by: azarmohds on Aug 15, 2009 6:32 AM

  • Terminated session

    how can i terminated session?
    doesn't state in v$session with status killed.
    Edited by: Shahin Karimov on Aug 4, 2009 2:43 AM

    Hi
    Step 1
    SELECT s.sid,
    s.serial#,
    s.osuser,
    s.program
    FROM   v$session s;
    SID    SERIAL# OSUSER                         PROGRAM
    *1 1 SYSTEM ORACLE.EXE*
    *2 1 SYSTEM ORACLE.EXE*
    *3 1 SYSTEM ORACLE.EXE*
    *4 1 SYSTEM ORACLE.EXE*
    *5 1 SYSTEM ORACLE.EXE*
    *6 1 SYSTEM ORACLE.EXE*
    *20 60 SYSTEM DBSNMP.EXE*
    *43 11215 USER1 SQLPLUSW.EXE*
    *33 5337 USER2 SQLPLUSW.EXE*
    Step 2
    SQL> ALTER SYSTEM KILL SESSION 'sid,serial#';
    In some situations the Oracle.exe is not able to kill the session immediately. In these cases the session will be "marked for kill". It will then be killed as soon as possible.
    Issuing the ALTER SYSTEM KILL SESSION command is the only safe way to kill an Oracle session. If the marked session persists for some time you may consider killing the process at the operating system level, as explained below. Killing OS processes is dangerous and can lead to instance failures, so do this at your own peril.
    It is possible to force the kill by adding the IMMEDIATE keyword:
    SQL> ALTER SYSTEM KILL SESSION 'sid,serial#' IMMEDIATE;
    Reference
    http://www.oracle-base.com/articles/misc/KillingOracleSessions.php
    Regards
    S.Azar
    DBA
    "Question is Unquestionable"

  • Sequence generating duplicate numbers

    Hi guys,
    this might be more of a DBA question type... we had a situation where we copied data (once full schema and other time only tables ) from one database to another but ended up having sequence problem because new sequence was generating numbers which were lower than previousley generated one !
    I wonder if anyone had similar problem or know what could be causing it.
    when we copy full schema this happens to random table/sequences.
    Thanks for reading.
    Ali

    The sequence skipping behaviour is seen when cached sequences are exported.
    From the Oracle utilities manual
    >
    If transactions continue to access sequence numbers during an export, sequence numbers might be skipped. The best way to ensure that sequence numbers are not skipped is to ensure that the sequences are not accessed during the export.
    Sequence numbers can be skipped only when cached sequence numbers are in use. When a cache of sequence numbers has been allocated, they are available for use in the current database. The exported value is the next sequence number (after the cached values). Sequence numbers that are cached, but unused, are lost when the sequence is imported.
    >
    Hope this helps
    Varad

  • $I rows: 24,973,528 takes 8 hours to optimize against 0% fragmentation

    We are using UCM 10g for our Web Content Management environment. We use Oracle Text Search (DB version 11.1.0.7) as our search engine. To maintain performance of the indexes, we have a daily job scheduled in database to optimize the indexes. But it takes around 8 hours to optimize a 0% fragmented index. Any idea why it takes long time? Any suggestions to reduce the time it takes to run?
    Before running optimization script - Fragmentation details:*
    total size of $I data: 838,699,490 (799.85 MB)
    $I rows: 24,973,528
    estimated $I rows if optimal: 24,973,528
    estimated row fragmentation: 0 %
    Time taken to optimize the above index:_
    =============== FT_IDCTEXT2 Start Date and Time: 28=FEB-2013 02:37:22===========
    PL/SQL procedure successfully completed.
    =============== FT_IDCTEXT2 End Date and Time: 28=FEB-2013 10:55:55=============
    Script:*
    select '=============== FT_IDCTEXT2 Start Date and Time: ' ||sysdate||'=============== ' from dual;
    begin
    ctx_ddl.optimize_index('FT_IDCTEXT2','FULL', parallel_degree =>'10');
    end;
    select '=============== FT_IDCTEXT2 End Date and Time: ' ||sysdate||'=============== ' from dual;

    Hi ,
    I believe it would be a question for DB to tell why the fragmentation is taking such a long time for un-fragmented db schema . For UCM to improve it's search , indexing processes this action plan is done . But , since the DB itself is taking such an inordinate long time to do optimization , I think it would be a DBA question :-) .
    Thanks,
    Srinath

  • Soft sessionspace exceeded

    Hi all,
    I'm not sure this is the right newsgroup to ask, but I'll try anyway ;-)
    I have an application (module) deployed as EJB in a 8.1.6 db on a win2000 machine. It seems to work fine, except I get the following message over and over in my user-dump logs of my database:
    Session 11 exceeded soft sessionspace limit of 0x100000 bytes.
    What is the soft sessionspace and how do I change it?
    I know this probably an Oracle DBA question but I figured you people have already seen this and know the answer by heart (as always..)
    Thanks in advance,
    Arik.
    null

    Check the following settings in the init.ora and increase as appropriate:
    JAVA_SOFT_SESSIONSPACE_LIMIT
    If not present please add a line as
    JAVA_SOFT_SESSIONSPACE_LIMIT=3097152 or higher value and restart the database.
    Increasing the JAVA_SOFT_SESSIONSPACE_LIMIT should suppress this warning
    message.
    null

  • Locks on a table on multiple updates

    i have one table with INITRANS as 1... this table is updated by many users. on a peak time locks are getting increase on this table this cause increase in database lock.... can u please advice me the best practise to resolve this issue.

    this is realed to DBA questions. You should post on dba/General forum.
    You can increase (set) number of locs in oracle paramter file.
    Please refer the same.

Maybe you are looking for