Sunday, November 24, 2019

Workflow notification mailer issue - Few notification not going

Issue due to smtp server.
SMTP test was failing , so once SMTP issue resolved notification mailer start coming.

Thanks

Wednesday, November 13, 2019

Few important POSTGRES monitoring command

pg_controldata -- It display control information of a PostgreSQL database cluster

-bash-4.1$ ./pg_controldata /u01/postgres/data
pg_control version number:            1002
Catalog version number:               201707211
Database system identifier:           6754729802804905833
...
..........



Query Monitoring:
=================

postgres=# SELECT * FROM pg_stat_activity;
 datid | datname  |  pid  | usesysid | usename  | application_name | client_addr | client_hostname | client_port |          backend_start           |            xact_start            |
      query_start            |           state_change           | wait_event_type |     wait_event      | state  | backend_xid | backend_xmin |              query              |    backend_
type
-------+----------+-------+----------+----------+------------------+-------------+-----------------+-------------+----------------------------------+----------------------------------+-----
-----------------------------+----------------------------------+-----------------+---------------------+--------+-------------+--------------+---------------------------------+------------
---------
       |          | 89107 |          |          |                  |             |                 |             | 2017-10-13 21:33:17.427986+05:30 |                                  |
                             |                                  | Activity        | AutoVacuumMain      |        |             |              |                                 | autovacuum
launcher
       |          | 89109 |       10 | postgres |                  |             |                 |             | 2017-10-13 21:33:17.430675+05:30 |                                  |
                             |                                  | Activity        | LogicalLauncherMain |        |             |              |                                 | background
worker
 13804 | postgres | 89818 |       10 | postgres |                  |             |                 |          -1 | 2017-10-13 21:45:38.093483+05:30 | 2019-11-13 21:45:39.471797+05:30 | 2019
-11-13 21:45:39.471797+05:30 | 2017-10-13 21:45:39.471805+05:30 |                 |                     | active |             |          571 | SELECT * FROM pg_stat_activity; | client back
end
       |          | 89105 |          |          |                  |             |                 |             | 2017-10-13 21:33:17.426106+05:30 |                                  |
                             |                                  | Activity        | BgWriterMain        |        |             |              |                                 | background
writer
       |          | 89104 |          |          |                  |             |                 |             | 2017-10-13 21:33:17.429943+05:30 |                                  |
                             |                                  | Activity        | CheckpointerMain    |        |             |              |                                 | checkpointe
r
       |          | 89106 |          |          |                  |             |                 |             | 2017-10-13 21:33:17.427542+05:30 |                                  |
                             |                                  | Activity        | WalWriterMain       |        |             |              |                                 | walwriter
(6 rows)


Database Statistics:
====================

postgres=# SELECT * FROM pg_stat_database;
 datid |  datname  | numbackends | xact_commit | xact_rollback | blks_read | blks_hit | tup_returned | tup_fetched | tup_inserted | tup_updated | tup_deleted | conflicts | temp_files | temp
_bytes | deadlocks | blk_read_time | blk_write_time |           stats_reset
-------+-----------+-------------+-------------+---------------+-----------+----------+--------------+-------------+--------------+-------------+-------------+-----------+------------+-----
-------+-----------+---------------+----------------+----------------------------------
 13804 | postgres  |           1 |          53 |             0 |       208 |     4054 |        26818 |        1639 |            0 |           0 |           0 |         0 |          0 |
     0 |         0 |             0 |              0 | 2017-10-13 21:21:18.233825+05:30
 16393 | test      |           0 |           0 |             0 |         0 |        0 |            0 |           0 |            0 |           0 |           0 |         0 |          0 |
     0 |         0 |             0 |              0 |
     1 | template1 |           0 |           0 |             0 |         0 |        0 |            0 |           0 |            0 |           0 |           0 |         0 |          0 |

Table activities:
=================

