Tuesday, April 30, 2019

RMAN Incremental Level 1 backup with out Level 0 backup




 Incremental Level 1 backup with out Level 0 backup




level 1 incremental backup can be either of the following types:

Differential backup:  

Its backs up all blocks changed after the most recent incremental backup at level 1 or 0

 Cumulative backup : 

Its backs up all blocks changed after the most recent incremental backup at level 0






RMAN> list backup;

specification does not match any backup in the repository

RMAN>

RMAN>

RMAN> backup incremental level 1 database;

Starting backup at 30-APR-19
using channel ORA_DISK_1
no parent backup or copy of datafile 1 found
no parent backup or copy of datafile 3 found
no parent backup or copy of datafile 4 found
no parent backup or copy of datafile 7 found
channel ORA_DISK_1: starting incremental level 0 datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00001 name=/u01/app/oracle/oradata/IND/system01.dbf
input datafile file number=00003 name=/u01/app/oracle/oradata/IND/sysaux01.dbf
input datafile file number=00004 name=/u01/app/oracle/oradata/IND/undotbs01.dbf
input datafile file number=00007 name=/u01/app/oracle/oradata/IND/users01.dbf
channel ORA_DISK_1: starting piece 1 at 30-APR-19
channel ORA_DISK_1: finished piece 1 at 30-APR-19
piece handle=/u01/app/oracle/product/18.0.0/db/dbs/IND/backupset/2019_04_30/o1_mf_nnnd0_TAG20190430T171432_gdjf91z7_.bkp tag=TAG20190430T171432 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:03:27
channel ORA_DISK_1: starting incremental level 1 datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
including current control file in backup set
including current SPFILE in backup set
channel ORA_DISK_1: starting piece 1 at 30-APR-19
channel ORA_DISK_1: finished piece 1 at 30-APR-19
piece handle=/u01/app/oracle/product/18.0.0/db/dbs/IND/backupset/2019_04_30/o1_mf_ncsn1_TAG20190430T171432_gdjfhrcq_.bkp tag=TAG20190430T171432 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 30-APR-19

RMAN>


RMAN>

RMAN>

RMAN> list backup summary;


List of Backups
===============
Key     TY LV S Device Type Completion Time #Pieces #Copies Compressed Tag
------- -- -- - ----------- --------------- ------- ------- ---------- ---
9       B  0  A DISK        30-APR-19       1       1       NO         TAG20190430T171432
10      B  1  A DISK        30-APR-19       1       1       NO         TAG20190430T171432

RMAN>

Friday, April 12, 2019

Disable firewall in Linux


Disable firewall in Linux



Stop the firewall using root user



[root@grac43 ~]# service iptables status

iptables: Firewall is not running.

[root@pri ~]#
[root@pri ~]# chkconfig --list  | egrep 'iptables|ip6tables|libvirt'
ip6tables       0:off   1:off   2:on    3:on    4:on    5:on    6:off
iptables        0:off   1:off   2:on    3:on    4:on    5:on    6:off
libvirt-guests  0:off   1:off   2:on    3:on    4:on    5:on    6:off
libvirtd        0:off   1:off   2:off   3:on    4:on    5:on    6:off
[root@pri ~]#
[root@pri ~]#
[root@pri ~]# chkconfig libvirtd off
[root@pri ~]# chkconfig libvirt-guests off
[root@pri ~]# chkconfig ip6tables off
[root@pri ~]# chkconfig iptables off
[root@pri ~]# chkconfig --list  | egrep 'iptables|ip6tables|libvirt'
ip6tables       0:off   1:off   2:off   3:off   4:off   5:off   6:off
iptables        0:off   1:off   2:off   3:off   4:off   5:off   6:off
libvirt-guests  0:off   1:off   2:off   3:off   4:off   5:off   6:off
libvirtd        0:off   1:off   2:off   3:off   4:off   5:off   6:off
[root@pri ~]#
[root@pri ~]#


reboot the system using init 6 

[root@pri ~]# init 6
[root@pri ~]#
login as: oracle
oracle@192.168.43.68's password:
Last login: Fri Apr 12 17:36:20 2019 from 192.168.43.70
[oracle@pri ~]$
[oracle@pri ~]$
[oracle@pri ~]$
[oracle@pri ~]$ su - root
Password:
[root@pri ~]#
[root@pri ~]# service iptables status
iptables: Firewall is not running.
[root@pri ~]# chkconfig --list  | egrep 'iptables|ip6tables|libvirt'
ip6tables       0:off   1:off   2:off   3:off   4:off   5:off   6:off
iptables        0:off   1:off   2:off   3:off   4:off   5:off   6:off
libvirt-guests  0:off   1:off   2:off   3:off   4:off   5:off   6:off
libvirtd        0:off   1:off   2:off   3:off   4:off   5:off   6:off
[root@pri ~]#

Check database status using python

Check database status using python


save this file as dbstatus.py




import cx_Oracle


db=cx_Oracle.connect("hr","hr","192.168.43.68/ind")

cursor=db.cursor()
cursor.execute(""" select name,open_mode from v$database """)

for count in cursor:
    print(count)










Output:

"C:\Program Files\Python37\python.exe" C:/Users/ANURAG/PycharmProjects/phython_master/conn.py
('IND', 'READ WRITE')

Process finished with exit code 0

Thursday, April 11, 2019

How to check and stop firewall on Oracle Linux 6.

How to check and stop firewall on Oracle Linux 6



[root@pri ~]# service iptables status
Table: nat
Chain PREROUTING (policy ACCEPT)
num  target     prot opt source               destination

Chain INPUT (policy ACCEPT)
num  target     prot opt source               destination

Chain OUTPUT (policy ACCEPT)
num  target     prot opt source               destination

Chain POSTROUTING (policy ACCEPT)
num  target     prot opt source               destination
1    MASQUERADE  tcp  --  192.168.122.0/24    !192.168.122.0/24    masq ports: 1024-65535
2    MASQUERADE  udp  --  192.168.122.0/24    !192.168.122.0/24    masq ports: 1024-65535
3    MASQUERADE  all  --  192.168.122.0/24    !192.168.122.0/24

Table: mangle
Chain PREROUTING (policy ACCEPT)
num  target     prot opt source               destination

Chain INPUT (policy ACCEPT)
num  target     prot opt source               destination

Chain FORWARD (policy ACCEPT)
num  target     prot opt source               destination

Chain OUTPUT (policy ACCEPT)
num  target     prot opt source               destination

Chain POSTROUTING (policy ACCEPT)
num  target     prot opt source               destination
1    CHECKSUM   udp  --  0.0.0.0/0            0.0.0.0/0           udp dpt:68 CHECKSUM fill

Table: filter
Chain INPUT (policy ACCEPT)
num  target     prot opt source               destination
1    ACCEPT     udp  --  0.0.0.0/0            0.0.0.0/0           udp dpt:53
2    ACCEPT     tcp  --  0.0.0.0/0            0.0.0.0/0           tcp dpt:53
3    ACCEPT     udp  --  0.0.0.0/0            0.0.0.0/0           udp dpt:67
4    ACCEPT     tcp  --  0.0.0.0/0            0.0.0.0/0           tcp dpt:67
5    ACCEPT     all  --  0.0.0.0/0            0.0.0.0/0           state RELATED,ESTABLISHED
6    ACCEPT     icmp --  0.0.0.0/0            0.0.0.0/0
7    ACCEPT     all  --  0.0.0.0/0            0.0.0.0/0
8    ACCEPT     tcp  --  0.0.0.0/0            0.0.0.0/0           state NEW tcp dpt:22
9    REJECT     all  --  0.0.0.0/0            0.0.0.0/0           reject-with icmp-host-prohibited

Chain FORWARD (policy ACCEPT)
num  target     prot opt source               destination
1    ACCEPT     all  --  0.0.0.0/0            192.168.122.0/24    state RELATED,ESTABLISHED
2    ACCEPT     all  --  192.168.122.0/24     0.0.0.0/0
3    ACCEPT     all  --  0.0.0.0/0            0.0.0.0/0
4    REJECT     all  --  0.0.0.0/0            0.0.0.0/0           reject-with icmp-port-unreachable
5    REJECT     all  --  0.0.0.0/0            0.0.0.0/0           reject-with icmp-port-unreachable
6    REJECT     all  --  0.0.0.0/0            0.0.0.0/0           reject-with icmp-host-prohibited

Chain OUTPUT (policy ACCEPT)
num  target     prot opt source               destination

[root@pri ~]#
[root@pri ~]#
[root@pri ~]# service iptables stop
iptables: Setting chains to policy ACCEPT: nat mangle filte[  OK  ]
iptables: Flushing firewall rules:                         [  OK  ]
iptables: Unloading modules:                               [  OK  ]
[root@pri ~]#
[root@pri ~]#
[root@pri ~]#
[root@pri ~]# service iptables status
iptables: Firewall is not running.

[root@pri ~]#