I always like to have an E-R diagram handy whenever I am dealing with a database, and maybe some of you do as well.  If that is the case, there is the E-R diagram that I use in my Pluralsight course “Oracle Performance Tuning for Developers”.  It should print on legal paper, so you shouldn’t […]

CREATE ROLE perf_viewer;GRANT SELECT ON V_$LOCK TO perf_viewer;GRANT SELECT ON V_$LOCKED_OBJECT TO perf_viewer;GRANT SELECT ON USER_OBJECT_USAGE TO perf_viewer;GRANT SELECT ON V_$SESSION TO perf_viewer;GRANT SELECT ON V_$SESSION_LONGOPS TO perf_viewer;GRANT SELECT ON V_$SESSMETRIC TO perf_viewer;GRANT SELECT ON V_$SESSTAT TO perf_viewer;GRANT SELECT ON V_$SQL TO perf_viewer;GRANT SELECT ON V_$SQLAREA TO perf_viewer;GRANT SELECT ON V_$SQLSTATS TO perf_viewer;GRANT SELECT ON […]

In Oracle 12c, you can now define columns as auto increment columns, similar to what you can do in SQL Server and other databases.  Ultimately, what Oracle is doing is creating a sequence in the background and wiring this up behind the scenes to the column in your table. Here is an example of an […]

Consider a table like the one below: CREATE TABLE students( student_id NUMBER(10) GENERATED ALWAYS AS IDENTITY NOT NULL, first_name VARCHAR2(30) NOT NULL, last_name VARCHAR2(30) NOT NULL, email VARCHAR2(50) NULL, phone VARCHAR2(20) NULL, create_date DATE NOT NULL, modified_date DATE NOT NULL, CONSTRAINT pk_students PRIMARY KEY (student_id)); Specifically, we have two columns in this table CREATE_DATE and […]

We are often times faced with the situation where we need to know what statements are running right now in our Oracle database.  Maybe we are having some sort of issue, and applications are not responding or responding very slowly, and you need to get some information fast about what is happening in your system. […]