• Link to X
  • Link to LinkedIn
  • Link to Facebook
  • עברית עברית עברית he
  • English English אנגלית en
Real Time DBA Magic
  • בית
  • Oracle
    • Data Guard
    • Performance
  • Big Data
    • Hadoop
  • אודות
    • מי אני
    • צור קשר
    • בלוג
    • Oracle ACE Program
  • Click to open the search input field Click to open the search input field חיפוש באתר
  • Menu Menu

ארכיון עבור קטגוריה: שליפות

הנך כאן: עמוד הבית1 / Oracle2 / שליפות

שליפות שעושות Downgrade

28/10/2010/0 תגובות/ב- Performance, שליפות/מאת זהר אלקיים/זמן קריאה משוער: 1 דקה

לפעמים יש צורך למצוא מהן השליפות שעשו downgrade במערכת ולא קיבלו מספיק parallel processes. צריך להבחין בין שני מקרים: מקרה שהשליפות קיבלו חלק מהמשאבים ומקרה שבהם הן לא קיבלו בכלל משאבים ועכשיו הן עובדות ב-serial.

כדי למצוא מהן השליפות שקיבלו downgrade (אבל עדיין עובדות ב-Parallel) ניתן להשתמש בשליפה הבאה. השליפה מחזירה רק את ה-PX coordinator (כלומר ה-SID של ההורה) ולא את כל הפרוססים עצמם:

SELECT a.sid parent_sid,
       a.logon_time,
       a.program,
       a.osuser,
       a.username,
       a.sql_id,
       ps.req_degree,
       ps.got_degree
  FROM (SELECT s.sid,
               s.osuser,
               s.USERNAME,
               s.status,
               s.sql_id,
               s.logon_time,
               s.last_call_et,
               UPPER(s.program) program
          FROM v$session s
         WHERE ((s.username IS NOT NULL) AND (NVL(s.osuser, 'x') <> 'SYSTEM') AND
               (s.TYPE <> 'BACKGROUND'))) a
  JOIN (SELECT DISTINCT qcsid,
                        CASE
                            WHEN req_degree > degree THEN
                             1
                            ELSE
                             0
                        END is_downgrade,
                        MAX(req_degree) req_degree,
                        MAX(degree) got_degree
          FROM v$px_session
         GROUP BY qcsid,
                  CASE
                      WHEN req_degree > degree THEN
                       1
                      ELSE
                       0
                  END) ps ON a.sid = ps.qcsid
 WHERE ps.is_downgrade = 1

כדי לאתר את השליפות שלא קיבלו פרוססים בכלל (ובעצם עשו downgrade to serial) ניתן להשתמש בשליפה הבאה:

SELECT sess.sid parent_sid,
		 logon_time,
		 sess.program,
		 sess.osuser,
		 sess.username,
		 sql_id,
		 TRUNC (last_call_et / 60) dur_minutes
  FROM v$sesstat sesstat, v$sysstat sysstat, v$session sess
 WHERE	  sesstat.statistic# = sysstat.statistic#
		 AND sesstat.sid = sess.sid
		 AND name = 'Parallel operations downgraded to serial'
		 AND sesstat.VALUE > 0
		 AND sess.status = 'ACTIVE'
https://www.realdbamagic.com/wp-content/uploads/2026/10/real-dba-magic-logo-1200w.png 0 0 זהר אלקיים https://www.realdbamagic.com/wp-content/uploads/2026/10/real-dba-magic-logo-1200w.png זהר אלקיים2010-10-28 10:25:312010-10-28 10:25:31שליפות שעושות Downgrade

n השליפות הארוכות ביותר של משתמש מתוך ה-AWR

28/10/2010/0 תגובות/ב- Oracle, Performance, שליפות/מאת זהר אלקיים/זמן קריאה משוער: 1 דקה

איך מוציאים את 30‏ השליפות הארוכות ביותר של משתמש מסויים מתוך ה-AWR‏?

משתמשים בשליפה הבאה:

select sub.sql_id,
       txt.sql_text,
       parsing_schema_name,
       sub.seconds_since_date,
       sub.execs_since_date,
--       sub.gets_since_date,
       round(sub.seconds_since_date / sub.execs_since_date, 3) avg_query_time
  from ( -- sub to sort before rownum
        select sql_id,
                g.parsing_schema_name,
                round(sum(elapsed_time_delta) / 1000000) as seconds_since_date,
                sum(executions_delta) as execs_since_date,
                sum(buffer_gets_delta) as gets_since_date
          from dba_hist_snapshot natural
          join dba_hist_sqlstat g
         where begin_interval_time > to_date('2010-01-01', 'YYYY-MM-DD')
           and parsing_schema_name = '&user_name'
         group by sql_id, g.parsing_schema_name
         order by seconds_since_date desc) sub
  join dba_hist_sqltext txt on sub.sql_id = txt.sql_id
 where rownum < &n;
https://www.realdbamagic.com/wp-content/uploads/2026/10/real-dba-magic-logo-1200w.png 0 0 זהר אלקיים https://www.realdbamagic.com/wp-content/uploads/2026/10/real-dba-magic-logo-1200w.png זהר אלקיים2010-10-28 00:02:312016-12-26 12:15:39n השליפות הארוכות ביותר של משתמש מתוך ה-AWR

