Archives November 2021

ModuleNotFoundError: No module named

Cause:

Wrong module name is entered

---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
<ipython-input-1-4e2ec5777b17> in <module>()
      6 import seaborn as sn
      7 import plotly as ply
----> 8 from sklearn.model_selectionlection import train_test_split
      9 from sklearn.metrics import r2_score
     10 from sklearn.ensemble import RandomForestRegressor

ModuleNotFoundError: No module named 'sklearn.model_selectionlection'

Solution:

Enter the right module name

from sklearn.model_selection import train_test_split
SQL QUERY TO FIND HIDDEN PARAMETERS AND THEIR VALUES ORACLE

Use this query to find hidden parameters and their values set in oracle database

set lines 200 pages 1000
col "Hidden_parameter" for a40
col "It's Value" for a20
select x.ksppinm as Hidden_parameter,
            y.ksppstvl "It's Value"
     from
  x$ksppi x
  inner join x$ksppcv y on (x.indx = y.indx)
and
  x.ksppinm like '%_optimizer_%batch%'
order by x.ksppinm;

Hidden value with its description

set lines 200 pages 1000
col "Hidden_parameter" for a40
col "It's Value" for a20
col Desc for a40
select x.ksppinm as Hidden_parameter,
         y.ksppstvl "It's Value",
		   x.ksppdesc "Desc"	 
     from
  x$ksppi x
  inner join x$ksppcv y on (x.indx = y.indx)
and
  x.ksppinm like '%pipe%'
order by x.ksppinm;
SEVERE:emctl secure agent command has failed with status=1

Cause:

Wrong registration password has been specified in the parameter AGENT_REGISTRATION_PASSWORD while deploying the agent in target database

Error message while configuration of agent

SEVERE:emctl secure agent command has failed with status=1
SEVERE:emctl secure agent command has failed with status=1
SEVERE:emctl secure agent command has failed with status=1
Agent configuration has failed
/u01/app/oracle/agent/agent_13.4.0.0.0/cfgtoollogs/agentDeploy/agentDeploy_2021-11-25_22-17-28-PM.log
Waiting for agent targets to get promoted...
Waiting for agent targets to get promoted...
Waiting for agent targets to get promoted...
Waiting for agent targets to get promoted...
Waiting for agent targets to get promoted...

Log file shows message similar to below errors

SEVERE: emctl secure agent command has failed with status=1 on attempt 1
INFO: CONFIG_ERROR7
INFO:
Cloning the agent home...
INFO: Oracle Enterprise Manager Cloud Control 13c Release 4
INFO: Copyright (c) 1996, 2020 Oracle Corporation.  All rights reserved.
INFO: Agent is already stopped...   Done.
INFO: Securing agent...   Started.
INFO: ^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^HInvalid Agent Registration Password specified
INFO: Securing agent...   Failed.
INFO: Plugin homes:
INFO: Plugin homes:
SEVERE: STDERR:

STDOUT=

Oracle Enterprise Manager Cloud Control 13c Release 4
Copyright (c) 1996, 2020 Oracle Corporation.  All rights reserved.
Agent is already stopped...   Done.
Securing agent...   Started.
^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^HInvalid Agent Registration Password specified
Securing agent...   Failed.
INFO: The command: /u01/app/oracle/agent/agent_inst/bin/emctl secure agent  completed with status=1
SEVERE: emctl secure agent command has failed with status=1 on attempt 2
INFO: CONFIG_ERROR7
INFO: Agent configuration has failed

Diagnosis:

If the command the executed manually, then still it fails.

[oracle@hydrupgrd agent]$ /u01/app/oracle/agent/agent_inst/bin/emctl secure agent
Oracle Enterprise Manager Cloud Control 13c Release 5
Copyright (c) 1996, 2021 Oracle Corporation.  All rights reserved.
Agent is already stopped...   Done.
Securing agent...   Started.
Enter Agent Registration Password :
Securing agent...   Failed.

Solution:

Specify the right password for AGENT_REGISTRATION_PASSWORD

