Friday 7 September 2018

Step by step : How to add space in existing file system from Physical Volume (LVM)

Step 1. Check Physical Volume and Volume Group  

[root@oracledb ~]# pvs
  PV         VG   Fmt  Attr PSize  PFree
  /dev/sda2  rhel lvm2 a--  19.05g  4.00m
  /dev/sdc3       lvm2 a--  11.72g 11.72g
[root@oracledb ~]# vgs
  VG   #PV #LV #SN Attr   VSize  VFree
  rhel   1   4   0 wz--n- 19.05g 4.00m
 
Step 2. Now add 11.72 GB to rhel VG
 
[root@oracledb ~]# vgextend rhel /dev/sdc3
  Volume group "rhel" successfully extended
 
[root@oracledb ~]# vgs
  VG   #PV #LV #SN Attr   VSize  VFree
  rhel   2   4   0 wz--n- 30.77g 11.72g
 
Step 3. Check file system
 
[root@oracledb ~]# df -h
Filesystem             Size  Used Avail Use% Mounted on
/dev/mapper/rhel-root  7.9G  6.5G  1.4G  83% /
devtmpfs               909M     0  909M   0% /dev
tmpfs                  918M   84K  918M   1% /dev/shm
tmpfs                  918M  9.1M  909M   1% /run
tmpfs                  918M     0  918M   0% /sys/fs/cgroup
/dev/mapper/rhel-home  497M   47M  451M  10% /home
/dev/sda1              497M  122M  376M  25% /boot
/dev/mapper/rhel-u01   8.8G  6.9G  2.0G  78% /u01
/dev/sr0               3.5G  3.5G     0 100% /run/media/root/RHEL-7.0 Server.x86_64

Step 4. Check Logical Volume Status

[root@oracledb ~]# lvs
  LV   VG   Attr       LSize   Pool Origin Data%  Move Log Cpy%Sync Convert
  home rhel -wi-ao---- 500.00m
  root rhel -wi-ao----   7.81g
  swap rhel -wi-ao----   1.95g
  u01  rhel -wi-ao----   8.79g
[root@oracledb ~]# vgs
  VG   #PV #LV #SN Attr   VSize  VFree
  rhel   2   4   0 wz--n- 30.77g 11.72g
 
Step 5. Now Merge added 11.72 GB space with /dev/rhel/u01 
 
[root@oracledb ~]# lvextend /dev/rhel/
/dev/rhel/home  /dev/rhel/root  /dev/rhel/swap  /dev/rhel/u01
[root@oracledb ~]# lvextend /dev/rhel/u01 /dev/sdc3
  Extending logical volume u01 to 20.51 GiB
  Logical volume u01 successfully resized
[root@oracledb ~]#

Step 6. Still /dev/mapper/rhel-u01 size previous one but lvs command output showing added space

[root@oracledb ~]# df -h
Filesystem             Size  Used Avail Use% Mounted on
/dev/mapper/rhel-root  7.9G  6.5G  1.4G  83% /
devtmpfs               909M     0  909M   0% /dev
tmpfs                  918M   84K  918M   1% /dev/shm
tmpfs                  918M  9.1M  909M   1% /run
tmpfs                  918M     0  918M   0% /sys/fs/cgroup
/dev/mapper/rhel-home  497M   47M  451M  10% /home
/dev/sda1              497M  122M  376M  25% /boot
/dev/mapper/rhel-u01   8.8G  6.9G  2.0G  78% /u01
/dev/sr0               3.5G  3.5G     0 100% /run/media/root/RHEL-7.0 Server.x86_64
[root@oracledb ~]# lvs
  LV   VG   Attr       LSize   Pool Origin Data%  Move Log Cpy%Sync Convert
  home rhel -wi-ao---- 500.00m
  root rhel -wi-ao----   7.81g
  swap rhel -wi-ao----   1.95g
  u01  rhel -wi-ao----  20.51g
[root@oracledb ~]# cat /etc/fstab

#
# /etc/fstab
# Created by anaconda on Fri Mar 11 23:15:03 2016
#
# 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
#
/dev/mapper/rhel-root   /                       xfs     defaults        1 1
UUID=c6708dec-5103-402c-84f3-9bd7f39686ef /boot                   xfs     defaults        1 2
/dev/mapper/rhel-home   /home                   xfs     defaults        1 2
/dev/mapper/rhel-u01    /u01                    xfs     defaults        1 2
/dev/mapper/rhel-swap   swap                    swap    defaults        0 0
192.168.184.128:/netshared      /soft   nfs     _netdev 0       0

Step 7.  Now extend /u01 filesystem size

[root@oracledb ~]# resize2fs /dev/mapper/rhel-u01
resize2fs 1.42.9 (28-Dec-2013)
resize2fs: Bad magic number in super-block while trying to open /dev/mapper/rhel-u01
Couldn't find valid filesystem superblock.

Note: Possible reason is, the mounted filesystem would be XFS filesystem. SO resize2fs wont work for xfs filesystem, we should use xfs_growfs instead of resize2fs.

[root@oracledb ~]# resize
resize2fs   resizecons  resizepart
[root@oracledb ~]# xf
xfreerdp       xfs_copy       xfs_estimate   xfs_growfs     xfs_io         xfs_metadump   xfs_quota      xfs_rtcp
xfs_admin      xfs_db         xfs_freeze     xfs_info       xfs_logprint   xfs_mkfile     xfs_repair
xfs_bmap       xfsdump        xfs_fsr        xfsinvutil     xfs_mdrestore  xfs_ncheck     xfsrestore
[root@oracledb ~]# xfs_growfs /dev/mapper/rhel-u01
meta-data=/dev/mapper/rhel-u01   isize=256    agcount=4, agsize=576000 blks
         =                       sectsz=512   attr=2, projid32bit=1
         =                       crc=0
data     =                       bsize=4096   blocks=2304000, imaxpct=25
         =                       sunit=0      swidth=0 blks
naming   =version 2              bsize=4096   ascii-ci=0 ftype=0
log      =internal               bsize=4096   blocks=2560, version=2
         =                       sectsz=512   sunit=0 blks, lazy-count=1
realtime =none                   extsz=4096   blocks=0, rtextents=0
data blocks changed from 2304000 to 5376000

[root@oracledb ~]# df -h
Filesystem             Size  Used Avail Use% Mounted on
/dev/mapper/rhel-root  7.9G  6.5G  1.4G  83% /
devtmpfs               909M     0  909M   0% /dev
tmpfs                  918M   84K  918M   1% /dev/shm
tmpfs                  918M  9.1M  909M   1% /run
tmpfs                  918M     0  918M   0% /sys/fs/cgroup
/dev/mapper/rhel-home  497M   47M  451M  10% /home
/dev/sda1              497M  122M  376M  25% /boot
/dev/mapper/rhel-u01    21G  6.9G   14G  34% /u01
/dev/sr0               3.5G  3.5G     0 100% /run/media/root/RHEL-7.0 Server.x86_64
[root@oracledb ~]#


Thats it !!!!!!!!!!!!!!!!!!!!!

Saturday 27 January 2018

ORA-39001: invalid argument value ORA-01775: looping chain of synonyms

Error:

When running DataPump import/export (impdp/expdp) the following errors occur:

Export: Release 11.2.0.3.0 - Production on Sun Jan 28 10:51:40 2018

Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.

Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, Automatic Storage Management, OLAP, Data Mining
and Real Application Testing options
ORA-39001: invalid argument value
ORA-01775: looping chain of synonyms



Reason:


Apparently, the SYS_IMPORT_SCHEMA_01 table is a master table being created during schema impdp. If the impdp is carried out normally then this table would be dropped automatically. In case there is an abnormal termination of the impdp then, the table might still remain.


running this query shows that a public synonym (not created by DataPump) still exists with the name "SYS_IMPORT_SCHEMA_01".

Dropping the synonym SYS_IMPORT_SCHEMA_01 should resolve this issue.


Solution

SQL> select owner, object_name, object_type, status from dba_objects where object_name like '%SYS_IMPORT_SCHEMA_01%';
OWNER           OBJECT_NAME            OBJECT_TYPE      STATUS
--------------- ---------------------- ---------------- -------
PUBLIC          SYS_IMPORT_SCHEMA_01   SYNONYM           VALID
connect / as sysdba
drop public synonym sys_import_schema_01;

Friday 19 January 2018

ERROR: "ORA-28040: No matching authentication protocol"

Error: The following error is coming when trying to connect Oracle 12c database from below Oracle 12c client client 

ERROR: "ORA-28040: No matching authentication protocol"

Reason:

This is an Oracle issue and further inquires should be opened with Oracle support. Here is the information we have and a workaround:
 Bug 14575666
 In 12.1, the default value for the SQLNET.ALLOWED_LOGON_VERSION parameter has been updated to 11. This means that database clients using pre-11g JDBC thin drivers cannot authenticate to 12.1 database servers unless the SQLNET.ALLOWED_LOGON_VERSION parameter is set to the old default of 8.
 This will cause a 10.2.0.5 Oracle RAC database creation using DBCA to fail with the ORA-28040: No matching authentication protocol error in 12.1 Oracle ASM and Oracle Grid Infrastructure environments.

Solution : 

Set SQLNET.ALLOWED_LOGON_VERSION=8 in the oracle/network/admin/sqlnet.ora file. Now reload the listener and try to connect

[oracle@sisdb network]$ cd admin/
[oracle@sisdb admin]$ cat sqlnet.ora 
# sqlnet.ora Network Configuration File: /orasoft/oracle/product/12.2.0.1/db_1/network/admin/sqlnet.ora
# Generated by Oracle configuration tools.

NAMES.DIRECTORY_PATH= (TNSNAMES, ONAMES, HOSTNAME)

[oracle@sisdb admin]$ vim sqlnet.ora 

SQLNET.ALLOWED_LOGON_VERSION_SERVER=8


[oracle@sisdb admin]$ lsnrctl reload

LSNRCTL for Linux: Version 12.2.0.1.0 - Production on 20-JAN-2018 13:42:41

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

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=sisdb)(PORT=1521)))
The command completed successfully