Tuesday, April 23, 2019

How to change the hostname on HP-UX

Method 1: (With Reboot)

login as root and run set_parms <hostname>

The set_parms program supposed to update ALL necessary files in server.

Take reboot for new hostname.

Method 2 : (Without Reboot)

#hostname "newname"
#uname -S "newname"
#hostanme

Above commands will change hostname Without rebooting server, but once the machine is reboot old hostname will be there.

Method 3: (Without Reboot)

#hostname "newname"
#uname -S "newname"
#update /etc/hosts and /etc/rc.config.d/netconf

Above commands will change hostname Without rebooting server, also once the machine is reboot new hostname will be there.

How to recreate Em DB console in Oracle 10gR2

Source environment and run below emca command

bash-5.0$ emca -config dbcontrol db -repos recreate

STARTED EMCA at Apr 22, 2019 11:13:17 AM
EM Configuration Assistant, Version 10.2.0.5.0 Production
Copyright (c) 2003, 2009, Oracle.  All rights reserved.

Enter the following information:
Database SID: <sid> Ex: orcl
Listener port number: <Port> Ex: 1521
Password for SYS user:
Password for DBSNMP user:
Password for SYSMAN user:
Email address for notifications (optional):
Outgoing Mail (SMTP) server for notifications (optional):
-----------------------------------------------------------------

You have specified the following settings

Database ORACLE_HOME ................ /u01/app/oracle/OraHome_1

Local hostname ................ <hostname>
Listener port number ................ 1521
Database SID ................ <sid>
Email address for notifications ...............
Outgoing Mail (SMTP) server for notifications ...............

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

----------------------------------------------------------------------
WARNING : While repository is dropped the database will be put in quiesce mode.
----------------------------------------------------------------------
Do you wish to continue? [yes(Y)/no(N)]: Y
Apr 22, 2019 11:13:37 AM oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at /u01/app/oracle/OraHome_1/cfgtoollogs/emca/<sid>/emca_2019-04-22_11-13-17-AM.log.
Apr 22, 2019 11:13:38 AM oracle.sysman.emcp.EMReposConfig invoke
INFO: Dropping the EM repository (this may take a while) ...
Apr 22, 2019 11:13:38 AM oracle.sysman.emcp.EMReposConfig dropRepository
INFO: Dropping the EM repository (this may take a while) ...
Apr 22, 2019 11:14:05 AM oracle.sysman.emcp.EMReposConfig invoke
INFO: Repository successfully dropped
Apr 22, 2019 11:14:05 AM oracle.sysman.emcp.EMReposConfig createRepository
INFO: Creating the EM repository (this may take a while) ...
Apr 22, 2019 11:15:29 AM oracle.sysman.emcp.EMReposConfig invoke
INFO: Repository successfully created
Apr 22, 2019 11:15:32 AM oracle.sysman.emcp.util.DBControlUtil secureDBConsole
INFO: Securing Database Control (this may take a while) ...
Apr 22, 2019 11:16:12 AM oracle.sysman.emcp.util.DBControlUtil secureDBConsole
INFO: Database Control secured successfully.
Apr 22, 2019 11:16:12 AM oracle.sysman.emcp.util.DBControlUtil startOMS
INFO: Starting Database Control (this may take a while) ...
Apr 22, 2019 11:17:51 AM oracle.sysman.emcp.EMDBPostConfig performConfiguration
INFO: Database Control started successfully
Apr 22, 2019 11:17:51 AM oracle.sysman.emcp.EMDBPostConfig performConfiguration
INFO: >>>>>>>>>>> The Database Control URL is https://<hostname>:5502/em <<<<<<<<<<<
Enterprise Manager configuration completed successfully
FINISHED EMCA at Apr 22, 2019 11:17:51 AM

Tuesday, April 16, 2019

EM 12c/EM 13c monitoring credentials for the database in Enterprise Manager password has expired/account locked

Issue:

ORA-28001: the password has expired The Connect Descriptor was (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = <hostname>)(PORT = 1521))(CONNECT_DATA = (SID = <sid>)))

The error message shown above indicates that the agent is unable to monitor this database because the agent cannot logon. 
To correct this, the Monitor Password needs to match the corresponding database password for dbsnmp. 
To change both the dbsnmp database password and the Monitor Password, click the Change dbsnmp Password button. 
This operation will also unlock the dbsnmp user.












Cause:

The dbsnmp password has expired" or "ORA-28000: the account is locked"

Solution:

Method 1 -

