Wednesday, May 11, 2022

Upgrading Oracle Restart from 19c to 21c on RHEL 7

This post shows the steps for upgrading the grid infrastructure portion of 19c Oracle Restart to 21c.

1. The current Oracle restart configuration is as below.
Resource Name             Type                      Target             State              Host
-------------             ------                    -------            --------           ----------
ora.DATA.dg               ora.diskgroup.type        ONLINE             ONLINE             ip-172-31-10-91
ora.FRA.dg                ora.diskgroup.type        ONLINE             ONLINE             ip-172-31-10-91
ora.LISTENER.lsnr         ora.listener.type         ONLINE             ONLINE             ip-172-31-10-91
ora.asm                   ora.asm.type              ONLINE             ONLINE             ip-172-31-10-91
ora.cssd                  ora.cssd.type             ONLINE             ONLINE             ip-172-31-10-91
ora.diskmon               ora.diskmon.type          OFFLINE            OFFLINE
ora.evmd                  ora.evm.type              ONLINE             ONLINE             ip-172-31-10-91
ora.ons                   ora.ons.type              OFFLINE            OFFLINE
ora.testcdb.db            ora.database.type         ONLINE             ONLINE             ip-172-31-10-91
The software and release version of the HAS are as below.
crsctl query has releaseversion
Oracle High Availability Services release version on the local node is [19.0.0.0.0]

crsctl query has softwareversion
Oracle High Availability Services version on the local node is [19.0.0.0.0]
2. The current patch on 19c GI is 19.12.
$ORACLE_HOME/OPatch/opatch lspatches
32918050;TOMCAT RELEASE UPDATE 19.0.0.0.0 (32918050)
32904851;Database Release Update : 19.12.0.0.210720 (32904851)
32585572;DBWLM RELEASE UPDATE 19.0.0.0.0 (32585572)
32915586;ACFS RELEASE UPDATE 19.12.0.0.0 (32915586)
32916816;OCW RELEASE UPDATE 19.12.0.0.0 (32916816)
3. Make the directory for GI home and unzip the 21c installer to this directory.
mkdir -p /opt/app/oracle/product/21.x.0/grid
unzip LINUX.X64_213000_grid_home.zip -d /opt/app/oracle/product/21.x.0/grid
4. Run the cluster verification tool from 21c GI home with hacfg option. The failure listed below is due to 0 SWAP size on AWS node. This could be ignored.
./runcluvfy.sh stage -pre hacfg

Performing following verification checks ...

  Physical Memory ...PASSED
  Available Physical Memory ...PASSED
  Swap Size ...FAILED (PRVF-7573)
  Free Space: ip-172-31-10-91:/usr,ip-172-31-10-91:/var,ip-172-31-10-91:/etc,ip-172-31-10-91:/sbin,ip-172-31-10-91:/tmp ...PASSED
  User Existence: oracle ...
    Users With Same UID: 501 ...PASSED
  User Existence: oracle ...PASSED
  Group Existence: dba ...PASSED
  Group Existence: oinstall ...PASSED
  Group Membership: oinstall(Primary) ...PASSED
  Group Membership: dba ...PASSED
  Run Level ...PASSED
  Architecture ...PASSED
  OS Kernel Version ...PASSED
  OS Kernel Parameter: semmsl ...PASSED
  OS Kernel Parameter: semmns ...PASSED
  OS Kernel Parameter: semopm ...PASSED
  OS Kernel Parameter: semmni ...PASSED
  OS Kernel Parameter: shmmax ...PASSED
  OS Kernel Parameter: shmmni ...PASSED
  OS Kernel Parameter: shmall ...PASSED
  OS Kernel Parameter: file-max ...PASSED
  OS Kernel Parameter: ip_local_port_range ...PASSED
  OS Kernel Parameter: rmem_default ...PASSED
  OS Kernel Parameter: rmem_max ...PASSED
  OS Kernel Parameter: wmem_default ...PASSED
  OS Kernel Parameter: wmem_max ...PASSED
  OS Kernel Parameter: aio-max-nr ...PASSED
  Package: kmod-20-21 (x86_64) ...PASSED
  Package: kmod-libs-20-21 (x86_64) ...PASSED
  Package: binutils-2.23.52.0.1 ...PASSED
  Package: libgcc-4.8.2 (x86_64) ...PASSED
  Package: libstdc++-4.8.2 (x86_64) ...PASSED
  Package: sysstat-10.1.5 ...PASSED
  Package: ksh ...PASSED
  Package: make-3.82 ...PASSED
  Package: glibc-2.17 (x86_64) ...PASSED
  Package: glibc-devel-2.17 (x86_64) ...PASSED
  Package: libaio-0.3.109 (x86_64) ...PASSED
  Package: nfs-utils-1.2.3-15 ...PASSED
  Package: smartmontools-6.2-4 ...PASSED
  Package: net-tools-2.0-0.17 ...PASSED
  Package: libxcb-1.11 (x86_64) ...PASSED
  Package: libX11-1.6.3 (x86_64) ...PASSED
  Package: libXau-1.0.8 (x86_64) ...PASSED
  Package: libXi-1.7.4 (x86_64) ...PASSED
  Package: libXtst-1.2.2 (x86_64) ...PASSED
  Package: policycoreutils-python-2.5-17 ...PASSED
  Package: policycoreutils-2.5-17 ...PASSED
  Users With Same UID: 0 ...PASSED
  Current Group ID ...PASSED
  Root user consistency ...PASSED

Pre-check for Oracle Restart configuration was unsuccessful.


Failures were encountered during execution of CVU verification request "stage -pre hacfg".

Swap Size ...FAILED
ip-172-31-10-91: PRVF-7573 : Sufficient swap size is not available on node
                 "ip-172-31-10-91" [Required = 15.5115GB (1.6265024E7KB) ;
                 Found = 0.0 bytes]


CVU operation performed:      stage -pre hacfg
Date:                         Apr 25, 2022 12:56:04 PM
CVU home:                     /opt/app/oracle/product/21.x.0/grid
Grid home:                    /opt/app/oracle/product/19.x.0/grid
User:                         oracle
Operating system:             Linux3.10.0-1062.9.1.el7.x86_64
5. ASM will be upgraded as part of the upgrade process. Therefore stop the database before starting the GI upgrade. Upgrade process will prompt to stop the database during gridSetup run as well.


Stop the DB.
srvctl stop database -d testcdb


6. Run the gridsetup with '-applyRU' to apply the latest RU on 21c. One the patch is applied the OUI will appear.
./gridSetup.sh -applyRU /opt/installs/21c/psu_apr22/33859395
Preparing the home to patch...
Applying the patch /opt/installs/21c/psu_apr22/33859395...
Select upgrade GI
The unzip location is the GI home. Only Oracle base could be changed at install time.


During the pre-req check the following two items failed.

First item is related to ASM compatibility.

As shown on the message the asm.compatibility must be 11.2.0.2 or above. This was lower on the system used for this upgrade test. Upgrade the asm.compatibility to above 11.2.0.2.
NAME                           VALUE                          GROUP_NUMBER 
------------------------------ ------------------------------ ------------ 
compatible.asm                 19.0.0.0.0                                1 
compatible.rdbms               19.0.0.0.0                                1 
compatible.asm                 19.0.0.0.0                                2 
compatible.rdbms               19.0.0.0.0                                2
Once the asm.compatibility was updated this pre-req failure went away.
The second failure is related to disk discovery string.

The message states there's a mismatch between values in GnP profile and ASM instance. The asm disk discovery string could be at ASM instance level either with
SQL> alter system set asm_diskstring='/dev/oracleasm/cg*' scope=both;
or
dsset /dev/oracleasm/cg*
However, this did not resolve this pre-req failure and kept being flagged. Finally decided to ignore this pre-req failure and continue.
Summary page is shown below.

7. When prompted run the rootupgrade.sh.
# /opt/app/oracle/product/21.x.0/grid/rootupgrade.sh
Performing root user operation.