postgres=# SELECT * FROM pg_stat_all_tables;
 relid |     schemaname     |         relname         | seq_scan | seq_tup_read | idx_scan | idx_tup_fetch | n_tup_ins | n_tup_upd | n_tup_del | n_tup_hot_upd | n_live_tup | n_dead_tup | n_
mod_since_analyze | last_vacuum | last_autovacuum | last_analyze | last_autoanalyze | vacuum_count | autovacuum_count | analyze_count | autoanalyze_count
-------+--------------------+-------------------------+----------+--------------+----------+---------------+-----------+-----------+-----------+---------------+------------+------------+---
------------------+-------------+-----------------+--------------+------------------+--------------+------------------+---------------+-------------------
  2606 | pg_catalog         | pg_constraint           |        0 |            0 |        0 |             0 |         0 |         0 |         0 |             0 |          0 |          0 |
                0 |             |                 |              |                  |            0 |                0 |             0 |                 0
 13644 | information_schema | sql_implementation_info |        0 |            0 |          |               |         0 |         0 |         0 |             0 |          0 |          0 |
                0 |             |                 |              |                  |            0 |                0 |             0 |                 0



Table Block activity:
====================

postgres=# SELECT * FROM pg_statio_all_tables;
 relid |     schemaname     |         relname         | heap_blks_read | heap_blks_hit | idx_blks_read | idx_blks_hit | toast_blks_read | toast_blks_hit | tidx_blks_read | tidx_blks_hit
-------+--------------------+-------------------------+----------------+---------------+---------------+--------------+-----------------+----------------+----------------+---------------
 13646 | pg_toast           | pg_toast_13644          |              0 |             0 |             0 |            0 |                 |                |                |
  3596 | pg_catalog         | pg_seclabel             |              0 |             0 |             0 |            0 |               0 |              0 |              0 |             0
  2603 | pg_catalog         | pg_amproc               |              8 |            51 |             6 |          108 |                 |          |                |
 
Lock monitoring:
================

postgres=# SELECT * FROM pg_locks;
  locktype  | database | relation | page | tuple | virtualxid | transactionid | classid | objid | objsubid | virtualtransaction |  pid  |      mode       | granted | fastpath
------------+----------+----------+------+-------+------------+---------------+---------+-------+----------+--------------------+-------+-----------------+---------+----------
 relation   |    13804 |    11577 |      |       |            |               |         |       |          | 3/37               | 90315 | AccessShareLock | t       | t
 virtualxid |          |          |      |       | 3/37       |               |         |       |          | 3/37               | 90315 | ExclusiveLock   | t       | t
(2 rows)


Thanks,

How to start/stop postgres services

How to start/stop postgres services 


Services are not running:

-bash-4.1$ ps -ef | egrep "pg|postgres"
root      85717  79705  0 20:35 pts/0    00:00:00 su - postgres
postgres  85718  85717  0 20:35 pts/0    00:00:00 -bash
postgres  85777  85718  1 20:35 pts/0    00:00:00 ps -ef
postgres  85778  85718  0 20:35 pts/0    00:00:00 egrep pg|postgres


Using postgres user try to start using below :

-bash-4.1$ cd /u01/postgres/bin

-bash-4.1$ ./pg_ctl -D /u01/postgres/data -l /u01/postgres/server.log start
pg_ctl: another server might be running; trying to start server anyway
waiting for server to start.... stopped waiting
pg_ctl: could not start server
Examine the log output.

-bash-4.1$

When searched got below error in logfile:

2017-08-06 20:35:26.620 IST [85781] FATAL:  data directory "/u01/postgres/data" has group or world access
2017-08-06 20:35:26.620 IST [85781] DETAIL:  Permissions should be u=rwx (0700).


-bash-4.1$ chmod -R 700 /u01/postgres/data

-bash-4.1$ ./pg_ctl -D /u01/postgres/data -l /u01/postgres/server.log start
pg_ctl: another server might be running; trying to start server anyway
waiting for server to start.... done
server started

