Saturday 15 April 2023

Oracle Database 23c Free - Developer Release launch on Oracle VM VirtualBox 7.0

 

Hi All,


Oracle has recently launched the Oracle database 23c Free Developer Release , in this post i am sharing how launch this on Oracle VM VitualBox 7.0.


Access the below URL and download the 

https://www.oracle.com/database/technologies/databaseappdev-vm.html

Setup

Step 1. Download and install Oracle VM VirtualBox on your host system.


Download .... >  Oracle DB Developer VM .


Step 2. Import your VM: File > Import Appliance to launch Appliance Import Wizard. Click Choose... to browse to the directory you re-assembled all the files in and select the Oracle_Database_23c_Free_Developer_Appliance.ova then click Next> to begin importing the virtual machine. It will prompt you to agree to the appropriate Oracle licenses while importing. You will see 'Oracle Database 23c Free - Developer' when it is finished importing.

Step 3. Test your VM: Once the import has completed, double-click the 23c Free - Developer VM. Click OK to close the Virtualbox Information dialogs. Allow the boot and startup process to complete; it is ready when you see a Firfox browser and/or terminal window. Once you are finished working in the guest VM you can shut it down via System > Shut Down; this will return the guest VM to the Powered Off state.











Follow the below instruction's to access the Oracle 23C database on VM.

Oracle Database 23c Free – Developer Release is the first release of the next-generation Oracle Database, allowing developers a head-start on building applications with innovative 23c features that simplify development of modern data-driven apps. The entire feature set of Oracle Database 23c is planned to be generally available within the next 12 months.

Please note that this appliance is for testing purposes only as such it is unsupported and should not be used as a production environment.

Database Information

    Oracle SID    : free

    Pluggable DB  : freepdb1

ALL PASSWORDS ARE : oracle

Sample schemas have been preloaded (HR, OE, PM, IX, BI, AV, SH) for your convenience.

Oracle REST Data Service (ORDS) and APEX are both installed, configured, and available at startup. Port Forwards are defined for HTTP and SQL*Net, these are configurable in the Virtual Machine settings.

  8080:8080

  1521:1521 

From your host, simply launch:

    http://localhost:8080/ords to launch APEX

    http://localhost:8080/ords/sql-developer to start SQL Developer Web

    sql hr/oracle@localhost:1521/freepdb1 tp get a SQLcl session for the Pluggable Database (PDB)

    sql system/oracle@localhost:1521/free to get a SQLcl session for the Container Database (CDB)


The HR schema is REST enabled, you can login to SQL Developer Web using: HR/oracle


I have accessed the database and see few of the imported parameters on this new database.


sql system/oracle@localhost:1521/free


[oracle@localhost dbhomeFree]$ sql system/oracle@localhost:1521/free



SQLcl: Release 23.1 Production on Thu Apr 13 19:40:03 2023


Copyright (c) 1982, 2023, Oracle.  All rights reserved.


Last Successful login time: Thu Apr 13 2023 19:40:05 +00:00


Connected to:

Oracle Database 23c Free, Release 23.0.0.0.0 - Developer-Release

Version 23.2.0.0.0


SQL> sho pdbs


   CON_ID CON_NAME    OPEN MODE     RESTRICTED    

_________ ___________ _____________ _____________ 

        2 PDB$SEED    READ ONLY     NO            

        3 FREEPDB1    READ WRITE    NO            

SQL> select name,open_mode from v$database;


NAME    OPEN_MODE     

_______ _____________ 

FREE    READ WRITE    


SQL> select banner from v$version;


BANNER                                                              

___________________________________________________________________ 

Oracle Database 23c Free, Release 23.0.0.0.0 - Developer-Release    


SQL> select * from dba_data_files;


FILE_NAME                                   FILE_ID TABLESPACE_NAME            BYTES    BLOCKS STATUS          RELATIVE_FNO AUTOEXTENSIBLE          MAXBYTES    MAXBLOCKS    INCREMENT_BY    USER_BYTES    USER_BLOCKS ONLINE_STATUS    LOST_WRITE_PROTECT    

________________________________________ __________ __________________ _____________ _________ ____________ _______________ _________________ ______________ ____________ _______________ _____________ ______________ ________________ _____________________ 

/opt/oracle/oradata/FREE/system01.dbf             1 SYSTEM                1216348160    148480 AVAILABLE                  1 YES                  34359721984      4194302            1280    1215299584         148352 SYSTEM           OFF                   

/opt/oracle/oradata/FREE/sysaux01.dbf             3 SYSAUX                 576716800     70400 AVAILABLE                  3 YES                  34359721984      4194302            1280     575668224          70272 ONLINE           OFF                   

/opt/oracle/oradata/FREE/users01.dbf              7 USERS                    5242880       640 AVAILABLE                  7 YES                  34359721984      4194302             160       4194304            512 ONLINE           OFF                   

/opt/oracle/oradata/FREE/undotbs2.dbf            16 UNDOTBS2                52428800      6400 AVAILABLE                 16 YES                  34359721984      4194302            6400      51380224           6272 ONLINE           OFF                   


SQL> alter session set container=freepdb1;


Session altered.


SQL> sho pdbs


   CON_ID CON_NAME    OPEN MODE     RESTRICTED    

_________ ___________ _____________ _____________ 

        3 FREEPDB1    READ WRITE    NO            

SQL> exit

Disconnected from Oracle Database 23c Free, Release 23.0.0.0.0 - Developer-Release

Version 23.2.0.0.0



[oracle@localhost dbhomeFree]$ cd $ORACLE_HOME

[oracle@localhost dbhomeFree]$ cd network/admin/

[oracle@localhost admin]$ ls -ltr

total 16

-rw-r--r--. 1 oracle oinstall 1866 May 19  2021 shrept.lst

drwxr-xr-x. 2 oracle oinstall   64 Apr  3 16:43 samples

-rw-r-----. 1 oracle oracle    190 Apr  3 16:43 sqlnet.ora

-rw-r-----. 1 oracle oracle    365 Apr  3 16:43 listener.ora

-rw-r--r--. 1 oracle oracle    584 Apr  3 16:50 tnsnames.ora

[oracle@localhost admin]$ cat listener.ora 

# listener.ora Network Configuration File: /opt/oracle/product/23c/dbhomeFree/network/admin/listener.ora

# Generated by Oracle configuration tools.


DEFAULT_SERVICE_LISTENER = FREE


LISTENER =

  (DESCRIPTION_LIST =

    (DESCRIPTION =

      (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))

      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))

    )

  )


[oracle@localhost admin]$ cat tnsnames.ora 

# tnsnames.ora Network Configuration File: /opt/oracle/product/23c/dbhomeFree/network/admin/tnsnames.ora

# Generated by Oracle configuration tools.


FREE =

  (DESCRIPTION =

    (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))

    (CONNECT_DATA =

      (SERVER = DEDICATED)

      (SERVICE_NAME = FREE)

    )

  )


LISTENER_FREE =

  (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))



FREEPDB1 =

  (DESCRIPTION =

    (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))

    (CONNECT_DATA =

      (SERVER = DEDICATED)

      (SERVICE_NAME = FREEPDB1)

    )

  )

[oracle@localhost admin]$ ps -ef |grep tns

root           6       2  0 19:32 ?        00:00:00 [netns]

oracle      1853       1  0 19:32 ?        00:00:00 /opt/oracle/product/23c/dbhomeFree/bin/tnslsnr LISTENER -inherit

oracle      5328    3588  0 19:42 pts/0    00:00:00 grep --color=auto tns

[oracle@localhost admin]$ cd ../../dbs/

[oracle@localhost dbs]$ ls -ltr

total 20

-rw-r-----. 1 oracle oinstall 3079 May 14  2015 init.ora

-rw-r-----. 1 oracle oinstall   24 Apr  3 16:44 lkFREE

-rw-r-----. 1 oracle oracle   2048 Apr  3 16:46 orapwFREE

-rw-rw----. 1 oracle oinstall 1544 Apr 13 19:32 hc_FREE.dat

-rw-r-----. 1 oracle oinstall 3584 Apr 13 19:32 spfileFREE.ora


[oracle@localhost dbs]$ cat init.ora 

# $Header: rdbms/admin/init.ora /main/25 2015/05/14 15:02:30 kasingha Exp $ 

# Copyright (c) 1991, 2015, Oracle and/or its affiliates. All rights reserved.

# NAME

#   init.ora

# FUNCTION

# NOTES

# MODIFIED

#     kasingha   05/12/15  - 21041456 - fix copyright header

#     ysarig     02/01/12  - Renaming flash_recovery_area to

#                            fast_recovery_area

#     ysarig     05/14/09  - Updating compatible to 11.2

#     ysarig     08/13/07  - Fixing the sample for 11g

#     atsukerm   08/06/98 -  fix for 8.1.

#     hpiao      06/05/97 -  fix for 803

#     glavash    05/12/97 -  add oracle_trace_enable comment

#     hpiao      04/22/97 -  remove ifile=, events=, etc.

#     alingelb   09/19/94 -  remove vms-specific stuff

#     dpawson    07/07/93 -  add more comments regarded archive start

#     maporter   10/29/92 -  Add vms_sga_use_gblpagfile=TRUE 

#     jloaiza    03/07/92 -  change ALPHA to BETA 

#     danderso   02/26/92 -  change db_block_cache_protect to _db_block_cache_p

#     ghallmar   02/03/92 -  db_directory -> db_domain 

#     maporter   01/12/92 -  merge changes from branch 1.8.308.1 

#     maporter   12/21/91 -  bug 76493: Add control_files parameter 

#     wbridge    12/03/91 -  use of %c in archive format is discouraged 

#     ghallmar   12/02/91 -  add global_names=true, db_directory=us.acme.com 

#     thayes     11/27/91 -  Change default for cache_clone 

#     jloaiza    08/13/91 -         merge changes from branch 1.7.100.1 

#     jloaiza    07/31/91 -         add debug stuff 

#     rlim       04/29/91 -         removal of char_is_varchar2 

#   Bridge     03/12/91 - log_allocation no longer exists

#   Wijaya     02/05/91 - remove obsolete parameters

#

##############################################################################

# Example INIT.ORA file

# This file is provided by Oracle Corporation as a starting point for

# customizing the Oracle Database installation for your site.  

# NOTE: The values that are used in this file are example values only.

# You may want to adjust those values for your specific requirements. 

# You might also consider using the Database Configuration Assistant  

# tool (DBCA) to create a server-side initialization parameter file

# and to size your initial set of tablespaces. See the

# Oracle Database 2 Day DBA guide for more information.

###############################################################################


# Change '<ORACLE_BASE>' to point to the oracle base (the one you specify at

# install time)

db_name='ORCL'

memory_target=1G

processes = 150

audit_file_dest='<ORACLE_BASE>/admin/orcl/adump'

audit_trail ='db'

db_block_size=8192

db_domain=''

db_recovery_file_dest='<ORACLE_BASE>/fast_recovery_area'

db_recovery_file_dest_size=2G

diagnostic_dest='<ORACLE_BASE>'

dispatchers='(PROTOCOL=TCP) (SERVICE=ORCLXDB)'

open_cursors=300 

remote_login_passwordfile='EXCLUSIVE'

undo_tablespace='UNDOTBS1'

# You may want to ensure that control files are created on separate physical

# devices

control_files = (ora_control1, ora_control2)

compatible ='11.2.0'

[oracle@localhost dbs]$ 


Thanks,

Srini


Unrestricted Direct Loads Features in Oracle 23c Database Architecture .

 

Hi All,

In this post i am sharing the details about Unrestricted Direct Loads features in Oracle 23C database Architecture .

Unrestricted Direct Loads

Prior to this feature, after a direct load and prior to a commit, queries and additional DMLs were not allowed on the same table for the same session or for other database sessions. This enhancement allows the loading session to query and perform DML on the same table that was loaded. Other sessions are also able to concurrently perform direct loads and DML. Rollback to a savepoint is also supported.

This feature removes the restrictions that you may have encountered when loading and querying data. Potentially improving the performance of your applications in areas such as Data Warehousing and complex batch processing. 


Restrictions on Parallel DML

There are several restrictions that apply to parallel DML.

The following restrictions apply to parallel DML (including direct-path INSERT):

  • Intra-partition parallelism for UPDATEMERGE, and DELETE operations require that the COMPATIBLE initialization parameter be set to 9.2 or greater.

  • The INSERT VALUES statement is never executed in parallel.

  • Parallel DML operations cannot be done on tables with triggers.

  • Replication functionality is not supported for parallel DML.

  • Parallel DML cannot occur in the presence of certain constraints: self-referential integrity, delete cascade, and deferred integrity. In addition, for direct-path INSERT, there is no support for any referential integrity.

  • Parallel DML can be done on tables with object columns provided the object columns are not accessed.

  • Parallel DML can be done on tables with LOB columns provided the table is partitioned. However, intra-partition parallelism is not supported.

    For non-partitioned tables with LOB columns, parallel INSERT operations are supported provided that the LOB columns are declared as SecureFiles LOBs. Parallel UPDATEDELETE, and MERGE operations on such tables are not supported.

  • A DML operation cannot be executed in parallel if it is in a distributed transaction or if the DML or the query operation is on a remote object.

  • Clustered tables are not supported.

  • Parallel UPDATEDELETE, and MERGE operations are not supported for temporary tables.

  • Parallel DML is not supported on a table with bitmap indexes if the table is not partitioned.

Note:

As of Oracle Database 23c, some previous restrictions on DML and PDML after direct-path inserts have been lifted. You can now do the following immediately after a direct-path insert:
  • Query the same table multiple times within the same session.
  • Perform conventional DML (serial and parallel) on the same table within the same session.
  • Multiple direct loads on the same table in the same session.
However, the restrictions on the above operations still apply when:
  • The tables are IOT or clustered tables. (The table must be a heap table.)
  • The tablespace is not under Automatic Segment Space Management (ASSM). Temporary tables are not under ASSM, so this includes them as well.
  • The tablespace is of uniform extent.

The restrictions on multiple queries and DML/PDML operations as well as the restriction on multiple direct-path inserts in the same session can be reinstated when needed by including the NO_MULTI_STATEMENT hint in SQL statements.

See Also:

Partitioning Key Restriction

You can only update the partitioning key of a partitioned table to a new value if the update does not cause the row to move to a new partition.

The update is possible if the table is defined with the row movement clause enabled.

Function Restrictions

The function restrictions for parallel DML are the same as those for parallel DDL and parallel query.

See About Parallel Execution of Functions for more information.

Data Integrity Restrictions

The interactions of integrity constraints and parallel DML statements are introduced in the topic.

This section contains following topics:

  • NOT NULL and CHECK

  • UNIQUE and PRIMARY KEY

  • FOREIGN KEY (Referential Integrity)

  • Delete Cascade

  • Self-Referential Integrity

  • Deferrable Integrity Constraints

NOT NULL and CHECK

The integrity constraints for NOT NULL and CHECK are discussed in this topic.

NOT NULL and CHECK integrity constraints are allowed. They are not a problem for parallel DML because they are enforced on the column and row level, respectively.

UNIQUE and PRIMARY KEY

The integrity constraints for UNIQUE and PRIMARY KEY are discussed in this topic.

UNIQUE and PRIMARY KEY integrity constraints are allowed.

FOREIGN KEY (Referential Integrity)

Restrictions for referential integrity occur whenever a DML operation on one table could cause a recursive DML operation on another table.

These restrictions also apply when, to perform an integrity check, it is necessary to see simultaneously all changes made to the object being modified.

below table lists all of the operations that are possible on tables that are involved in referential integrity constraints.

Table  Referential Integrity Restrictions

DML StatementIssued on ParentIssued on ChildSelf-Referential

INSERT

(Not applicable)

Not parallelized

Not parallelized

MERGE

(Not applicable)

Not parallelized

Not parallelized

UPDATE No Action

Supported

Supported

Not parallelized

DELETE No Action

Supported

Supported

Not parallelized

DELETE Cascade

Not parallelized

(Not applicable)

Not parallelized

Delete Cascade

The delete cascade data integrity restrictions are discussed in this topic.

Deletion on tables having a foreign key with delete cascade is not parallelized because parallel execution servers attempt to delete rows from multiple partitions (parent and child tables).

Self-Referential Integrity

DML on tables with self-referential integrity constraints is not parallelized if the referenced keys (primary keys) are involved.

For DML on all other columns, parallelism is possible.

Deferrable Integrity Constraints

The deferrable integrity constraints are discussed in this topic.

If any deferrable constraints apply to the table being operated on, the DML operation is not executed in parallel.

Trigger Restrictions

A DML operation is not executed in parallel if the affected tables contain enabled triggers that may get invoked as a result of the statement.

This implies that DML statements on tables that are being replicated are not parallelized.

Relevant triggers must be disabled to parallelize DML on the table. If you enable or disable triggers, then the dependent shared cursors are invalidated.

Distributed Transaction Restrictions

The distributed transaction restrictions are discussed in this topic.

A DML operation cannot be executed in parallel if it is in a distributed transaction or if the DML or the query operation is on a remote object.

Examples of Distributed Transaction Parallelization

Several examples of distributed transaction processing are shown in this topic.

In the first example, the DML statement queries a remote object. The DML operation is executed serially without notification because it references a remote object.


INSERT /*+ APPEND PARALLEL (t3,2) */ INTO t3 SELECT * FROM t4@dblink;

In the next example, the DML operation is applied to a remote object. The DELETE operation is not parallelized because it references a remote object.

DELETE /*+ PARALLEL (t1, 2) */ FROM t1@dblink;

In the last example, the DML operation is in a distributed transaction. The DELETE operation is not executed in parallel because it occurs in a distributed transaction (which is started by the SELECT statement).

SELECT * FROM t1@dblink; 
 DELETE /*+ PARALLEL (t2,2) */ FROM t2;
 COMMIT; 


Thanks,
Srini



Friday 14 April 2023

Increase Column Limit in 23c Oracle database architecture

 

Hi All,


In this post i am going to share the one of the new Features in oracle database architecture .

### Increase Column Limit


The maximum number of columns allowed in a database table or view has been increased to 4096. This feature allows you to build applications that can store attributes in a single table with more than the previous 1000-column limit. Some applications, such as Machine Learning and streaming IoT application workloads, may require the use of de-normalized tables with more than 1000 columns.


You now have the ability to store a larger number of attributes in a single row which for some applications may simplify application design and implementation.


MAX_COLUMNS specifies the maximum number of columns allowed in database tables and views.






When this parameter is set to STANDARD, the maximum number of columns allowed in a database table or view is 1000.

When this parameter is set to EXTENDED, the maximum number of columns allowed in a database table or view is 4096.

The COMPATIBLE initialization parameter must be set to 23.0.0.0 or higher to set MAX_COLUMNS = EXTENDED.

You can change the value of MAX_COLUMNS from STANDARD to EXTENDED at any time. However, you can change the value of MAX_COLUMNS from EXTENDED to STANDARD only when all tables and views in the database have 1000 or fewer columns.


Note:


This parameter is available starting with Oracle Database 23c.


Thanks,

Srini


Oracle 23C database Architecture New Feature Lock-Free Reservations

 Hi All,

In this post i am going to share the one of the new Features in oracle database architecture .

1. Lock-Free Reservations 

####. Lock-Free Reservations

Lock-Free Reservations enables concurrent transactions to proceed without being blocked on updates of heavily updated rows. Lock-Free reservations are held on the rows instead of locking them. Lock-Free Reservations verifies if the updates can succeed and defers the updates until the transaction commit time.

Lock-Free Reservations improves the end user experience and concurrency in transactions.

Using Lock-Free Reservation

============================

This chapter explains how to use lock-free reservation in database applications.

Topics:

# About Concurrency in Transaction Processing

# Lock-Free Reservation Terminology

# Lock-Free Reservation

# Benefits of Using Lock-Free Reservation

# Guidelines and Restrictions for Lock-Free Reservation

######### About Concurrency in Transaction Processing


Transaction processing usually involves flat transactions with data updates that replace old values with new. Most applications store numeric and aggregate values, such as quantity-on-hand of products, bank account balances, stocks, and number of seats available. These numeric aggregate data, although referenced as a single entity, are based on one or more same or similar data. Such data involve subtraction or addition of the values rather than an assignment of the form “data ← value.” For example, a bank account balance is based on the debit and credit transactions that happen on the account.


Applications that provide inventory control, supply chain, financial or investment banking, stocks, travel, and entertainment operate on numeric aggregate data. A numeric aggregate data is generally identified as a “hot” resource because applications continuously and repeatedly read or update such data. The likelihood of many transactions concurrently accessing such data is high. In conventional locking protocols, such as two-phase locking (2PL), execution of concurrent transactions is serialized after a transaction initiates an update on a row. The initiated update is complete only when the transaction finalizes with a commit or a rollback. Serialization blocks other concurrent transactions from accessing the row until the transaction that initiated the update is completed. If you allow concurrent transactions to access data, you must control the transactions to preserve application correctness.


In long-running transactions such as microservices applications, a resource remains locked for an extended period, potentially making it a hot resource. The long-term resource locking limits concurrency. In microservices applications that offer services like trip booking services, you may have flight, hotel, and car bookings in long-running transactions. These transactions are typically handled as Sagas and span different services with databases holding locks until the Saga finalization.


Let us look at an example of an online shopping cart to understand how you would handle concurrency in a normal course. A shopping cart has items added to the cart before being sold. Your application must be able to handle multiple transactions at various states like: when a user puts an item into the cart, the item becomes unavailable to other buyers and yet unsold. For concurrent transactions, managing the inventory states and count becomes complex with multiple transactions adding items to the cart and checking out or abandoning the cart. The inventory or similar fields must be locked for a transaction much before a commit or rollback can change the quantity. Locking data for long periods prevents other concurrent transactions from accessing the item until the lock is released. Therefore, aiming for isolation and allowing the application to run transactions independently, limits concurrency.


For many business applications, blocking concurrent accesses to “hot” data can severely impact performance, reducing user experience and throughput. Applications can benefit if there is improved concurrency with reduced isolation while maintaining the atomicity, consistency, and durability properties of transactions. To improve concurrency, it is important to capture the state of a hot resource during a transaction lifecycle and enable data locking only when the resource value is being modified.

See Also:

Lock-Free Reservation for more information about how reservable columns are used to control concurrency in transaction processing.

####### Lock-Free Reservation Terminology

Numeric Aggregate Data

Hot Data or Hot Resource

Transaction Lifecycle

Compensation or Compensating Transaction

Reservable

Reservable Column

Reservable Update

Reservation Journal

Lock-free Reservation

Optimistic Locking

Saga

Numeric Aggregate Data

Data that involves subtraction (consume, decrement) or addition (replenish, increment) of the quantity (numeric data) rather than an assignment of the form “data ← value”. Operations on numeric aggregate data are commutative in nature.

Hot Data or Hot Resource

Data or a resource that receives high traffic from transactions requiring frequent reads and updates or a resource that is read or updated in a long-running transaction.

Transaction Lifecycle

The states in a business transaction as it transitions from its creation to its committed or rollback state.

Compensation or Compensating Transaction

A compensation or compensating transaction compensates (rolls back) for the already committed transactions of a saga if any other transactions that is also a part of the saga fails.

Reservable

Reservable is a column property that you can define for a column with numeric data type. A reservable column keeps journals of modification made to the column. These journals are used for concurrency control and auto-compensation.

Reservable Column

A column that contains a hot resource and is identified for lock-free reservation. These columns are declared with a reservable column property keyword.

Reservable Update

Numeric aggregate data updates made on a reservable column.

Reservation Journal

A reservation journal is a table associated with the user table that records the modification (increase or decrease by a delta amount with respect to the current value) in the reservable column.


Lock-free Reservation


Any reservable update is treated as a lock-free reservation, implying that the transactions making the updates to a qualifying row do not lock the row, but indicate their intention to modify the reservable column value by a delta amount. The operation of modification is recorded in a reservation journal. Lock-free reservations are transformed to the actual updates at the commit of the transaction.


Lock-free reservation ensures that the lock is obtained only at the time of commit to update a reservable column. Lock-free reservation is used for high-concurrency hot data and are suited for microservices transaction models because of its implicit compensation support.

Optimistic Locking

Optimistic locking is a concurrency control method that allows transactions to use data resources without acquiring locks on those resources. Before committing, each transaction verifies that no other transaction has modified the data that it last read.

Saga

A saga encapsulates a long running business transaction that is composed of several independent microservices. Each microservice comprises of one or more local transactions that are part of the same saga.


######## Lock-Free Reservation


Lock-free reservation provides an in-database infrastructure for transactions operating on reservable columns to:

Enable concurrent transactions to proceed without being blocked on updates made to reservable columns

Issue automatic compensations for reservable updates of successful transactions in an aborted saga

Here’s how lock-free reservation enables applications to include concurrency and auto-compensating features into their transactions:


Declaring a Reservable Column

You can use the reservable keyword to declare a reservable column when you create or alter a table. Lock-free reservation is offered on columns with numeric data types. To identify a potential reservable column, look for hot resources with numeric aggregate data that could benefit from improved concurrency.

Reserving a Transaction Update

When a transaction issues an update operation on a reservable column, the reservable update is placed as a lock-free reservation in a reservation journal. All updates issued on reversable columns are treated as lock-free reservation.


The transaction update does not lock the row (that has the reservable update) but indicate their intention to modify (add or subtract) the reservable column in the row by a delta amount. The modification amount is reserved and promised so that the transaction may proceed without waiting on other uncommitted, concurrent transactions that have made earlier reservations on the same row’s reservable column. The reservation enables other concurrent transactions to issue reservable updates to the same row.

The operation of modification (increase or decrease by the delta amount with respect to the current value of the reservable column) is recorded in a reservation journal. Instead of reading and writing the actual value of the reservable column, transactions issue operations to increment or decrement the reservable column value. Update requests made to the reservable column are recorded in a reservation journal. Before executing the operation for reservation, each concurrent transaction accesses the journal, and checks the total reservable quantities of all uncommitted transactions.


Verifying and Deferring an Update

The transaction, based on the constraints placed on the reservable column, decides whether the quantity is sufficient to make the update. The transaction checks for the following:

Verifies that the update can succeed. The update to reservation journal is allowed to proceed if there is sufficient balance. If the balance is not sufficient to fulfill the update (consume) request, the update request to the reservable column is failed without relying on any active (not yet committed) replenishment to succeed.

Checks for any constraints or bounds (CHECK constraints) on reservable columns to enforce business rules and to ensure application correctness. Check constraints can include checks for reservable and non-reservable columns.

Defers the actual update to reservable column until the commit time to improve concurrency

Auto-compensating Successful Updates in a Failed Transaction


Lock-free reservation enables the tracking of the state transitions of a reservable column through its transaction lifecycle. If a transaction is aborted (after partial completions) due to reasons such as insufficient balance or an abort of a saga, lock-free reservation issues automatic compensation or rollback of the reservable updates.

Ensuring Durability of a Reservable Update

The lock-free reservations are transformed to the actual updates at the commit of the transaction. Rollback of the transaction voids all lock-free reservations that the transaction holds in the reservation journals. Rollback to a savepoint removes the lock-free reservations made by the transaction after the affected savepoint.


For sagas in microservices, lock-free reservations enable automatic compensation of the reservable updates for successful local transactions in an aborted saga. Lock-free reservation enables tracking the reservable updates within the database during the execution of transactions and retains the journals beyond the commit of the transaction until the saga finalization.

############## Comparing Optimistic Locking and Lock-Free Reservation


Lock-free reservation guarantees the outstanding reservations by operating within bounds as follows:

Journals on-going requests.

Introduces new reservation journal columns to track projected values based on the pending requests.

Consults the journal to allow or reject new requests based on outstanding reservations.

Rejects new requests that cannot be satisfied due to outstanding reservations or if the request quantity is greater than the availability.

In comparison, optimistic locking does not track or guarantee reservations.

Here are other drawbacks of the optimistic locking approach:

Requests may not be satisfied at the commit time because of insufficient quantity ( if over-promised).

Possibility of abort of a transaction at the end. If a long-running transaction is aborted, work is wasted and the changes must be rolled back.


*********** Creating a Reservable Column at Table Creation

When you create a new table, you can declare a reservable column using the reservable keyword.

Modify the CREATE TABLE command to enable lock-free reservation as follows:

Create_table_command::={relational_table | object_table | XMLType_table }

Relational_table::= CREATE TABLE [ schema. ] table …;

relational_properties::= [ column_definition ] 

column_definition::= column_name datatype reservable [CONSTRAINT constraint_name check_constraint]

CREATE TABLE Account( ID NUMBER PRIMARY KEY,

 Name VARCHAR2(10),

 Balance NUMBER reservable CONSTRAINT minimum_balance CHECK (Balance >= 50))

 The creation of the "Account" table with the reservable column "Balance" creates an associated reservation journal table. The reservation journal table is created under the same user schema and in the same tablespace as the user table. The reservation journal table also has deferred segment creation enabled.

Note:The CREATE TABLE statement syntax supports the RESERVABLE keyword but not the NOT RESERVABLE keyword. The NOT RESERVABLE keyword is supported in the ALTER TABLE command.

See Also:

Reservation Journal Table Columns for more information about the columns used in the reservation journal table.

Use the ALL_CONSTRAINTS view to get the constraint details.

SELECT table_name, constraint_name, search_condition

 FROM ALL_CONSTRAINTS

 WHERE table_name='ACCOUNT';

 

#########Reservation Journal Table Columns

A reservation journal table contains the following column information.

The DESCRIBE statement gives you the actual names of the columns in the reservation journal table associated with the earlier mentioned Account table:

SQL>desc SYS_RESERVJRNL_<object_number_of_base_table>;

Table 29-1 Reservation Table Columns

Name Null? Type Description

ORA_SAGA_ID$

RAW(16)

Saga ID of the transaction (0 for non-saga transactions)

ORA_TXN_ID$

RAW(8)

Transaction ID of the transaction (containing usn, slot, seq)

ORA_STATUS$

CHAR(12)

Status of the Txn ID, with values: {ACTIVE, INACTIVE, COMPENSATED}

ORA_STMT_TYPE$

CHAR(16)

DML statement type {UPDATE}

ID

NOT NULL NUMBER

Primary Key column of user table

BALANCE_OP

CHAR(7)

Reservable column operation with operations having ‘+’ or ‘-’ for replenishment or consumption

BALANCE_RESERVED

  NUMBER

Reservable column reserved and is the amount reserved from the reservable column


******** Adding or Modifying Reservable Columns


You can modify the ALTER TABLE statement to add a reservable column or change a reservable column into a non-reservable column.

To add a reservable column, modify the ALTER TABLE command as follows:

ALTER TABLE [ schema.]table

 [add [column_definition]]…;

 column_definition::= column_name datatype reservable [default <value>]

 [CONSTRAINT constraint_name check_constraint]

ALTER TABLE Account

 ADD (Balance NUMBER reservable CONSTRAINT minimum_balance CHECK (Balance >= 50));