The following environment variables are set as:
    ORACLE_OWNER= oracle
    ORACLE_HOME=  /opt/app/oracle/product/21.x.0/grid

Enter the full pathname of the local bin directory: [/usr/local/bin]:
The contents of "dbhome" have not changed. No need to overwrite.
The file "oraenv" already exists in /usr/local/bin.  Overwrite it? (y/n)
[n]: y
   Copying oraenv to /usr/local/bin ...
The file "coraenv" already exists in /usr/local/bin.  Overwrite it? (y/n)
[n]: y
   Copying coraenv to /usr/local/bin ...

Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root script.
Now product-specific root actions will be performed.
Using configuration parameter file: /opt/app/oracle/product/21.x.0/grid/crs/install/crsconfig_params
The log of current session can be found at:
  /opt/app/oracle/crsdata/ip-172-31-10-91/crsconfig/roothas_2022-04-25_01-50-58PM.log
2022/04/25 13:51:00 CLSRSC-595: Executing upgrade step 1 of 12: 'UpgPrechecks'.
2022/04/25 13:51:04 CLSRSC-595: Executing upgrade step 2 of 12: 'GetOldConfig'.
2022/04/25 13:51:06 CLSRSC-595: Executing upgrade step 3 of 12: 'GenSiteGUIDs'.
2022/04/25 13:51:06 CLSRSC-595: Executing upgrade step 4 of 12: 'SetupOSD'.
2022/04/25 13:51:07 CLSRSC-595: Executing upgrade step 5 of 12: 'PreUpgrade'.
2022/04/25 13:51:35 CLSRSC-595: Executing upgrade step 6 of 12: 'UpgradeAFD'.
2022/04/25 13:51:36 CLSRSC-595: Executing upgrade step 7 of 12: 'UpgradeOLR'.
clscfg: EXISTING configuration version 0 detected.
Creating OCR keys for user 'oracle', privgrp 'oinstall'..
Operation successful.
2022/04/25 13:51:42 CLSRSC-595: Executing upgrade step 8 of 12: 'UpgradeOCR'.
LOCAL ONLY MODE
Successfully accumulated necessary OCR keys.
Creating OCR keys for user 'root', privgrp 'root'..
Operation successful.
CRS-4664: Node ip-172-31-10-91 successfully pinned.
2022/04/25 13:51:45 CLSRSC-595: Executing upgrade step 9 of 12: 'CreateOHASD'.
2022/04/25 13:51:46 CLSRSC-595: Executing upgrade step 10 of 12: 'ConfigOHASD'.
2022/04/25 13:51:46 CLSRSC-329: Replacing Clusterware entries in file 'oracle-ohasd.service'
2022/04/25 13:52:03 CLSRSC-595: Executing upgrade step 11 of 12: 'UpgradeSIHA'.

ip-172-31-10-91     2022/04/25 13:52:55     /opt/app/oracle/crsdata/ip-172-31-10-91/olr/backup_20220425_135255.olr     498597253

ip-172-31-10-91     2021/08/27 12:17:16     /opt/app/oracle/crsdata/ip-172-31-10-91/olr/backup_20210827_121716.olr     1944883066
2022/04/25 13:52:56 CLSRSC-595: Executing upgrade step 12 of 12: 'InstallACFS'.
2022/04/25 13:53:54 CLSRSC-327: Successfully configured Oracle Restart for a standalone server
8. This would have successfully upgrade GI to 21c.
9. Current release and software version for HAS are as below.
crsctl query has releaseversion
Oracle High Availability Services release version on the local node is [21.0.0.0.0]

crsctl query has softwareversion
Oracle High Availability Services version on the local node is [21.0.0.0.0]
10. Run the cluvfy for post ugprade.
cluvfy stage -post hacfg

Performing following verification checks ...

  Oracle Restart Integrity ...PASSED
  OLR Integrity ...PASSED

Post-check for Oracle Restart configuration was successful.

