Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New script to create SQL baseline from AWR and some changes in the hint.sql #34

Merged
merged 4 commits into from
Jun 4, 2024

Conversation

tomasz-sroka
Copy link
Contributor

No description provided.

Copy link
Owner

@tanelpoder tanelpoder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you know in which DB version this V$SQL_HINT.TARGET_LEVEL column showed up? I only have access to 12.2+ right now, would be good to have this hint script not fail in 11.2 and 12.1 ...

@ursusca
Copy link

ursusca commented Sep 15, 2021

v$sql_hint was a new feature in 11.2. Unfortunately, I don’t have any 11.2 databases left to verify but I checked on 12.1 and the column exists on 12.1

@tomasz-sroka
Copy link
Contributor Author

At least 11.2, not sure about the stuff below 11.2. Just tested it successfully on 11.2.0.1.

@tanelpoder
Copy link
Owner

11.2 support is good enough. I am even thinking of defaulting to 12.1+ support by default and people still running TPT scripts on older versions would have to comment out the fancy new columns that they don't have - or perhaps use a cloned script with "11" suffix its name, in the cases where 12c+ has a great new column that's not available in 11.2...

This way I don't have to add too much dynamic complexity into these scripts. Another major piece of work (for 12c+) would be to convert the scripts from using dba_ to cdb_ views with the right container filtering logic, so that one would be able to run queries at CDB level too, but yet join to the right object names, etc in appropriate containers.

I'll merge the change, thanks!

@jgebal
Copy link

jgebal commented Sep 17, 2021

You can create a version in github
Each version can have supported DB list.
So older version of DB could be using older scripts while with newer versions you only support new DBs.

Copy link
Owner

@tanelpoder tanelpoder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Finally got to reviewing this....

Since this uses dbms_sqltune, it would require tuning pack licenses... perhaps better to use DBMS_SPM.LOAD_PLANS_FROM_AWR (as my create_sql_baseline_awr.sql uses). That should still be usable in basic mode without Tuning Pack.

I'll reject that baseline addition, but will merge the hint.sql changes (useful stuff!)

Copy link
Owner

@tanelpoder tanelpoder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

accepting the hint.sql changes

@tanelpoder
Copy link
Owner

new columns for hint.sql

@tanelpoder tanelpoder closed this Jun 4, 2024
@tanelpoder tanelpoder reopened this Jun 4, 2024
@tanelpoder tanelpoder merged commit 7ea4fad into tanelpoder:master Jun 4, 2024
@tanelpoder
Copy link
Owner

forgot to merge before closing the PR apparently

@tanelpoder
Copy link
Owner

I changed the hint scope display column to one column:

SQL> @hint merge

NAME                                VERSION         VERSION_OUTLINE INVERSE                             HINT_SCOPE
----------------------------------- --------------- --------------- ----------------------------------- -------------------------
MERGE_CONST_ON                      8.0.0                                                               STATEMENT
MERGE_AJ                            8.1.0           8.1.7                                               QUERY_BLOCK JOIN
MERGE_SJ                            8.1.0           8.1.7                                               QUERY_BLOCK JOIN
MV_MERGE                            9.0.0                                                               QUERY_BLOCK JOIN
MERGE                               8.1.0           10.1.0          NO_MERGE                            QUERY_BLOCK OBJECT JOIN
NO_MERGE                            8.0.0           10.1.0          MERGE                               QUERY_BLOCK OBJECT JOIN
USE_MERGE_CARTESIAN                 11.1.0.6        11.1.0.6                                            OBJECT JOIN
USE_MERGE                           8.1.0           8.1.7           NO_USE_MERGE                        OBJECT JOIN
NO_USE_MERGE                        10.1.0.3        10.1.0.3        USE_MERGE                           OBJECT JOIN

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants