linux : Unlock SSH Failed Login Attempts and disable account expiration

1) unlock oracle user:
   centos 5.x
faillog -u oracle -r o

   centos 6.x
pam_tally2 -u oracle -r

pam_tally2 module is used to lock user accounts after certain number of failed ssh login attempts made to the system. This module keeps the count of attempted accesses and too many failed attempts.

2) disable account password expiration:
chage -d 0 oracle

Zamong is free oracle monitoring software with DMA method.

how to access oracle sga directly with c code

Zamong is free  oracle monitoring software with DMA method.

dma_picture

What is Direct oracle sga Memory Access ?

This example is from an AIX environment.
On linux, address value is differ from aix.

SQL>  select * from x$ksmmem  where rownum < 10 ;

ADDR                   INDX    INST_ID KSMMMVAL
---------------- ---------- ---------- ----------------
0700000000000000          0          1 00
0700000000000008          1          1 0700000514334020
0700000000000010          2          1 00
0700000000000018          3          1 00
0700000000000020          4          1 00
0700000000000028          5          1 00
0700000000000030          6          1 00
0700000000000038          7          1 00
0700000000000040          8          1 00

9 rows selected.

“0700000000000000” address is sga start address.

oracle@PaCG:/oracle> ipcs -mba
IPC status from /dev/mem as of Thu 
T        ID     KEY        MODE       OWNER    GROUP  CREATOR   CGROUP NATTCH     SEGSZ  CPID  LPID   ATIME    DTIME    CTIME 
Shared Memory:
m   1048576   00000000 --rw-r-----     grid      dba     grid      dba     32 318767104 4456886 58524018 21:41:51 21:41:51  5:38:14
m   5242882   00000000 --rw-r-----     grid      dba     grid      dba     32   3678208 4456886 58524018 21:41:51 21:41:51  5:38:14
m         3 0x8895c820 --rw-r-----     grid      dba     grid      dba     32      8192 4456886 58524018 21:41:51 21:41:51  5:38:14
m   1048581 0x3bea2a94 --rw-r-----   oracle      dba   oracle      dba   2404     16384 9371670 23593476 21:55:27 21:55:27  6:00:24
m   1048582   00000000 --rw-r-----   oracle      dba   oracle      dba   2404 21340618752 9371670 23593476 21:55:27 21:55:27  6:00:24
m   3145735   00000000 --rw-r-----   oracle      dba   oracle      dba   2404 134217728 9371670 23593476 21:55:27 21:55:27  6:00:24

shared memory id : 3145735

This is simple example of attaching oracle shared memory.

linux firewall command example

you can use linux firewall to open a port.
Linux operating systems using firewall utility ‘Iptables’ service is built for Linux operating systems(centos 5.x ~ 6.x).
In Centos 7.x, The default firewall system has changed.
CentOS 7, a firewall system called ‘firewalld’ was installed by default.

[example - iptables command for centos5.x ~ 6.x.    as root user]
1) iptables configuration for mariadb or mysql 

    iptables -A INPUT -p tcp -m tcp --dport 3306 -j ACCEPT 
    service iptables save
    service iptables restart

2) iptables configuration for apatch http 

    iptables -A INPUT -p tcp -m tcp --dport 80 -j ACCEPT 
    service iptables save 
    service iptables restart 



[example - firewalld command for centos7.x]
1) stop firewalld 

    systemctl stop firewalld

2) prevent the firewall from running when rebooting 

    systemctl disable firewalld

3) open ports 

    firewall-cmd --zone=public --add-port=3306/tcp --permanent 
    firewall-cmd --zone=public --add-port=80/tcp --permanent 
    firewall-cmd --reload 

4) check list of opened ports 

    firewall-cmd --list-ports