CVU operation performed:      stage -post hacfg
Date:                         Apr 25, 2022 2:17:30 PM
CVU home:                     /opt/app/oracle/product/21.x.0/grid
Grid home:                    /opt/app/oracle/product/21.x.0/grid
User:                         oracle
Operating system:             Linux3.10.0-1062.9.1.el7.x86_64

Related Posts
Upgrading Oracle Single Instance with ASM (Oracle Restart) from 11.2.0.4 to 19c (19.6) on RHEL 7
Upgrading Oracle Restart from 18c (18.6) to 19c (19.3)
Upgrading Oracle Restart from 12.2.0.1 to 18c
Upgrading Oracle Single Instance with ASM (Oracle Restart) from 11.2.0.4 to 12.2.0.1
Upgrading Oracle Single Instance with ASM (Oracle Restart) from 12.1.0.2 to 12.2.0.1
Upgrading Single Instance on ASM from 11.2.0.3 to 11.2.0.4
Upgrading Grid Infrastructure Used for Single Instance from 11.2.0.4 to 12.1.0.2

Saturday, March 26, 2022

Initiating Switchover on a Physical Standby

It seems the best instance to intiaiate the switchover changes based on whether data guard broker is used or not. Oracle documentation states when performing switchover using SQL, the switchover process is initiated on the primary database.
Initiate the switchover on the primary database, BOSTON, by issuing the following SQL statement
On the data guard broker documentation it doesn't explicitly states where to initiate the switchover. In practice switchover command could be initiated while logged into any instance. However, executing switchover on the primary instance when data gaurd broker is used will output the following in the data guard broker log. The DG configuration is
DGMGRL> show configuration

Configuration - test_dg

  Protection Mode: MaxAvailability
  Members:
  dgtest  - Primary database
    dgtest2 - Physical standby database
    dgtest3 - Physical standby database

Fast-Start Failover:  Disabled

Configuration Status:
SUCCESS   (status updated 9 seconds ago)
Switchover command is issued while connected to the current primary, dgtest.
2022-03-21T10:41:33.122+00:00
Forwarding MON_PROPERTY operation to member dgtest2 for processing
2022-03-21T10:41:42.319+00:00
Initiating a healthcheck...
SWITCHOVER TO dgtest2
Switchover to physical standby database cannot be initiated from the primary database
redirecting connection to switchover target database dgtest2...
...using connect identifier: dgtest2tns
SWITCHOVER TO dgtest2
Notifying Oracle Clusterware to prepare primary database for switchover
2022-03-21T10:41:44.319+00:00
Executing SQL: [ALTER DATABASE SWITCHOVER TO 'dgtest2']
2022-03-21T10:42:02.573+00:00
SQL [ALTER DATABASE SWITCHOVER TO 'dgtest2'] executed successfully
2022-03-21T10:42:03.652+00:00
Switchover successful
From the output it seems that DG broker is creating a remote connection to the standby (new primary) using the TNS entry used when the standby was added to the data guard broker.



On the otherhand if connected to the standby and switchover command is issued no such message appears.
DGMGRL>  show configuration

Configuration - test_dg

  Protection Mode: MaxAvailability
  Members:
  dgtest2 - Primary database
    dgtest  - Physical standby database
    dgtest3 - Physical standby database

Fast-Start Failover:  Disabled

Configuration Status:
SUCCESS   (status updated 5 seconds ago)
New primary is dgtest2 and switchover command is issued from standby, dgtest. The output on DG broker log of the primary (dgtest2) shows the below
2022-03-21T10:50:27.266+00:00
Initiating a healthcheck...
SWITCHOVER TO dgtest
2022-03-21T10:50:28.682+00:00
Notifying Oracle Clusterware to prepare primary database for switchover
Executing SQL: [ALTER DATABASE SWITCHOVER TO 'dgtest']
2022-03-21T10:50:49.451+00:00
SQL [ALTER DATABASE SWITCHOVER TO 'dgtest'] executed successfully
Similary if the switchvoer is issued from another standby that is not the future primary (in this confiugration dgtest3) then again the primary's DG broker log output will have the below output
2022-03-21T11:31:51.242+00:00
Initiating a healthcheck...
SWITCHOVER TO dgtest2
2022-03-21T11:31:52.601+00:00
Notifying Oracle Clusterware to prepare primary database for switchover
Executing SQL: [ALTER DATABASE SWITCHOVER TO 'dgtest2']

