TRUNCATE  = DELETE

Hi all,
11g and 10g
I am truncating a big table and it took 1hr to complete :(
If I set my database to force logging, does this mean that truncate table is forced to log and behave like delete command?
Thanks a lot,
zxy

Force logging is for redo. See http://www.orafaq.com/wiki/Nologging_and_force_logging
Your problem might be Oracle's tendency to do lazy databases writes. It's quick to write things to memory, then the dbwr writes it whenever it damn well pleases, which could be never in the case of delayed block cleanout. Why is this not a problem? Because redo is the critical write for Oracle to know conclusively that something is real when you have to recover. That's why you need to do a backup right after nologging operations, because things are not in the redo stream, and use force logging for standby databases, which are basically in continuous recovery.
It is possible for some performance effects to be seen if you have contention between redo and datafiles. But that is consequential, not likely causative for what you are talking about. Then again, if you have some kind of redo writing problem, who knows? You probably should check what Oracle is actually waiting on.

Similar Messages

  • Shrink table and Truncate/delete command

    Friends ,
    Regarding truncate cmmand we know ,
    "Truncate table removes all rows from a table, but the table structure and its columns, constraints, indexes etc., remains as it is."
    That means the table's data are deleted but the block is still not free .Blocks are still use the information of table's structue & others . In this case , if I shrink that table then what happen ? Are these blocks are going to be free or still contain the structure and its columns, constraints, indexes informaton ? Blocks becomes unused or used ?
    Waiting for reply ... ...

    Shippon,
    Trucate table <table> with 2 options
    1. reuse storage : leaces the space currently used by deleted rows: Leaves the HWM to where it is
    2. drop stroage: deallocated the space currently used by deleted rows: Resets the HWM to zero
    Are these blocks are going to be free or still contain the structure and its columns, constraints, indexes informaton ? Blocks becomes unused or used ?
    The  cleaned up blocks contains data and not the structure and indexes information. Truncate is just dropping data not structure (metadata). Blocks will be reused by my_objects again if "REUSE" option used, and if "DROP" option used, then blocks will be available to all the objects on residing on that tablespace.
    _*Example*_
    TABLE_NAME                       NUM_ROWS     BLOCKS INITIAL_EXTENT EMPTY_BLOCKS
    MY_OBJECTS                          84018        625          81920           15
    1 row selected.
    Truncate table my_object reuse storage;
    TABLE_NAME                       NUM_ROWS     BLOCKS INITIAL_EXTENT   EMPTY_BLOCKS
    MY_OBJECTS                              0                 0          81920                         640
    1 row selected.
    Truncate table my_object drop storage;
    TABLE_NAME                       NUM_ROWS     BLOCKS INITIAL_EXTENT     EMPTY_BLOCKS
    MY_OBJECTS                              0                 0          81920                             8
    1 row selected.Regards

  • Undo tablespace/redo logs/ DML /DDL/ truncate/ delete

    1st scenario:Delete
    10 rows in a table
    Delete 5 rows
    5 rows in the table
    savepoint sp1
    Delete 3 rows
    2 rows in the table
    rollback to savepoint sp1
    5 rows in the table
    So all DML affected values are noted in the undotablespace and present in the undotablespace until a commit is issued.And also redo logs make note of DML statements.AM I RIGHT??????
    2nd scenario-truncate
    10 rows in table
    savepoint sp1
    truncate
    0 rows in table
    rollback to savepoint sp1 gives this error
    ORA-01086: savepoint 'SP2' never established
    So is truncate [are all DDL statements] noted in the undo tablespace and are they noted in the redologs????????
    I KNOW THAT A DML IS NOT AUTOCOMMIT AND A DDL IS AN AUTOCOMMIT

    When you issue a delete is the data really deleted ?WHen you issue a delete, there is a before image of the data recorded to the undo area. (And that undo information itself is forwarded to the redo.) Then the data is actually deleted from the 'current' block as represented in memory.
    Therefore, the data is actually deleted, but can be recovered by rolling back until a commit occurs.
    It can also be recovered using flashback techniques which simply rebuild from the undo.
    When you issue a truncate is the data really deleted
    or is the high water mark pointer for a datablock lost?The data is not deleted. Therefore there is no undo record of the data 'removal' to be rolled back.
    The high water mark pointer is reset. It's old value is in the undo, but the truncate is a DDL command, and it is preceded and followed by an implicit commit, voiding any potential rollback request.
    I mean you can always rollback a delete and not
    rollback a truncate?Correct - using standard techniques, deletes can be rolled back and truncates can not.

  • Difference between Truncate & Delete

    Hi,
    I've a table D with child tables A,B,C. I've truncated in the below order:
    truncate table A;
    truncate table B;
    truncate table C;
    truncate table D;
    And got a foreign key dependency error, though I've truncated all the child tables;
    When I issue delete from D, all the rows got deleted without any error.
    How is Truncate different from Delete other than the AutoCommit?

    Truncating a Table
    TRUNCATE TABLE is a DDL statement, which is used to remove all rows from a
    table and to release the storage space used by that table. When using the TRUNCATE TABLE statement,
    you cannot rollback row removal.
    Syntax
    TRUNCATE TABLE table;
    You must be the owner of the table or have DELETE TABLE system privileges to truncate a table.
    Deleting a Table Record
    The DELETE statement can also remove all rows from a table, but it does not release storage space. The
    TRUNCATE command is faster. Removing rows with the TRUNCATE statement is faster than removing
    them with the DELETE statement for the following reasons
    1 ) The TRUNCATE statement is a data definition language (DDL) statement and generates no rollback
    information.
    2 ) Truncating a table does not fire the delete triggers of the table.
    3 ) If the table is the parent of a referential integrity constraint, you cannot truncate the table. Disable the
    constraint before issuing the TRUNCATE statement.

  • DELETE, DROP, TRUNCATE의 비교

    제품 : ORACLE SERVER
    작성날짜 : 1998-06-23
    DELETE, DROP, TRUNCATE의 비교
    =============================
    TABLE에서 행을 삭제하는 세 가지 OPTION의 비교
    TABLE에서 모든 행을 삭제하는 방법에는 다음과 같은 세 가지 OPTION이 있다.
    1. DELETE 명령어 사용
         DELETE 명령어를 사용하여 TABLE의 행을 삭제할 수 있다.
         예를 들어 EMP TABLE에서 모든 행을 삭제하는 명령문은 다음과 같다.
         DELETE FROM emp;
         O. DELETE 문을 사용할 때 TABLE이나 CLUSTER에 행이 많으면 행이 삭제
    될 때마다 많은 SYSTEM 자원이 소모된다. 예를 들어 CPU 시간, REDO
    LOG 영역, TABLE이나 INDEX에 대한 ROLLBACK SEGMENT 영역 등의 자
    원이 필요하다.
         O. TRIGGER가 걸려 있다면 각 행이 삭제될 때 실행된다.
         O. 이전에 할당되었던 영역은 삭제되어 빈 TABLE이나 CLUSTER에 그대로
    남아 있게 된다.
    2. DROP 과 CREATE 명령어 사용
         TABLE을 삭제한 다음 재생성할 수 있다. 예를 들어 EMP TABLE을 삭제하
    고 재생성하는 명령문은 다음과 같다.
         DROP TABLE emp;
         CREATE TABLE emp (......);
         O. TABLE이나 CLUSTER를 삭제하고 재생성하면 모든 관련된 INDEX,
    CONSTRAINT,TRIGGER도 삭제되며, 삭제된 TABLE이나 CLUSTERED
         TABLE에 종속된 OBJECTS는 무효화 된다.
         O. 삭제된 TABLE이나 CLUSTERED TABLE에 부여된 권한도 삭제된다.
    3. TRUNCATE 명령어 사용
         SQL명령어 TRUNCATE를 사용하여 TABLE의 모든 행을 삭제할 수 있다.
         예를 들어 EMP TABLE을 잘라내는 명령문은 다음과 같다.
         TRUNCATE TABLE emp:
         O. TRUNCATE 명령어는 TABLE이나 CLUSTER에서 모든 행을 삭제하는 빠르
    고 효율적인 방법이다.
         O. TRUNCATE 명령어는 어떤 ROLLBACK 정보도 만들지 않고 즉시 COMMIT
    한다.
         O. TRUNCATE 명령어는 DDL 명령문으로 ROLLBACK될 수 없다.
         O. TRUNCATE 명령문은 잘라 버릴 TABLE과 관련된 구조(CONSTRAINT,
         TRIGGER 등)과 권한에 영향을 주지 않는다.
         O. TRUNCATE 명령문은 현재 TABLE에 할당된 영역을 잘라버린 후에 포함
    되는 TABLESPACE로 복귀되도록 지정한다.
    (REUSE STORAGE, DROP STORAGE OPTION 사용)
         - DROP STORAGE OPTION 사용 시 : TABLE EXTENTS 수를 MINEXTENTS의
         원래 설정값으로 줄인다.
                   해제된 확장영역은 SYSTEM에 복귀되며,
              다른 OBJECTS가 사용할 수 있다.
    - REUSE STORAGE OPTION 사용 시 : 현재 TABLE이나 CLUSTER에 할당된
    모든 영역이 할당된 채로 남아 있도록
    지정한다.
         O. TRUNCATE 명령문이 TABLE에서 ROW를 삭제하면 해당 TABLE에 걸려 있는
    TRIGGER는 실행되지 않는다.
         O. AUDIT 기능이 ENABLE되어 있으면, TRUNCATE 명령문은 DELETE 문에 해
    당하는 AUDIT 정보를 생성하지 않는다. 대신 발생한 TRUNCATE 명령문
    에 대한 단일 AUDIT RECORD를 생성한다.
    * HASH CLUSTER는 잘라버릴 수 없다.
    또한 HASH CLUSTER나 INDEX CLUSTER 내의 TABLE도 개별적으로 잘라버릴 수
    없다.
    INDEX CLUSTER를 잘라버리면 CLUSTER에 있는 모든 TABLE의 모든 ROW가 삭제
    된다.
    모든 ROW가 각각의 CLUSTERED TABLE에서 삭제되어야 한다면 DELETE 명령어를
    사용하거나 TABLE을 삭제하고 재생성한다.

    There Oracle says us about CASCADE keyword in ALTER TYPE ... DROP METHOD statement
    http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96540/statements_43a.htm#2078974
    CASCADE Clause
    Specify the CASCADE clause if you want to propagate the type change to dependent types and tables. Oracle Database aborts the statement if any errors are found in the dependent types or tables unless you also specify FORCE.
    Try to find the dependences between your super - and subtypes.
    It would be better if you specify your complete objects
    hierarchy in the example.
    Rgds.

  • Delete DML statment tales more time than Update or Insert.

    i want to know whether a delete statement takes more time than an update or insert DML command. Please help in solving the doubt.
    Regards.

    I agree: the amount of ROLLBACK (called UNDO) and ROLLFORWARD (called REDO) information written by the various statement has a crucial impact on the speed.
    I did some simple benchmarks for INSERT, UPDATE and DELETE using a 1 million row simple table. As an alternative to the long UPDATEs and DELETEs, I tested also the usual workarounds (which have only partial applicability).
    Here are the conclusions (quite important in my opinion, but not to be taken as universal truth):
    1. Duration of DML statements for 1 million rows operations (with the size of redo generated):
    --- INSERT: 3.5 sec (redo: 3.8 MB)
    --- UPDATE: 24.8 sec (redo: 240 MB)
    --- DELETE: 26.1 sec (redo: 228 MB)
    2. Replacement of DELETE with TRUNCATE
    --- DELETE: 26.1 sec (rollback: 228 MB)
    --- TRUNCATE: 0.1 sec (rollback: 0.1 MB)
    3. Replacement of UPDATE with CREATE new TABLE AS SELECT (followed by DROP ols and RENAME new AS old)
    --- UPDATE: 24.8 sec (redo_size: 240 MB)
    --- replacement: 3.5 sec (rollback: 0.3 MB)
    -- * Preparation *
    CREATE TABLE ao AS
        SELECT rownum AS id,
              'N' || rownum AS name
         FROM all_objects, all_objects
        WHERE rownum <= 1000000;
    CREATE OR REPLACE PROCEDURE print_my_stat(p_name IN v$statname.NAME%TYPE) IS
        v_value v$mystat.VALUE%TYPE;
    BEGIN
        SELECT b.VALUE
          INTO v_value
          FROM v$statname a,
               v$mystat   b
         WHERE a.statistic# = b.statistic# AND lower(a.NAME) LIKE lower(p_name);
        dbms_output.put_line('*' || p_name || ': ' || v_value);
    END print_my_stat;
    -- * Test 1: Comparison of INSERT, UPDATE and DELETE *
    CREATE TABLE ao1 AS
        SELECT * FROM ao WHERE 1 = 2;
    exec print_my_stat('redo_size')
    *redo_size= 277,220,544
    INSERT INTO ao1 SELECT * FROM ao;
    1000000 rows inserted
    executed in 3.465 seconds
    exec print_my_stat('redo_size')
    *redo_size= 301,058,852
    commit;
    UPDATE ao1 SET name = 'M' || SUBSTR(name, 2);
    1000000 rows updated
    executed in 24.786 seconds
    exec print_my_stat('redo_size')
    *redo_size= 545,996,280
    commit;
    DELETE FROM ao1;
    1000000 rows deleted
    executed in 26.128 seconds
    exec print_my_stat('redo_size')
    *redo_size= 783,655,196
    commit;
    -- * Test 2:  Replace DELETE with TRUNCATE *
    DROP TABLE ao1;
    CREATE TABLE ao1 AS
        SELECT * FROM ao;
    exec print_my_stat('redo_size')
    *redo_size= 807,554,512
    TRUNCATE TABLE ao1;
    executed in 0.08 seconds
    exec print_my_stat('redo_size')
    *redo_size= 807,616,528
    -- * Test 3:  Replace UPDATE with CREATE TABLE AS SELECT *
    INSERT INTO ao1 SELECT * FROM ao;
    commit;
    exec print_my_stat('redo_size')
    *redo_size= 831,525,556
    CREATE TABLE ao2 AS
        SELECT id, 'M' || SUBSTR(name, 2) name FROM ao1;
    executed in 3.125 seconds
    DROP TABLE ao1;
    executed in 0.32 seconds
    RENAME ao2 TO ao1;
    executed in 0.01 seconds
    exec print_my_stat('redo_size')
    *redo_size= 831,797,608

  • Is it safe to purge / delete older records from AUD$ table in SYS schema

    Hi,
    Can we purge / delete older records from AUD$ table in SYS schema.
    Please advice.
    Thanks
    Naveen

    Pl see MOS Doc 73408.1 (How to Truncate, Delete, or Purge Rows from the Audit Trail Table SYS.AUD$) fro details on how to do so.
    HTH
    Srini

  • Exchange Logs Delete and Backup Successfull

    kindly clarify the given information :we have 2 mailbox servers in DAG environment but both do not having same numbers of Logs ( let say MBX01 has 3000 logs and MBX02 has 1400 Logs ) so in this case NetBackup will not take successful backup or Logs will
    not truncate/Delete. Our MBX01 having true copy.
    Thanks in advance !!
    Best Regards, Hussain

    Hi Hussain,
    Base on my knowledge, the numbers of the logs will not effect the backup. 
    In addition, I also recommend you post this in netbackup forum, as this is a 3rd party backup software, Microsoft does not provide support for it. 
    Best regards,
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact [email protected]
    Niko Cheng
    TechNet Community Support

  • Oracle SQL and PL/SQL interview questions.

    Can anyone forward me all Oracle SQL and PL/SQL Interview questions and answers asap.
    Many Thanks.
    Bba

    Dear Pal
    I not sure all the all answers are correct. I got one mail couple yrs back. I am just sharing mail contents. Kindly keep question and compare answers.
    1 Which is more faster - IN or EXISTS?
    EXISTS is more faster than IN because EXISTS returns a Boolean value whereas IN returns a value.
    2 Which datatype is used for storing graphics and images?
    LONG RAW data type is used for storing BLOB's (binary large objects).
    3 When do you use WHERE clause and when do you use HAVING clause?
    HAVING clause is used when you want to specify a condition for a group function and it is written after GROUP BY clause. The WHERE clause is used when you want to specify a condition for columns, single row functions except group functions and it is written before GROUP BY clause if it is used.
    4 What WHERE CURRENT OF clause does in a cursor?
    LOOPSELECT num_credits INTO v_numcredits FROM classesWHERE dept=123 and course=101;UPDATE studentsSET current_credits=current_credits+v_numcreditsWHERE CURRENT OF X;END LOOPCOMMIT;END;
    5 What should be the return type for a cursor variable.Can we use a scalar data type as return type?
    The return type for a cursor must be a record type.It can be declared explicitly as a user-defined or %ROWTYPE can be used. eg TYPE t_studentsref IS REF CURSOR RETURN students%ROWTYPE
    6 What is use of a cursor variable? How it is defined?
    A cursor variable is associated with different statements at run time, which can hold different values at run time. Static cursors can only be associated with one run time query. A cursor variable is reference type (like a pointer in C).Declaring a cursor variable:TYPE type_name IS REF CURSOR RETURN return_type type_name is the name of the reference type,return_type is a record type indicating the types of the select list that will eventually be returned by the cursor variable.
    7 What is the purpose of a cluster?
    Oracle does not allow a user to specifically locate tables, since that is a part of the function of the RDBMS. However, for the purpose of increasing performance, oracle allows a developer to create a CLUSTER. A CLUSTER provides a means for storing data from different tables together for faster retrieval than if the table placement were left to the RDBMS.
    8 What is the maximum buffer size that can be specified using the DBMS_OUTPUT.ENABLE function?
    1,000,00
    9 What is syntax for dropping a procedure and a function .Are these operations possible?
    Drop Procedure procedure_nameDrop Function function_name
    10 What is OCI. What are its uses?
    Oracle Call Interface is a method of accesing database from a 3GL program. Uses--No precompiler is required,PL/SQL blocks are executed like other DML statements. The OCI library provides· -functions to parse SQL statemets· -bind input variables· -bind output variables· -execute statements· -fetch the results
    11 What is difference between UNIQUE and PRIMARY KEY constraints?
    A table can have only one PRIMARY KEY whereas there can be any number of UNIQUE keys. The columns that compose PK are automatically define NOT NULL, whereas a column that compose a UNIQUE is not automatically defined to be mandatory must also specify the column is NOT NULL.
    12 What is difference between SUBSTR and INSTR?
    SUBSTR returns a specified portion of a string eg SUBSTR('BCDEF',4) output BCDEINSTR provides character position in which a pattern is found in a string. eg INSTR('ABC-DC-F','-',2) output 7 (2nd occurence of '-')
    13 What is difference between SQL and SQL*PLUS?
    SQL*PLUS is a command line tool where as SQL and PL/SQL language interface and reporting tool. Its a command line tool that allows user to type SQL commands to be executed directly against an Oracle database. SQL is a language used to query the relational database(DML,DCL,DDL). SQL*PLUS commands are used to format query result, Set options, Edit SQL commands and PL/SQL.
    14 What is difference between Rename and Alias?
    Rename is a permanent name given to a table or column whereas Alias is a temporary name given to a table or column which do not exist once the SQL statement is executed.
    15 What is difference between a formal and an actual parameter?
    The variables declared in the procedure and which are passed, as arguments are called actual, the parameters in the procedure declaration. Actual parameters contain the values that are passed to a procedure and receive results. Formal parameters are the placeholders for the values of actual parameters
    16 What is an UTL_FILE.What are different procedures and functions associated with it?
    UTL_FILE is a package that adds the ability to read and write to operating system files. Procedures associated with it are FCLOSE, FCLOSE_ALL and 5 procedures to output data to a file PUT, PUT_LINE, NEW_LINE, PUTF, FFLUSH.PUT, FFLUSH.PUT_LINE,FFLUSH.NEW_LINE. Functions associated with it are FOPEN, ISOPEN.
    17 What is a view ?
    A view is stored procedure based on one or more tables, it’s a virtual table.
    18 What is a pseudo column. Give some examples?
    It is a column that is not an actual column in the table.eg USER, UID, SYSDATE, ROWNUM, ROWID, NULL, AND LEVEL.
    19 What is a OUTER JOIN?
    Outer Join--Its a join condition used where you can query all the rows of one of the tables in the join condition even though they don’t satisfy the join condition.
    20 What is a cursor?
    Oracle uses work area to execute SQL statements and store processing information PL/SQL construct called a cursor lets you name a work area and access its stored information A cursor is a mechanism used to fetch more than one row in a Pl/SQl block.
    21 What is a cursor for loop?
    Cursor For Loop is a loop where oracle implicitly declares a loop variable, the loop index that of the same record type as the cursor's record.
    22 What are various privileges that a user can grant to another user?
    · SELECT· CONNECT· RESOURCES
    23 What are various constraints used in SQL?
    · NULL· NOT NULL· CHECK· DEFAULT
    24 What are ORACLE PRECOMPILERS?
    Using ORACLE PRECOMPILERS, SQL statements and PL/SQL blocks can be contained inside 3GL programs written in C,C++,COBOL,PASCAL, FORTRAN,PL/1 AND ADA.The Precompilers are known as Pro*C,Pro*Cobol,...This form of PL/SQL is known as embedded pl/sql,the language in which pl/sql is embedded is known as the host language. The prcompiler translates the embedded SQL and pl/sql ststements into calls to the precompiler runtime library.The output must be compiled and linked with this library to creater an executable.
    25 What are different Oracle database objects?
    · TABLES· VIEWS· INDEXES· SYNONYMS· SEQUENCES· TABLESPACES etc
    26 What are different modes of parameters used in functions and procedures?
    · IN· OUT· INOUT
    27 What are cursor attributes?
    · %ROWCOUNT· %NOTFOUND· %FOUND· %ISOPEN
    28 What a SELECT FOR UPDATE cursor represent. [ANSWER]SELECT......FROM......FOR......UPDATE[OF column-reference][NOWAIT] The processing done in a fetch loop modifies the rows that have been retrieved by the cursor. A convenient way of modifying the rows is done by a method with two parts: the FOR UPDATE clause in the cursor declaration, WHERE CURRENT OF CLAUSE in an UPDATE or declaration statement.
    29 There is a string 120000 12 0 .125 , how you will find the position of the decimal place?
    INSTR('120000 12 0 .125',1,'.')output 13
    30 There is a % sign in one field of a column. What will be the query to find it?
    '' Should be used before '%'.
    31 Suppose a customer table is having different columns like customer no, payments.What will be the query to select top three max payments?
    SELECT customer_no, payments from customer C1
    WHERE 3<=(SELECT COUNT(*) from customer C2
    WHERE C1.payment <= C2.payment)
    32 minvalue.sql Select the Nth lowest value from a table
    select level, min('col_name') from my_table where level = '&n' connect by prior ('col_name') <
    'col_name')
    group by level;
    Example:
    Given a table called emp with the following columns:
    -- id number
    -- name varchar2(20)
    -- sal number
    -- For the second lowest salary:
    -- select level, min(sal) from emp
    -- where level=2
    -- connect by prior sal < sal
    -- group by level
    33 maxvalue.sql Select the Nth Highest value from a table
    select level, max('col_name') from my_table where level = '&n' connect by prior ('col_name') >
    'col_name')
    group by level;
    Example:
    Given a table called emp with the following columns:
    -- id number
    -- name varchar2(20)
    -- sal number
    -- For the second highest salary:
    -- select level, max(sal) from emp
    -- where level=2
    -- connect by prior sal > sal
    -- group by level
    34 How you will avoid your query from using indexes?
    SELECT * FROM emp
    Where emp_no+' '=12345;
    i.e you have to concatenate the column name with space within codes in the where condition.
    SELECT /*+ FULL(a) */ ename, emp_no from emp
    where emp_no=1234;
    i.e using HINTS
    35 How you will avoid duplicating records in a query?
    By using DISTINCT
    36 How you were passing cursor variables in PL/SQL 2.2?
    In PL/SQL 2.2 cursor variables cannot be declared in a package.This is because the storage for a cursor variable has to be allocated using Pro*C or OCI with version 2.2, the only means of passing a cursor variable to a PL/SQL block is via bind variable or a procedure parameter.
    37 How you open and close a cursor variable.Why it is required?
    OPEN cursor variable FOR SELECT...Statement
    CLOSE cursor variable In order to associate a cursor variable with a particular SELECT statement OPEN syntax is used. In order to free the resources used for the query CLOSE statement is used.
    38 How will you delete duplicating rows from a base table?
    delete from table_name where rowid not in (select max(rowid) from table group by duplicate_values_field_name); or
    delete duplicate_values_field_name dv from table_name ta where rowid <(select min(rowid) from table_name tb where ta.dv=tb.dv);
    39 How do you find the numbert of rows in a Table ?
    A bad answer is count them (SELECT COUNT(*) FROM table_name)
    A good answer is :-
    'By generating SQL to ANALYZE TABLE table_name COUNT STATISTICS by querying Oracle System Catalogues (e.g. USER_TABLES or ALL_TABLES).
    The best answer is to refer to the utility which Oracle released which makes it unnecessary to do ANALYZE TABLE for each Table individually.
    40 Find out nth highest salary from emp table
    SELECT DISTINCT (a.sal) FROM EMP A WHERE &N = (SELECT COUNT (DISTINCT (b.sal)) FROM EMP B WHERE a.sal<=b.sal);
    For Eg:-
    Enter value for n: 2
    SAL
    3700
    41 Display the records between two range?
    select rownum, empno, ename from emp where rowid in (select rowid from emp where rownum <=&upto minus select rowid from emp where rownum<&Start);
    42 Display the number value in Words?
    SQL> select sal, (to_char(to_date(sal,'j'), 'jsp'))
    from emp;
    the output like,
    SAL (TO_CHAR(TO_DATE(SAL,'J'),'JSP'))
    800 eight hundred
    1600 one thousand six hundred
    1250 one thousand two hundred fifty
    If you want to add some text like, Rs. Three Thousand only.
    SQL> select sal "Salary ",
    (' Rs. '|| (to_char(to_date(sal,'j'), 'Jsp'))|| ' only.'))
    "Sal in Words" from emp
    Salary Sal in Words
    800 Rs. Eight Hundred only.
    1600 Rs. One Thousand Six Hundred only.
    1250 Rs. One Thousand Two Hundred Fifty only.
    43 Display Odd/ Even number of records
    Odd number of records:
    select * from emp where (rowid,1) in (select rowid, mod(rownum,2) from emp);
    Output:-
    1
    3
    5
    Even number of records:
    select * from emp where (rowid,0) in (select rowid, mod(rownum,2) from emp)
    Output:-
    2
    4
    6
    44 Difference between procedure and function.
    Functions are named PL/SQL blocks that return a value and can be called with arguments procedure a named block that can be called with parameter. A procedure all is a PL/SQL statement by itself, while a Function call is called as part of an expression.
    45 Difference between NO DATA FOUND and %NOTFOUND
    NO DATA FOUND is an exception raised only for the SELECT....INTO statements when the where clause of the querydoes not match any rows. When the where clause of the explicit cursor does not match any rows the %NOTFOUND attribute is set to TRUE instead.
    46 Difference between database triggers and form triggers?
    Data base trigger(DBT) fires when a DML operation is performed on a data base table. Form trigger(FT) Fires when user presses a key or navigates between fields on the screen
    Can be row level or statement level No distinction between row level and statement level.
    Can manipulate data stored in Oracle tables via SQL Can manipulate data in Oracle tables as well as variables in forms.
    Can be fired from any session executing the triggering DML statements. Can be fired only from the form that define the trigger.
    Can cause other database triggers to fire.Can cause other database triggers to fire, but not other form triggers.
    47 Difference between an implicit & an explicit cursor.
    PL/SQL declares a cursor implicitly for all SQL data manipulation statements, including quries that return only one row. However,queries that return more than one row you must declare an explicit cursor or use a cursor FOR loop.
    Explicit cursor is a cursor in which the cursor name is explicitly assigned to a SELECT statement via the CURSOR...IS statement. An implicit cursor is used for all SQL statements Declare, Open, Fetch, Close. An explicit cursors are used to process multirow SELECT statements An implicit cursor is used to process INSERT, UPDATE, DELETE and single row SELECT. .INTO statements.
    48 Can you use a commit statement within a database trigger?
    No.
    49 Can the default values be assigned to actual parameters?
    Yes
    50 Can cursor variables be stored in PL/SQL tables.If yes how. If not why?
    No, a cursor variable points a row which cannot be stored in a two-dimensional PL/SQL table.
    51 Can a primary key contain more than one columns?
    Yes
    52 Can a function take OUT parameters. If not why?
    No. A function has to return a value,an OUT parameter cannot return a value.
    53 What are various joins used while writing SUBQUERIES?
    Self join-Its a join foreign key of a table references the same table. Outer Join--Its a join condition used where One can query all the rows of one of the tables in the join condition even though they don't satisfy the join condition.
    Equi-join--Its a join condition that retrieves rows from one or more tables in which one or more columns in one table are equal to one or more columns in the second table.
    54 Differentiate between TRUNCATE and DELETE
    TRUNCATE deletes much faster than DELETE
    TRUNCATE
    DELETE
    It is a DDL statement It is a DML statement
    It is a one way trip,cannot ROLLBACK One can Rollback
    Doesn't have selective features (where clause) Has
    Doesn't fire database triggers Does
    It requires disabling of referential constraints. Does not require
    1 What is PL/SQL ?
    PL/SQL is a procedural language that has both interactive SQL and procedural programming language constructs such as iteration, conditional branching.
    2 Write the order of precedence for validation of a column in a table ?
    I. done using Database triggers.
    ii. done using Integarity Constraints.
    I & ii.
    Exception :
    3 Where the Pre_defined_exceptions are stored ?
    In the standard package.
    Procedures, Functions & Packages ;
    4 What are % TYPE and % ROWTYPE ? What are the advantages of using these over datatypes?
    % TYPE provides the data type of a variable or a database column to that variable.
    % ROWTYPE provides the record type that represents a entire row of a table or view or columns selected in the cursor.
    The advantages are : I. Need not know about variable's data type
    ii. If the database definition of a column in a table changes, the data type of a variable changes accordingly.
    5 What will happen after commit statement ?
    Cursor C1 is
    Select empno,
    ename from emp;
    Begin
    open C1; loop
    Fetch C1 into
    eno.ename;
    Exit When
    C1 %notfound;-----
    commit;
    end loop;
    end;
    The cursor having query as SELECT .... FOR UPDATE gets closed after COMMIT/ROLLBACK.
    The cursor having query as SELECT.... does not get closed even after COMMIT/ROLLBACK.
    6 What is the basic structure of PL/SQL ?
    PL/SQL uses block structure as its basic structure. Anonymous blocks or nested blocks can be used in PL/SQL.
    7 What is Raise_application_error ?
    Raise_application_error is a procedure of package DBMS_STANDARD which allows to issue an user_defined error messages from stored sub-program or database trigger.
    8 What is Pragma EXECPTION_INIT ? Explain the usage ?
    The PRAGMA EXECPTION_INIT tells the complier to associate an exception with an oracle error. To get an error message of a specific oracle error.
    e.g. PRAGMA EXCEPTION_INIT (exception name, oracle error number)
    9 What is PL/SQL table ?
    Objects of type TABLE are called "PL/SQL tables", which are modeled as (but not the same as) database tables, PL/SQL tables use a primary PL/SQL tables can have one column and a primary key.
    Cursors
    10 What is Overloading of procedures ?
    The Same procedure name is repeated with parameters of different datatypes and parameters in different positions, varying number of parameters is called overloading of procedures.
    e.g. DBMS_OUTPUT put_line
    What is a package ? What are the advantages of packages ?
    11 What is difference between a PROCEDURE & FUNCTION ?
    A FUNCTION is always returns a value using the return statement.
    A PROCEDURE may return one or more values through parameters or may not return at all.
    12 What is difference between a Cursor declared in a procedure and Cursor declared in a package specification ?
    A cursor declared in a package specification is global and can be accessed by other procedures or procedures in a package.
    A cursor declared in a procedure is local to the procedure that can not be accessed by other procedures.
    13 What is difference between % ROWTYPE and TYPE RECORD ?
    % ROWTYPE is to be used whenever query returns a entire row of a table or view.
    TYPE rec RECORD is to be used whenever query returns columns of different
    table or views and variables.
    E.g. TYPE r_emp is RECORD (eno emp.empno% type,ename emp ename %type
    e_rec emp% ROWTYPE
    cursor c1 is select empno,deptno from emp;
    e_rec c1 %ROWTYPE.
    14 What is an Exception ? What are types of Exception ?
    Exception is the error handling part of PL/SQL block. The types are Predefined and user defined. Some of Predefined exceptions are.
    CURSOR_ALREADY_OPEN
    DUP_VAL_ON_INDEX
    NO_DATA_FOUND
    TOO_MANY_ROWS
    INVALID_CURSOR
    INVALID_NUMBER
    LOGON_DENIED
    NOT_LOGGED_ON
    PROGRAM-ERROR
    STORAGE_ERROR
    TIMEOUT_ON_RESOURCE
    VALUE_ERROR
    ZERO_DIVIDE
    OTHERS.
    15 What is a stored procedure ?
    A stored procedure is a sequence of statements that perform specific function.
    16 What is a database trigger ? Name some usages of database trigger ?
    Database trigger is stored PL/SQL program unit associated with a specific database table. Usages are Audit data modifications, Log events transparently, Enforce complex business rules Derive column values automatically, Implement complex security authorizations. Maintain replicate tables.
    17 What is a cursor for loop ?
    Cursor for loop implicitly declares %ROWTYPE as loop index,opens a cursor, fetches rows of values from active set into fields in the record and closes
    when all the records have been processed.
    eg. FOR emp_rec IN C1 LOOP
    salary_total := salary_total +emp_rec sal;
    END LOOP;
    18 What is a cursor ? Why Cursor is required ?
    Cursor is a named private SQL area from where information can be accessed. Cursors are required to process rows individually for queries returning multiple rows.
    19 What happens if a procedure that updates a column of table X is called in a database trigger of the same table ?
    Mutation of table occurs.
    20 What are two virtual tables available during database trigger execution ?
    The table columns are referred as OLD.column_name and NEW.column_name.
    For triggers related to INSERT only NEW.column_name values only available.
    For triggers related to UPDATE only OLD.column_name NEW.column_name values only available.
    For triggers related to DELETE only OLD.column_name values only available.
    21 What are two parts of package ?
    The two parts of package are PACKAGE SPECIFICATION & PACKAGE BODY.
    Package Specification contains declarations that are global to the packages and local to the schema.
    Package Body contains actual procedures and local declaration of the procedures and cursor declarations.
    22 What are the two parts of a procedure ?
    Procedure Specification and Procedure Body.
    23 What are the return values of functions SQLCODE and SQLERRM ?
    SQLCODE returns the latest code of the error that has occurred.
    SQLERRM returns the relevant error message of the SQLCODE.
    24 What are the PL/SQL Statements used in cursor processing ?
    DECLARE CURSOR cursor name, OPEN cursor name, FETCH cursor name INTO or Record types, CLOSE cursor name.
    25 What are the modes of parameters that can be passed to a procedure ?
    IN,OUT,IN-OUT parameters.
    26 What are the datatypes a available in PL/SQL ?
    Some scalar data types such as NUMBER, VARCHAR2, DATE, CHAR, LONG, BOOLEAN.
    Some composite data types such as RECORD & TABLE.
    27 What are the cursor attributes used in PL/SQL ?
    %ISOPEN - to check whether cursor is open or not
    % ROWCOUNT - number of rows fetched/updated/deleted.
    % FOUND - to check whether cursor has fetched any row. True if rows are fetched.
    % NOT FOUND - to check whether cursor has fetched any row. True if no rows are featched.
    These attributes are proceeded with SQL for Implicit Cursors and with Cursor name for Explicit Cursors.
    28 What are the components of a PL/SQL Block ?
    Declarative part, Executable part and Exception part.
    Datatypes PL/SQL
    29 What are the components of a PL/SQL block ?
    A set of related declarations and procedural statements is called block.
    30 What are advantages fo Stored Procedures /
    Extensibility,Modularity, Reusability, Maintainability and one time compilation.
    1 What is PL/SQL ?
    PL/SQL is a procedural language that has both interactive SQL and procedural programming language constructs such as iteration, conditional branching.
    2 Write the order of precedence for validation of a column in a table ?
    I. done using Database triggers.
    ii. done using Integarity Constraints.
    I & ii.
    Exception :
    3 Where the Pre_defined_exceptions are stored ?
    In the standard package.
    Procedures, Functions & Packages ;
    4 What are % TYPE and % ROWTYPE ? What are the advantages of using these over datatypes?
    % TYPE provides the data type of a variable or a database column to that variable.
    % ROWTYPE provides the record type that represents a entire row of a table or view or columns selected in the cursor.
    The advantages are : I. Need not know about variable's data type
    ii. If the database definition of a column in a table changes, the data type of a variable changes accordingly.
    5 What will happen after commit statement ?
    Cursor C1 is
    Select empno,
    ename from emp;
    Begin
    open C1; loop
    Fetch C1 into
    eno.ename;
    Exit When
    C1 %notfound;-----
    commit;
    end loop;
    end;
    The cursor having query as SELECT .... FOR UPDATE gets closed after COMMIT/ROLLBACK.
    The cursor having query as SELECT.... does not get closed even after COMMIT/ROLLBACK.
    6 What is the basic structure of PL/SQL ?
    PL/SQL uses block structure as its basic structure. Anonymous blocks or nested blocks can be used in PL/SQL.
    7 What is Raise_application_error ?
    Raise_application_error is a procedure of package DBMS_STANDARD which allows to issue an user_defined error messages from stored sub-program or database trigger.
    8 What is Pragma EXECPTION_INIT ? Explain the usage ?
    The PRAGMA EXECPTION_INIT tells the complier to associate an exception with an oracle error. To get an error message of a specific oracle error.
    e.g. PRAGMA EXCEPTION_INIT (exception name, oracle error number)
    9 What is PL/SQL table ?
    Objects of type TABLE are called "PL/SQL tables", which are modeled as (but not the same as) database tables, PL/SQL tables use a primary PL/SQL tables can have one column and a primary key.
    Cursors
    10 What is Overloading of procedures ?
    The Same procedure name is repeated with parameters of different datatypes and parameters in different positions, varying number of parameters is called overloading of procedures.
    e.g. DBMS_OUTPUT put_line
    What is a package ? What are the advantages of packages ?
    11 What is difference between a PROCEDURE & FUNCTION ?
    A FUNCTION is always returns a value using the return statement.
    A PROCEDURE may return one or more values through parameters or may not return at all.
    12 What is difference between a Cursor declared in a procedure and Cursor declared in a package specification ?
    A cursor declared in a package specification is global and can be accessed by other procedures or procedures in a package.
    A cursor declared in a procedure is local to the procedure that can not be accessed by other procedures.
    13 What is difference between % ROWTYPE and TYPE RECORD ?
    % ROWTYPE is to be used whenever query returns a entire row of a table or view.
    TYPE rec RECORD is to be used whenever query returns columns of different
    table or views and variables.
    E.g. TYPE r_emp is RECORD (eno emp.empno% type,ename emp ename %type
    e_rec emp% ROWTYPE
    cursor c1 is select empno,deptno from emp;
    e_rec c1 %ROWTYPE.
    14 What is an Exception ? What are types of Exception ?
    Exception is the error handling part of PL/SQL block. The types are Predefined and user defined. Some of Predefined exceptions are.
    CURSOR_ALREADY_OPEN
    DUP_VAL_ON_INDEX
    NO_DATA_FOUND
    TOO_MANY_ROWS
    INVALID_CURSOR
    INVALID_NUMBER
    LOGON_DENIED
    NOT_LOGGED_ON
    PROGRAM-ERROR
    STORAGE_ERROR
    TIMEOUT_ON_RESOURCE
    VALUE_ERROR
    ZERO_DIVIDE
    OTHERS.
    15 What is a stored procedure ?
    A stored procedure is a sequence of statements that perform specific function.
    16 What is a database trigger ? Name some usages of database trigger ?
    Database trigger is stored PL/SQL program unit associated with a specific database table. Usages are Audit data modifications, Log events transparently, Enforce complex business rules Derive column values automatically, Implement complex security authorizations. Maintain replicate tables.
    17 What is a cursor for loop ?
    Cursor for loop implicitly declares %ROWTYPE as loop index,opens a cursor, fetches rows of values from active set into fields in the record and closes
    when all the records have been processed.
    eg. FOR emp_rec IN C1 LOOP
    salary_total := salary_total +emp_rec sal;
    END LOOP;
    18 What is a cursor ? Why Cursor is required ?
    Cursor is a named private SQL area from where information can be accessed. Cursors are required to process rows individually for queries returning multiple rows.
    19 What happens if a procedure that updates a column of table X is called in a database trigger of the same table ?
    Mutation of table occurs.
    20 What are two virtual tables available during database trigger execution ?
    The table columns are referred as OLD.column_name and NEW.column_name.
    For triggers related to INSERT only NEW.column_name values only available.
    For triggers related to UPDATE only OLD.column_name NEW.column_name values only available.
    For triggers related to DELETE only OLD.column_name values only available.
    21 What are two parts of package ?
    The two parts of package are PACKAGE SPECIFICATION & PACKAGE BODY.
    Package Specification contains declarations that are global to the packages and local to the schema.
    Package Body contains actual procedures and local declaration of the procedures and cursor declarations.
    22 What are the two parts of a procedure ?
    Procedure Specification and Procedure Body.
    23 What are the return values of functions SQLCODE and SQLERRM ?
    SQLCODE returns the latest code of the error that has occurred.
    SQLERRM returns the relevant error message of the SQLCODE.
    24 What are the PL/SQL Statements used in cursor processing ?
    DECLARE CURSOR cursor name, OPEN cursor name, FETCH cursor name INTO or Record types, CLOSE cursor name.
    25 What are the modes of parameters that can be passed to a procedure ?
    IN,OUT,IN-OUT parameters.
    26 What are the datatypes a available in PL/SQL ?
    Some scalar data types such as NUMBER, VARCHAR2, DATE, CHAR, LONG, BOOLEAN.
    Some composite data types such as RECORD & TABLE.
    27 What are the cursor attributes used in PL/SQL ?
    %ISOPEN - to check whether cursor is open or not
    % ROWCOUNT - number of rows fetched/updated/deleted.
    % FOUND - to check whether cursor has fetched any row. True if rows are fetched.
    % NOT FOUND - to check whether cursor has fetched any row. True if no rows are featched.
    These attributes are proceeded with SQL for Implicit Cursors and with Cursor name for Explicit Cursors.
    28 What are the components of a PL/SQL Block ?
    Declarative part, Executable part and Exception part.
    Datatypes PL/SQL
    29 What are the components of a PL/SQL block ?
    A set of related declarations and procedural statements is called block.
    30 What are advantages fo Stored Procedures /
    Extensibility,Modularity, Reusability, Maintainability and one time compilation.
    31 Name the tables where characteristics of Package, procedure and functions are stored ?
    User_objects, User_Source and User_error.
    32 Is it possible to use Transaction control Statements such a ROLLBACK or COMMIT in Database Trigger ? Why ?
    It is not possible. As triggers are defined for each table, if you use COMMIT of ROLLBACK in a trigger, it affects logical transaction processing.
    33 How packaged procedures and functions are called from the following?
    a. Stored procedure or anonymous block
    b. an application program such a PRC C, PRO COBOL
    c. SQL *PLUS
    a. PACKAGE NAME.PROCEDURE NAME (parameters);
    variable := PACKAGE NAME.FUNCTION NAME (arguments);
    EXEC SQL EXECUTE
    b.
    BEGIN
    PACKAGE NAME.PROCEDURE NAME (parameters)
    variable := PACKAGE NAME.FUNCTION NAME (arguments);
    END;
    END EXEC;
    c. EXECUTE PACKAGE NAME.PROCEDURE if the procedures does not have any
    out/in-out parameters. A function can not be called.
    34 How many types of database triggers can be specified on a table ? What are they ?
    Insert Update Delete
    Before Row o.k. o.k. o.k.
    After Row o.k. o.k. o.k.
    Before Statement o.k. o.k. o.k.
    After Statement o.k. o.k. o.k.
    If FOR EACH ROW clause is specified, then the trigger for each Row affected by the statement.
    If WHEN clause is specified, the trigger fires according to the returned Boolean value.
    35 Give the structure of the procedure ?
    PROCEDURE name (parameter list.....)
    is
    local variable declarations
    BEGIN
    Executable statements.
    Exception.
    exception handlers
    end;
    36 Give the structure of the function ?
    FUNCTION name (argument list .....) Return datatype is
    local variable declarations
    Begin
    executable statements
    Exception
    execution handlers
    End;
    37 Explain the usage of WHERE CURRENT OF clause in cursors ?
    WHERE CURRENT OF clause in an UPDATE,DELETE statement refers to the latest row fetched from a cursor.
    Database Triggers
    38 Explain the two type of Cursors ?
    There are two types of cursors, Implicit Cursor and Explicit Cursor.
    PL/SQL uses Implicit Cursors for queries.
    User defined cursors are called Explicit Cursors. They can be declared and used.
    39 Explain how procedures and functions are called in a PL/SQL block ?
    Function is called as part of an expression.
    sal := calculate_sal ('a822');
    procedure is called as a PL/SQL statement
    calculate_bonus ('A822');
    Programmatic Constructs
    Last Update: September 06, 2004
    1 What are the different types of PL/SQL program units that can be defined and stored in ORACLE database ?
    Procedures and Functions,Packages and Database Triggers.
    2 What are the differences between Database Trigger and Integrity constraints ?
    A declarative integrity constraint is a statement about the database that is always true. A constraint applies to existing data in the table and any statement that manipulates the table.
    A trigger does not apply to data loaded before the definition of the trigger, therefore, it does not guarantee all data in a table conforms to the rules established by an associated trigger.
    A trigger can be used to enforce transitional constraints where as a declarative integrity constraint cannot be used.
    3 What is difference between Procedures and Functions ?
    A Function returns a value to the caller where as a Procedure does not.
    4 What is Database Trigger ?
    A Database Trigger is procedure (set of SQL and PL/SQL statements) that is automatically executed as a result of an insert in,update to, or delete from a table.
    5 What is a Procedure ?
    A Procedure consist of a set of SQL and PL/SQL statements that are grouped together as a unit to solve a specific problem or perform a set of related tasks.
    6 What is a Package ?
    A Package is a collection of related procedures, functions, variables and other package constructs together as a unit in the database.
    7 What are the uses of Database Trigger ?
    Database triggers can be used to automatic data generation, audit data modifications, enforce complex Integrity constraints, and customize complex security authorizations.
    8 What are the advantages of having a Package ?
    Increased functionality (for example,global package variables can be declared and used by any proecdure in the package) and performance (for example all objects of the package are parsed compiled, and loaded into memory once)
    1 With which function of summary item is the compute at options required?
    percentage of total functions.
    2 Why is it preferable to create a fewer no. of queries in the data model?
    Because for each query, report has to open a separate cursor and has to rebind, execute and fetch data.
    3 Why is a Where clause faster than a group filter or a format trigger?
    Because, in a where clause the condition is applied during data retrieval than after retrieving the data.
    4 Which parameter can be used to set read level consistency across multiple queries?
    Read only.
    5 Which of the two views should objects according to possession?
    view by structure.
    6 Which of the above methods is the faster method?
    performing the calculation in the query is faster.
    7 Where is the external query executed at the client or the server?
    At the server.
    8 Where is a procedure return in an external pl/sql library executed at the client or at the server?
    At the client.
    9 When do you use data parameter type?
    When the value of a data parameter being passed to a called product is always the name of the record group defined in the current form. Data parameters are used to pass data to produts invoked with the run_product built-in subprogram.
    10 When a form is invoked with call_form, Does oracle forms issues a save point?
    Yes
    11 What are the important difference between property clause and visual attributes?
    Named visual attributes differ only font, color & pattern attributes, property clauses can contain this and any other properties. You can change the appearance of objects at run time by changing the named visual attributes programmatically , property clause assignments cannot be changed programmatically. When an object is inheriting from both a property clause and named visual attribute, the named visual attribute settings take precedence, and any visual attribute properties in the class are ignored.
    12 What use of command line parameter cmd file?
    It is a command line argument that allows you to specify a file that contain a set of arguments for r20run.
    13 What is WHEN-Database-record trigger?
    Fires when oracle forms first marks a record as an insert or an update. The trigger fires as soon as oracle forms determines through validation that the record should be processed by the next post or commit as an insert or update. c generally occurs only when the operators modifies the first item in the record, and after the operator attempts to navigate out of the item.
    14 What is use of term?
    The term file which key is correspond to which oracle report functions.
    15 What is trigger associated with the timer?
    When-timer-expired.
    16 What is the use of transactional triggers?
    Using transactional triggers we can control or modify the default functionality of the oracle forms.
    17 What is the use of place holder column?
    A placeholder column is used to hold calculated values at a specified place rather than allowing is to appear in the actual row where it has to appear.
    18 What is the use of image_zoom built-in?
    To manipulate images in image items.
    19 What is the use of hidden column?
    A hidden column is used to when a column has to embed into boilerplate text.
    20 What is the use of break group?
    A break group is used to display one record for one group ones. While multiple related records in other group can be displayed.
    21 What is the remove on exit property?
    For a modelless window, it determines whether oracle forms hides the window automatically when the operators navigates to an item in the another window.
    22 What is the purpose of the product order option in the column property sheet?
    To specify the order of individual group evaluation in a cross products.
    23 What is the maximum no of chars the parameter can store?
    The maximum no of chars the parameter can store is only valid for char parameters, which can be upto 64K. No parameters default to 23Bytes and Date parameter default to 7Bytes.
    24 What is the main diff. bet. Reports 2.0 & Reports 2.5?
    Report 2.5 is object oriented.
    25 What is the frame & repeating frame?
    A frame is a holder for a group of fields. A repeating frame is used to display a set of records when the no. of records that are to displayed is not known before.
    26 What is the difference between OLE Server & Ole Container?
    An Ole server application creates ole Objects that are embedded or linked in ole Containers ex. Ole servers are ms_word & ms_excel. OLE containers provide a place to store, display and manipulate objects that are created by ole server applications. Ex. oracle forms is an example of an ole Container.
    27 What is the difference between object embedding & linking in Oracle forms?
    In Oracle forms, Embedded objects become part of the form module, and linked objects are references from a form module to a linked source file.
    28 What is the difference between boiler plat images and image items?
    Boiler plate Images are static images (Either vector or bit map) that you import from the file system or database to use a graphical elements in your form, such as company logos and maps. Image items are special types of interface controls that store and display either vector or bitmap images. Like other items that store values, image items can be either base table items(items that relate directly to database columns) or control items. The definition of an image item is stored as part of the form module FMB and FMX files, but no image file is actually associated with an image item until the item is populate at run time.
    29 What is the difference between $$DATE$$ & $$DBDATE$$ $$DBDATE$$ retrieves the current database date $$date$$ retrieves the current operating system date.
    30 What is the diff. when Flex mode is mode on and when it is off?
    When flex mode is on, reports automatically resizes the parent when the child is resized.
    31 What is the diff. when confine mode is on and when it is off?
    When confine mode is on, an object cannot be moved outside its parent in the layout.
    32 What is the diff. bet. setting up of parameters in reports 2.0 reports 2.5?
    LOVs can be attached to parameters in the reports 2.5 parameter form.
    33 What is the advantage of the library?
    Libraries provide a convenient means of storing client-side program units and sharing them among multiple applications. Once you create a library, you can attach it to any other form, menu, or library modules. When you can call library program units from triggers menu items commands and user named routine, you write in the modules to which you have attach the library. When a library attaches another library, program units in the first library can reference program units in the attached library. Library support dynamic loading-that is library program units are loaded into an application only when needed. This can significantly reduce the run-time memory requirements of applications.
    34 What is term?
    The term is terminal definition file that describes the terminal form which you are using r20run.
    35 What is system.coordination_operation?
    It represents the coordination causing event that occur on the master block in master-detail relation.
    36 What is synchronize?
    It is a terminal screen with the internal state of the form. It updates the screen display to reflect the information that oracle forms has in its internal representation of the screen.
    37 What is strip sources generate options?
    Removes the source code from the library file and generates a library files that contains only pcode. The resulting file can be used for final deployment, but can not be subsequently edited in the designer. ex. f45gen module=old_lib.pll userid=scott/tiger strip_source YES output_file
    38 What is relation between the window and canvas views?
    Canvas views are the back ground objects on which you place the interface items (Text items), check boxes, radio groups etc.,) and boilerplate objects (boxes, lines, images etc.,) that operators interact with us they run your form . Each canvas views displayed in a window.
    39 What is pop list?
    The pop list style list item appears initially as a single field (similar to a text item field). When the operator selects the list icon, a list of available choices appears.
    40 What is new_form built-in?
    When one form invokes another form by executing new_form oracle form exits the first form and releases its memory before loading the new form calling new form completely replace the first with the second. If there are changes pending in the first form, the operator will be prompted to save them before the new form is loaded.
    41 What is lexical reference? How can it be created?
    Lexical reference is place_holder for text that can be embedded in a sql statements. A lexical reference can be created using & before the column or parameter name.
    42 What is forms_DDL?
    Issues dynamic Sql statements at run time, including server side pl/SQl and DDL
    43 What is difference between open_form and call_form?
    when one form invokes another form by executing open_form the first form remains displayed, and operators can navigate between the forms as desired. when one form invokes another form by executing call_form, the called form is modal with respect to the calling form. That is, any windows that belong to the calling form are disabled, and operators cannot navigate to them until they first exit the called form.
    44 What is bind reference and how can it be created?
    Bind reference are used to replace the single value in sql, pl/sql statements a bind reference can be created using a (:) before a column or a parameter name.
    45 What is an user exit used for?
    A way in which to pass control (and possibly arguments ) form Oracle report to another Oracle products of 3 GL and then return control ( and ) back to Oracle reports.
    46 What is an OLE?
    Object Linking & Embedding provides you with the capability to integrate objects from many Ms-Windows applications into a single compound document creating integrated applications enables you to use the features form .
    47 What is an object group?
    An object group is a container for a group of objects; you define an object group when you want to package related objects, so that you copy or reference them in other modules.
    48 What is an anchoring object & what is its use?
    An anchoring object is a print condition object which used to explicitly or implicitly anchor other objects to itself.
    49 What is a User_exit?
    Calls the user exit named in the user_exit_string. Invokes a 3Gl program by name which has been properly linked into your current oracle forms executable.
    50 What is a timer?
    Timer is an "internal time clock" that you can programmatically create to perform an action each time the timer expires.
    51 What is a Text_io Package?
    It allows you to read and write information to a file in the file system.
    52 What is a text list?
    The text list style list item appears as a rectangular box which displays the fixed number of values. When the text list contains values that can not be displayed, a vertical scroll bar appears, allowing the operator to view and select undisplayed values.
    53 What is a property clause?
    A property clause is a named object that contains a list of properties and their settings. Once you create a property clause you can base other object on it. An object based on a property can inherit the setting of any property in the clause that makes sense for that object.
    54 What is a physical page ? & What is a logical page ?
    A physical page is a size of a page. That is output by the printer. The logical page is the size of one page of the actual report as seen in the Previewer.
    55 What is a library?
    A library is a collection of subprograms including user named procedures, functions and packages.
    56 What is a difference between pre-select and pre-query?
    Fires during the execute query and count query processing after oracle forms constructs the select statement to be issued, but before the statement is actually issued. The pre-query trigger fires just before oracle forms issues the select statement to the database after the operator as define the example records by entering the query criteria in enter query mode. Pre-query trigger fires before pre-select trigger.
    57 What is a combo box?
    A combo box style list item combines the features found in list and text item. Unlike the pop list or the text list style list items, the combo box style list item will both display fixed values and accept one operator entered value.
    58 What does the term panel refer to with regard to pages?
    A panel is the no. of physical pages needed to print one logical page.
    59 What are visual attributes?
    Visual attributes are the font, color, pattern proprieties that you set for form and menu objects that appear in your application interface.
    60 What are three panes that appear in the run time pl/sql interpreter?
    1.Source pane. 2. interpreter pane. 3. Navigator pane.
    Regards
    B RANGARAJAN

  • DEFERRED TRANSACTION QUEUE의 내용을 지우는 여러가지 방법 (replication)

    제품 : ORACLE SERVER
    작성날짜 : 2004-08-13
    PURPOSE
    advanced replication 환경에서, 특정 master site나 updatable snapshot
    site은 다른 remote의 master site로 데이타를 propagation시키기 위해서
    해당 local site에 deferred transaction queue를 유지한다.
    remote site로 잘 전달된 데이타는 주기적으로 dbms_defer_sys.purge job에
    의해 deferred transaction queue인 DEFCALL에서 지워지게 되는데, 경우에
    따라 문제가 발생하면서 DEFCALL의 내용이 remote site로 전달이 안되면서
    계속해서 지워지지 않고 남게 될 수 있다.
    이러한 경우 다음 트랜잭션의 진행이나 전달에도 방해가 될 수 있어
    강제로 지우고자 하는 상황이 발생하는데 그러한 경우의 조치 방법에 대해서
    자세히 설명한다.
    SCOPE
    Advanced Replication Feature는 8~10g Standard Edition에서는 지원하지
    않는다.
    Explanation
    1. 특정 deferred transaction id를 지우는 경우
    기본적으로 deferred transaction queue에 쌓인 트랜잭션을 지우는
    방법은 다음과 같다.
    dbms_defer_sys.delete_tran(deferred_tran_id, destination)
    즉 다음 예와 같다.
    SQL>exec dbms_defer_sys.delete_tran('2.7.10', 'rep2.world');
    이때, 해당 destination에 대한 모든 트랜잭션인경우는 앞의 argument를
    null로 하고, 특정 transaction id에 대한 모든 destination에 대해서인
    경우는 뒷부분의 argument를 null로 한다.
    결국 저장된 모든 deferred transaction이라면, 다음과 같다.
    SQL>exec dbms_defer_sys.delete_tran(null,null);
    2. 특정 table에 관한 내용만 지우는 경우
    예를 들어 특정 table, 여기서는 DEPT table에 관한 사항을 DEFCALL에서
    지우고자 한다면 다음과 같이 조치하면 된다.
    SQL>connect repadmin/repadmin
    SQL>set pagesize 1000
    SQL>set head off
    SQL>spool purgedefcall.sql
    SQL>select 'exec dbms_defer_sys.delete_tran('''
    || deferred_tran_id || ''', null);'
    from defcall
    where packagename like 'DEPT%';
    SQL>spool off
    spool에 의해 만들어진 purgedefcall.sql을 깨끗하게 편집한 후 다시 save한다.
    SQL>connect repadmin/repadmin
    SQL>@purgedefcall.sql
    이때 만약 특정 site로의 전달만을 막고자 한다면, null대신 MS_B.WORLD와 같이
    해당 site를 가리키는 database link이름을 직접 지정하면 된다.
    3. 전체 queue의 내용을 모두 지우는 경우
    DEFCALL의 내용을 모두 지우는 경우라면 기본적으로는 앞에서 사용한
    DBMS_DEFER_SYS.DELETE_TRAN을 이용하면 된다.
    SQL>connect repadmin/repadmin
    SQL>exec dbms_defer_sys.delete_tran(null,null);
    DEFERROR의 내용을 모두 지우는 경우에는 DBMS_DEFER_SYS.DELETE_ERROR를
    사용한다.
    SQL>exec dbms_defer_sys.delete_error(null,null);
    그런데 이 delete_tran과 delete_error의 경우는 내부적으로 delete문장을
    사용하면서 undo record를 위해 rollback을 사용하면서 지워야 하는 데이타가
    매우 많은 경우 속도도 문제가 되고 rollback space오류도 발생 가능하다.
    이러한 경우에는 다음과 같이 truncate command를 이용하여 간단하고 빠르게
    deferred transaction queue의 내용을 정리할 수 있다.
    (1) Oracle7의 경우
    DEF$_CALL, DEF$_CALLDEST, DEF$_ERROR 를 모두 truncate시킨다.
    단 이때 DEF$_CALLDEST가 DEF$_CALL을 reference하는 constraint가 있는 관계로,
    DEF$_CALLDEST를 모두 truncate하여 데이타가 전혀 없는 상태에서도,
    DEF$_CALL이 truncate가 되지 않는다.
    delete operation의 경우 child table이 비어 있다면 master table의 데이타를
    지우는데 오류가 없지만, truncate의 경우는 데이타 확인 없이 바로 지우는
    것이기 때문에 child table에 데이타가 없다하더라도 그러한 check없이,
    무조건 자신을 reference하는 child table의 constraint가 enable되어 있는한은
    master table이 truncate가 불가능하게 된다.
    SQL>connect as system/password
    SQL>alter table system.DEF$_CALLDEST disable constraint
    DEF$_CALLDEST_CALL;
    SQL>truncate table system.DEF$_CALL;
    SQL>truncate table system.DEF$_CALLDEST;
    SQL>truncate table system.DEF$_ERROR;
    SQL>alter table system.DEF$_CALLDEST enable constraint DEF$_CALLDEST_CALL;
    (2) Oracle8의 경우
    Oracle8에서는 DEF$_CALLDEST가 더이상 DEF$_CALLDEST_CALL constraint를
    가지지 않으므로 이 부분에 대한 고려는 필요없이 다음과 같이 해당 table들을
    truncate시키면 된다.
    SQL>truncate table system.DEF$_AQCALL;
    SQL>truncate table system.DEF$_CALLDEST;
    SQL>truncate table system.DEF$_ERROR;
    SQL>truncate table system.DEF$_AQERROR;
    4. deferror의 내용을 지우는 방법
    deferred transaction이 remote로 전달되어 반영되다가 오류가 발생하면
    source가 되는 데이타베이스의 queue에서는 해당 내용이 사라지고,
    반영되던 destination 데이타베이스의 deferror와 defcall/deftran에
    해당 내용이 쌓이게 된다.
    이러한 경우 error의 내용을 다시 반영을 시도하거나 아니면 내용을
    확인 후 지우게 된다.
    다음과 같이 지우면 된다.
    SQL>exec dbms_defer_sys.delete_error(null,null);
    참고로 다시 수행하는 것은
    SQL>exec dbms_defer_sys.execute_error(null,null);
    Reference Documents
    <Note:190885.1> How to Clear Down the Deferred Queue and DBMS_DEFER_SYS.
    DELETE_TRAN

  • Dba_scheduler_jobs for clearing the sys audit table

    Hi.
    can u please tell me how to purge a sys.aud$ table records once its reached more than once lakh ... these 1 lakh is the threshold and other more data will be peridiodically purged by automated dba_scheduler_jobs.
    My db is - 10g
    so i need to always retain 1lakh rows on the table..extra data will be purged...once breaching the threshold...i don know how to write..since i am new to this oracle.can anyone help?
    Thanks

    See these MOS Docs
    How To Shrink AUD$ IN ORACLE 10G (Doc ID 1080112.1)
    New Feature DBMS_AUDIT_MGMT To Manage And Purge Audit Information (Doc ID 731908.1)
    How to Truncate, Delete, or Purge Rows from the Audit Trail Table SYS.AUD$ (Doc ID 73408.1)
    Srini

  • Populating a table sequentially

    I have a column within a table which is already truncated/deleted (Microsoft SQL 2008). I have to now populate the column  with sequential numbers up to 50,000 records arbitrary numbers (doesn't mater) up to 7 characters.
     Can any one help as to what SQL statement I need to write that will automatically polulate the newly empty table with A000001,A0000002,A0000003, etc so that I can sort number the records within the table.
     I have approximately 50000 records which I need to sequentially entered and I really dont want to number the column manually via hand editing.
     Thanks in advance

    Please follow basic Netiquette and post the DDL we need to answer this. Follow industry and ANSI/ISO standards in your data. You should follow ISO-11179 rules for naming data elements. You should follow ISO-8601 rules for displaying temporal data. We need
    to know the data types, keys and constraints on the table. Avoid dialect in favor of ANSI/ISO Standard SQL. 
    And you need to read and download the PDF for: 
    https://www.simple-talk.com/books/sql-books/119-sql-code-smells/
    >> I have to now populate it with sequential numbers up to 50,000 records [sic] arbitrary numbers (doesn't matter) up to 7 characters. <<
    Rows are not records; this is a fundamental concept. Numeric values are not character strings; this is another fundamental concept. On a scale from 1 to 10, what color is your favorite letter of the alphabet? 
    In COBOL, all the data is characters; so why are you trying to write COBOL in SQL? We have no idea how the numeric values are kept internally in SQL; we work at a more abstract level. 
    >>  Can any one help as to what SQL statement I need to write that will automatically populate the newly empty table with 'A000001', 'A0000002', 'A0000003', etc so that I can sort number the records [sic] within the table. <<
    What you showed is strings without the required single quotes on them. Sort? SQL is based on sets, so a table has no ordering by definition. That is one of the many ways rows are not records. 
    >> I have approximately 50000 records [sic] which I need to be sequentially entered and I really do not want to number the column manually via hand editing. <<
    Why do you want to do this without the rest of the data for the rows? You need to read this:
    https://www.simple-talk.com/sql/learn-sql-server/sql-server-sequence-basics/
    Read the part about creating ticket numbers. 
    --CELKO-- Books in Celko Series for Morgan-Kaufmann Publishing: Analytics and OLAP in SQL / Data and Databases: Concepts in Practice Data / Measurements and Standards in SQL SQL for Smarties / SQL Programming Style / SQL Puzzles and Answers / Thinking
    in Sets / Trees and Hierarchies in SQL

  • Data pump imports

    I have a need to move the data from certain tables(of schema A) to schema B.I would be moving only tables and no other objects.I am using oracle sql developer and thought there are 2 options:
    1.database copy  2.datapump
    I have few questions:
    1.Datapump import is not working if the target environment has truncated tables.It works only if the target tables are dropped...why? is there any setting that i can do so that it drops the table at runtime by itself if required?
    2.which is teh best? db copy or datapump ...also do we have any other effective options for moving data
    plaese suggest.thanks in advance

    3bc2b7be-dee7-4dfd-b905-2d63f2927e86 wrote:
    I have a need to move the data from certain tables(of schema A) to schema B.I would be moving only tables and no other objects.I am using oracle sql developer and thought there are 2 options:
    1.database copy  2.datapump
    I have few questions:
    1.Datapump import is not working if the target environment has truncated tables.It works only if the target tables are dropped...why? is there any setting that i can do so that it drops the table at runtime by itself if required?
    2.which is teh best? db copy or datapump ...also do we have any other effective options for moving data
    plaese suggest.thanks in advance
    Sounds like you need to take a look at the
    TABLE_EXISTS_ACTION
    parameter of impdp.
    From
    Oracle® Database Utilities
    11g Release 2 (11.2)
    E22490-05
    Contents
    TABLE_EXISTS_ACTION
    Default: SKIP (Note that if CONTENT=DATA_ONLY is specified, then the default is APPEND, not SKIP.)
    Purpose
    Tells Import what to do if the table it is trying to create already exists.
    Syntax and Description
    TABLE_EXISTS_ACTION=[SKIP | APPEND | TRUNCATE | REPLACE]
    The possible values have the following effects:
    SKIP leaves the table as is and moves on to the next object. This is not a valid option if the CONTENT parameter is set to DATA_ONLY.
    APPEND loads rows from the source and leaves existing rows unchanged.
    TRUNCATE deletes existing rows and then loads rows from the source.
    REPLACE drops the existing table and then creates and loads it from the source. This is not a valid option if the CONTENT parameter is set to DATA_ONLY.
    ====================
    Hint: whenever I have a question about how to do something with a utility, the very first thing I do is check the documentation and simply go down the list of run-time parameters to see if something looks like it might do what I want.

  • Problem after installing NW04

    Hello SAP Gurus:
    I have just installed NetWeaver '04.  When I log on to client 000  using DDIC, I get this error message LOAD_FORMAT_ERROR.
    Can someone please help fix this problem?
    Thanks in advance.

    Hi
    There may be some old loads in the load table from    
    an old installation.Check /usr/sap/SID/DVEBMGSXX/work_dev_w0_loadformat.
    Truncate (delete all entries)         
    the following tables                                           
    and to restart the system:                                                                               
    D010LINF                                                       
    D010L                                                          
    D010Q                                                          
    D010Y  <- may be no existing.
    Restart the system.Should work.
    Reward oints if usefull

  • 10.2.0.5 Database (  WE8ISO8859P1)   --- AL32UTF8

    Hi All,
    I have reviewed a lot of the ML docs but would just like to clarify/verify.
    1). LOSSY DATA; Needs to be fixed or we will have data losss
    2). CONVERTIBLE DATA : how to fix this?
    What does actually mean?
    any User/Application Data that is "convertible" needs to be exported and truncated/deleted before the change of the characterset and imported afterwards.
    " I need to export the data first"? What if I am using DMU utility?

    "Lossy" has been renamed in the DMU to "Invalid Binary Representation". The new name better describes the actual problem with the data but is the same as "lossy".
    "Convertible" data will be converted by the DMU unless it is in data dictionary columns (other than a few supported).
    In CSSCAN, "convertible" means requiring export/import, except for convertible CLOB columns in data dictionary tables.
    CSSCAN and DMU "convertible" is the same category but CSSCAN-based migration process is not normally able to convert in place.
    -- Sergiusz

Maybe you are looking for

  • Can multiple transducer be handled by single datalogger

    I have 3 presure guages generating 0-20mA analog signal and one differential pressure transducer also generating 0-20 mA signal. I need to maintain a log of all pressure readings. In this regard I need to have a datalogger which can translate my anal

  • New ABAP Debugger Session does not close after Exiting

    Hi Friends, I am working on SAP GUI 710 & ECC 6.  When I am  debugging, new abap debugger is opening and I can do analysis normally. When we finish the debugging and want to exit, the debugging session is not closing and i get the following message o

  • HDMI connected to work flatscreen not displaying, but detected

    Hi all. I'm having an HDMI output problem on a MacBook pro retina, just got it a couple days ago. When I connect to the flatscreen in the conference room (Toshiba) via HDMI, the mac screen does it's resolution-switching blue flicker, and I get, in th

  • Cant specify the Java Build Path in the Web Module Project

    hi, I have a problem while specify  the project dependencies in the Web Module Project.While opening the properties of the web module project i cant choose the Java Build Path.The only two options i have are design root path and web service consisten

  • PO Release strategy User Exit  if value is Reduced

    Hi, I need to write a user exit to trigger the release strategy in Purchase order even if the value is "Reduced". As you may be knowing releases will only be triggered if the value is increased according to standard SAP functionality. So to trigger t