For more details see this link on how to configure registration passwords in OEM https://alphaoragroup.com/2021/11/25/configure-registration-passwords-in-oem-13c/?preview_id=10774&preview_nonce=005946b6b1&preview=true

HOW TO CONFIGURE REGISTRATION PASSWORDS IN OEM 13C

Toggle to setup -> security -> registration passwords

Click on create

Fill in the following details and click create

If you choose

persistent -> applies to multiple agents

one-time -> applies to one agent and deleted after an agent use the password for registration

Also set the expiry date for security reasons

Registration Password is created

DEFAULT LOGIN USERNAME PASSWORD FOR ORACLE ENTERPRISE MANAGER

Default username password for OEM is ,

username – sysman

password – whatever you set while installation (or)

Modify the password from the OEM repository and also specify both characters and numbers in the password string and if not it may stop you from logging in throwing ,

“[#EM_SYSTEM_POOL#:BadSQLEvaluation] ERROR dbjava.sqleval doWork.148 – Exception from BadSQLEvaluation: java.sql.SQLException: ORA-01017: invalid username/password; logon denied”

SQL> alter user sysman identified by "password123" account unlock;

User altered.
OEM 13CC WEBPAGE SAYS “This site can’t be reached took too long to respond”

Cause:

When trying to access the OEM GUI webpage, i face the error and not able to access the page

Workaround:

Check the firewall status from the host using systemctl

[root@oem oracle]# systemctl status firewalld
● firewalld.service - firewalld - dynamic firewall daemon
   Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled; vendor preset: enabled)
   Active: active (running) since Thu 2021-11-25 11:42:59 IST; 6h ago
     Docs: man:firewalld(1)
 Main PID: 798 (firewalld)
    Tasks: 2
   CGroup: /system.slice/firewalld.service
           └─798 /usr/bin/python2 -Es /usr/sbin/firewalld --nofork --nopid

Nov 25 11:42:53 oem systemd[1]: Starting firewalld - dynamic firewall daemon...
Nov 25 11:42:59 oem systemd[1]: Started firewalld - dynamic firewall daemon.

If running, then stop the firewall daemon

[root@oem oracle]# systemctl stop firewalld

Check the status of firewall

[root@oem oracle]# systemctl status firewalld
● firewalld.service - firewalld - dynamic firewall daemon
   Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled; vendor preset: enabled)
   Active: inactive (dead) since Thu 2021-11-25 17:50:05 IST; 1h 10min ago
     Docs: man:firewalld(1)
  Process: 798 ExecStart=/usr/sbin/firewalld --nofork --nopid $FIREWALLD_ARGS (code=exited, status=0/SUCCESS)
 Main PID: 798 (code=exited, status=0/SUCCESS)

Nov 25 11:42:53 oem systemd[1]: Starting firewalld - dynamic firewall daemon...
Nov 25 11:42:59 oem systemd[1]: Started firewalld - dynamic firewall daemon.
Nov 25 17:50:04 oem systemd[1]: Stopping firewalld - dynamic firewall daemon...
Nov 25 17:50:05 oem systemd[1]: Stopped firewalld - dynamic firewall daemon.

If SELINUX is enforced, then stop it

[root@oem oracle]# setenforce 0
[root@oem oracle]# getenforce
Permissive
[root@oem oracle]# getenforce
Permissive

Use WGET to send a HTTP request to check the status. If you receive response, then you will get a message like “HTTP request sent, awaiting response… 200 OK”

[root@oem oracle]# wget --no-check-certificate https://oem:7803/em
--2021-11-25 17:43:58--  https://oem:7803/em
Resolving oem (oem)... 192.168.56.222
Connecting to oem (oem)|192.168.56.222|:7803... connected.
WARNING: cannot verify oem's certificate, issued by ‘/O=EnterpriseManager on oem/OU=EnterpriseManager on oem/L=EnterpriseManager on oem/ST=CA/C=US/CN=oem’:
  Self-signed certificate encountered.
