Subscribe to Posts by Email

Subscriber Count

    696

Disclaimer

All information is offered in good faith and in the hope that it may be of use for educational purpose and for Database community purpose, but is not guaranteed to be correct, up to date or suitable for any particular purpose. db.geeksinsight.com accepts no liability in respect of this information or its use. This site is independent of and does not represent Oracle Corporation in any way. Oracle does not officially sponsor, approve, or endorse this site or its content and if notify any such I am happy to remove. Product and company names mentioned in this website may be the trademarks of their respective owners and published here for informational purpose only. This is my personal blog. The views expressed on these pages are mine and learnt from other blogs and bloggers and to enhance and support the DBA community and this web blog does not represent the thoughts, intentions, plans or strategies of my current employer nor the Oracle and its affiliates or any other companies. And this website does not offer or take profit for providing these content and this is purely non-profit and for educational purpose only. If you see any issues with Content and copy write issues, I am happy to remove if you notify me. Contact Geek DBA Team, via geeksinsights@gmail.com

Pages

Oracle 18c: Optimizer_ignore_hints

If and if anytime you need to test it ignore hints or you have legacy codes, you can set ignore hint parameters. Before to 18c this is parameter is a hidden parameter "_Optimizer_ignore_hints" and been obsoleted. This can be set at system/session level.

alter system set optimizer_ignore_hints=TRUE

In addition, there is another parameter to ignore parallel hints also

alter system set optimizer_ignore_parallel_hints=true;

Oracle 12.2: Lock Down Profiles

To restrict user operations at PDB levels and even more granular restriction, in 12.2 we can create Lock down profiles using "create lock down profile".

Here are some examples

CREATE LOCKDOWN PROFILE test;
ALTER LOCKDOWN PROFILE test DISABLE STATEMENT = ('ALTER SYSTEM');
ALTER LOCKDOWN PROFILE test ENABLE STATEMENT = ('ALTER SYSTEM') CLAUSE= ('flush shared_pool');
ALTER LOCKDOWN PROFILE test DISABLE FEATURE = ('NETWORK_ACCESS');
ALTER LOCKDOWN PROFILE test DISABLE OPTION = ('Partitioning');
ALTER LOCKDOWN PROFILE test DISABLE STATEMENT = ('ALTER SYSTEM') CLAUSE = ('SUSPEND', 'RESUME');

Then set at PDB level using static parameter

ALTER SESSION SET CONTAINER=PDB1;
ALTER SYSTEM SET PDB_LOCKDOWN = test SCOPE = SPFILE;
ALTER PLUGGABLE DATABASE PDB1 CLOSE;
ALTER PLUGGABLE DATABASE PDB1 OPEN;

Oracle 20c: Datapump enhancements

Starting 20c, the following datapump enhancements are available as per new features guide which are more useful to DBA on day to day.

Resume Transportable Tablespace Jobs Oracle Data Pump resumes transportable tablespace export and import jobs that are stopped. Oracle Data Pump has the capacity to resume transportable tablespace export and import jobs. Due to errors, or other problems, you can find that transportable tablespace export or import jobs are stopped. Oracle Data Pump's capacity to resume these stopped jobs helps to save you time, and makes the system more available.

Include & Exclude in Same Operations Oracle Data Pump provides powerful, flexible inclusion and exclusion of objects for a job. Now, Oracle Data Pump commands can include both INCLUDE and EXCLUDE parameters in the same operation. By enabling greater specificity about what is being migrated, this enhancement makes it easier to migrate to Oracle Cloud, or to another on-premises Oracle

Oracle Data Pump Provides Optional Index Compression Oracle Data Pump supports optional index compression on imports, including for Oracle Autonomous Database. Oracle Data Pump supports adding, changing and eliminating table compression. Oracle Database 20c supports index compression as well by introducing a new TRANSFORM parameter clause, INDEX_COMPRESSION_CLAUSE. This clause enables you to control whether index compression is performed during import. Adding this clause also enables you to specify index compression on import with the autonomous services.

Oracle 20c: PDB Point in time recovery

In Oracle database 20c, flashback and PITR are supported when recovering PDBs to an ancestor or orphan PDB incarnations. That means you can do a recovery for specific PDB if the PDB is in the same CDB level incarnation. Just to mention in 12.1 also we can do flashback and PITR for container databases however that effects all PDB's in the container. While doing flashback or PITR the operation just changes the datafiles pertaining to that PDB and checks the CDB , PDB, ancestoral and current incarnation and performs that operation.

To create restore point for PDB

SQL> CREATE RESTORE POINT restore_point_pdb2 FOR PLUGGABLE DATABASE PDB2;

SQL> ALTER PLUGGABLE DATABASE PDB2 CLOSE;

Pluggable database altered.

SQL> FLASHBACK PLUGGABLE DATABASE PDB2 TO RESTORE POINT restore_point_pdb2;

Flashback complete.

SQL> ALTER PLUGGABLE DATABASE PDB2 OPEN RESETLOGS;

Pluggable database altered.

Oracle 19c: Max_Idle_Blocker_Time Parameter

DBA's often kill the blocking sessions and from 19c (not sure which patch set) we have new parameter called MAX_IDLE_BLOCKER_TIME parameter which helps to specifies the maximum number of minutes that a blocking session can be idle. After that point, the session is automatically terminated.

