Results 1 to 7 of 7
  1. #1
    Join Date
    Mar 2013
    Posts
    9

    Unanswered: Tuning of database using neural network

    Please help urgent required for my project...
    1.SQL Query to COUNT NUMBER OF USERS for db2

    2.SQL Query to find AVERAGE TABLE SIZE for db2

    Please give me answer fast..I am new to db2...very urgent..pls pls

    thanks in advance..

  2. #2
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5
    Quote Originally Posted by john sergo View Post
    Please help urgent required for my project...
    1.SQL Query to COUNT NUMBER OF USERS for db2

    2.SQL Query to find AVERAGE TABLE SIZE for db2

    Please give me answer fast..I am new to db2...very urgent..pls pls

    thanks in advance..
    You should start your own thread.

    1) depends on how you define users
    2) depends on how you define table size

    Start by reading the manual.

    Andy

  3. #3
    Join Date
    Mar 2013
    Posts
    9

    db2 sql query

    Hi thanks for replying...but for oracle we have direct query...and for buffer hit ratio.. i already found a query......hope we may ve some query in db2 also...offcourse some system process may also effect...but can u provide a query ..i wll modify it as required for me...
    thanks in advance

  4. #4
    Join Date
    Mar 2013
    Posts
    9

    db2 query

    query pls...i wll modify it...

  5. #5
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5
    Like I said:

    1) Start your own thread.
    2) It depends on what you mean, and as you have not supplied us with your definition, we cannot help you.

    Andy

  6. #6
    Join Date
    Mar 2013
    Posts
    9
    my project is Tuning of database using neural network...i ve code as follows


    %connect to database, providing datasource, username and password
    con=database('mybase','db2admin','rajesh');
    ping(con)

    %sql for buffer hit ratio
    %The buffer hit represents that a logical read was successful. That is, the
    %requested bock was already present in the database buffer cache, and
    %so no physical read request was issued.
    %Hit Ratio = ( 1 - (( buffer pool data physical reads + buffer pool index physical reads ) / ( buffer pool data logical reads + buffer pool index logical reads ))) * 100%


    bhr='select 100* (1-(v2.value + v4.value)/(v1.value+v3.value)) from v$sysstat v1, v$sysstat v2, v$sysstat v3 ,v$sysstat v4 where v1.name=''POOL_DATA_L_READS''and v2.name=''POOL_DATA_P_READS'' and v3.name=''POOL_INDEX_L_READS''' and v4.name=''POOL_INDEX_P_READS''';


    %execute the above query
    cur_bhr=exec(con,bhr);
    setdbprefs('DataReturnFormat','numeric');
    %fetch the result
    cur_bhr=fetch(cur_bhr,1);

    m1=cur_bhr.data;

    X=28;
    %sql for no. of users
    users='select count(*)-X from v$session';
    %execute the above query
    cur_user=exec(con,users);
    setdbprefs('DataReturnFormat','numeric');
    %fetch the result
    cur_user=fetch(cur_user,1);
    m2=cur_user.data;

    %sql for avg table size
    tsize='select avg(bytes)/(1024*1024) from user_segments where segment_name in(''C_WAREHOUSE'',''C_ORDER'',''C_ITEM'',''C_STOC K'')';
    %execute the above query
    cur_tsize=exec(con,tsize);
    setdbprefs('DataReturnFormat','numeric');
    %fetch the result
    cur_t=fetch(cur_tsize,1);
    m3=cur_tsize.data;
    m=[m1, m2, m3];
    %fuzzy evaluatio
    fuztune_oracle; %executes fuztune_oracle.m file
    c1=evalfis(m,a); %evaluates the fuzzy structure created in above step
    c1=round(c1); %c1 is fuzzy output

    %neural network simulation
    m=[m1;m2;m3];
    nnet_oracle; %executes nnet.m file
    c2=sim(net,m); %simulates the network created in above step
    c2=round(c2); % c2 is NN output

    %aggregation
    if c2 < c1
    c = (c1*0.4) + (c2*0.6);
    else
    c = (c1*0.6) + (c2*0.4);
    end
    c=round(c);



    %sql to alter database SORTHEAP
    %SQL>update db cfg for DB_NAME using SORTHEAP a_value

    %sql to alter SHEAPTHRES
    %SQL>update dbm cfg using SHEAPTHRES b_value

    sql=['update db cfg for STUDENT using SORTHEAP num2str(c)'];
    %execute the above query
    curs=exec(con,sql);

    %disconnect from the oracle connection
    close(con);

    this is my neural network code....just i required query for no of users and table size in db2...the above program is for oracle tuning...help me out...
    thanks...

  7. #7
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5
    All I asked for was what you consider "Number of Users" and "Table Size". Just use words. Not everyone (me included) knows Oracle. I do not have the time nor inclination to try to find what you want from a bunch of code that I do not immediately understand.

    Andy

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •