Jephe Wu - http://linuxtechres.blogspot.com
Objective: Value-add advanced Linux OpenSSH video tutorial made free to everyone.
Video course 1: OpenSSH chroot sftp part I with PDF tutorial
Video course 2: OpenSSH chroot sftp part II with PDf tutorial
Video course 3: OpenSSH chroot sftp Part III with PDF tutorial
Video course 4: SSH passwordless login with PDF tutorial
Video course 5: SSH transparent proxy with PDF tutorial
Video course 6: SSH local port forwarding with PDF tutorial
Video course 7: SSH remote port forwarding with PDF tutorial
Video course 8: SSH gateway ports local with PDF tutorial
Video course 9: SSH gateway ports remote with PDF tutorial
Video course 10: SSH socks proxy with PDF tutorial
Video course 11: SSH http proxy with PDF tutorial
Video course 12: SSH agent with PDF tutorial
Video course 13: OpenSSH screen with PDF tutorial
Video course 14: OpenSSH keepalive with PDF tutorial
Video course 15: OpenSSH troubleshooting I with PDF tutorial
Video course 16: OpenSSH troubleshooting II with PDF tutorial
Linux OpenSSH Advanced Video Tutorial
at 5/30/2015 11:29:00 PM 0 comments
Labels: openssh
How to Install Oracle VM Server 3.2 and 3.3 from USB Key
Jephe Wu - http://linuxtechres.blogspot.com
Objective: to install Oracle VM server 3.2.8 or 3.3.2 from USB key for those server without DVD/CDROM drive
Steps on Linux Mint 17
use unetbootin
copy ISO file into /dev/sdb1
boot from USB to install OVMS 3.2.8
Steps on Windows
FAQ
at 5/13/2015 11:18:00 PM 0 comments
Labels: Oracle VM
How to decide ethX layout after Oracle VM Server 3.2 Installation
Jephe Wu - http://linuxtechres.blogspot.com
Objective: to decide ethX layout remotely after Oracle VM Server 3.2 installation.
Environment: Oracle VM server 3.2.9
If you are in front of the physical server, you can decide ethX layout easily by running 'ethtool -p ethX' etc to blink each NIC light. e.g. ethtool -p eth0
How Oracle VM server to decide which NIC for which ethX
based on pci bus address from low to high to assign eth0, eth1 etc
Theory behind
- Os will assign ethX sequence based on NIC PCI bus address sequence
- 4 NICs onboard are actually 2 dualports cards
- For additional PCI card, the ports near the bottom pins are getting high pci bus number, from ethX is assigned from top to bottom.
- Sometimes, pci bus address has primary-secondary relationships,
Check steps
Get server model, pci NIC slot direction, PCI numbering sequence physically etc first
/sys/class/net
Intel 82576 Ethernet Controller.
List ethX bus information - ethtool -i ethX
eth0 bus-info: 0000:01:00.0
eth1 bus-info: 0000:01:00.1
eth2 bus-info: 0000:02:00.0
eth3 bus-info: 0000:02:00.1
eth4 bus-info: 0000:04:00.0
eth5 bus-info: 0000:04:00.1
eth6 bus-info: 0000:07:00.0
eth7 bus-info: 0000:07:00.1
eth8 bus-info: 0000:08:00.0
eth9 bus-info: 0000:08:00.1
lspci to get ethernet NICs - lspci | grep -i eth
[root@ovms01 ~]# lspci | grep -i eth
01:00.0 Ethernet controller: Broadcom Corporation Device 165f
01:00.1 Ethernet controller: Broadcom Corporation Device 165f
02:00.0 Ethernet controller: Broadcom Corporation Device 165f
02:00.1 Ethernet controller: Broadcom Corporation Device 165f
04:00.0 Ethernet controller: Intel Corporation Device 154d (rev 01)
04:00.1 Ethernet controller: Intel Corporation Device 154d (rev 01)
07:00.0 Ethernet controller: Intel Corporation 82571EB Gigabit Ethernet Controller (Copper) (rev 06)
07:00.1 Ethernet controller: Intel Corporation 82571EB Gigabit Ethernet Controller (Copper) (rev 06)
08:00.0 Ethernet controller: Intel Corporation 82571EB Gigabit Ethernet Controller (Copper) (rev 06)
08:00.1 Ethernet controller: Intel Corporation 82571EB Gigabit Ethernet Controller (Copper) (rev 06)
lspci bridge to secondary - lspci -vvv | grep primary
Bus: primary=00, secondary=02, subordinate=02, sec-latency=0
Bus: primary=00, secondary=01, subordinate=01, sec-latency=0
Bus: primary=00, secondary=04, subordinate=04, sec-latency=0
Bus: primary=00, secondary=03, subordinate=03, sec-latency=0
Bus: primary=00, secondary=05, subordinate=08, sec-latency=0
Bus: primary=00, secondary=09, subordinate=09, sec-latency=0
Bus: primary=00, secondary=0a, subordinate=0a, sec-latency=0
Bus: primary=00, secondary=0b, subordinate=0f, sec-latency=0
Bus: primary=00, secondary=10, subordinate=10, sec-latency=32
Bus: primary=05, secondary=06, subordinate=08, sec-latency=0
Bus: primary=06, secondary=07, subordinate=07, sec-latency=0
Bus: primary=06, secondary=08, subordinate=08, sec-latency=0
Bus: primary=0b, secondary=0c, subordinate=0f, sec-latency=0
Bus: primary=0c, secondary=0d, subordinate=0e, sec-latency=0
Bus: primary=0c, secondary=0f, subordinate=0f, sec-latency=0
Bus: primary=0d, secondary=0e, subordinate=0e, sec-latency=0
dmidecode to list PCI slot information
# dmidecode 2.10
SMBIOS 2.7 present.
# SMBIOS implementations newer than version 2.6 are not
# fully supported by this version of dmidecode.
System Slot Information
Designation: PCI1
Type: x8 <OUT OF SPEC>
Current Usage: In Use
Length: Long
Characteristics:
3.3 V is provided
PME signal is supported
Bus Address: 0000:04:00.0
System Slot Information
Designation: PCI2
Type: x16 <OUT OF SPEC>
Current Usage: In Use
Length: Long
Characteristics:
3.3 V is provided
PME signal is supported
Bus Address: 0000:05:00.0
dmidecode to get onboard device information
# dmidecode 2.10
SMBIOS 2.7 present.
# SMBIOS implementations newer than version 2.6 are not
# fully supported by this version of dmidecode.
Onboard Device
Reference Designation: Integrated NIC 1
Type: Ethernet
Status: Enabled
Type Instance: 1
Bus Address: 0000:01:00.0
Onboard Device
Reference Designation: Integrated NIC 2
Type: Ethernet
Status: Enabled
Type Instance: 2
Bus Address: 0000:01:00.1
Onboard Device
Reference Designation: Integrated NIC 3
Type: Ethernet
Status: Enabled
Type Instance: 3
Bus Address: 0000:02:00.0
Onboard Device
Reference Designation: Integrated NIC 4
Type: Ethernet
Status: Enabled
Type Instance: 4
Bus Address: 0000:02:00.1
lspci to get ethernet NIC information
[root@ovms01 ~]# lspci | grep -i ethernet
dmidecode to get PCI card information
[root@ovms01 ~]# dmidecode -t slot | grep -e Designation -e Bus
use ethtool to decide bus info
[root@ovms10 ~]# for i in `ifconfig -a | grep ^eth | awk '{print $1}' | xargs`; do echo -n "$i " && ethtool -i $i| grep -i bus ; done
eth0 bus-info: 0000:01:00.0
eth1 bus-info: 0000:01:00.1
eth2 bus-info: 0000:04:00.0
eth3 bus-info: 0000:04:00.1
eth4 bus-info: 0000:42:00.0
eth5 bus-info: 0000:42:00.1
eth6_rename bus-info: 0000:07:00.0
eth7_rename bus-info: 0000:07:00.1
dmesg to get PCI slot cards MAC address
ixgbe: Intel(R) 10 Gigabit PCI Express Network Driver - version 3.4.8-k
ixgbe 0000:08:00.0: (PCI Express:5.0GT/s:Width x8) 90:e2:ba:19:a6:80
ixgbe 0000:08:00.1: (PCI Express:5.0GT/s:Width x8) 90:e2:ba:19:a6:81
ixgbe 0000:0e:00.0: (PCI Express:5.0GT/s:Width x8) 90:e2:ba:19:a5:ac
ixgbe 0000:0e:00.1: (PCI Express:5.0GT/s:Width x8) 90:e2:ba:19:a5:ad
ixgbe 0000:0f:00.0: (PCI Express:5.0GT/s:Width x8) 90:e2:ba:19:58:20
ixgbe 0000:0f:00.1: (PCI Express:5.0GT/s:Width x8) 90:e2:ba:19:58:21
bnx2 0000:01:00.0: eth0: Broadcom NetXtreme II BCM5709 1000Base-T (C0) PCI Express found at mem f2000000, IRQ 36, node addr d4:ae:52:e6:83:a0
bnx2 0000:01:00.1: eth1: Broadcom NetXtreme II BCM5709 1000Base-T (C0) PCI Express found at mem f4000000, IRQ 48, node addr d4:ae:52:e6:83:a2
bnx2 0000:02:00.0: eth2: Broadcom NetXtreme II BCM5709 1000Base-T (C0) PCI Express found at mem f6000000, IRQ 37, node addr d4:ae:52:e6:83:a4
bnx2 0000:02:00.1: eth3: Broadcom NetXtreme II BCM5709 1000Base-T (C0) PCI Express found at mem f8000000, IRQ 49, node addr d4:ae:52:e6:83:a6
echo "fixing ethX device sequence" ETH2=`dmesg | grep Express | grep "30:00.0" | awk '{print $NF}'` ETH3=`dmesg | grep Express | grep "30:00.1" | awk '{print $NF}'` ETH6=`dmesg | grep Express | grep "88:00.0" | awk '{print $NF}'` ETH7=`dmesg | grep Express | grep "88:00.1" | awk '{print $NF}'` cd /etc/sysconfig/network-scripts sed -i -e "s/^HWADDR.*/HWADDR=$ETH6/g" ifcfg-eth2 sed -i -e "s/^HWADDR.*/HWADDR=$ETH7/g" ifcfg-eth3 sed -i -e "s/^HWADDR.*/HWADDR=$ETH2/g" ifcfg-eth6 sed -i -e "s/^HWADDR.*/HWADDR=$ETH3/g" ifcfg-eth7
Draw ethX layout at last step
example below:
PCI1RAID Controller PCI200:42.00.1(eth5)(pin) 00:42.00.0(eth4) PCI300:04:00.0(eth2) 00:04:00.1(eth3)(pin) eth000:01:00.0 eth100:01:00.1 eth6 (X)00:07:00.0 eth7 (X)00:07:00.1
Ultimate way to associate ethX with PCI bus address
[root @ovms10 rules.d]# more 99 -ethernet.rules KERNEL== "eth*" , ID== "0000:01:00.0" , name= "eth0" KERNEL== "eth*" , ID== "0000:01:00.1" , name= "eth1" KERNEL== "eth*" , ID== "0000:04:00.0" , name= "eth2" KERNEL== "eth*" , ID== "0000:04:00.1" , name= "eth3" KERNEL== "eth*" , ID== "0000:42:00.0" , name= "eth4" KERNEL== "eth*" , ID== "0000:42:00.1" , name= "eth5" KERNEL== "eth*" , ID== "0000:07:00.0" , name= "eth6" KERNEL== "eth*" , ID== "0000:07:00.1" , name= "eth7" |
[root
@ovms10
rules.d]# ethtool -i eth0
driver: ixgbe
version:
3.4
.
8
-k
firmware-version:
4.2
-
8
bus-info:
0000
:
01
:
00.0
at 5/13/2015 11:04:00 PM 0 comments
Labels: Oracle VM
Calculate Oracle Database Size
Jephe Wu - http://linuxtechres.blogspot.com
Objective: to calculate all kinds of database sizes.
Items:
Size of datafiles in MB
select sum(bytes)/(
1024
*
1024
) from dba_data_files;
Size of tempfiles in MB
select sum(bytes)/(
1024
*
1024
) from dba_temp_files;
Size of redo logs in MB
Not accounting
for
mirrored redolog files:
select sum(bytes)/(
1024
*
1024
) from v$log;
To get the used-up space of your datafiles:
This will give you the total used-up space inside the database in MB.
select sum(bytes)/(
1024
*
1024
) from dba_segments;
Total Size of the database:
Also accounting
for
controlfiles and mirrored redolog files.
select a.data_size+b.temp_size+c.redo_size+d.cont_size
"total_size"
from ( select sum(bytes) data_size
from dba_data_files ) a,
( select nvl(sum(bytes),
0
) temp_size
from dba_temp_files ) b,
( select sum(bytes) redo_size
from sys.v_$logfile lf, sys.v_$log l
where lf.group# = l.group#) c,
( select sum(block_size*file_size_blks) cont_size
from v$controlfile ) d;
Total Size and free size:
select round(sum(used.bytes) /
1024
/
1024
) ||
' MB'
"Database Size"
, round(free.p /
1024
/
1024
) ||
' MB'
"Free space"
from (select bytes from v$datafile
union all
select bytes from v$tempfile
union all
select bytes from v$log) used
, (select sum(bytes) as p from dba_free_space) free
group by free.p;
Individual tablespace size:
select tablespace_name as
"Tablespace Name"
,sum(bytes)/(
1024
*
1024
) as
"Size"
from dba_data_files
group by tablespace_name
ORDER BY
1
;
Individual tablespace used size:
select tablespace_name as
"Tablespace Name"
,sum(bytes)/(
1024
*
1024
) as
"Used Size"
from dba_segments
GROUP BY TABLESPACE_NAME
order by
1
;
Individual tablespace free space:
select tablespace_name as
"Tablespace Name"
, sum(bytes)/(
1024
*
1024
) as
"Free Space"
from dba_free_space
group by tablespace_name
order by
1
;
References:
How to Calculate the Size of the Database (Doc ID 1360446.1)
at 5/13/2015 10:02:00 PM 0 comments
Labels: size