אז מה קורה עם השליפה הזו?!?

27/10/2010/1 תגובה/ב- שליפות/מאת זהר אלקיים/זמן קריאה משוער: 1 דקה

כדי לדעת מה הסטטוס של שליפה שרצה ב-Parallel, כותבת ל-Temp ובכלל עושה המון שלבים, אפשר להשתמש בשליפה הזו:

SELECT TO_NUMBER(DECODE(sid, 65535, NULL, sid)) || '(' || qcsid || ')' sid,
       gv$sql_workarea_active.sql_id,
       operation_type || '(' || operation_id || ')' operation,
       TRUNC(work_area_size / 1024 / 1024) wsize,
       TRUNC(expected_size / 1024 / 1024) esize,
       TRUNC(actual_mem_used / 1024 / 1024) "MEM_USE(MB)",
       TRUNC(max_mem_used / 1024 / 1024) "MAX MEM(MB)",
       number_passes passes,
       active_time / 1000000 / 60 active_time,
       tempseg_size / 1024 / 1024 tempseg_size,
       ROWS_PROCESSED,
       tablespace tbs
  FROM gv$sql_workarea_active
  join gv$sqlarea
    on gv$sql_workarea_active.sql_id = gv$sqlarea.sql_id
 where gv$sql_workarea_active.sql_id like '1b66186na1r25%'
 ORDER BY tempseg_size desc nulls last

השליפה מקבלת SQL_ID וצריך לשים לב שאם יש יותר משליפה כזו בזמן מסויים, היא תחזיר את הסטטוס של כל השליפות מאותו ID שרצות באותו זמן.

https://www.realdbamagic.com/wp-content/uploads/2026/10/real-dba-magic-logo-1200w.png 0 0 זהר אלקיים https://www.realdbamagic.com/wp-content/uploads/2026/10/real-dba-magic-logo-1200w.png זהר אלקיים2010-10-27 18:47:332014-11-16 11:46:24אז מה קורה עם השליפה הזו?!?
עמוד 3 מתוך 3123
  • עברית
    • English (אנגלית)
דירוג
  • שימוש ב-Append ו-redo logs05/04/2011 - 23:06
  • יצירת קובץ CSV על ידי שימוש ב-SQLPLUS...18/11/2010 - 17:45
  • כמה מילים על bind peeking ואיך למחוק Execution Plan מה-...21/03/2012 - 18:25
  • עולם ה- Big Data ופתרון ה- Hadoop – מאמר מתוך Oracle New...06/06/2012 - 09:00
פוסטים אחרונים
  • לאלה שתוהים למה הבלוג לא מתעדכן בעברית...23/05/2016 - 22:38
  • ההשפעה של no logging על data guard03/09/2015 - 10:45
  • תהליך ה-startup של אורקל (מדריך למתחילים)...18/05/2015 - 09:57
  • PRVF-0002 : Could not retrieve local nodename10/05/2015 - 15:39
תגובות
  • rotemadפוסט מעולה! אני יודע שזה פוסט ישן, אבל בכל זאת אני רק אוסיף ...24/05/2016 - 12:23 מאת rotemad
  • […] דוגמה אחרת היא הדוגמה הזו. […]...15/03/2016 - 22:36 מאת Oracle Database Firewall - Real DBA Magic
  • […] not as a participant) was in 2011. I gave to session...16/11/2015 - 10:27 מאת Oracle Database Advanced Querying Presentation
  • […] first time I took place (as a trainer, not as...16/11/2015 - 10:22 מאת Oracle Database Advanced Querying Presentation
תגיות
#oow13 12c 12cR1 awr Big data BigData csv Database data guard data guard broker Data warehouse DB12c DBIM expdp guide Hadoop howto iloug Linux Microsoft SQL Server New Features NoSQL oracle Oracle 11g Oracle 12c oracle 12c new features Oracle Database Oracle Data Guard ORACLE DATAGUARD performance PL/SQL RAC redo log rman script SQL sqluldr startup transaction vldb webinar with אורקל האדופ שבוע אורקל
© Copyright - Zohar Elkayam, Real DBA Magic, 2010-2017
  • Link to X
  • Link to LinkedIn
  • Link to Facebook
  • בית
  • Oracle
  • Big Data
  • אודות
Scroll to top Scroll to top Scroll to top
Manage Consent
To provide the best experiences, we use technologies like cookies to store and/or access device information. Consenting to these technologies will allow us to process data such as browsing behavior or unique IDs on this site. Not consenting or withdrawing consent, may adversely affect certain features and functions.
Functional Always active
The technical storage or access is strictly necessary for the legitimate purpose of enabling the use of a specific service explicitly requested by the subscriber or user, or for the sole purpose of carrying out the transmission of a communication over an electronic communications network.
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
The technical storage or access that is used exclusively for statistical purposes. The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
The technical storage or access is required to create user profiles to send advertising, or to track the user on a website or across several websites for similar marketing purposes.
  • Manage options
  • Manage services
  • Manage {vendor_count} vendors
  • Read more about these purposes
View preferences
  • {title}
  • {title}
  • {title}