Friday, September 2, 2022

ORA-01586: database must be mounted EXCLUSIVE and not open for this operation

 You can choose among multiple options to drop Oracle databases. 

1. DBCA (Silent Method or GUI)

2. Command Line Interface (startup mount restrict and then issue drop database) using sqlplus or rman
3. Manually cleaning up files

SQL> drop database;
drop database
*
ERROR at line 1:
ORA-01586: database must be mounted EXCLUSIVE and not open for this operation

We are decommissioning the RAC database here. So we need to change the parameter cluster_database=FALSE.

Set your database profile.

srvctl stop database -d <DB_name>
SQL> startup mount;
SQL> alter system enable restricted session;
SQL> alter system set cluster_database=FALSE scope=spfile;
SQL>Drop Database;
Database dropped.

How to find temporary MySQL Root Password after installation

 Sometimes once MySQL installation is done. You will not be able to find the temporary password, here I was working on the latest MySQL version 8.0.30-commercial MySQL Enterprise Server.

[root@Sajidserver01 ~]# grep -i pass /var/log/mysqld.log

Remove the /var/lib/mysql and restart mysqld as below

[root@Sajidserver01 ~]#cd /var/lib
[root@Sajidserver01 ~]#rm -rf mysql 
[root@Sajidserver01 ~]#systemctl stop mysqld
[root@Sajidserver01 ~]#systemctl start mysqld

Once it is done, you will find the new temporary password generated in mysqld.log below.

[root@Sajidserver01 ~]# grep -i pass /var/log/mysqld.log 
2022-09-01T21:32:34.029030Z 6 [Note] [MY-0454] [Server] A temporary password is generated for root@localhost: S2<3!chrde

Once it is done you can reset your password as per your standards using /usr/bin/mysql_secure_installation.


Monday, August 1, 2022

ORA-16525: The Oracle Data Guard broker is not yet available in the dataguard environment

 Sometimes you might be facing an error ORA-16525: The Oracle Data Guard broker is not yet available in the dataguard environment. It might occur because of multiple reasons, but one of the main reasons, is if the particular server is having the issue on which real-time apply is being applied gets rebooted. Then the real-time apply might be running on a different node and goes in hung mode. You can follow the below steps to remediate it.

[oracle@sajidserver01 ~]$ dgmgrl

DGMGRL for Linux: Release 19.0.0.0.0 - Production on Thu Jul 21 12:07:36 2022
Version 19.15.0.0.0
Copyright (c) 1982, 2019, Oracle and/or its affiliates.  All rights reserved.
Welcome to DGMGRL, type "help" for information.
DGMGRL> connect sys/<password>;
Connected as SYSDG.
DGMGRL> show configuration;
ORA-16525: The Oracle Data Guard broker is not yet available.
Configuration details cannot be determined by DGMGRL

###
Fix:
###

Bounce the standby database and enable the configuration in dgmgrl.

[oracle@sajidserver01 ~]$ srvctl stop database -d sajid_texas
[oracle@sajidserver01 ~]$ srvctl start database -d sajid_texas

[oracle@sajidserver01 ~]$ dgmgrl

DGMGRL for Linux: Release 19.0.0.0.0 - Production on Thu Jul 21 12:07:36 2022
Version 19.15.0.0.0
Copyright (c) 1982, 2019, Oracle and/or its affiliates.  All rights reserved.
Welcome to DGMGRL, type "help" for information.
DGMGRL> connect sys/<password>;
Connected as SYSDG.

DGMGRL> enable configuration;
Enabled.

DGMGRL> show configuration;
Configuration - SAJID_CONF
  Protection Mode: MaxPerformance
  Members:
  sajid_pittsburgh     - Primary database
  sajid_texas - Physical standby database
Fast-Start Failover: DISABLED
Configuration Status:
SUCCESS   (status updated 27 seconds ago)

You will see the alert log will be updated with an attempt to start the background Managed Standby Recovery process. MRP0: Background Managed Standby Recovery process started and the Managed Standby Recovery started Real-Time Apply.


Tuesday, July 12, 2022

ORA-29548:Java system reported: release mismatch

 When you are running the Preupgrade task to upgrade the database from 12c to 19.14.0.0.0 version either using DBUA or the Auto upgrade feature. Sometimes you might face the below error depending on your system. If you happen to run into below error, you can follow the below steps. One of the reasons you may find a similar issue is if an OJVM patch is applied or rolled back.

Error:

Contact Oracle Support for instructions on how to resolve this error. 

Error: ORA-29548 ORA-29548:Java system reported: release mismatch, 

12.2.0.1.180717 1.8 in database (classes.bin) vs 12.2.0.1.0 1.8 in executable

SQL> select dbms_java.lonname('TEST') from dual;

select dbms_java.lonname('TEST') from dual

                        *

ORA-29548: Java system class reported: joxcsys: release mismatch, 

12.2.0.1.180717 1.8 in database (classes.bin) vs 12.2.0.1.0 1.8 in executable

SQL> conn /as sysdba

Connected.

SQL>  @?/javavm/install/update_javavm_db.sql

SQL> SET FEEDBACK 1

SQL> SET NUMWIDTH 10

SQL> SET LINESIZE 80

SQL> SET TRIMSPOOL ON

SQL> SET TAB OFF

SQL> SET PAGESIZE 100

SQL> alter session set "_ORACLE_SCRIPT"=true;

Session altered.


SQL> -- If Java is installed, do CJS.

SQL> -- If CJS can deal with the SROs inconsistent with the new JDK,

SQL> -- the drop_sros() call here can be removed.

SQL> call initjvmaux.drop_sros();

Call completed.

SQL> create or replace java system;

Java created.

