首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往
  • 您找到你想要的搜索结果了吗?
    是的
    没有找到

    Linux中查看系统CPU、内存、磁盘、网卡、硬件槽信息的命令

    linux查看系统的硬件信息,并不像windows那么直观,这里我罗列了查看系统信息的实用命令,并做了分类,实例解说。 查看系统信息 uname -a 显示系统名、节点名称、操作系统的发行版号、操作系统版本、运行系统的机器 ID 号 cpu lscpu命令,查看的是cpu的统计信息. blue@blue-pc:~$ lscpu Architecture:          i686            #cpu架构 CPU op-mode(s):        32-bit, 64-bit Byte Order:            Little Endian   #小尾序 CPU(s):                4               #总共有4核 On-line CPU(s) list:   0-3 Thread(s) per core:    1               #每个cpu核,只能支持一个线程,即不支持超线程 Core(s) per socket:    4               #每个cpu,有4个核 Socket(s):             1               #总共有1一个cpu Vendor ID:             GenuineIntel    #cpu产商 intel CPU family:            6 Model:                 42 Stepping:              7 CPU MHz:               1600.000 BogoMIPS:              5986.12 Virtualization:        VT-x            #支持cpu虚拟化技术 L1d cache:             32K L1i cache:             32K L2 cache:              256K L3 cache:              6144K 查看/proc/cpuinfo,可以知道每个cpu信息,如每个CPU的型号,主频等。 #cat /proc/cpuinfo processor    : 0 vendor_id    : GenuineIntel cpu family    : 6 model        : 42 model name    : Intel(R) Core(TM) i5-2320 CPU @ 3.00GHz ..... 上面输出的是第一个cpu部分信息,还有3个cpu信息省略了。 内存 概要查看内存情况 free -m              total       used       free     shared    buffers     cached Mem:          3926       3651        274          0         12        404 -/+ buffers/cache:       3235        691 Swap:         9536         31       9505 这里的单位是MB,总共的内存是3926MB。 查看内存详细使用 # cat /proc/meminfo MemTotal:        4020868 kB MemFree:          230884 kB Buffers:            7600 kB Cached:           454772 kB SwapCached:          836 kB ..... 查看内存硬件信息 dmidecode -t memory # dmidecode 2.11 SMBIOS 2.7 present. Handle 0x0008, DMI type 16, 23 bytes Physical Memory Array     Location: System Board Or Motherboard ....     Maximum Capacity: 32 GB .... Handle 0x000A, DMI type 17, 34 bytes .... Memory Device     Array Handle: 0x0008     Error Information Handle: Not Provided     Total Width: 64 bits     Data Width: 64 bits     Size: 4096 MB ..... 磁盘 查看硬

    03

    中小型数据库 RMAN CATALOG 备份恢复方案(一)

    对于数据库的稳定性,高可用,跨平台以及海量数据库的处理,Oracle 数据库通常是大型数据库和大企业的首选。尽管如此,仍然不乏很多中小企业想要品尝一下Oracle腥味,因此在Oracle环境中也有不少中小型数据库。出于成本的考虑,通常有可能就搞个标准版了,跑在Linux上。谁叫Oracle太贵呢?对于中小企业而言,选择合理的才是最好的。对我们这些个搞DB的,贵的一定有贵的道理,我们也可以都进多几斗米。哈哈......典型的打工者的心态哟。言归正传,中小企业的成本限制了我们搞高可用,RAC和DG也就比较少了。最近就碰到这样的情形,就是能否模拟DataGuard来保护数据库。我们知道DataGuard可以实时将数据库从主库切换到备库,或者从备库再切换回主库,实现无缝对接,从而避免由于硬件故障所带来的数据损失。下文即是基于上面的情形来使用rman catalog方式从某种程度上模拟DataGuard来更大程度地保护数据。

    01

    [Oracle]-[SORT AGGREGATE]-count与索引

    Oracle10g: create table t_count as select * from dba_objects; create index t_count_i on t_count(object_id): 分别用: select count(*) from t_count; select count(object_id) from t_count; select count(object_name) from t_count; 查看是否使用索引对count查询性能起到作用。 它们的执行计划: SQL> select count(*) from t_count; Execution Plan ---------------------------------------------------------- Plan hash value: 2197880521 ---------------------------------------------------------------------- | Id  | Operation           | Name    | Rows  | Cost (%CPU)| Time     | ---------------------------------------------------------------------- |   0 | SELECT STATEMENT   |             |           1 |          39   (0)| 00:00:01 | |   1 |  SORT AGGREGATE    |             |           1 |                  |             | |   2 |   TABLE ACCESS FULL| T_COUNT | 12028 |          39   (0)| 00:00:01 | ---------------------------------------------------------------------- Note -----    - dynamic sampling used for this statement SQL> select count(object_name) from t_count;

    02

    linux 将现有分区转换为lvm2分区并扩展放大容量

    此次主要进行了/dev/sdb从默认系统转换到lvm系统模式。期间备份恢复数据,不同磁盘下的不同分区创建pv加入同一vg组,放大lv容量,从vg中删除单个pv,通过实验验证lvm2突破了在lvm1版本时pe size大小限制vg大小的限制,自动挂载lv等。 期间经历重启由于fstab文件忘记修改导致无法开机,后进入单用户救援模式修改/etc/fstab后恢复,经过此番折腾更加深入了解了linux的磁盘文件系统模式。 1、查看现有系统信息。 [root@localhost ~]# df 文件系统 1K-块 已用 可用 已用% 挂载点 /dev/sda2 99190032 4077672 89992368 5% / /dev/sdb1 567161764 246748 537640172 1% /opt /dev/sda1 99098 12238 81743 14% /boot tmpfs 8196244 0 8196244 0% /dev/shm [root@localhost ~]# fdisk /dev/sdb The number of cylinders for this disk is set to 72891. There is nothing wrong with that, but this is larger than 1024, and could in certain setups cause problems with: 1) software that runs at boot time (e.g., old versions of LILO) 2) booting and partitioning software from other OSs (e.g., DOS FDISK, OS/2 FDISK) Command (m for help): p Disk /dev/sdb: 599.5 GB, 599550590976 bytes 255 heads, 63 sectors/track, 72891 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System /dev/sdb1 * 1 72891 585496926 83 Linux 2、备份数据,将原先/opt下的文件复制到新建的mkdir /optbak下,已做备份。 [root@localhost ~]# ll /opt/ 总计 32 drwxr-xr-x 2 root root 4096 01-27 15:20 disk drwx------ 2 root root 16384 01-22 15:40 lost+found drwxr-xr-x 3 root root 4096 01-23 12:54 svn drwxrwxrwx 3 root root 4096 02-02 16:50 svntongbu drwxr-xr-x 5 root root 4096 01-30 14:43 wzcs 执行cp -r /opt /optbak后 [root@localhost ~]# ll /optbak/opt/ 总计 20 drwxr-xr-x 2 root root 4096 02-08 15:48 disk drwx------ 2 root root 4096 02-08 15:48 lost+found drwxr-xr-x 3 root root 4096 02-08 15:48 svn drwxr-xr-x 3 root root 4096 02-08 15:48 svntongbu drwxr-xr-x 5 root root 4096 02-08 15:48 wzcs 3、执行umount /opt 写在文件挂载,这时/opt 目录下的文件已经看不到了,因为它所挂载的硬盘已被从文件系统卸载了。但是/opt目录仍然存在,只是成空文件夹了。 [root@localhost ~]# df -h 文件系统 容量 已用 可用 已用% 挂载点 /dev/sda2 95G 4.0G 86G 5% / /dev/sda1 97M 12M 80M 14% /boot tmpfs 7.9G 0 7.9G 0% /dev/shm 4、现在开始执行将原有磁盘系统转化为lvm,因为服务器原先有两块磁盘sda sdb,sda为系统盘 其中sda3已经设置为了lvm分区,sdb这块磁盘由于我只分了一个区现在我需要把它删了重建。 [root@localhost ~]# fdisk /dev/sdb T

    04
    领券