SQL> select username, account_status from dba_users where username=’DBSNMP’;

USERNAME   ACCOUNT_STATUS
__________________________

DBSNMP       EXPIRED

SQL> alter user dbsnmp identified by <password> account unlock;

User altered.

update dbsnmp password in OEM grid control.

Method 2 -

1. Login grid control with sysman
2. Click Setup -> Manage Cloud Control -> Agents
3. Click Server name
4. Goto Monitoring -> Click Database Instance name
5. Click configure and Provide sys password
6. Change password














7. Click test connection
8. Message displays “The connection test was successful”
9. Click next
10.Submit

Enterprise Manager Database Control Configuration/Certificate issue after upgrading 10.2.0.1 to 10.2.0.5

Issue:
bash-5.0$ emctl start dbconsole
Oracle Enterprise Manager 10g Database Control Release 10.2.0.5.0
Copyright (c) 1996, 2010 Oracle Corporation.  All rights reserved.
https:/hostname:1158/em/console/aboutApplication
ps: cmd is not a valid field name
Starting Oracle Enterprise Manager 10g Database Control ............................................................ failed.
------------------------------------------------------------------
Logs are generated in directory /u01/app/oracle/OraHome_1/<hostname_sid>/sysman/log
bash-5.0$ ./emctl status dbconsole
Oracle Enterprise Manager 10g Database Control Release 10.2.0.5.0
Copyright (c) 1996, 2010 Oracle Corporation.  All rights reserved.
https://hostname:1158/em/console/aboutApplication
Oracle Enterprise Manager 10g is not running.

Checking the ORACLE_HOME\<hostname>_<SID>\sysman\log\emagent.trc, below errors can see also:

2019-04-12 10:49:29 Thread-5 ERROR http: 16: Unable to initialize ssl connection with server, aborting connection attempt
2019-04-12 10:49:29 Thread-5 ERROR command: nmejcn: failed http connection to https://hostname:1158/em/upload/: retStatus=-1
2019-04-12 10:49:30 Thread-24 ERROR upload: Error in uploadXMLFiles.  Trying again in 103.00 seconds.
2019-04-12 10:49:34 Thread-25 ERROR upload: Error in uploadXMLFiles.  Trying again in 123.00 seconds.
2019-04-12 10:49:39 Thread-28 ERROR upload: Error in uploadXMLFiles.  Trying again in 147.00 seconds.
2019-04-12 10:49:45 Thread-5 ERROR ssl: Open wallet failed, ret = 28750
2019-04-12 10:49:45 Thread-5 ERROR ssl: nmehlenv_openWallet failed

(or)

2019-04-12 12:14:18 Thread-128 ERROR ssl: nzos_Handshake failed, ret=28862
2019-04-12 12:14:18 Thread-128 ERROR http: 15: Error initializing SSL connection for incoming request, aborting request. ret=-1


Cause:
In Enterprise Manager (EM) Database Control with Oracle Database 10.2.0.4 and 10.2.0.5, the root certificate used to secure communications via the Secure Socket Layer (SSL) protocol will expire on 31-Dec-2010 00:00:00. The certificate expiration will cause errors if you attempt to configure Database Control on or after 31-Dec-2010.Existing Database Control configurations are not impacted by this issue.

Solution:

1. Stop database,listener and em services.
2. Download and apply patch
bash-5.0$ /u01/app/oracle/OraHome_1/OPatch/opatch apply
Invoking OPatch 10.2.0.4.9

Oracle Interim Patch Installer version 10.2.0.4.9
Copyright (c) 2009, Oracle Corporation.  All rights reserved.


Oracle Home       : /u01/app/oracle/OraHome_1
Central Inventory : /u01/app/oracle/oraInventory
   from           : /var/opt/oracle/oraInst.loc
OPatch version    : 10.2.0.4.9
OUI version       : 10.2.0.5.0
OUI location      : /u01/app/oracle/OraHome_1/oui
Log file location : /u01/app/oracle/OraHome_1/cfgtoollogs/opatch/opatch2019-04-12_11-34-01AM.log

Patch history file: /u01/app/oracle/OraHome_1/cfgtoollogs/opatch/opatch_history.txt

ApplySession applying interim patch '8350262' to OH '/u01/app/oracle/OraHome_1'

Running prerequisite checks...

OPatch detected non-cluster Oracle Home from the inventory and will patch the local system only.

Backing up files and inventory (not for auto-rollback) for the Oracle Home
Backing up files affected by the patch '8350262' for restore. This might take a while...
Backing up files affected by the patch '8350262' for rollback. This might take a while...