To change an existing column to a reservable column, modify the ALTER TABLE command as follows:

ALTER TABLE [ schema.]table

 [modify [column_definition]]…;

 column_definition::= column_name reservable [default <value>]

 [CONSTRAINT constraint_name check_constraint]

To change an existing QOH column to a reservable column and to optionally add a new constraint:


ALTER TABLE PRODUCTS 

MODIFY (QOH reservable default 0 CONSTRAINT maxAmount CHECK (QOH <= 100));


To change a reservable column to a non-reservable column, modify the ALTER TABLE command as follows:


ALTER TABLE [ schema.]table

 [modify [column_definition]]…;

 column_definition::= column_name not reservable]

 To change an existing reservable column QOH to a non-reservable column:

ALTER TABLE PRODUCTS modify (QOH not reservable);


Note:A reservable column can be converted to a non-reservable column using the earlier mentioned ALTER TABLE command. Although the lock-free reservations are disabled once a reservable column is changed to a non-reservable column, applications may choose to enforce the constraints. Hence, the constraints are not automatically dropped when a column is converted to a non-reservable column. You can choose to drop the constraints using the ALTER TABLE statement.


######## About CHECK Constraints in Reservable Columns


A CHECK constraint lets you specify a condition that each row in the table must satisfy. To satisfy the constraint, each row in the table must make the condition either TRUE or unknown (due to a NULL). When Oracle evaluates a check constraint condition for a particular row, any column names in the condition refer to the column values in that row.


Note:Oracle does not verify that conditions of check constraints are not mutually exclusive. Therefore, if you create multiple check constraints for a column, design them carefully so their purposes do not conflict. Do not assume any particular order of evaluation of the conditions.

Table-level CHECK Constraints for Reservable Columns


You can have reservable columns in table-level CHECK constraints. If a table-level CHECK constraint that involves reservable and non-reservable columns fails validation at commit time, then the transaction is aborted. The abort happens because the non-reservable column values cannot be guaranteed using the reservation mechanism.


For example:


CREATE TABLE Account(

 ID NUMBER PRIMARY KEY,

 Name VARCHAR2(10),

 Balance NUMBER reservable,

 Earmark NUMBER,

 Limit NUMBER,

 CONSTRAINT minimum_balance CHECK (Balance + Limit – Earmark >= 0))

 

You can also define reservable columns without constraints. For such reservable columns all lock-free reservations are successful.

No storage clause specification is supported for reservable columns.

Example: Conventional Locking and Lock-Free Reservation

The examples below provide a purchase transaction in conventional and lock-free reservation modes.

Conventional Locking (with Long-held Locks)

The following example uses traditional locking to allow a purchase of a $25 item while maintaining a $50 minimum balance:

A SELECT FOR UPDATE is first issued to read and lock the balance.

If the balance is at least 75, the item purchase is allowed.

The UPDATE then debits the balance.

The transaction then commits.

An insufficient balance causes an abort.

CREATE TABLE Account (

 ID NUMBER PRIMARY KEY,

 Name VARCHAR2(10),

 Balance NUMBER CONSTRAINT minimum_balance CHECK (Balance >= 50)); 


DECLARE current NUMBER;

BEGIN

 -- Read and Lock account balance

 SELECT Balance INTO current

 FROM Account

 WHERE ID = 12345 FOR UPDATE;


 IF current >= 75 THEN

  -- Sufficient funds: Perform item purchase

  PurchaseItem();

  -- Debit account balance and commit 

  UPDATE Account

  SET Balance = Balance - 25

  WHERE ID = 12345;

  COMMIT;

 ELSE

  ROLLBACK; -- Insufficient funds, abort

 END IF;

END;

Lock-Free Reservation (with Short-held Locks)


The following example uses lock-free reservation to allow a purchase of a $25 item while maintaining a $50 minimum balance. The reservable column constraint allows a reservation to be placed on a column value without locking the row.


The balance update reserves $25 without locking the account.

If the reservation succeeds, the item purchase is allowed to proceed.

The final commit locks the account row and applies the balance debit of $25 as recorded in the reservation.

If the reservation fails due to insufficient funds, the update statement fails with the CHECK constraint violation.



CREATE Table Account(

 ID NUMBER PRIMARY KEY,

 Name VARCHAR2(10),

 Balance NUMBER RESERVABLE CONSTRAINT minimum_balance CHECK (Balance >= 50));


BEGIN

 -- Reserve 25 from account balance

 UPDATE Account SET Balance = Balance - 25

 WHERE ID = 12345;

 -- If reservation succeeds perform item purchase

 PurchaseItem();

 -- The commit finalizes the balance update

 COMMIT; -- This gets the account row lock 

 EXCEPTION WHEN Check_Constraint_Violated

 -- This indicates that the reservation failed

 THEN ROLLBACK;

END;



****Querying Reservable Column Views


You can run queries on the dictionary views of reservable columns to get information about reservable columns.


You can run queries on the DBA_TAB_COLUMNS, USER_TAB_COLUMNS and ALL_TAB_COLUMNS views to check if a column is declared as a reservable column.


SELECT table_name, column_name , reservable_column

 FROM user_tab_columns

 WHERE table_name = <table name>;

 

