Help - how to finde out with a query if table runs in parallel or not?
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 9 of 9

Thread: Help - how to finde out with a query if table runs in parallel or not?

  1. #1
    Join Date
    May 2009
    Location
    Zurich (Switzerland)
    Posts
    5

    Question Help - how to finde out with a query if table runs in parallel or not?

    Hi there

    As I'm not a DBA may some of you can help me.

    How can I find out fast with a query which table runs in Paralle and which one in no_parallel?

    Thanks a lot for your help!

    Cheers,
    Daniela

  2. #2
    Join Date
    Mar 2007
    Location
    Ft. Lauderdale, FL
    Posts
    3,554
    dba_tables, degree column.

    Try user_tables table to check tables you own.
    Pablo (Paul) Berzukov

    Author of Understanding Database Administration available at amazon and other bookstores.

    Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.

  3. #3
    Join Date
    May 2009
    Location
    Zurich (Switzerland)
    Posts
    5
    I have this query which I have to run on the DB:

    SELECT 'ALTER TABLE '

    || table_name

    || CASE WHEN num_rows > 100000 THEN ' PARALLEL ( DEGREE Default INSTANCES Default );' ELSE ' noparallel;' END

    FROM user_tables

    UNION ALL

    SELECT 'ALTER INDEX '

    || index_name

    || CASE WHEN num_rows > 100000 THEN ' PARALLEL ( DEGREE Default INSTANCES Default );' ELSE ' noparallel;' END

    FROM user_indexes;

    but in a case of a "rollback" I wanted to know, which table (over 413 at the moment) already have (if so) already parallel activ....

    do you have a faster method to find it out?

  4. #4
    Join Date
    Mar 2007
    Location
    Ft. Lauderdale, FL
    Posts
    3,554
    Your query is creating a series of "ALTER TABLE..." and "ALTER INDEX..." statements on the fly -those statements will not touch data so no rollback would ever occur.

    If you are curious and want to find out tables with parallel option enable just try:

    select table_name, degree
    from user_tables
    where decode(degree, 'DEFAULT', 1, degree) > 1;

    Something similar for user_indexes.
    Pablo (Paul) Berzukov

    Author of Understanding Database Administration available at amazon and other bookstores.

    Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.

  5. #5
    Join Date
    May 2009
    Location
    Zurich (Switzerland)
    Posts
    5
    As we have a performance problem on a productive enviroment I would sleep better if we have a rollback szenario if this script wouldn't bring the result requested by management...

  6. #6
    Join Date
    Mar 2007
    Location
    Ft. Lauderdale, FL
    Posts
    3,554
    oh... you mean "backout" e.g. going back to your previous scenario -"rollback" means a transaction is rolledback which is not the case.

    I agree with you, better to know what you have today in case you have to "backout" your changes.

    By the way, shouldn't a DBA be involved in these kind of changes?
    Pablo (Paul) Berzukov

    Author of Understanding Database Administration available at amazon and other bookstores.

    Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.

  7. #7
    Join Date
    May 2009
    Location
    Zurich (Switzerland)
    Posts
    5
    don't talk about our DBA.... :-S we either got the scrip from an other guy but not from the DBA... he don't feel responsible on such kind of tasks...

  8. #8
    Join Date
    Mar 2007
    Location
    Ft. Lauderdale, FL
    Posts
    3,554
    Quote Originally Posted by stella75 View Post
    he don't feel responsible on such kind of tasks...
    Oh boy... that kind, huh?
    Pablo (Paul) Berzukov

    Author of Understanding Database Administration available at amazon and other bookstores.

    Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.

  9. #9
    Join Date
    May 2009
    Location
    Zurich (Switzerland)
    Posts
    5
    Thanks anyway... we did it know and it wasn't necessary to do a backout!

    Have a nice Day!

Tags for this Thread

Posting Permissions

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



Click Here to Expand Forum to Full Width