Patching component oracle.sysman.agent.core, 10.2.0.5.0a...
Updating jar file "/u01/app/oracle/OraHome_1/sysman/jlib/emCORE.jar" with "/sysman/jlib/emCORE.jar/oracle/sysman/eml/sec/fsc/FSWalletUtil.class"
Updating jar file "/u01/app/oracle/OraHome_1/sysman/jlib/emCORE.jar" with "/sysman/jlib/emCORE.jar/oracle/sysman/eml/sec/rep/RepWalletUtil.class"
Updating jar file "/u01/app/oracle/OraHome_1/sysman/jlib/emCORE.jar" with "/sysman/jlib/emCORE.jar/oracle/sysman/eml/sec/util/RootCert.class"
Updating jar file "/u01/app/oracle/OraHome_1/sysman/jlib/emCORE.jar" with "/sysman/jlib/emCORE.jar/oracle/sysman/eml/sec/util/SecConstants.class"
Updating jar file "/u01/app/oracle/OraHome_1/sysman/jlib/emd_java.jar" with "/sysman/jlib/emd_java.jar/oracle/sysman/eml/sec/fsc/FSWalletUtil.class"
Updating jar file "/u01/app/oracle/OraHome_1/sysman/jlib/emd_java.jar" with "/sysman/jlib/emd_java.jar/oracle/sysman/eml/sec/rep/RepWalletUtil.class"
Updating jar file "/u01/app/oracle/OraHome_1/sysman/jlib/emd_java.jar" with "/sysman/jlib/emd_java.jar/oracle/sysman/eml/sec/util/RootCert.class"
Updating jar file "/u01/app/oracle/OraHome_1/sysman/jlib/emd_java.jar" with "/sysman/jlib/emd_java.jar/oracle/sysman/eml/sec/util/SecConstants.class"
ApplySession adding interim patch '8350262' to inventory

Verifying the update...
Inventory check OK: Patch ID 8350262 is registered in Oracle Home inventory with proper meta-data.
Files check OK: Files from Patch ID 8350262 are present in Oracle Home.

OPatch succeeded.
bash-5.0$ /u01/app/oracle/OraHome_1/OPatch/opatch lsinventory
Invoking OPatch 10.2.0.4.9

Oracle Interim Patch Installer version 10.2.0.4.9
Copyright (c) 2009, Oracle Corporation.  All rights reserved.


Oracle Home       : /u01/app/oracle/OraHome_1
Central Inventory : /u01/app/oracle/oraInventory
   from           : /var/opt/oracle/oraInst.loc
OPatch version    : 10.2.0.4.9
OUI version       : 10.2.0.5.0
OUI location      : /u01/app/oracle/OraHome_1/oui
Log file location : /u01/app/oracle/OraHome_1/cfgtoollogs/opatch/opatch2019-04-12_11-34-25AM.log

Patch history file: /u01/app/oracle/OraHome_1/cfgtoollogs/opatch/opatch_history.txt

Lsinventory Output file location : /u01/app/oracle/OraHome_1/cfgtoollogs/opatch/lsinv/lsinventory2019-04-12_11-34-25AM.txt

--------------------------------------------------------------------------------
Installed Top-level Products (2):

Oracle Database 10g                                                  10.2.0.1.0
Oracle Database 10g Release 2 Patch Set 4                            10.2.0.5.0
There are 2 products installed in this Oracle Home.


Interim patches (1) :

Patch  8350262      : applied on Fri Apr 12 11:34:11 IST 2019
Unique Patch ID:  13011832
   Created on 13 Sep 2010, 14:09:12 hrs GMT
   Bugs fixed:
     8350262

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

OPatch succeeded.

3. Start database and listener services.
4. Re-secure Database Control with the following command:
   <ORACLE_HOME>/bin/emctl secure dbconsole -reset
You will be prompted twice to confirm that the Root key must be overwritten. In both cases, enter upper-case "Y" as the response. Any other response (including lower-case "y") will cause the command to terminate without completing. If this happens, the command can be re-invoked.