You can run queries on the DBA_TAB_COLS, USER_TAB_COLS, and ALL_TAB_COLS views to check if a column is declared as a reservable column.



SELECT table_name, column_name , reservable_column 

 FROM user_tab_cols 

 WHERE table_name = <table name>;

 

Example Query:


SQL> SELECT table_name, column_name , reservable_column 

 FROM user_tab_cols 

 WHERE table_name = 'ACCOUNT';

 

Result:


TABLE_NAME     COLUMN_NAME     ESC

–-----------------------------------

ACCOUNT         NAME          NO

ACCOUNT         BALANCE       YES

ACCOUNT         ID            NO


3 rows selected


You can run queries on the DBA_TABLES, USER_TABLES, and ALL_TABLES views to check if the user table has one or more reservable columns.


SELECT table_name, has_reservable_column 

 FROM user_tables 

 WHERE table_name = <table name>;

 

Example Query:


SQL> SELECT table_name, has_reservable_column 

 FROM user_tables 

 WHERE table_name = 'ACCOUNT';

Result:

TABLE_NAME     HAS

–-------------------

ACCOUNT        YES


1 row selected


Thanks ,

Srini

Friday 7 April 2023

EBS R12.2.12 Single Node installation on OCI.

How to Create Oracle Cloud Infrastructure (OCI) to provision an Oracle E-Business Suite Release 12.2.12 with Oracle Database 19c demonstration instance on a single virtual machine (VM) on OCI. 


Operating system : Oracle Linux 7.9 64-bit

RDBMS Oracle Home : Oracle Database 19c (19.17 RU)

Oracle E-Business Suite 12.2.12

Oracle Forms and Reports    10.1.2.3

Oracle WebLogic Server    10.3.6.0.220719

Web Tier    11.1.1.9

JDK  1.7.0_331

Using Java Web Start with Oracle E-Business Suite (Doc ID 2188898.1)

Pre-requisites :

  • An SSH Key Pair which will be used for accessing your instance. See Generating an SSH Key Pair for Oracle Compute Cloud Service Instances.
  • An Oracle Cloud Infrastructure (OCI) tenancy, with the following associated resources:
    • A compartment
    • A user who is either a tenancy administrator, or who has privileges to manage all resources in the compartment
    • A Virtual Cloud Network (VCN) and an associated subnet which will be associated with the Oracle E-Business Suite instance


Create Instance Using an Image from the OCI Console Marketplace


Follow these steps to create and connect to your Oracle E-Business Suite instance when using an image from the OCI Console Marketplace.

Login to OCI Console .

select the main menu and click on Marketplace and select all applicatons .




Search for Oracle E-Business Suite and select the Demo Install Image .




By default it will select the root compartment , if you want to place diffent compartment you can select and click on launch .. 




Provide the instnace name , shape, network select vpn and subnet  and compartment and other 





if you have alredy private and public keys , you past the public key in the instance , private key you can use to connect for Putty . dont share private key with anyone .




Select the boot volume min 500G , 



Click on Create ..




Wait for few minutes thats it you install will be launched ..

you can see the instance under compute and instances .








  1. Establish SSH Connectivity.

    Review the security lists associated with the subnet to ensure that an ingress rule exists with the following attributes:

    • SOURCE TYPE: CIDR
    • SOURCE CIDR: Enter the CIDR block of your choice. Note that 0.0.0.0/0 corresponds to the public internet. We recommend restricting this to the CIDR block that corresponds to the IP range you want to give access to.
    • IP PROTOCOL: SSH (TCP/22)
    • DESTINATION PORT: 22

    When the instance is fully provisioned and running, connect to it using SSH as described in Connecting to an Instance.

  2. After the instance has been created (provisioned), it will appear in the instance list. To view full details about it, including IP addresses, click the instance name in the list.





Perform Post-Install Steps


Connect to putty using public IP with user opc .





click on SSH then click on Auth and add the private key  to access the EBS instance from on premise.

 


Click on Open ..





$ sudo su -
# yum update
Is this ok [y/d/N]: y



then 






this will take few minutes ater that follow the below stpes to enable port.

Enable Instance-Level Firewall Access to Port 8000

While still logged on as the root user, use the following commands to enable port 8000:
# firewall-cmd --add-port=8000/tcp --permanent
# systemctl restart firewalld


To confirm the change, use the following command:

# firewall-cmd --list-all



Update Hostname

Your hostname must be updated to reflect the current VCN network configuration. While still logged on as the root user, perform a required hostname update using the following command:

# /u01/install/scripts/updatehosts.sh



Enable and Change SYSADMIN Password

Switch to Oracle user .

sudo -i -u oracle


start the databsae services .

$ /u01/install/APPS/scripts/startdb.sh





start the application services .

 /u01/install/APPS/scripts/startapps.sh



EBS and ECC started successfully ..





$ . /u01/install/APPS/EBSapps.env run




 mkdir -p ~/logs

$ cd ~/logs
$ sh /u01/install/APPS/scripts/enableSYSADMIN.sh


then set the demo user password .

/u01/install/APPS/scripts/enableDEMOusers.sh

Configure Web Entry Point , this step is option if you want to change your applicaiton login url follow the below steps .


 /u01/install/scripts/configwebentry.sh









database verison :











Click on ignore option then re-login you will see the applicaiton login.










will kep post for further steps in my next post ..



Thanks,
Srini