Friday, March 18, 2022

ATP Auto Indexing

ATP DB has the ability to automatically create indexes based on the improvment those indexes would bring to the query execution. This post explore the usage of this feature. By default auto indexing is off when an ATP is first created. All of the parameters related to auto indexing could be found out by querying the DBA_AUTO_INDEX_CONFIG.
select PARAMETER_NAME,PARAMETER_VALUE from DBA_AUTO_INDEX_CONFIG;

PARAMETER_NAME                           PARAMETER_VALUE
---------------------------------------- ----------------
AUTO_INDEX_SCHEMA
AUTO_INDEX_DEFAULT_TABLESPACE
AUTO_INDEX_SPACE_BUDGET                  100
AUTO_INDEX_REPORT_RETENTION              373
AUTO_INDEX_RETENTION_FOR_AUTO            373
AUTO_INDEX_RETENTION_FOR_MANUAL
AUTO_INDEX_MODE                          OFF
AUTO_INDEX_COMPRESSION                   ON
For detail explanation on setting these parameters refer the Oracle documentation.
Auto indexing configuration could be set to read only mode where indexes are created in invisible state or implement mode where indexes are created visible mode and any invisible indexes prevoiusly created are also made visible if they improve the performance. To set the configuration to implement execute the following
EXEC DBMS_AUTO_INDEX.CONFIGURE('AUTO_INDEX_MODE','IMPLEMENT');

PL/SQL procedure successfully completed.

select PARAMETER_NAME,PARAMETER_VALUE from DBA_AUTO_INDEX_CONFIG WHERE PARAMETER_NAME='AUTO_INDEX_MODE';
PARAMETER_NAME       PARAMETER_
-------------------- ----------
AUTO_INDEX_MODE      IMPLEMENT
For read only mode do the following
EXEC DBMS_AUTO_INDEX.CONFIGURE('AUTO_INDEX_MODE','REPORT ONLY');

select PARAMETER_NAME,PARAMETER_VALUE from DBA_AUTO_INDEX_CONFIG WHERE PARAMETER_NAME='AUTO_INDEX_MODE';
PARAMETER_NAME       PARAMETER_VALUE
-------------------- --------------------
AUTO_INDEX_MODE      REPORT ONLY
To see auto indexing in use, created a test case with two tables with parent child relationship. The child table did not have any indexes created on it. Ran a select statement which used child table as the driver, multiple times with different values.
create table x (a number primary key, b number);
create table y (c number,d number, foreign key (c) references x(a));
insert into x select level,mod(level,100) from dual connect by level < 100000;
insert into x values (0,0);
insert into y select mod(level,100000),level from dual connect by level < 400000;
commit;

select x.a,y.d from x,y where x.a=y.c and c=500;
The past and current auto index executions could be viewd on DBA_AUTO_INDEX_EXECUTIONS. When an auto indexing job is running the status would be executing.
col EXECUTION_NAME format a30
col ERROR_MESSAGE format a10
select EXECUTION_NAME,to_char(EXECUTION_START,'YYYY-MM-DD HH24:MI') exec_st, to_char(EXECUTION_END,'YYYY-MM-DD HH24:MI') exec_end,ERROR_MESSAGE,STATUS from DBA_AUTO_INDEX_EXECUTIONS order by 2;
EXECUTION_NAME                                               EXEC_ST          EXEC_END         ERROR_MESSAGE        STATUS
------------------------------------------------------------ ---------------- ---------------- -------------------- -----------
SYS_AI_2021-10-26/11:35:25                                   2021-10-26 11:35 2021-10-26 11:35                      COMPLETED
...
EXECUTION_NAME                                               EXEC_ST          EXEC_END         ERROR_MESSAGE        STATUS
------------------------------------------------------------ ---------------- ---------------- -------------------- -----------
SYS_AI_2021-10-26/11:35:25                                   2021-10-26 11:35 2021-10-26 11:35                      COMPLETED
SYS_AI_2021-10-26/12:07:36                                   2021-10-26 12:07                                       EXECUTING
...
EXECUTION_NAME                                               EXEC_ST          EXEC_END         ERROR_MESSAGE        STATUS
------------------------------------------------------------ ---------------- ---------------- -------------------- -----------
SYS_AI_2021-10-26/11:35:25                                   2021-10-26 11:35 2021-10-26 11:35                      COMPLETED
SYS_AI_2021-10-26/12:07:36                                   2021-10-26 12:07 2021-10-26 12:13                      COMPLETED