SQL> update dependency$

  set p_timestamp=(select stime from obj$ where obj#=p_obj#)

  where (select stime from obj$ where obj#=p_obj#)!=p_timestamp and

  (select type# from obj$ where obj#=p_obj#)=29  and

  (select owner# from obj$ where obj#=p_obj#)=0;

161 rows updated.

SQL> commit;

SQL> alter session set "_ORACLE_SCRIPT"=false;

Session altered.

SQL> select dbms_java.longname('TEST') from dual;

DBMS_JAVA.LONGNAME('TEST')

-------------------------------------------------------------

TEST

1 row selected.


Once the above steps are followed and recompile the invalid objects. Now if you run Preupgrade script, the above error will not pop up. 

Happy Oracle Database Upgrades!!!


Tuesday, November 16, 2021

Remove Oracle Multimedia in 19c

 Few of the Oracle documentation says Oracle Multimedia is deprecated in 19c. You might see the component name Oracle Multimedia (ORDIM) in the dba_registry once you login into the database, it might not function anymore. But still, to clean it up from the database end, you can implement the below steps.

[oracle@sajidserver01 ~]$ sqlplus "/ as sysdba"

SQL> alter session set "_oracle_script"=TRUE;

Session altered.

SQL> drop user MDSYS cascade;

User dropped.

SQL> @?/rdbms/admin/catcmprm.sql ORDIM

Session altered.

About to remove Oracle Multimedia.

Checking to see if anyone is using Oracle Multimedia.

Session altered.

Oracle Multimedia is not being used

PL/SQL procedure successfully completed.

Session altered.

Are you sure you want to remove Oracle Multimedia (Y/N): Y

PL/SQL procedure successfully completed.

Session altered.

Removing Oracle Multimedia

PL/SQL procedure successfully completed.

PL/SQL procedure successfully completed.

PL/SQL procedure successfully completed.

Commit complete.

PL/SQL procedure successfully completed.

PL/SQL procedure successfully completed.

Session altered.

Session altered.

SQL> alter session set "_oracle_script"=FALSE;

Session altered.

Now check your dba_registry it will be clean.

SQL> SELECT comp_id,comp_name,version FROM dba_registry where comp_id='ORDIM';

no rows selected

Make sure the above steps are implemented in all the pluggable databases as well. If not the databases will end up in restricted mode and users will not be able to connect.

######
Note:
######

If you face the below error while dropping the component name.

ERROR at line 1:
ORA-28014: cannot drop administrative users

To bypass it try using alter session set "_oracle_script"=TRUE; then you will be good to drop the component.

Friday, September 24, 2021

[INS-41210] one of the available network subnets is marked for use by ASM.

 When you opt for Advanced Installation for 12.1.0.2 Grid installation on RHEL 8 operating system and when you do designate the private interfaces subnets either as "ASM" or as "ASM & Private". You will get [INS-41210] one of the available network subnets is marked for use by ASM.



Solution:

Just use "Private" rather than "ASM & Private" for both the private interface subnets and leave the last one as Public for the Public interface subnet.

Friday, August 6, 2021

runcluvfy.sh command gets hung on 19c before Grid Installation

 When you are running pre-check for cluster installation using runcluvfy command in 19c to install on RHEL 8 operating system, it gets hung and does not generate any report.

[grid@sajidserver01 19000]$ ./runcluvfy.sh stage -pre crsinst -n sajidserver01,sajidserver02 -verbose==>hangs

To get the detailed output, you can follow the below workaround. By setting an environment variable.

[grid@sajidserver01 19000]$ export CV_ASSUME_DISTID=OL7
[grid@sajidserver01 19000]$ ./runcluvfy.sh stage -pre crsinst -n sajidserver01,sajidserver02 -verbose

     | |  | |  | |
     | |  | |  | |
     | |  | |  | |   Output is Truncated
   \                /
     \            /
       \        /
         \    /
           \/

CVU operation performed:  stage -pre crsinst
Date:  Aug 6, 2021 11:55:22 PM
CVU home:/usr/app/grid/product/19000/
User: grid

Hope this helps with Grid 19c RAC builds.


Friday, June 18, 2021

How to detach and attach Oracle Home to an inventory

Sometimes when you are working on database patching, you will notice opatch lsinventory will be completely corrupted. In the next few minutes, I will walk you through a step-by-step process of getting it fixed.

#####
Error:
#####
List of Homes on this system:
  Home name= OraGI12c_Home1, Location= "/usr/12.2/grid"
  Home name= agent13c2, Location= "/usr/agent13c/agent_13.2.0.0.0"
  Home name= OraDB12_Home1, Location= "/usr/product/12.2.0.2"
OPatchSession cannot load inventory for the given Oracle Home /usr/agent13c/agent_13.2.0.0.0. Possible causes are:
   No read or write permission to ORACLE_HOME/.patch_storage
   Central Inventory is locked by another OUI instance
   No read permission to Central Inventory
   The lock file exists in ORACLE_HOME/.patch_storage
   The Oracle Home does not exist in Central Inventory
   OUI-67073:UtilSession failed: RawInventory gets null OracleHomeInfo
UtilSession failed: RawInventory gets null OracleHomeInfo
Log file location: /usr/agent13c/agent_13.2.0.0.0/cfgtoollogs/opatch/opatch2021-01-02_01-30-00PM_1.log

####
Fix:
####

Detach and attach the home to fix it like below. Then check opatch lsinventory to make sure it is properly fixed. This system is a two-node Oracle RAC. One beauty is, this does not require any database downtime and can be fixed on the fly.

cd /usr/agent13c/agent_13.4.0.0.0/oui/bin
[oracle@sajidserver01 bin]$ ./detachHome.sh ORACLE_HOME=/usr/agent13c/agent_13.2.0.0.0 ORACLE_HOME_NAME=agent13c2 CLUSTER_NODES=sajidserver01, sajidserver02 INVENTORY_LOCATION=/usr/oraInventory LOCAL_NODE=sajidserver01
Launcher log file is /tmp/OraInstall2021/launcher2021-01-02_01-58-40PM.log.
Ignoring command-line variable "INVENTORY_LOCATION=/usr/oraInventory".
Checking swap space: must be greater than 500 MB.   Actual 34811 MB    Passed
Checking if this platform requires a 64-bit JVM.   Actual 64    Passed (64-bit not required)
detachHome was successful.
Logs successfully copied to /usr/oraInventory/logs.
cd /usr/agent13c/agent_13.2.0.0.0/oui/bin

Now attach the home.

[oracle@sajidserver01 bin]$ ./attachHome.sh ORACLE_HOME=/usr/agent13c/agent_13.2.0.0.0 ORACLE_HOME_NAME=agent13c2 CLUSTER_NODES=sajidserver01, sajidserver02 INVENTORY_LOCATION=/usr/oraInventory LOCAL_NODE=sajidserver01
Launcher log file is /tmp/OraInstall2021-02-17_02-59-22PM/launcher2021-02-17_02-59-22PM.log.
Checking swap space: must be greater than 500 MB.   Actual 34811 MB    Passed
Checking if this platform requires a 64-bit JVM.   Actual 64    Passed (64-bit not required)
attachHome was successful.
Logs successfully copied to /usr/oraInventory/logs.

Check the inventory, it will be fixed.

[oracle@sajidserver01 bin]$ opatch lsinventory
Oracle Interim Patch Installer version 13.9.4.2.2
Copyright (c) 2021, Oracle Corporation.  All rights reserved.
Oracle Home       : /usr/agent13c/agent_13.2.0.0.0
Central Inventory : /usr/oraInventory
   from                  : /usr/agent13c/agent_13.2.0.0.0/oraInst.loc
OPatch version    : 13.9.4.2.2
OUI version       : 13.9.4.0.0
Log file location : /usr/agent13c/agent_13.2.0.0.0/cfgtoollogs/opatch/opatch2021-01-02_07-00-50PM_1.log
   | |  | |  | |
     | |  | |  | |
     | |  | |  | |   Output is Truncated
  \                /
    \            /
      \        /
        \    /
          \/
OPatch succeeded.

Now your inventory is back in business.

Tuesday, May 11, 2021

Oracle RAC instance start and stop

Oracle RAC instance start and stop

[oracle@sajidserver1~]$srvctl status database -d sajiddb
Instance sajiddb2 is running on node sajidserver2
Instance sajiddb1 is running on node sajidserver1

[oracle@sajidserver1]srvctl stop instance –d sajiddb –i sajiddb1 -f
PRKO-3122 : -instance option or -node option is required for stopping an instance of database null

There is nothing wrong with the above command, but it suddenly stopped working. Anyhow, if you notice the error (PRKO-3122 : -instance option or -node option is required for stopping an instance of database null). To make it work, use the below command.

[oracle@sajidserver1]srvctl stop instance –db sajiddb –instance sajiddb1 -f
[oracle@sajidserver1]

The above command works for various oracle database versions 19c/18c/12c. Similarly to start the instance you can use the below command.

[oracle@sajidserver1]srvctl start instance –db sajiddb –instance sajiddb1
[oracle@sajidserver1]

Monday, February 15, 2021

Installing Oracle Enterprise Manager Cloud Control 13c Release 4 (13.4.0.0) on Oracle Linux 7

 

        In this post, I will be discussing installing Oracle Enterprise Manager Cloud Control 13c Release 4 (13.4.0.0) on Oracle Enterprise Linux 7. OEM makes the life of DBA or DMA much easier. You need to have the appropriate Linux OS packages, kernel parameters, and database parameters to be in place.  First, you need to install the repository database, for step by step instructions to install 12.2 database you can follow (Link)


[oracle@sajidserver ~]$ cd /usr/app/stage/

[oracle@sajidserver stage]$ ls -ltr

-rwxrwxr-x 1 oracle oinstall 1623577684 Jul 20 14:38 em13400_linux64.bin

-rwxrwxr-x 1 oracle oinstall 2109004737 Jul 20 14:48 em13400_linux64-2.zip

-rwxrwxr-x 1 oracle oinstall 2047749474 Jul 20 14:55 em13400_linux64-3.zip

-rwxrwxr-x 1 oracle oinstall 2117312528 Jul 20 15:05 em13400_linux64-4.zip

-rwxrwxr-x 1 oracle oinstall  808014516 Jul 20 15:09 em13400_linux64-5.zip

-rwxrwxr-x 1 oracle oinstall 2143125187 Jul 20 15:27 em13400_linux64-6.zip

-rwxrwxr-x 1 oracle oinstall 1879163226 Jul 20 15:34 em13400_linux64-7.zip

[oracle@sajidserver stage]$ ./em13400_linux64.bin

Launcher log file is /tmp/OraInstall2020_15AM/launcher2020_AM.log.

Extracting the installer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Done

Checking monitor: must be configured to display at least 256 colors.  Actual unknown.  

Checking swap space: must be greater than 512 MB.   Actual 2047 MB    Passed

Checking if this platform requires a 64-bit JVM.   Actual 64    Passed (64-bit not required)

You must fulfill these requirements before continuing.

Continue? (yes [y] / no [n]) [n]

y

You have confirmed that the product can be installed on this platform.

Continuing with the installation.













At this point, you are done with the installation of  Oracle Enterprise Manager Cloud Control 13c Release 4 (13.4.0.0) on Oracle Linux 7. Please email me if anyone needs any advice during the installation, will be happy to help. Happy Monitoring!.



Saturday, December 26, 2020

ORA-00922: missing or invalid option

 Generally, when you are trying to create a user or trying to change the password with special characters or numbers, you will get the below error.

SQL>alter user test identified by 3esafe;

alter user test identified by 3esafe *

ERROR at line 1:

ORA-00922: missing or invalid option

SQL>create user test identified by am@zing;

create user test identified by am@zing *

ERROR at line 1:

ORA-00922: missing or invalid option


To fix it you need to use double quotes for setting the passwords, as below.


SQL>create user test identified by "am@zing";

User created.

SQL>alter user test identified by "3esafe";

User created.


Wednesday, September 30, 2020

Remove oracle PDB$SEED from migrate mode.

                 I was working on applying quarterly patches on the oracle database 12c and once the patch was applied happened to notice PDB$SEED was in migrate mode. I will share a few steps about how to remove PDB$SEED from migrate mode and bring it to normal read-only mode, you can use the same steps for both standalone and RAC.

SYS@sajiddb1>show pdbs;

CON_ID CON_NAME    OPEN MODE    RESTRICTED

----- ----------- ------------ ------------

 2     PDB$SEED     MIGRATE         NO

 3     SAJIDDB_PDB  READ WRITE      NO


You will see the error message already registered in the DB alert log as below:

Database Characterset for PDB$SEED is AL32UTF8

*******************************************************

WARNING: Pluggable Database PDB$SEED with pdb id - 2 is

         altered with errors or warnings. Please look into

         PDB_PLUG_IN_VIOLATIONS view for more details.

********************************************************

Opening pdb PDB$SEED (2) with no Resource Manager plan active

Pluggable database PDB$SEED opened migrate


SYS@sajiddb1>alter session set "_oracle_script"=TRUE;

session altered

SYS@sajiddb1>alter pluggable database pdb$seed close immediate instances=all;

Pluggable database altered.

SYS@sajiddb1>alter pluggable database pdb$seed OPEN READ ONLY force;

Pluggable database altered.

SYS@sajiddb1>alter session set container=PDB$SEED;

session altered

SYS@sajiddb1>show pdbs;

CON_ID  CON_NAME     OPEN MODE   RESTRICTED

------ ------------ ----------- ------------

 2       PDB$SEED     READ ONLY    NO

SYS@sajiddb1>alter session set "_oracle_script"=FALSE;

session altered


Thursday, June 18, 2020

Oracle Cloud Infrastructure 2019 Architect Professional

Completed few more #Oracle certifications by the blessings of Almighty God!

    1. Oracle Cloud Infrastructure 2019 Architect Professional
    2. Oracle Autonomous Database Cloud 2019 Specialist
    3. Oracle Cloud Infrastructure Foundations 2020 Associate


A Big Thank you #Oracle for providing great learning and opportunity to upskill #oci #oraclecloud #certification #oraclecloudinfrastructure.

Thursday, April 30, 2020

Oracle Cloud Infrastructure 2019 Certified Architect Associate

        Passed the Oracle Cloud Infrastructure 2019 Certified Architect Associate in this Holy month by God's grace. Thanks to #Oracle, I will even try to complete a few more Oracle certifications next month.

       Shared my knowledge and experience about how I prepared for the exam with a couple of my friends, which was helpful for them to attend and pass the exam too.


I wish Good luck to guys who are preparing for Oracle Certifications!

Tuesday, March 31, 2020

AHF-00014: AHF Location is not owned by root in directory hierarchy


Download Autonomous Health Framework (AHF) - Including TFA and ORAchk/EXAChk (Doc ID 2550798.1). To check the previous TFA version 18.3 install you can follow here.

Got the below error when trying to install Autonomous Health Framework (AHF) version 19.3.2.0.0.

[ERROR] : AHF-00014: AHF Location /usr/tfa is not owned by root in directory hierarchy

Create a directory under /usr as <tfa> owned as root user and follow the below steps for a clean and successful install of AHF.

[root@sajidserver tfa]# ./ahf_setup -local

AHF Installer for Platform Linux Architecture x86_64

AHF Installation Log : /tmp/ahf_install_753_2020_03_01-16_12_12.log

Starting Autonomous Health Framework (AHF) Installation

AHF Version: 193200 Build Date: 201911251652

TFA is already installed at : /usr/tfa/tfa_home

Installed TFA Version : 192200 Build ID : 2019092614532

Default AHF Location : /usr/tfa

Do you want to change AHF Location (/usr/tfa) ? Y|[N] : Y

Please Enter new AHF Location : /usr/tfa

AHF Location : /usr/tfa/oracle.ahf

AHF Data Directory stores diagnostic collections and metadata.
AHF Data Directory requires at least 5GB (Recommended 10GB) of free space.

Choose Data Directory from below options :

1. /usr/tfa/oracle.ahf [Free Space : 73569 MB]
2. /usr [Free Space : 73569 MB]
3. Enter a different Location

Choose Option [1 - 3] : 1

AHF Data Directory : /usr/tfa/oracle.ahf/data

orachk scheduler is already running at : usr/tfa/tfa_home/ext/orachk

Installed orachk version : ORACHK  VERSION: 19.2.0_20190717

Stopping orachk scheduler

Copying orachk configuration from /usr/tfa/tfa_home/ext/orachk

Shutting down TFA : /usr/tfa/tfa_home

Copying TFA Data Files from /usr/tfa/tfa_home

Uninstalling TFA : /usr/tfa/tfa_home

Do you want to add AHF Notification Email IDs ? [Y]|N : N

Extracting AHF to /usr/tfa/oracle.ahf

Configuring TFA Services

Copying TFA Data Files to AHF

Configuring TFA Services

Copying TFA Data Files to AHF

Discovering Nodes and Oracle Resources

Starting TFA Services


Running TFA Inventory...

Adding default users to TFA Access list...



Retrieving legacy orachk wallet details ...
Storing orachk wallet details into AHF config/wallet ...

Starting orachk daemon from AHF ...

AHF binaries are available in /usr/tfa/oracle.ahf/bin

AHF is successfully installed

Moving /tmp/ahf_install_35943_2020_03_01-16_12_12.log to /usr/tfa/oracle.ahf/data/diag/ahf/

Done with the installation. Happy Log Collection.