HTTP request sent, awaiting response... 302 Moved Temporarily
Location: https://oem:7803/em/login.jsp [following]
--2021-11-25 17:43:58--  https://oem:7803/em/login.jsp
Reusing existing connection to oem:7803.
HTTP request sent, awaiting response... 302 Moved Temporarily
Location: https://oem:7803/em/faces/logon/core-uifwk-console-login [following]
--2021-11-25 17:43:58--  https://oem:7803/em/faces/logon/core-uifwk-console-login
Reusing existing connection to oem:7803.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: ‘em’

    [ <=>                                                                         ] 25,573      --.-K/s   in 0s

2021-11-25 17:43:59 (115 MB/s) - ‘em’ saved [25573]

Check is firewall port is opened using telnet

[root@oem oracle]# telnet 192.168.56.222 7803
Trying 192.168.56.183...
Connected to 192.168.56.183.
Escape character is '^]'.
ORA-65118: operation affecting a pluggable database cannot be performed fromanother pluggable database

Cause:

You try to open or close a pdb by logging the session to another pdb and not from CDB$ROOT

SQL> alter pluggable database pdb2 open;
alter pluggable database pdb2 open
*
ERROR at line 1:
ORA-65118: operation affecting a pluggable database cannot be performed from
another pluggable database

Solution:

Check current logged in pluggable database

SQL> show con_name

CON_NAME
------------------------------
PDB1

Log on to CDB$ROOT container to control all pdbs

SQL> alter session set container=CDB$ROOT;

Session altered.
SQL> show con_name

CON_NAME
------------------------------
CDB$ROOT

Now try to open the pdb

SQL> alter pluggable database pdb2 open;

Pluggable database altered.
The referenced database doesn’t contain a valid Management Repository.

Cause:

Due to improper cleanup of the em files and direct removal of agent and middleware files without deinstallation cause this error after a fresh installation

Workaround:

Perform proper cleanup of the SYSMAN user related data related to EM from the repository database.

Welcome to emergency mode ! Linux

Emergency mode in linux appear due to corruption in filesystem or incorrect entry in the fstab file

Dont panic, just give the password for root and you will be able to enter the command line

Check if recently any changed happen in the filesystem part

This error can be fixed using fsck.ext4 /directory where ext4 stands for filesystem type

Check /etc/fstab entries if all entries are correct

[root@orcl19x data01]# cat /etc/fstab

#
# /etc/fstab
# Created by anaconda on Sat Dec 12 21:53:57 2020
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
UUID=8d318942-c98a-4cb8-821a-393279fb5d5b /                       xfs     defaults        0 0
UUID=392d89ab-da02-4ce2-b070-6c932bca2da4 /apps01                 xfs     defaults        0 0
UUID=85c6edd9-08f6-4253-a727-e3314e8ee13d /data01                 xfs     defaults        0 0
UUID=8a0e41d4-bb17-4526-b6d3-e6d3dc34fa13 swap                    swap    defaults        0 0
UUID=e158bdb3-4bd5-44ca-aec5-0652ff147953 /u01                    ext4     defaults        0 0
PARSE CPU TO PARSE ELAPSED % HAVE YOU EVER HESITATED AND SKIPPED THIS METRIC IN AWR REPORT ? ORACLE

In AWR report, there is a field in Instance efficiency % called Parse CPU to Parse Elapsd% which in most of the cases lead us to scepticism and skip this metric

To directly come to the point, this metric is related to calculation of efficiency of parsing of the SQL statements with CPU

The amount of CPU time by SQL that is spent on parsing or waiting on an event to parse (ie)

For every second of CPU , the amount of clock time spent in parsing or waiting by database

Higher the ratio better the instance efficiency which means CPU time = Parse time ==>(Efficiency = 100%) and CPU is effectively used for parsing itself which is its purpose

Lower the ratio, which means there is a parsing issue (application not reuse the SQL) in the database or SQL is waiting on some events latch or mutex to parse which is not good.

Example: As the ratio in itself says, ( parse time cpu / parse time elapsed ) * 100

=>

( 12527/401081 ) * 100 = ~3.12