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.

Saturday, February 29, 2020

How to collect Hanganalyze and Systemstate dump

Oracle easily handles DML locks. There will be a certain situation when the database will be in the hung mode and at that particular time to detect the proper blocking and waiting for sessions. Oracle has provided with Hanganalyze utility which will help in collecting Lite Onboard Monitor (LTOM) across the server, which will provide detailed information about network, disks, RAM and CPU.

Oracle support usually asks to collect Hanganalyze and Systemstat dump from the system. Both Hanganalyze and Systemstate dump can be collected using SQL* plus utility. Rather than giving more theoretical knowledge, I will keep it more practical. It will help you to understand how to collect it both across RAC and standalone databases.

Check the screenshot below for the level and description of Hanganalyze.



To generate it across RAC, detailed step by step.

SQL> oradebug setmypid;
Statement processed.
SQL> oradebug unlimit;
Statement processed.
SQL> oradebug setinst all;
Statement processed.
SQL> oradebug -g all dump systemstate 258;
Statement processed.
SQL>oradebug all hanganalyze 4;
Hang Analysis in /usr/rdbms/test/test1/trace/test1_ora_43219.trc
SQL>oradebug tracefile_name;
/usr/rdbms/test/test1/trace/test1_ora_43219.trc
SQL>exit


To generate it on standalone database, detailed step by step.

SQL>oradebug setmypid;
Statement processed.
SQL>oradebug unlimit;
Statement processed.
SQL>oradebug hanganalyze 4;
Hang Analysis in /usr/rdbms/test/test1/trace/test1_ora_56429.trc
SQL>exit

SQL>oradebug setmypid;
Statement processed.
SQL>oradebug dump systemstate 258;
Statement processed.
SQL>oradebug tracefile_name;
/usr/rdbms/test/test1/trace/test1_ora_56623.trc
SQL>exit

Remmember it will generate huge trace files. Certain scenarious you will not be able to invoke SQL* plus, at that time you need to connect with sqlplus -prelim. Happy Troubleshooting!.