The auto indexing job could also be viewed on the performance hub.

The result of the auto indexing job could be viewed using the last activity report, either in text
set long 1000000 pagesize 0
select dbms_auto_index.report_last_activity() from dual;
or in html
select dbms_auto_index.report_last_activity(type => 'HTML') from dual;
Below is the output from an HTML report. The summary section shows out of two index candidates one was created as a visible index (when auto indexing mode is set to implement).

Index detail section tells the name of the index and on which table column it was created on.

The verification section shows the justification for creating the index, i.e. performance improvment gained due to the index.

Finally the plan section shows the change of query plan due to the auto index.

Even though the report says only one index was created querying the user_indexes shows that two auto indexes were created. One that was mentioned in the report and another one in invisible mode.
SQL>  select table_name,INDEX_NAME,COMPRESSION,AUTO,CONSTRAINT_INDEX,SECONDARY,VISIBILITY from user_indexes;

TABLE_NAME           INDEX_NAME           COMPRESSION   AUT CON S VISIBILIT
-------------------- -------------------- ------------- --- --- - ---------
X                    SYS_C0027706         DISABLED      NO  YES N VISIBLE
Y                    SYS_AI_614y39b1xnucg ADVANCED LOW  YES NO  N VISIBLE
Y                    SYS_AI_6ztznk7h3fq0b ADVANCED LOW  YES NO  N INVISIBLE
On the otherhand if the auto indexing mode was report only then the index would be created as an invisible index. The report shows no overall performance improvment. It could be interpreted as no performance improvment until index is made visible.

At times in addition to an index the auto indexing job could create SQL baselines as well. These are also mentioned in the report. (below screenshot is from a different set of tables than mentioned above).




The indexes created by auto index job cannot be dropped with a drop statement. To drop these indexes dbms_auto_index PL/SQL package should be used.
select table_name,INDEX_NAME,COMPRESSION,AUTO,CONSTRAINT_INDEX,SECONDARY,VISIBILITY from user_indexes;

TABLE_NAME           INDEX_NAME           COMPRESSION   AUT CON S VISIBILIT
-------------------- -------------------- ------------- --- --- - ---------
X                    SYS_C0027706         DISABLED      NO  YES N VISIBLE
Y                    SYS_AI_614y39b1xnucg ADVANCED LOW  YES NO  N VISIBLE
Y                    SYS_AI_6ztznk7h3fq0b ADVANCED LOW  YES NO  N INVISIBLE

SQL> drop index SYS_AI_6ztznk7h3fq0b;

SQL>  drop index "SYS_AI_6ztznk7h3fq0b";
 drop index "SYS_AI_6ztznk7h3fq0b"
            *
ERROR at line 1:
ORA-65532: cannot alter or drop automatically created indexes

exec dbms_auto_index.drop_auto_indexes('ASANGA','"SYS_AI_6ztznk7h3fq0b"',TRUE);

select table_name,INDEX_NAME,COMPRESSION,AUTO,CONSTRAINT_INDEX,SECONDARY,VISIBILITY from user_indexes;

