Query on Recyclebin (Oracle 10g)

Hi Gurus,
Can you tell me the command to clear the Recyclebin in Oracle 10g.
Thanks in advance
~Anup.

[url http://download-west.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_9018.htm#i2152611]purge
You want not to use Recyclebin, then you may try as follws
alter system set recyclebin = off scope = both; -- 10.20
alter system set _recyclebin = off scope = spfile; -- 10.01                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

Similar Messages

  • Sub-query problem on Oracle 10g

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

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

  • How do I clear query parameter in Oracle 10g ADF

    HI ,
    My question is
    1. when i am navigating to page B from Page A its querying data and showing . And I have same Pgae B which is attached to Menu also
    so . How do i trace whether I am comming from menu or comming from Page A ..??
    2. if i moved to page A and searched with some criteria , after then I moved to Page B from Menu , again come back to Page A from Menu
    its retaining the old search criteria in the page . not clearing my search criteria . ( as a result what is happening its not showing the data whatever
    in the Table ) . In order to show my existing data , i need to clear and then again clicking page B in Menu then only its showing the data .
    so how to clear query parameter

    [email protected] wrote:
    HI ,
    My question is
    1. when i am navigating to page B from Page A its querying data and showing . And I have same Pgae B which is attached to Menu also
    so . How do i trace whether I am comming from menu or comming from Page A ..??Add a setActionListner and set a sessionscope variable according to the action?
    >
    2. if i moved to page A and searched with some criteria , after then I moved to Page B from Menu , again come back to Page A from Menu
    its retaining the old search criteria in the page . not clearing my search criteria . ( as a result what is happening its not showing the data whatever
    in the Table ) . In order to show my existing data , i need to clear and then again clicking page B in Menu then only its showing the data .
    so how to clear query parameter

  • Slow query against seg$ - Oracle 10g

    Hi,
    Our AWR report shows the following slow query, 3 minutes per execution,
    select file#, block# from seg$ where type# = 3 and ts# = :1
    This query isn't from our application for sure. Does anyone know what backgroud jobs or processes may execute this query?
    Thanks.

    user632535 wrote:
    Hi,
    Our AWR report shows the following slow query, 3 minutes per execution,
    select file#, block# from seg$ where type# = 3 and ts# = :1
    This query isn't from our application for sure. Does anyone know what backgroud jobs or processes may execute this query?
    It looks like the type of thing the SMON would run to clear up temporary segments after a process has done a rebuild, move, drop or similar. One reason why it might be slow is if you have a very large number of objects in a given tablespace that is subject to a lot of drops, creates etc. (E.g. a tablespace holding a complicated composite partitioned object with lots of indexes that goes through a frequent cycle of add/drop partition).
    Regards
    Jonathan Lewis
    http://jonathanlewis.wordpress.com
    http://www.jlcomp.demon.co.uk
    "The temptation to form premature theories upon insufficient data is the bane of our profession."
    Sherlock Holmes (Sir Arthur Conan Doyle) in "The Valley of Fear".

  • Oracle 10g Licensing Query

    Hi,
    I have a query with regards to Oracle 10g licensing for additional options (OLAP, Data Mining, Partitioning, Spatial & Database Vault) on top of enterprise edition.
    Even though i am not using any of the options, i have them installed along with enterprise edition. Do i still need to pay for these additional options?
    From 10g, you can always prove to oracle that any of the features/options are not in use via DBA_FEATURE_USAGE_STATISTICS.
    We are using shared infrastructure for hosting many application databases. Today we have a application that uses only partitioning, but tommorrow we might have to create a database within the same oracle home that uses OLAP & data mining as well.
    would be interested in knowing what is oracle stand on this i.e. we pay for additional options only if we are using them or we pay just because they are installed regardless of we are using them or not??
    Thanks & Regards
    Chandar

    Chandark,
    You need to pay licenses if you are using it commercially and if it is installed and you haven't paid for it then how would you stop anyone not using it because its not paid but its there. This will be against your contractual agreement and they may fine you or you have to pay for the options. So I recommend not to install options you haven't paid for to avoid any issues. But if you are using for learning purpose and not commercial then you are good. You can further contact local Oracle Support or local Sales rep for more information
    Hope this helps, regards
    OrionNet

  • Issue with "Select Distinct" query in Oracle 10g against Oracle 9i

    Hi,
    I would appreciate if some one help me here because it is really urgent.
    We are upgrading our database from 9i to 10g.
    There are the "Select distinct" queries in the code which populated the grid on the applications screens. We found a difference in 9i and 10g the way the result is populated for these queries. If "Select Distinct" query wihtout a order by clause is executed in 9i then the result is automatically sorted. But Oracle 10g does not do this.
    We can change the queries adding order by clause but we are almost at the end of the testing and want to know if there is any way that we can do this from database settings. Would there be any impact of these settings change on overall operation of Oracle 10g?
    I would appreciate if some one can help me here.
    Thanks,
    Dinesh

    then the result is automatically sorted.No. Oracle may have done a sort operation to perform the distinct, but it still did not guarantee the order of your results.
    In 10g and in 9i, if you want your results in a certain order you must use order by.

  • Query can run in Oracle 10g but very slow in 11g

    Hi,
    We've just migrated to Oracle 11g and we noticed that some of our view are very slow (it takes seconds in 10g and takes 30 minutes in 11g), and the tables are using the local table.
    Do any of you face the same issue?
    This is our query:
    SELECT
    A.wellbore
    ,a.depth center
    ,d.MD maxbc
    ,d.XDELT xbc
    ,d.YDELT ybc
    ,e.MD minac
    ,e.XDELT xac
    ,e.YDELT yac
    from
    table_A d,table_A e, table_B a
    where a.wellbore = d.WELLBORE (+)
    and a.wellbore = e.WELLBORE(+)
    and d.MD = (select max(MD) from table_A b where b.MD < a.depth and
    d.wellBORE = b.wellBORE)
    and e.md = (select min(md) from table_A c where c.MD > a.depth and
    e.wellBORE = c.wellBORE);

    Thanks I will move to the correct one..
    Rafi,
    Build the Indexes and it is still slow. I am querying from a view from another database, which is in 10g instances.
    Moved: Query can run in Oracle 10g but very slow in 11g
    Edited by: 924400 on Apr 1, 2012 6:03 PM
    Edited by: 924400 on Apr 1, 2012 6:26 PM

  • Query working fine in 9i but throwing an error in Oracle 10g

    Hi All,
    I am having a query which contains large number of When clauses inside a case statement.
    The Same SQL is working fine in 9i, but not working in 10G.
    If we try to remove one of the When clause in the query, its working fine else it is giving the error ORA-00939 Too many arguments for functions.
    Can any one tell me the solution for this and what is the maximum number of when clauses allowed inside case statemen in oracle 10g.
    Thanks in advance
    Regards
    Karthik

    it should not have worked in 9iR2... it is correct according to the doc to return an error message when using more than 255 expressions...
    SQL> select version from v$instance;
    VERSION
    9.2.0.7.0
    SQL> select case 1
      2  when 2 then 3
      3  when 4 then 5
      4  when 6 then 7
      5  when 8 then 9
      6  when 10 then 11
      7  when 12 then 13
      8  when 14 then 15
      9  when 16 then 17
    10  when 18 then 19
    11  when 20 then 21
    12  when 22 then 23
    13  when 24 then 25
    14  when 26 then 27
    15  when 28 then 29
    16  when 30 then 31
    17  when 32 then 33
    18  when 34 then 35
    19  when 36 then 37
    20  when 38 then 39
    21  when 40 then 41
    22  when 42 then 43
    23  when 44 then 45
    24  when 46 then 47
    25  when 48 then 49
    26  when 50 then 51
    27  when 52 then 53
    28  when 54 then 55
    29  when 56 then 57
    30  when 58 then 59
    31  when 60 then 61
    32  when 62 then 63
    33  when 64 then 65
    34  when 66 then 67
    35  when 68 then 69
    36  when 70 then 71
    37  when 72 then 73
    38  when 74 then 75
    39  when 76 then 77
    40  when 78 then 79
    41  when 80 then 81
    42  when 82 then 83
    43  when 84 then 85
    44  when 86 then 87
    45  when 88 then 89
    46  when 90 then 91
    47  when 92 then 93
    48  when 94 then 95
    49  when 96 then 97
    50  when 98 then 99
    51  when 100 then 101
    52  when 102 then 103
    53  when 104 then 105
    54  when 106 then 107
    55  when 108 then 109
    56  when 110 then 111
    57  when 112 then 113
    58  when 114 then 115
    59  when 116 then 117
    60  when 118 then 119
    61  when 120 then 121
    62  when 122 then 123
    63  when 124 then 125
    64  when 126 then 127
    65  when 128 then 129
    66  when 130 then 131
    67  when 132 then 133
    68  when 134 then 135
    69  when 136 then 137
    70  when 138 then 139
    71  when 140 then 141
    72  when 142 then 143
    73  when 144 then 145
    74  when 146 then 147
    75  when 148 then 149
    76  when 150 then 151
    77  when 152 then 153
    78  when 154 then 155
    79  when 156 then 157
    80  when 158 then 159
    81  when 160 then 161
    82  when 162 then 163
    83  when 164 then 165
    84  when 166 then 167
    85  when 168 then 169
    86  when 170 then 171
    87  when 172 then 173
    88  when 174 then 175
    89  when 176 then 177
    90  when 178 then 179
    91  when 180 then 181
    92  when 182 then 183
    93  when 184 then 185
    94  when 186 then 187
    95  when 188 then 189
    96  when 190 then 191
    97  when 192 then 193
    98  when 194 then 195
    99  when 196 then 197
    100  when 198 then 199
    101  when 200 then 201
    102  when 202 then 203
    103  when 204 then 205
    104  when 206 then 207
    105  when 208 then 209
    106  when 210 then 211
    107  when 212 then 213
    108  when 214 then 215
    109  when 216 then 217
    110  when 218 then 219
    111  when 220 then 221
    112  when 222 then 223
    113  when 224 then 225
    114  when 226 then 227
    115  when 228 then 229
    116  when 230 then 231
    117  when 232 then 233
    118  when 234 then 235
    119  when 236 then 237
    120  when 238 then 239
    121  when 240 then 241
    122  when 242 then 243
    123  when 244 then 245
    124  when 246 then 247
    125  when 248 then 249
    126  when 250 then 251
    127  when 252 then 253
    128  when 254 then 255
    129  when 256 then 257
    130  end x from dual;
             X
    SQL> select version from v$instance;
    VERSION
    10.2.0.2.0
    SQL> select case 1
      2  when 2 then 3
      3  when 4 then 5
      4  when 6 then 7
      5  when 8 then 9
      6  when 10 then 11
      7  when 12 then 13
      8  when 14 then 15
      9  when 16 then 17
    10  when 18 then 19
    11  when 20 then 21
    12  when 22 then 23
    13  when 24 then 25
    14  when 26 then 27
    15  when 28 then 29
    16  when 30 then 31
    17  when 32 then 33
    18  when 34 then 35
    19  when 36 then 37
    20  when 38 then 39
    21  when 40 then 41
    22  when 42 then 43
    23  when 44 then 45
    24  when 46 then 47
    25  when 48 then 49
    26  when 50 then 51
    27  when 52 then 53
    28  when 54 then 55
    29  when 56 then 57
    30  when 58 then 59
    31  when 60 then 61
    32  when 62 then 63
    33  when 64 then 65
    34  when 66 then 67
    35  when 68 then 69
    36  when 70 then 71
    37  when 72 then 73
    38  when 74 then 75
    39  when 76 then 77
    40  when 78 then 79
    41  when 80 then 81
    42  when 82 then 83
    43  when 84 then 85
    44  when 86 then 87
    45  when 88 then 89
    46  when 90 then 91
    47  when 92 then 93
    48  when 94 then 95
    49  when 96 then 97
    50  when 98 then 99
    51  when 100 then 101
    52  when 102 then 103
    53  when 104 then 105
    54  when 106 then 107
    55  when 108 then 109
    56  when 110 then 111
    57  when 112 then 113
    58  when 114 then 115
    59  when 116 then 117
    60  when 118 then 119
    61  when 120 then 121
    62  when 122 then 123
    63  when 124 then 125
    64  when 126 then 127
    65  when 128 then 129
    66  when 130 then 131
    67  when 132 then 133
    68  when 134 then 135
    69  when 136 then 137
    70  when 138 then 139
    71  when 140 then 141
    72  when 142 then 143
    73  when 144 then 145
    74  when 146 then 147
    75  when 148 then 149
    76  when 150 then 151
    77  when 152 then 153
    78  when 154 then 155
    79  when 156 then 157
    80  when 158 then 159
    81  when 160 then 161
    82  when 162 then 163
    83  when 164 then 165
    84  when 166 then 167
    85  when 168 then 169
    86  when 170 then 171
    87  when 172 then 173
    88  when 174 then 175
    89  when 176 then 177
    90  when 178 then 179
    91  when 180 then 181
    92  when 182 then 183
    93  when 184 then 185
    94  when 186 then 187
    95  when 188 then 189
    96  when 190 then 191
    97  when 192 then 193
    98  when 194 then 195
    99  when 196 then 197
    100  when 198 then 199
    101  when 200 then 201
    102  when 202 then 203
    103  when 204 then 205
    104  when 206 then 207
    105  when 208 then 209
    106  when 210 then 211
    107  when 212 then 213
    108  when 214 then 215
    109  when 216 then 217
    110  when 218 then 219
    111  when 220 then 221
    112  when 222 then 223
    113  when 224 then 225
    114  when 226 then 227
    115  when 228 then 229
    116  when 230 then 231
    117  when 232 then 233
    118  when 234 then 235
    119  when 236 then 237
    120  when 238 then 239
    121  when 240 then 241
    122  when 242 then 243
    123  when 244 then 245
    124  when 246 then 247
    125  when 248 then 249
    126  when 250 then 251
    127  when 252 then 253
    128  when 254 then 255
    129  when 256 then 257
    130  end x from dual;
    when 16 then 17
    ERROR at line 9:
    ORA-00939: too many arguments for function
    SQL> del 129
    SQL> /
             X
    ----------

  • Query works on Oracle 9i, but fails on Oracle 10g - puzzling...

    In porting an application from Oracle 9i to Oracle 10g, I hit a problem that for a while I assumed was some bug of mine. But I eventually isolated the problem and can reproduce this using a single sql script and then a single delete. The amazing thing is that it works fine on Oracle 9i (always) and fails on Oracle 10g (always).
    Have I found a bug? (I would be pretty amazed).
    Here's the situation. I have four tables and a trigger set on one of those tables.
    The tables are configured so that there is the "parent" table (A). Table B has a foreign key dependency on A's primary key, with "on delete cascade". Table B also has a trigger that runs on the delete. Table C (which has no data) has an integrity constraint on A's primary key. Table D holds information used by the trigger to determine if/when table C should be dropped. (I have a script that sets all this up).
    After setting up the tables and the few data records needed, I delete a record from Table A. This causes the records in Table B to be deleted. That fires the trigger, which determines that Table C can be dropped, so the trigger drops Table C. Then, Oracle decides it still needs to check the integrity constraint on Table C (after all, C depended on A and we have deleted a record in A). Oracle then issues a query against table C, but of course table C has already been dropped and an error results.
    The exact same script followed by the delete works fine on Oracle 9i. Is this a bug or is this a documented change in behavior? Any known workarounds? Unfortunately, the application needs all the integrity constraints that are present in the schema and also runs on SQL Server, so modifications in the integrity constraints are probably not what I am seeking).
    Thanks so much!
    RB

    I wasn't sure how to post the script, but it is short enough to include below. Many thanks for the quick response.
    To connect the script below to my original post, the names are:
    Table A = OT_AW_PROCESSDEF
    Table B = OT_AW_PROCESS_APPDATADEF
    Table C = OT_AW_AD_OneLoop_1
    Table D = OT_AW_APPDATA_TABLEINFO
    The trigger is also included in the script. After running this script, the command:
    delete from OT_AW_ProcessDef where processdefId = 101
    will cause the failure on Oracle10g, but succeeds on Oracle 9i.
    Thanks again!
    RB
    /* *********************** CLEAN UP ********************************** */
    /* Order the dropping of objects in reverse of creation */
    DROP TABLE OT_AW_AD_OneLoop_1 CASCADE CONSTRAINTS
    DROP TABLE OT_AW_PROCESS_APPDATADEF CASCADE CONSTRAINTS
    DROP TABLE OT_AW_APPDATA_TABLEINFO CASCADE CONSTRAINTS
    DROP TABLE OT_AW_PROCESSDEF CASCADE CONSTRAINTS
    /* ******************* DATA TABLES *********************************** */
    /* OT_AW_PROCESSDEF(Process Definition) Table */
    /* ********** NOTE: OT_AW_PROCESSDEF and AW_PROCESS TABLES SHOULD ALWAYS HAVE THE SAME SET OF COLUMNS ********* */
    create table OT_AW_PROCESSDEF (
    processDefId NUMBER /* Id for the process definition */
    , processDefName NVARCHAR2(255) /* Name of the process definition */
    , CONSTRAINT OT_AW_PROCESSDEF_PK PRIMARY KEY(processDefId)
    insert into OT_AW_PROCESSDEF (
    processDefId, processDefName
    values (
    1, 'ADHOC'
    /* OT_AW_APPDATA_TABLEINFO(List of all application Data tables in the system) Table */
    create table OT_AW_APPDATA_TABLEINFO (
    namespace VARCHAR2(65) NOT NULL, /* name of the namespace to which it belongs */
    tableName VARCHAR2(128) , /* Name of the appdata table */
    adLevel NUMBER(38) NOT NULL /* Appdata table level: 0=>PROCESS, 1=>CONVERSATION */
    , CONSTRAINT OT_AW_APPDATA_TABLEINFO_PK PRIMARY KEY ( tableName )
    , CONSTRAINT OT_AW_APPDATA_TABLEINFO_UNQ UNIQUE( namespace, tableName, adLevel )
    /* OT_AW_PROCESS_APPDATADEF(Process level application data definition) Table */
    create table OT_AW_PROCESS_APPDATADEF (
    processDefId NUMBER NOT NULL /* Id for the process definition */
    , name VARCHAR2(65) NOT NULL /* Name of the application data field, This name may be pointing to a shared namespace field */
    , tableName VARCHAR2(128) /* Name of the table that holds the value for the field, may be same as local namespace table name */
    , namespace VARCHAR2(65) NOT NULL /* Name of the namespace to which this field belongs */
    , mappedNamespace VARCHAR2(65) null /* Name of the shared namespace to which this field is mapped, if there is any mapping */
    , CONSTRAINT OT_AW_PROCESS_APPDATADEF_PK PRIMARY KEY (namespace, processDefId, name)
    , CONSTRAINT OT_AW_PROCESS_APPDATADEF_FK FOREIGN KEY (processDefId) REFERENCES OT_AW_PROCESSDEF(processDefId) on delete cascade
    CREATE TABLE OT_AW_AD_OneLoop_1(processDefId number , processId number ,FromRole number null, ToRole number null, Anyone number null,
    CONSTRAINT OT_AW_AD_OneLoop_1_FK1 FOREIGN KEY (processDefId) REFERENCES OT_AW_PROCESSDEF(processDefId) )
    /* TRIGGERS */
    CREATE OR REPLACE TRIGGER OT_AW_PROCESS_APPDATADEF_DEL
    AFTER DELETE ON OT_AW_PROCESS_APPDATADEF
    FOR EACH ROW
    DECLARE
    PRAGMA AUTONOMOUS_TRANSACTION;
    tableName_var OT_AW_PROCESS_APPDATADEF.tableName%TYPE;
    tempStr_var varchar2(128) :=null;
    deletedId OT_AW_PROCESS_APPDATADEF.processDefId%TYPE;
    deletedMNsp OT_AW_PROCESS_APPDATADEF.mappedNamespace%TYPE;
    numReferences number :=-1;
    tableExists number :=0;
    CURSOR ADPTable_cursor
    IS
    SELECT apa.tableName, apa.processDefId, apa.mappedNamespace
    FROM OT_AW_PROCESS_APPDATADEF apa
    WHERE apa.tableName = :old.tableName
    AND apa.processDefId = :old.processDefId;
    BEGIN
    dbms_output.put_line('Starting TRIGGER OT_AW_PROCESS_APPDATADEF_DEL');
    OPEN ADPTable_cursor;
    LOOP
    FETCH ADPTable_cursor
    INTO tableName_var, deletedId, deletedMNsp;
    EXIT WHEN ADPTable_cursor%NOTFOUND;
    BEGIN
    IF (deletedMNsp IS NULL) THEN
    BEGIN
    select count(*) into numReferences from OT_AW_PROCESS_APPDATADEF where tableName = tableName_var
    and processDefId <> deletedId;
    IF ( numReferences = 0 ) THEN
    BEGIN
    SELECT count(*) INTO tableExists FROM OT_AW_APPDATA_TABLEINFO where
              tableName=tableName_var;
    IF (tableExists > 0) THEN
    BEGIN
    --dbms_output.put_line('About to alter first table');
    -- EXECUTE IMMEDIATE 'ALTER TABLE ' || tableName_var || ' DROP CONSTRAINT ' || tableName_var ||'_FK1';
    --dbms_output.put_line('About to alter second table');
    -- EXECUTE IMMEDIATE 'ALTER TABLE ' || tableName_var || ' DROP CONSTRAINT ' || tableName_var ||'_FK2';
    dbms_output.put_line('About to drop table named: ' || tableName_var);
    tempStr_var := 'DROP TABLE ' || tableName_var;
    EXECUTE IMMEDIATE tempStr_var;
    dbms_output.put_line(tempStr_var);
    dbms_output.put_line('Table dropped');
    --dbms_output.put_line('Not dropping table now');
    END;
    END IF;
    delete from OT_AW_APPDATA_TABLEINFO where
              tableName=tableName_var;
    dbms_output.put_line('OT_AW_APPDATA_TABLEINFO updated');           
    END;
    END IF;
    END;
    END IF;
    END;
    END LOOP;
    dbms_output.put_line('Loop ended');
    CLOSE ADPTable_cursor;
    dbms_output.put_line('Cursor closed');
    COMMIT WORK;
    dbms_output.put_line('Work committed');
    dbms_output.put_line('Ending TRIGGER OT_AW_PROCESS_APPDATADEF_DEL');
    END;
    show errors;
    /* Set up data to simulate the creation of OT_AW_AD_OneLoop_1 */
    insert into OT_AW_PROCESSDEF (
    processDefId, processDefName
    values (
    101, 'OneLoop'
    insert into OT_AW_PROCESS_APPDATADEF (
    processDefId, name, tableName, namespace
    values (
    101, 'FromRole', 'OT_AW_AD_OneLoop_1', 'OneLoop'
    insert into OT_AW_PROCESS_APPDATADEF (
    processDefId, name, tableName, namespace
    values (
    101, 'ToRole', 'OT_AW_AD_OneLoop_1', 'OneLoop'
    insert into OT_AW_APPDATA_TABLEINFO (
    namespace, tablename, adlevel
    values (
    'OneLoop', 'OT_AW_AD_OneLoop_1', 0
    /

  • Oracle 11g- Straing behaviour of query after importing from Oracle 10g

    Hi,
    I have a table in Oracle 10g as follows:
    Create Table xyz (col1 varchar2(50), col2 varchar2(50));
    With following Data
    Col1     Col2
    A     320
    A     110
    A     290
    A     380
    B     ABC
    B     256
    B     LMN
    I am running following Query
    select * from xyz
    Where Col1='A' and Col2=110
    It works fine. But when I export this table and import it in Oracle 11g. It says invlid identifier.
    But if I enclose 110 in single quotes. It works fine.
    Also If I recreate this table in Oracle 11g like
    Create table xyz1
    as select * from xyz;
    Now alos I am able to run this query smoothly.
    select * from xyz1
    Where Col1='A' and Col2=110
    What is wrong exporting this table from 10g to 11g.
    Any comments/suggestion??
    Aarbi

    The check in your where clause
    Col2=110Is comparing a string (Col2 is defined as a VARCHAR) with a numeric literal, so there will be an implicit conversion taking place from character to number. The query then fails due to the B LMN row when 'LMN' fails number conversion.
    I'm guessing there was there an index on the table in your 10g installation which would allow the query to be satisfied without checking the B ABC or B LMN rows but is not present or not used in the 11g installation so a full table scan results in an attempt to convert 'ABC' and 'LMN' to a number. Check the explain plans.
    Or it could even just be a difference in the order in which the two conditions in the where clause are evaulated between the two versions.
    The solution, as you have already found is to do a string comparision
    Col2='110'Edited by: Cyn on Dec 7, 2009 12:38 PM

  • Oracle 10g vs Oracle 11g query performance

    Hi everyone,
    We are moving from Oracle 10g to Oracle 11g database.
    I have a query which in Oracle 1g takes 85 seconds to run, but when I run the same query in Oracle 11g database, it takes 635 seconds.
    I have confirmed that all indexes on tables involved are enabled.
    Does anyone have any pointers, what should I look into. I have compared explain plans and clearly they are different. Oracle 11g is taking a different approach than Oracle 1g.
    Thanks

    Pl post details of OS versions, exact database versions (to 4 digits) and init.ora parameters of the 10g and 11g databases. Have statistics been gathered after the upgrade ?
    For posting tuning requests, pl see these threads
    HOW TO: Post a SQL statement tuning request - template posting
    When your query takes too long ...
    Pl see if the SQL Performance Analyzer can help - MOS Doc 562899.1 (TESTING SQL PERFORMANCE IMPACT OF AN ORACLE 9i TO ORACLE DATABASE 10g RELEASE 2 UPGRADE WITH SQL PERFORMANCE ANALYZER)
    HTH
    Srini

  • SQL QUERY to create new schema in Oracle 10g Express

    Can anyone provide the SQL query to create a new schema in Oracle 10g Express edition.

    Can anyone provide a SQl query to create a
    schema/user named 'test' with username as 'system'
    and password as 'manager'system user is created during database creation, it's internal Oracle admin user that shouldn't be used as schema holder.
    In Oracle database, Oracle user is schema holder there's no seperate schema name to be defined other than username.

  • How to delete the recyclebin data  in oracle 10g

    i create one table.then i drop the that table.this table will be kept in recyclebin in oracle10g .how to remove table permanentley in oracle 10g.
    i used drop table table name and select * from tab;it will come two tables like
    BIN$kLM/ilgxTUil64ZsNG0l7A==$0.
    how to drop table permanentley.please give me steps.

    Hello;
    Use the PURGE statement to remove a table or index from your recycle bin and release all of the space associated with the object, or to remove the entire recycle bin, or to remove part of all of a dropped tablespace from the recycle bin.
    Remove a File From Your Recycle Bin: Example
    The following statement removes the table test from the recycle bin. If more than one version of test resides in the recycle bin, Oracle Database removes the version that has been there the longest:
    PURGE TABLE test;
    To determine system-generated name of the table you want removed from your recycle bin, issue a SELECT statement on your recycle bin. Using that object name, you can remove the table by issuing a statement similar to the following statement. (The system-generated name will differ from the one shown in the example.)
    PURGE TABLE RB$$33750$TABLE$0;
    Remove the Contents of Your Recycle Bin: Example
    To remove the entire contents of your recycle bin, issue the following statement:
    PURGE RECYCLEBIN;

  • Oracle 10G query

    I have following queries to be solved please help me out....
    1) Difference / Limitation of Oracle Standard Edition / Enterprise Edition 10..... latest ?
    2) Can Data of Oracle 8. ..... Expo File will be Imported to 10....... latest ?
    If not than what steps we have to take. Basically I would like my current DB of 8 to be moved to 10G
    3) From which AIX Ver Oracle 10 ...... is Supported ?
    4) if the customer has 8... Ver Lic When if goes for New Ver than media will have full Ver or only Upgrade files. ?
    5) If the Customer has Old ver Lic and he goes for upgrade Lic Than we have to first Install Old Lic Ver & than Upgrade or directly we can load Latest Lic Ver on New Server and work. ? What I mean is if I have to go ahead from Oracle 8 to Oracle 10G how should I go about.
    6) Is Oracle Media ver Compatible for Aix ?
    7) Oracle Lic Policy / Product Information Web Link ?
    Thanks & Regards
    Shivanand S S

    This is a perfectly valid way to query the data. Here's an example on my own production tables. This one has about 300 million rows:
    select *
    from   prod.tran_history
    where  tran_date >= to_date(add_months(sysdate, -2))
    | Id  | Operation                   |  Name                        | Rows  | Bytes | Cost  |
    |   0 | SELECT STATEMENT            |                              |    11M|   863M|   146K|
    |   1 |  TABLE ACCESS BY INDEX ROWID| TRAN_HISTORY                 |    11M|   863M|   146K|
    |*  2 |   INDEX RANGE SCAN          | TRAN_HIST_DATE_IDX           |  2144K|       |  2098 |
    --------------------------------------------------------------------------------------------

  • Oracle 10g Query Format

    0
    down vote
    favorite I am using oracle 10g. I have a temp table TEMP.
    TEMP has following structure:-
    USER COUNT TYPE
    1 10 T1
    2 21 T2
    3 45 T1
    1 7 T1
    I need a query which will show all types has column names,and types can be any value like T1,T2,..Tn and columns will be like:-
    USER T1 T2 Tn
    and User column will show all the users and T1,T2 column will show total count of types.
    Edited by: 969468 on Nov 15, 2012 9:35 PM

    Please see my original post ("I have a page erroring in production (but not in development) when it gets to a date that it needs to display.")  Sorry if it came across as vague.  It made sense, to me, when I typed it.  But, then, I'm usually typing fast just to get the question out there, when I'm in a hurry.
    Haven't done a CFDUMP, yet, as every time I make a change in development that needs to be tested in production, I have to notify my supervisor that there are files that need to be copied into production, which can sometimes take a while, so I try to do troubleshooting on dev side - it's a pain in the you-know-what, but that's the kind of environment I'm working in.
    As it turns out, changing the format in the SELECT to_char() did the trick.  If anyone else has this issue with Oracle 10g, I'm now using SELECT to_char(create_date,'YYYY/MM/DD HH:MI') FROM tableA, and now the CFOUTPUT is processing the whole page.  I guess the MM-DD-YYYY threw CF into a tizzy, breaking the process?
    Anyhoo, it's working, now.  Thank you, Dan and Adam, for your thoughts on this.
    ^_^

Maybe you are looking for