-bash-4.1$  ps -ef | egrep "pg|postgres"
root      85717  79705  0 20:35 pts/0    00:00:00 su - postgres
postgres  85718  85717  0 20:35 pts/0    00:00:00 -bash
postgres  85834      1  0 20:36 pts/0    00:00:00 /u01/postgres/bin/postgres -D /u01/postgres/data
postgres  85835  85834  0 20:36 ?        00:00:00 postgres: logger process
postgres  85837  85834  0 20:36 ?        00:00:00 postgres: checkpointer process
postgres  85838  85834  0 20:36 ?        00:00:00 postgres: writer process
postgres  85839  85834  0 20:36 ?        00:00:00 postgres: wal writer process
postgres  85840  85834  0 20:36 ?        00:00:00 postgres: autovacuum launcher process
postgres  85841  85834  0 20:36 ?        00:00:00 postgres: stats collector process
postgres  85842  85834  0 20:36 ?        00:00:00 postgres: bgworker: logical replication launcher
postgres  85846  85718  0 20:36 pts/0    00:00:00 ps -ef
postgres  85847  85718  0 20:36 pts/0    00:00:00 egrep pg|postgres


-bash-4.1$ ./pg_ctl -D /u01/postgres/data -l /u01/postgres/server.log stop
waiting for server to shut down.... done
server stopped

-bash-4.1$ ps -ef | egrep "pg|postgres"
root      85717  79705  0 20:35 pts/0    00:00:00 su - postgres
postgres  85718  85717  0 20:35 pts/0    00:00:00 -bash
postgres  88181  85718  1 21:17 pts/0    00:00:00 ps -ef

postgres  88182  85718  0 21:17 pts/0    00:00:00 egrep pg|postgres


========================================================


Another way we can do using below:


-bash-4.1$ export PGDATA=/u01/postgres/data

-bash-4.1$ ./pg_ctl stop
waiting for server to shut down.... done
server stopped

-bash-4.1$ ps -ef | egrep "pg|postgres"
root      85717  79705  0 20:35 pts/0    00:00:00 su - postgres
postgres  85718  85717  0 20:35 pts/0    00:00:00 -bash
postgres  89097  85718  1 21:33 pts/0    00:00:00 ps -ef
postgres  89098  85718  0 21:33 pts/0    00:00:00 egrep pg|postgres

-bash-4.1$ ./pg_ctl start
waiting for server to start....2017-11-13 21:33:17.087 IST [89101] LOG:  listening on IPv4 address "0.0.0.0", port 5432
2017-11-13 21:33:17.088 IST [89101] LOG:  listening on IPv6 address "::", port 5432
2017-11-13 21:33:17.098 IST [89101] LOG:  listening on Unix socket "/tmp/.s.PGSQL.5432"
2017-11-13 21:33:17.106 IST [89101] LOG:  redirecting log output to logging collector process
2017-11-13 21:33:17.106 IST [89101] HINT:  Future log output will appear in directory "log".
 done
server started





Thanks,

Oracle to MS Sql Server Heterogeneous DB link

Below are the steps we have to take care to achieve it:

1) Install ODBC driver or Gateway ( we used gateway )
2) Configure Listener and TNSNAMES .ora files
3) $ORACLE_HOME/hs/admin configuration
4) Create DB Link and test it

1) Gateway installation:










2)  Configure Listener and TNSNAMES.ora file as below:

Listener.ora 

dg4msql =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.58.10)(PORT = 1521))
    )
  )

SID_LIST_DG4MSQL =
  (SID_LIST =
    (SID_DESC =
      (ORACLE_HOME = /u01/app/12c/database/dbhome_1)
      (ENV = "LD_LIBRARY_PATH=/u01/app/12c/database/dbhome_1/dg4msql/driver/lib:/u01/app/12c/database/dbhome_1/lib")
      (SID_NAME = dg4msql)
      (PROGRAM = dg4msql)
    )
  )

tnsnames.ora file:

DG4MSQL =
  (DESCRIPTION=
    (ADDRESS=(PROTOCOL=tcp)(HOST=192.168.58.10)(PORT=1521))
      (CONNECT_DATA=(SID=dg4msql))
      (HS=OK)
  )


[oracle@prod admin]$ tnsping dg4msql

TNS Ping Utility for Linux: Version 12.1.0.2.0 - Production on 18-NOV-2017 17:40:47

Copyright (c) 1997, 2014, Oracle.  All rights reserved.

Used parameter files:
/u01/app/12c/database/dbhome_1/network/admin/sqlnet.ora


Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION= (ADDRESS=(PROTOCOL=tcp)(HOST=192.168.58.10)(PORT=1521)) (CONNECT_DATA=(SID=dg4msql)) (HS=OK))
OK (10 msec)

3) HS/admin configuration:

[oracle@prod admin]$ cat initdg4msql.ora
# This is a customized agent init file that contains the HS parameters
# that are needed for the Database Gateway for Microsoft SQL Server

#
# HS init parameters
#
HS_FDS_CONNECT_INFO=[192.168.58.10]:1433//testing
# alternate connect format is hostname/serverinstance/databasename
HS_FDS_TRACE_LEVEL=OFF
HS_FDS_RECOVERY_ACCOUNT=RECOVER
HS_FDS_RECOVERY_PWD=RECOVER

4) Create db link as mentioned :

create public database link db_link_name connect to username_of_sqlserver identified by password_of_sqlserver using 'dg4msql';

select * from dual@db_link_name;

Regards,





Monday, November 4, 2019

Few important day to day command in Postgres

Login psql:

-bash-4.1$ psql -U postgres
Password for user postgres:
psql (8.4.13, server 10.10)
WARNING: psql version 8.4, server version 10.10.
         Some psql features might not work.
Type "help" for help.

List of database:

postgres=# \l
                                  List of databases
   Name    |  Owner   | Encoding |  Collation  |    Ctype    |   Access privileges
-----------+----------+----------+-------------+-------------+-----------------------
 magicball | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =Tc/postgres
                                                             : postgres=CTc/postgres
                                                             : magic=CTc/postgres
 postgres  | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 |
 template0 | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =c/postgres
                                                             : postgres=CTc/postgres
 template1 | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =c/postgres
                                                             : postgres=CTc/postgres
(4 rows)


Create a user :

postgres=# CREATE USER hr WITH ENCRYPTED PASSWORD 'welcome1';
CREATE ROLE

Create a database:

postgres=# CREATE DATABASE hrdb
postgres-#  WITH ENCODING='UTF8'
postgres-#  OWNER=hr
postgres-#  CONNECTION LIMIT=25;
CREATE DATABASE

postgres=# \l
                                  List of databases
   Name    |  Owner   | Encoding |  Collation  |    Ctype    |   Access privileges
-----------+----------+----------+-------------+-------------+-----------------------
 hrdb      | hr       | UTF8     | en_US.UTF-8 | en_US.UTF-8 |
 magicball | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =Tc/postgres
                                                             : postgres=CTc/postgres
                                                             : magic=CTc/postgres
 postgres  | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 |
 template0 | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =c/postgres
                                                             : postgres=CTc/postgres
 template1 | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =c/postgres
                                                             : postgres=CTc/postgres
 (5 rows)




-bash-4.1$ psql -l
Password:
                                  List of databases
   Name    |  Owner   | Encoding |  Collation  |    Ctype    |   Access privileges
-----------+----------+----------+-------------+-------------+-----------------------
 hrdb      | hr       | UTF8     | en_US.UTF-8 | en_US.UTF-8 |
 magicball | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =Tc/postgres
                                                             : postgres=CTc/postgres
                                                             : magic=CTc/postgres
 postgres  | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 |
 template0 | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =c/postgres
                                                             : postgres=CTc/postgres
 template1 | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =c/postgres
                                                             : postgres=CTc/postgres
 test      | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 |
