Oracle 10g Backupset Query..

Hi Team,
I am working Backup & Restore on Oracle 10g (10.2.0.1.0).
For the backup I am using the following Script.
run
CONFIGURE BACKUP OPTIMIZATION OFF;
CONFIGURE CONTROLFILE AUTOBACKUP OFF;
CONFIGURE DEVICE TYPE DISK PARALLELISM 1;
CONFIGURE MAXSETSIZE TO UNLIMITED;
ALLOCATE CHANNEL C1 TYPE DISK FORMAT 'C:\BK\DATAFILE_CTL_SPFILE_%d_%s';
BACKUP DATABASE INCLUDE CURRENT CONTROLFILE;
RELEASE CHANNEL C1;
ALLOCATE CHANNEL C2 TYPE DISK FORMAT 'C:\BK\ARCHIVELOG_%d_%s';
BACKUP ARCHIVELOG ALL;
RELEASE CHANNEL C2;
Here I am doing backup for Control file , datafile , Spfile & archivelog all.
while creating the backup sets it creates the total three pieces for the backup sets. as
1) DATAFILE_CTL_SPFILE_RAVI_13 - 610466 KB
2) DATAFILE_CTL_SPFILE_RAVI_14 - 6899 KB
3) ARCHIVELOG_RAVI_15 - 39035 KB
where as when I use the same scripts in the Oracle 9i it creates only two backup pieces.
1) DATAFILE_CTL_SPFILE_BALA_01 - 512,909 KB
2) ARCHIVELOG_BALA_02'; - 9019 KB
Although I had also explicitly set the
CONFIGURE MAXSETSIZE TO UNLIMITED;
Why is is so? Can anybody please help me..

Hi, from rman issue list backup; to see the content of each backup.
Regards.