TABLE_NAME           INDEX_NAME           COMPRESSION   AUT CON S VISIBILIT
-------------------- -------------------- ------------- --- --- - ---------
X                    SYS_C0027706         DISABLED      NO  YES N VISIBLE
Y                    SYS_AI_614y39b1xnucg ADVANCED LOW  YES NO  N VISIBLE
The dbms_auto_index package also offeres a method to remove all indexes from a table that isn't used for constraints. This method cannot be used to remove auto indexes.
SQL>  exec dbms_auto_index.drop_secondary_indexes('ASANGA','Y');
BEGIN dbms_auto_index.drop_secondary_indexes('ASANGA','Y'); END;

*
ERROR at line 1:
ORA-65532: cannot alter or drop automatically created indexes
ORA-06512: at "SYS.DBMS_AUTO_INDEX", line 456
ORA-06512: at "SYS.DBMS_AUTO_INDEX", line 456
ORA-06512: at "SYS.DBMS_AUTO_INDEX", line 452
ORA-06512: at line 1
Also any invisible indexes created by the auto index job (say during report only mode) cannot be made visible. Only way to make them visible is to change the auto indexing mode to implement.
SQL> select PARAMETER_NAME,PARAMETER_VALUE from DBA_AUTO_INDEX_CONFIG WHERE PARAMETER_NAME='AUTO_INDEX_MODE';
PARAMETER_NAME       PARAMETER_VALUE
-------------------- --------------------
AUTO_INDEX_MODE      REPORT ONLY

select table_name,INDEX_NAME,COMPRESSION,AUTO,CONSTRAINT_INDEX,SECONDARY,VISIBILITY from user_indexes;

TABLE_NAME           INDEX_NAME           COMPRESSION   AUT CON S VISIBILIT
-------------------- -------------------- ------------- --- --- - ---------
X                    SYS_C0027706         DISABLED      NO  YES N VISIBLE
Y                    SYS_AI_614y39b1xnucg ADVANCED LOW  YES NO  N INVISIBLE
Y                    SYS_AI_6ztznk7h3fq0b ADVANCED LOW  YES NO  N INVISIBLE

SQL> alter index "SYS_AI_614y39b1xnucg" visible;
alter index "SYS_AI_614y39b1xnucg" visible
*
ERROR at line 1:
ORA-65532: cannot alter or drop automatically created indexes
Finally as mentioned earlier drop_secondary_indexes method allows dropping all indexes in a table that isn't used for enforcing constraints. This is useful if all indexes (not used for constriant enforcement) are to be dropped and let auto indexing take care of creating indexes. Below show case the use of this method. On the tables below X is the parent table and Y is the child table. The AIDX index is on the foreign key column and AIDX2 is an index on another column not used for enforcing any constraints.
col index_name format a30
col table_name format a30
set line 1000
select table_name,INDEX_NAME,COMPRESSION,AUTO,CONSTRAINT_INDEX,SECONDARY,VISIBILITY from user_indexes;

TABLE_NAME           INDEX_NAME           COMPRESSION   AUT CON S VISIBILIT
-------------------- -------------------- ------------- --- --- - ---------
X                    SYS_C0027706         DISABLED      NO  YES N VISIBLE
Y                    AIDX                 DISABLED      NO  NO  N VISIBLE
Y                    AIDX2                DISABLED      NO  NO  N VISIBLE
Executing drop secondary index meethod on table X will not drop the index created to enforce the primary key (SYS_C0027706).
exec dbms_auto_index.drop_secondary_indexes('ASANGA','X');

PL/SQL procedure successfully completed.

TABLE_NAME INDEX_NAME      COLUMN_NAM
---------- --------------- ----------
X          SYS_C0027706    A
Y          AIDX            C
Y          AIDX2           D
On the child table the index created on the foreign key column is not dropped. However, other index that is not enforcing any constraints is dropped.
exec dbms_auto_index.drop_secondary_indexes('ASANGA','Y');

PL/SQL procedure successfully completed.


TABLE_NAME INDEX_NAME      COLUMN_NAM
---------- --------------- ----------
X          SYS_C0027706    A
Y          AIDX            C