(6 rows)


Connect to database:

-bash-4.1$ psql -d hrdb -U hr -W
Password for user hr:
psql (8.4.13, server 10.10)
WARNING: psql version 8.4, server version 10.10.
         Some psql features might not work.
Type "help" for help.

Check all the tables in database:

hrdb=> \dt
No relations found.


Create a table:

hrdb=> CREATE TABLE role(
hrdb(>    role_id serial PRIMARY KEY,
hrdb(>    role_name VARCHAR (255) UNIQUE NOT NULL
hrdb(> );
CREATE TABLE

hrdb=> \dt
        List of relations
 Schema |  Name   | Type  | Owner
--------+---------+-------+-------
 public | role    | table | hr
(1 row)

Insert data into tables:

hrdb=> insert into role(role_id,role_name)
hrdb-> values
hrdb-> (3,'Manager');
INSERT 0 1

Find the details of tables:

hrdb=> select * from role;
 role_id | role_name
---------+-----------
       1 | worker
       2 | team lead
       3 | Manager
(3 rows)

Exit from database:

hrdb=> \q
-bash-4.1$


Thanks,

Install Postgres version 10.10 on Linux 64 machine

Download postgres from postgres source website and proceed as below:

[oracle@prod u01]$ cd stage/
[oracle@prod stage]$ ls -ltr
-rw-r--r--  1 root daemon  128913813 Nov  2 20:13 postgresql-10.10-2-linux-x64.run

RunInstaller should be run from super user

[root@prod stage]# ./postgresql-10.10-2-linux-x64.run
----------------------------------------------------------------------------
Welcome to the PostgreSQL Setup Wizard.

----------------------------------------------------------------------------
Please specify the directory where PostgreSQL will be installed.

Installation Directory [/opt/PostgreSQL/10]: /u01/postgres

----------------------------------------------------------------------------
Select the components you want to install; clear the components you do not want
to install. Click Next when you are ready to continue.

PostgreSQL Server [Y/n] :Y

pgAdmin 4 [Y/n] :Y

Stack Builder [Y/n] :Y

Command Line Tools [Y/n] :Y

Is the selection above correct? [Y/n]: Y

----------------------------------------------------------------------------
Please select a directory under which to store your data.

Data Directory [/u01/postgres/data]:

----------------------------------------------------------------------------
Please provide a password for the database superuser (postgres). A locked Unix
user account (postgres) will be created if not present.

Password :
Retype password :
----------------------------------------------------------------------------
Please select the port number the server should listen on.

Port [5432]:

----------------------------------------------------------------------------
Advanced Options

Select the locale to be used by the new database cluster.

Locale

[1] [Default locale]
[2] aa_DJ
..
....
[718] zu_ZA.utf8
Please choose an option [1] :

----------------------------------------------------------------------------
Pre Installation Summary

The following settings will be used for the installation::

Installation Directory: /u01/postgres
Server Installation Directory: /u01/postgres
Data Directory: /u01/postgres/data
Database Port: 5432
Database Superuser: postgres
Operating System Account: postgres
Database Service: postgresql-10
Command Line Tools Installation Directory: /u01/postgres
pgAdmin4 Installation Directory: /u01/postgres/pgAdmin 4
Stack Builder Installation Directory: /u01/postgres

Press [Enter] to continue:

----------------------------------------------------------------------------
Setup is now ready to begin installing PostgreSQL on your computer.

Do you want to continue? [Y/n]: y

----------------------------------------------------------------------------
Please wait while Setup installs PostgreSQL on your computer.

 Installing
 0% ______________ 50% ______________ 100%
 #########################################

----------------------------------------------------------------------------
Setup has finished installing PostgreSQL on your computer.

Once installer process completed check postgres background processes:

[root@prod stage]# su - postgres
-bash-4.1$ ps -fu postgres
UID         PID   PPID  C STIME TTY          TIME CMD
postgres   6527      1  0 20:51 ?        00:00:00 /u01/postgres/bin/postgres -D /u01/postgres/data
postgres   6528   6527  0 20:51 ?        00:00:00 postgres: logger process
postgres   6530   6527  0 20:51 ?        00:00:00 postgres: checkpointer process
postgres   6531   6527  0 20:51 ?        00:00:00 postgres: writer process
postgres   6532   6527  0 20:51 ?        00:00:00 postgres: wal writer process
postgres   6533   6527  0 20:51 ?        00:00:00 postgres: autovacuum launcher process
postgres   6534   6527  0 20:51 ?        00:00:00 postgres: stats collector process
postgres   6535   6527  0 20:51 ?        00:00:00 postgres: bgworker: logical replication launcher
postgres   7530   7529  0 21:00 pts/0    00:00:00 -bash
postgres   7590   7530  0 21:00 pts/0    00:00:00 ps -fu postgres

-bash-4.1$  ps -ef | egrep "pg|postgres"
postgres   6527      1  0 20:51 ?        00:00:00 /u01/postgres/bin/postgres -D /u01/postgres/data
postgres   6528   6527  0 20:51 ?        00:00:00 postgres: logger process
postgres   6530   6527  0 20:51 ?        00:00:00 postgres: checkpointer process
postgres   6531   6527  0 20:51 ?        00:00:00 postgres: writer process
postgres   6532   6527  0 20:51 ?        00:00:00 postgres: wal writer process
postgres   6533   6527  0 20:51 ?        00:00:00 postgres: autovacuum launcher process
postgres   6534   6527  0 20:51 ?        00:00:00 postgres: stats collector process
postgres   6535   6527  0 20:51 ?        00:00:00 postgres: bgworker: logical replication launcher
root       7529   3639  0 21:00 pts/0    00:00:00 su - postgres
postgres   7530   7529  0 21:00 pts/0    00:00:00 -bash
postgres   7662   7530  0 21:01 pts/0    00:00:00 ps -ef
postgres   7663   7530  0 21:01 pts/0    00:00:00 egrep pg|postgres


Regards,

Fragmented Table details

Fragmented Table in Oracle 


Below query will display all the highly fragmented table:

SQL> set lines 999
SQL> set pages 999
SQL> col table_name format a30
SQL> select *
  from (select table_name,
  2    3                 round((blocks * 8), 2) "size (kb)",
               round((num_rows * avg_row_len / 1024), 2) "actual_data (kb)",
  4    5                 (round((blocks * 8), 2) -
               round((num_rows * avg_row_len / 1024), 2)) "wasted_space (kb)"
          from dba_tables
         where (round((blocks * 8), 2) >
               round((num_rows * avg_row_len / 1024), 2))
         order by 4 desc)
 WHERE ROWNUM <= 10;  6    7    8    9   10   11

TABLE_NAME                      size (kb) actual_data (kb) wasted_space (kb)
------------------------------ ---------- ---------------- -----------------
ASO_ORDER_FEEDBACK_T              6130376       1315620.42        4814755.58
XLA_DIAG_SOURCES                 26622880       22002509.8        4620370.23

10 rows selected.

SQL> select sum(bytes)/1024/1024/1024 from dba_segments where segment_name='ASO_ORDER_FEEDBACK_T';

SUM(BYTES)/1024/1024/1024
-------------------------
               5.88623047

SQL> select table_name,avg_row_len,round(((blocks*16/1024)),2)||'MB' "TOTAL_SIZE",
  2  round((num_rows*avg_row_len/1024/1024),2)||'Mb' "ACTUAL_SIZE",
  3  round(((blocks*16/1024)-(num_rows*avg_row_len/1024/1024)),2) ||'MB' "FRAGMENTED_SPACE",
(round(((blocks*16/1024)-(num_rows*avg_row_len/1024/1024)),2)/round(((blocks*16/1024)),2))*100 "percentage"
  4    5  from all_tables WHERE table_name='ASO_ORDER_FEEDBACK_T';

TABLE_NAME                     AVG_ROW_LEN TOTAL_SIZE                                 ACTUAL_SIZE                                FRAGMENTED_SPACE                           percentage
------------------------------ ----------- ------------------------------------------ ------------------------------------------ ------------------------------------------ ----------
ASO_ORDER_FEEDBACK_T                   449 11973.39MB                                 1284.79Mb                                  10688.61MB                                 89.2697056


If above percentage is above 20 percent then we can think of these tables.

All the index details in that table:

SQL> select index_name from dba_indexes where table_name='ASO_ORDER_FEEDBACK_T'

INDEX_NAME
--------------------------------------------------------------------------------------------------------------------------------
SYS_IL0000081743C00333$$
SYS_IL0000081743C00334$$
SYS_IL0000081743C00335$$
SYS_IL0000081743C00336$$

SYS_IL0000081743C00337$$



We can take many measure to take care this fragmented table.

Regards,

Friday, November 1, 2019

Oracle Webtier 12c ( HTTP Server ) installation and Configure to run Privilege port 80

Oracle Webtier 12c ( HTTP Server ) installation and Configure to run Privilege port 80

Download software form support and unzip the software as below:

[oracle@test u02]$ unzip Oracle_Http_Server_12c_Linux_X86_64bit.zip
Archive:  Oracle_Http_Server_12c_Linux_X86_64bit.zip
  inflating: fmw_12.2.1.2.0_ohs_linux64.bin

  inflating: fmw_12212_readme.htm

Prior running below command set your display setting

[oracle@test u02]$./fmw_12.2.1.2.0_ohs_linux64.bin

















 You can see above web url opening with default port 7777 we wanted to change it to port 80 .

Few ports are explicitly reserved for system.
If you want to use those port then few other settings needs to be modified.

Shutdown OHS

[oracle@test bin]$ ./stopComponent.sh ohs1

[oracle@test bin]$ cd /u02/ohs_home/user_projects/domains/base_domain/config/fmwconfig/components/OHS/ohs1

[oracle@test ohs1]$ cp httpd.conf httpd.conf_org
[oracle@test ohs1]$ vi httpd.conf

Modify two values as mentioned below:

From :

Listen 192.168.171.20:7777
ServerName http://192.168.171.20:7777

To :

Listen 192.168.171.20:80
ServerName http://192.168.171.20:80




While starting OHS after modified port we are getting below error:

[oracle@test bin]$ ./startComponent.sh ohs1
Starting system Component ohs1 ...

weblogic.nodemanager.NMException: Received error message from Node Manager Server: [Server start command for OHS server 'ohs1' failed due to: [Failed to start the server ohs1
Check log file /u02/ohs_home/user_projects/domains/base_domain_new/system_components/OHS/ohs_nm.log
Check log file /u02/ohs_home/user_projects/domains/base_domain_new/servers/ohs1/logs/ohs1.log]. Please check Node Manager log and/or server 'ohs1' log for detailed information.]. Please check Node Manager log for details.
Error: Error occurred while performing nmStart : Error Starting server ohs1 : Received error message from Node Manager Server: [Server start command for OHS server 'ohs1' failed due to: [Failed to start the server ohs1
Check log file /u02/ohs_home/user_projects/domains/base_domain_new/system_components/OHS/ohs_nm.log
Check log file /u02/ohs_home/user_projects/domains/base_domain_new/servers/ohs1/logs/ohs1.log]. Please check Node Manager log and/or server 'ohs1' log for det
ailed information.]. Please check Node Manager log for details.
Use dumpStack() to view the full stacktrace :


After followed one of Oracle Doc id ohs came up fine:


[oracle@test bin]$ ./startComponent.sh ohs1
....
......
Successfully started server ohs1 ...
Successfully disconnected from Node Manager.


Exiting WebLogic Scripting Tool.

Done

Now URL coming with 80 as mentioned below:






Regards,