Similar Messages

  • 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

  • APEX 3.2 -ORACLE 10G - PIVOT QUERY

    Hello, i searched around the forum and i cound't find an answer to this specific matter, although i saw some replies that were close...
    i need to creat a form based on a pivot query. but oracle 10g doesn't support that feature so i hope someone can help me.
    my problem is that the number of columns will be variable. here's an example:
    ORIGINAL TABLE
    NAME     KMS     VEHICLE
    Joe     100     AUDI
    Tom     300     VW
    Mark     150     FORD
    Ann     250     FORD
    Joe     200     VW
    Tom     123     AUDI
    Mark     345     AUDI
    Ann     45     VW
    Joe     6     FORD
    Tom     67     FORD
    Mark     46     VW
    Ann     99     AUDI
    DESIRED RESULT
    Joe     Tom     Mark     Ann     Vehicle
    100     123     345     99     AUDI
    6     67     150     250     FORD
    200     300     46     45     VW
    the new columns will be the values in the old NAME column. BUT these values are variable. today its joe,tom,mark and ann tomorrow it could be silvia, tony,richard,harry , william and jane. this means the usuall replies i saw, using MAX and DECODE will not apply because i never know what values or how many values are in this column. with pivot i can get this done.... how can i do this in oracle 10g? is there a way to creat a ser function Pivot somehow? ideas?
    thanks!
    Mark Pereira
    Edited by: 899716 on Jul 18, 2012 12:02 PM

    This is the Oracle Forms forum. Post your question in the SQL forum.
    Tip: check the latest Oracle Magazine (July/August 2012). There is an article by Tom Kyte about the same question.
    http://www.oracle.com/technetwork/oramag/magazine/home/index.html

  • Oracle 10g RAC query fails

    Hi,
    I am a newbie to RAC implementations, I have a strange problem on the one we are testing,
    Failure (forced shutdown) of one of the nodes results in queries on the other node returning with a ORA-12805. This happens only in certain cases, otherwise the query waits for some time and completes. We are using Redhat 3, Oracle 10g (10.2.0.1.0) and TAF with SELECT and PRECONNECT options. Is there some reason and remedy on why this fails on only one of the nodes ?.

    Hi
    From metalink
    ORA-12805
    =========
    Error Summary
    ORA 12805 parallel query server died unexpectedly (Oerr:ORA.12805)
    Error Details
    ~~~~~~~~~~~~~
    Error: ORA 12805
    Text: parallel query server died unexpectedly
    Cause: The PMON process is cleaning up the process because a parallel query
    server terminated unexpectedly.
    Action: Check for operating system errors and retry the statement.
    If this problem persists, contact customer support.
    When a ORA-12805 occurs in most cases you will also see another error, ORA-600 or
    a ORA-7445.
    Best thing for you to do is to check all logs (that may include alert, crs, css etc) and determine the cause of node crash.
    Regards
    Adnan

  • Oracle 8.0.6 to Oracle 10G Upgrade Query

    Hi,
    I have a customer that has Business Objects Release 5.1.x accessing an Oracle 8.0.6 database. They are planning to migrate the database to Oracle 10G Release 2.0
    Will Business Objects Release 5.1.x reports run off their upgraded Oracle 10G Release 2.0 database or will Business Objects have to be migrated as well ?
    Any pointers or links on this will be very helpful.
    Thx in advance
    Best Regards
    Ramdas

    Hi
    BO5.1 is not supported with Oracle10g so the user has to upgrade their BO version too.
    You can download the Product documentations from help.sap.com for detailed information.
    Regards
    Sourashree

  • Oracle 10g Pivot query

    Hi,
    I want to create a view. Sales amounts, countries and products will be showed in this view.
    Report result will be like below:
    Products
    Countries Sales_Amount
    TV Ipad Iphone Netbook Notebook EbookReader
    England 1000 1200 1400 3000 5000 200
    Germany 800 1000 1300 2800 6000 400
    France 1100 1100 1500 2400 3000 500
    Number of products are not limited. New prodcuts can be added by the time.
    Customer is using Oracle 10g. So I can not use pivot function which cames with Oracle 11g.
    If the number of products is limited, I can write sql by decode operators.
    But I can not find how to implement pivot function in Oracle 10g with unlimited column values.
    Do you have any comment?
    Thanks,Regards

    From the SQL and PL/SQL FAQ:
    "This is not easily possible as the number of columns returned by an SQL must be known before any data is fetched, it would have to be done dynamically.
    See these threads:
    Franks pivoting, static and dynamic
    Dynamic Columns Pipelined"
    SQL and PL/SQL FAQ

  • Oracle 10g Insert query performs inconsistent as a query vs procedure and p

    Database Version: Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bi
    No error messages....
    I am facing a very weird issue that I have a insert statement in a procedure... pretty much
    inert
    into oracle_Table
    SELECT cr.a AS a,
    cr.b AS b,
    cr.c AS c,
    max(d.column_name) as d
    FROM "table 1"@Pmo.World Cr,
    [email protected] d
    WHERE d."a" = cr."column name"
    GROUP BY cr.a,
    cr.b,
    cr.c
    @Pmo.World is a database link to a MSSQL...
    The problem I am having right now is, every time I run this insert as a query. Everything works as what it should be... However, when I put this insert into a procedure, it inserts nothing...
    Simple test Proceudre:
    declare
    -- Local variables here
    i integer;
    begin
    inert
    into oracle_Table
    SELECT cr.a AS a,
    cr.b AS b,
    cr.c AS c,
    max(d.column_name) as d
    FROM "table 1"@Pmo.World Cr,
    [email protected] d
    WHERE d."a" = cr."column name"
    GROUP BY cr.a,
    cr.b,
    cr.c
    end;
    Thinking about character conversion issue I changed the procedure to
    inert
    into oracle_Table
    SELECT to_char(cr.a) AS a,
    to_char(cr.b) AS b,
    to_char(cr.c) AS c,
    max(d.column_name) as d
    FROM "table 1"@Pmo.World Cr,
    [email protected] d
    WHERE d."a" = cr."column name"
    GROUP BY cr.a,
    cr.b,
    cr.c
    Then this Inser works in the procedure... however when I revert it back with the original version that doesnt have to_char... it is working still... then I kept it running for few days... since it runs once per day, it was working for the first 2 days and then stopped working the third day... I verified the source table and every time this procedure runs, source tables were not empty...
    It is so confusing because if I manually run the insert as a query, it worked every time I ran it... however if I put that into a procedure, it works from time to time..
    Any help is highly apprecaited
    Edited by: 986006 on Feb 4, 2013 8:51 AM

    986006 wrote:
    Thanks for the hints up... I have updated my post... As I post the test procedure...it is about the exact the same as the insert query... Every time, the insert would actually insert data into the table but every time I run the test procedure, nothing gets inserted in... It sounds unbelievable but it happens... ThanksYou obviously haven't read the FAQ, or at least you haven't bothered doing what it asks. Help us to help you.
    Can you recreate the problem with simpler data on your local machine? If so provide create table and insert statements for test data.
    Format your code and place between tags.
    At the very least post the *exact* SQL or PL/SQL you are trying to run: what you've posted isn't even valid SQL.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Oracle 10g forms query!!!!

    Hi All,
    I am working on oracle Dev 10g forms, I have a table Employee with a poplist with different positions, like Operation Manager, Operation Exe, Department Exe, Sales Exe,etc..etc..
    here i need help!!!!
    when i select any position from the poplist, atomatically a fixed basic salaries have to be displayed in the salary display list.
    how can i do this...?
    need your help,
    Thank you,
    Regards.
    Nissar.
    Edited by: user12956566 on Apr 26, 2010 5:08 AM

    Hi,
    You can populate those values using post trigger...
    Balaji
    Edited by: balaji.palakayala on Apr 26, 2010 9:06 AM

  • Oracle 10g group by clause

    I have one SQL query using a GROUP BY clause and no ORDER BY clause is used. When executed in Oracle 8i, the query results are returned ordered by first column mentioned in the GROUP BY clause. When the same query is executed in Oracle 10g, the query results are returned withour ordering the data by the first column in the GROUP BY clause. It works only when I explicitly mention the ORDER BY clause. Can you please explain this? In Orcale 8i, is it that, by default, the data is ordered by the first column mentioned in the GROUP BY clause when ORDER BY clause is not mentioned?
    In which order does oracle 10g sorts when I use group by clause in oracle 10g

    [email protected] wrote:
    the use of group by is to group based on some column value, in this case why does the the output differs in rows. why does the output, when you use group by is not the following formatSorry, but this is a totally fruitless topic. Why are you bothering with something that is totally internal to the DBMS? If you want the data ordered, use ORDER BY, it's that simple.
    Check out this link, if you want some discussion on it:
    [http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:74320098178823]

  • 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

Maybe you are looking for