bash-5.0$ emctl secure dbconsole -reset
Oracle Enterprise Manager 10g Database Control Release 10.2.0.5.0
Copyright (c) 1996, 2010 Oracle Corporation.  All rights reserved.
http://hostname:1158/em/console/aboutApplication
Enter Enterprise Manager Root Password :
DBCONSOLE already stopped...   Done.
Agent is already stopped...   Done.
Securing dbconsole...   Started.
Checking Repository...   Done.
Checking Em Key...   Done.
Checking Repository for an existing Enterprise Manager Root Key...
WARNING! An Enterprise Manager Root Key already exists in
the Repository. This operation will replace your Enterprise
Manager Root Key.
All existing Agents that use HTTPS will need to be
reconfigured if you proceed. Do you wish to continue and
overwrite your Root Key
(Y/N) ?
Y
Are you sure ? Reset of the Enterprise Manager Root Key
will mean that you will need to reconfigure each Agent
that is associated with this OMS before they will be
able to upload any data to it. Monitoring of Targets
associated with these Agents will be unavailable until
after they are reconfigured.
(Y/N) ?
Y
Generating Enterprise Manager Root Key (this takes a minute)...   Done.
Fetching Root Certificate from the Repository...   Done.
Updating HTTPS port in emoms.properties file...   Done.
Generating Java Keystore...   Done.
Securing OMS ...   Done.
Generating Oracle Wallet Password for Agent....   Done.
Generating wallet for Agent ...    Done.
Copying the wallet for agent use...    Done.
Storing agent key in repository...   Done.
Storing agent key for agent ...   Done.
Configuring Agent...
Configuring Agent for HTTPS in DBCONSOLE mode...   Done.
EMD_URL set in /u01/app/oracle/OraHome_1/<hostname_sid>/sysman/config/emd.properties
   Done.
Configuring Key store..   Done.
Securing dbconsole...   Sucessful.

5. Re-start Database Control with the following command:

   <ORACLE_HOME>/bin/emctl start dbconsole
bash-5.0$ emctl start dbconsole
Oracle Enterprise Manager 10g Database Control Release 10.2.0.5.0
Copyright (c) 1996, 2010 Oracle Corporation.  All rights reserved.
https://hostname>:1158/em/console/aboutApplication
ps: cmd is not a valid field name
Starting Oracle Enterprise Manager 10g Database Control .................... started.
------------------------------------------------------------------
Logs are generated in directory /u01/app/oracle/OraHome_1/<hostname_sid>/sysman/log

6. Verify Database Control status with the following command:

bash-5.0$ emctl status dbconsole
Oracle Enterprise Manager 10g Database Control Release 10.2.0.5.0
Copyright (c) 1996, 2010 Oracle Corporation.  All rights reserved.
https://hostname:1158/em/console/aboutApplication
Oracle Enterprise Manager 10g is running.
------------------------------------------------------------------
Logs are generated in directory /u01/app/oracle/OraHome_1/<hostname_sid>/sysman/log

Wednesday, April 3, 2019

NL-08014: Failed to initialize Diagnosability framework, falling back to old network tracing/logging

Issue:

[oracle1@oracle ~]$ lsnrctl start

LSNRCTL for Linux: Version 12.2.0.1.0 - Production on 03-APR-2019 15:49:56

Copyright (c) 1991, 2016, Oracle.  All rights reserved.

Starting /u01/Installations/Oracledb_12c/product/12.2.0/dbhome_1/bin/tnslsnr: please wait...

TNSLSNR for Linux: Version 12.2.0.1.0 - Production
System parameter file is /u01/Installations/Oracledb_12c/product/12.2.0/dbhome_1/network/admin/listener.ora
Log messages written to /u01/Installations/Oracledb_12c/product/12.2.0/dbhome_1/network/log/humint.log
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=oracle)(PORT=1521)))
Error listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
TNS-12555: TNS:permission denied
 TNS-12560: TNS:protocol adapter error
  TNS-00525: Insufficient privilege for operation
   Linux Error: 1: Operation not permitted
    NL-08014: Failed to initialize Diagnosability framework, falling back to old network tracing/logging

     NL-08002: Diagnosability  context creation failed

Listener failed to start. See the error message(s) above...

Cause:

1.
OCI client running a script is unable to write a file to the ADR_BASE:

/u01/app/oracle:


oracle $ pwd
/u01/Installations/Oracledb_12c
oracle $ userid touch a.txt
user1 is executing touch a.txt as userid in /u01/Installations/Oracledb_12c
touch: cannot touch `a.txt': Permission denied <===User can not write to ADR_BASE destination directory

2. Also Problem with IPC PRotocal after changing ownership oracle to another.

Solution:

Give the correct owner permission to write to the directory specified in the parameter ADR_BASE in the sqlnet.ora file.
Alternatively, change the value for ADR_BASE to a directory where the same user has write permissions.
Change ownership to correct user.