A session is considered to be a blocking session when it is holding resources required by other sessions. For example:

  • The session is holding a lock required by another session.
  • The session is a parallel operation and its consumer group, PDB, or database has either reached its maximum parallel server limit or has queued parallel operations.
  • The session’s PDB or database instance is about to reach its SESSIONS or PROCESSES limit.

This parameter differs from the MAX_IDLE_TIME parameter in that MAX_IDLE_TIME applies to all sessions (blocking and non-blocking), whereas MAX_IDLE_BLOCKING_TIME applies only to blocking sessions. Therefore, in order for MAX_IDLE_BLOCKING_TIME to be effective, its limit must be less than the MAX_IDLE_TIME limit.

And the MAX_IDLE_TIME limit parameter is available from 12.2.0.1 version.

Oracle 20c: New SQL Macros

Most of time developers writes multiple procedures or pl/sql code with relevant conditions and blocks to simplify operations , but the complexity grows and number of joins increases the operations of SQL Engine and PLSQL engine has to involved more and do more context switching at the cost of performance. In Oracle Database 20c, SQL Macros solve this problem by allowing SQL expressions and table functions to be replaced by calls to stored procedures which return a string literal to be inserted in the SQL we want to execute. It's an incredibly simple concept and one that C and Rust programmers will be familiar with. The following trivial example shows it in action.

Some example from blogs.oracle.com

First, let's create a tables and insert a few rows.

CREATE TABLE(id integer, name varchar2(30), item_type varchar2(30), price float );
insert into line_items values (1, 'Red Red Wine', 'ALCOHOL', 15.6)
insert into line_items values (2, 'Its Cold Out There Heater', 'RADIATOR', 200.49);
insert into line_items values (3, 'How Sweet It Is Cake', 'FOOD', 4.56);

The SQL below calculates the value added tax on rows in our LINE_ITEMS table

select id,
  case
    when item_type = 'ALCOHOL' then round(1.2 * price, 2)
    when item_type = 'SOLAR PANEL' then round(1.05 * price, 2)
    when item_type = 'RADIATOR' then round(1.05 * price, 2)
    else price end as total_price_with_tax
from line_items; 

However in Oracle Database 20c we can simplify it by creating a function with the new SQL_MACRO keyword and returning a string.

create or replace function total_price_with_tax(the_price float, the_item_type varchar)
  return varchar2 SQL_MACRO(SCALAR) is
begin
  return q'[case
    when item_type = 'ALCOHOL' then round(1.2 * price, 2)
    when item_type = 'SOLAR PANEL' then round(1.05 * price, 2)
    when item_type = 'RADIATOR' then round(1.05 * price, 2)
    else price end as total_price_with_tax]';
end; 

We can then simply reference the SQL Macro inside of a select statement. The SQL that's executed is exactly the same as the original SQL Statement without the overhead of a context switch each time the row is fetched to execute our function.

 
SQL > select id, total_price_with_tax(price, item_type) from line_items;

  ID   TOTAL_PRICE_WITH_TAX(PRICE,ITEM_TYPE) 
  ------------------------------------------
   1                                   18.72 
   2                                210.5145 
   3                                    4.56 

Oracle 20c: New Base Level In memory option for free

With Oracle 20c, (as per preview details), introduced a new BASE_LEVEL value for the INMEMORY_FORCE parameter. When this new value is set the INMEMORY_SIZE parameter can be set up to a value of 16GB without having to license the Database In-Memory option. In fact, when the BASE_LEVEL value is set you cannot set the INMEMORY_SIZE parameter larger than 16GB. If you do then Oracle will generate an error message.

The 16GB limit applies at the container database (CDB) level. This means that all pluggable databases (PDBs) share the 16GB limit of the CDB. However, on RAC databases the Base Level feature allows a 16GB column store to be allocated on each RAC instance.

Feature tracking has been added to report usage of the Base Level feature as "In-Memory Base Level" so there should be no confusion as to whether the Base Level feature is being used or the full Database In-Memory option.

The new Base Level feature supports all Database In-Memory features except:
•    Automatic In-Memory  (AIM)
•    Compression levels other than memory compress for LOW
•    Excluded columns (all columns of a table are populated)
•    The CELLMEMORY feature on Exadata

AUSOUG – Webinars – Session on Container databases using Oracle Container services

Let's continue our momentum of learning's although they are myriad situations across the world and its an opportunity to know and practice new stuff while most of us doing Work from homes, Australia Oracle User group conducting some webinars "AUSOUG - National Webinar Series 2020 " and there are many sessions planned every month. Please go through and attend the webinars as you like.

https://ausoug.org.au/news/national-webinar-series-2020-news/

I am presenting on chatbots on Jun 24th.

You must register at https://attendee.gotowebinar.com/register/7043122249685164814 if you want to attend this event.

Oracle19c: Configuring Fast-Start Failover in Observe-only Mode

Starting 19c , dataguard broker can be put in observe only mode instead performing FSFO. This will help to test the broker conditions that have met. There will be entries in the broker log or observer log indicating Fast start failover would have been initiated.

DGMGRL> ENABLE FAST_START FAILOVER OBSERVE ONLY;

Oracle19c: EZConnect Enhancements

EZConnect is something very useful to make fast connection calls without requiring a TNS. Problem is that, until now, if you want to use some value pairs likes SDU, RETRY_COUNT, CONNECT_TIMEOUT, this wasn't possible and you would end-up using TNS. Now in 19c you will be able to write something like:

sqlplus user/pwd@//DB:1521/host?connect_timeout=100&transport_connect_timeout=10&retry_count=3