SuperBlock损坏修复

 

fsck -t ext4 /dev/sda1

说明:superblock损坏导致无法mount硬盘,可以使用以上命令自动恢复

1、fdisk -l                            确定是哪块硬盘

2、parted /dev/sda           确定文件系统是ext2 ext3 还是ext4

3、fsck -t ext4 /dev/sda1 这里文件系统是ext4,磁盘是sda1

 

【苏州IT外包经验】ping不通的情况下,如何扫描端口

Ping不通对方的主机能扫描到他的端口吗?答案是肯定的

1、现象:某个IP被网关禁ping了,但想知道它开了哪些端口

2、准备工具:nmap

3、命令格式:nmap X.X.X.X -Pn1-65535

        1-65535是指定端口范围

4、测试结果如图

使用“alter system register;”解决动态监听注册缓慢问题

感受一下Oracle数据库实例的动态监听注册细节。有如下这样一个规律,先总结在这里:
①如果是先启动监听,后启动数据库实例,则动态监听会自动识别到启动的数据库实例;
②在数据库实例正常运行的情况下重启监听,则数据库实例会等很长时间才能在动态监听中注册成功,大约需要1分钟的等待时间;
③如果是先启动数据库实例,后启动监听,效果和②一样;
④如果不希望长时间等待动态监听注册的过程,可以使用“alter system register;”命令加速。

真实的体验一下这个过程。切身体验之后这些结论将显得那样的自然和纯真。

1.第①种场景模拟
1)在数据库实例未启动时启动监听程序
ora11g@secdb /home/oracle$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on Tue Jan 18 20:47:22 2011

Copyright (c) 1982, 2009, Oracle.  All rights reserved.

Connected to an idle instance.

NotConnected@> !lsnrctl status

LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 18-JAN-2011 20:48:58

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

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 11.2.0.1.0 - Production
Start Date                29-DEC-2010 02:03:55
Uptime                    20 days 18 hr. 45 min. 3 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /oracle/ora11gR2/product/11.2.0/dbhome_1/network/admin/listener.ora
Listener Log File         /oracle/ora11gR2/diag/tnslsnr/secdb/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=secdb)(PORT=1521)))
The listener supports no services
The command completed successfully

因为数据库实例没有启动,监听理所当然地处于未检测到任何实例的状态。

2)启动数据库实例
NotConnected@> startup;
ORACLE instance started.

Total System Global Area  535662592 bytes
Fixed Size                  1337720 bytes
Variable Size             411043464 bytes
Database Buffers          117440512 bytes
Redo Buffers                5840896 bytes
Database mounted.
Database opened.

3)随即查看监听状态
sys@ora11g> !lsnrctl status

LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 18-JAN-2011 20:49:15

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

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 11.2.0.1.0 - Production
Start Date                29-DEC-2010 02:03:55
Uptime                    20 days 18 hr. 45 min. 20 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /oracle/ora11gR2/product/11.2.0/dbhome_1/network/admin/listener.ora
Listener Log File         /oracle/ora11gR2/diag/tnslsnr/secdb/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=secdb)(PORT=1521)))
Services Summary...
Service "ora11g" has 1 instance(s).
  Instance "ora11g", status READY, has 1 handler(s) for this service...
The command completed successfully

第①种场景结论得到印证:
①如果是先启动监听,后启动数据库实例,则动态监听会自动识别到启动的数据库实例;

2.第②种场景模拟
1)手工停启监听程序
sys@ora11g> !lsnrctl stop

LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 18-JAN-2011 20:52:55

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

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
The command completed successfully

sys@ora11g> !lsnrctl start

LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 18-JAN-2011 20:53:03

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

Starting /oracle/ora11gR2/product/11.2.0/dbhome_1/bin/tnslsnr: please wait...

TNSLSNR for Linux: Version 11.2.0.1.0 - Production
System parameter file is /oracle/ora11gR2/product/11.2.0/dbhome_1/network/admin/listener.ora
Log messages written to /oracle/ora11gR2/diag/tnslsnr/secdb/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=secdb)(PORT=1521)))

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 11.2.0.1.0 - Production
Start Date                18-JAN-2011 20:53:03
Uptime                    0 days 0 hr. 0 min. 0 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /oracle/ora11gR2/product/11.2.0/dbhome_1/network/admin/listener.ora
Listener Log File         /oracle/ora11gR2/diag/tnslsnr/secdb/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=secdb)(PORT=1521)))
The listener supports no services
The command completed successfully

2)每隔一秒检查一下监听的状态
sys@ora11g> !lsnrctl status

LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 18-JAN-2011 20:53:11

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

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 11.2.0.1.0 - Production
Start Date                18-JAN-2011 20:53:03
Uptime                    0 days 0 hr. 0 min. 7 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /oracle/ora11gR2/product/11.2.0/dbhome_1/network/admin/listener.ora
Listener Log File         /oracle/ora11gR2/diag/tnslsnr/secdb/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=secdb)(PORT=1521)))
The listener supports no services
The command completed successfully

……省略部分状态检查信息……

sys@ora11g> !lsnrctl status

LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 18-JAN-2011 20:53:14

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

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 11.2.0.1.0 - Production
Start Date                18-JAN-2011 20:53:03
Uptime                    0 days 0 hr. 0 min. 11 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /oracle/ora11gR2/product/11.2.0/dbhome_1/network/admin/listener.ora
Listener Log File         /oracle/ora11gR2/diag/tnslsnr/secdb/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=secdb)(PORT=1521)))
The listener supports no services
The command completed successfully

……省略部分状态检查信息……

sys@ora11g> !lsnrctl status

LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 18-JAN-2011 20:53:22

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

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 11.2.0.1.0 - Production
Start Date                18-JAN-2011 20:53:03
Uptime                    0 days 0 hr. 0 min. 18 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /oracle/ora11gR2/product/11.2.0/dbhome_1/network/admin/listener.ora
Listener Log File         /oracle/ora11gR2/diag/tnslsnr/secdb/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=secdb)(PORT=1521)))
The listener supports no services
The command completed successfully

……省略部分状态检查信息……

sys@ora11g> !lsnrctl status

LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 18-JAN-2011 20:53:58

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

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 11.2.0.1.0 - Production
Start Date                18-JAN-2011 20:53:03
Uptime                    0 days 0 hr. 0 min. 55 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /oracle/ora11gR2/product/11.2.0/dbhome_1/network/admin/listener.ora
Listener Log File         /oracle/ora11gR2/diag/tnslsnr/secdb/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=secdb)(PORT=1521)))
The listener supports no services
The command completed successfully

可见,直到20:53:58时数据库实例仍然没有注册到监听中,此时距离启动监听的时候20:53:03已经过去55秒。

最后是在20:53:59成功完成注册。
sys@ora11g> !lsnrctl status

LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 18-JAN-2011 20:53:59

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

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 11.2.0.1.0 - Production
Start Date                18-JAN-2011 20:53:03
Uptime                    0 days 0 hr. 0 min. 56 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /oracle/ora11gR2/product/11.2.0/dbhome_1/network/admin/listener.ora
Listener Log File         /oracle/ora11gR2/diag/tnslsnr/secdb/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=secdb)(PORT=1521)))
Services Summary...
Service "ora11g" has 1 instance(s).
  Instance "ora11g", status READY, has 1 handler(s) for this service...
The command completed successfully

距离启动监听时间56秒,大约用了1分钟的时间才完成数据库实例到监听的动态注册。

第②种场景结论得到印证:
②如果是先启动数据库实例,后启动监听,则数据库实例会等很长时间才能在动态监听中注册成功,大约需要1分钟的等待时间;

3.第③种场景和第②种场景式样的,不赘述。

4.第④种场景模拟
模拟这个场景比较简单,只需要连续执行如下这几条命令即可。
!lsnrctl stop
!lsnrctl start
!lsnrctl status
alter system register;
!lsnrctl status

以下是连续执行后的结果。

1)停止监听程序
sys@ora11g> !lsnrctl stop

LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 18-JAN-2011 21:30:40

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

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
The command completed successfully

2)启动监听程序
sys@ora11g> !lsnrctl start

LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 18-JAN-2011 21:30:44

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

Starting /oracle/ora11gR2/product/11.2.0/dbhome_1/bin/tnslsnr: please wait...

TNSLSNR for Linux: Version 11.2.0.1.0 - Production
System parameter file is /oracle/ora11gR2/product/11.2.0/dbhome_1/network/admin/listener.ora
Log messages written to /oracle/ora11gR2/diag/tnslsnr/secdb/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=secdb)(PORT=1521)))

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 11.2.0.1.0 - Production
Start Date                18-JAN-2011 21:30:44
Uptime                    0 days 0 hr. 0 min. 0 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /oracle/ora11gR2/product/11.2.0/dbhome_1/network/admin/listener.ora
Listener Log File         /oracle/ora11gR2/diag/tnslsnr/secdb/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=secdb)(PORT=1521)))
The listener supports no services
The command completed successfully

3)查看监听状态
sys@ora11g> !lsnrctl status

LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 18-JAN-2011 21:30:44

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

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 11.2.0.1.0 - Production
Start Date                18-JAN-2011 21:30:44
Uptime                    0 days 0 hr. 0 min. 0 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /oracle/ora11gR2/product/11.2.0/dbhome_1/network/admin/listener.ora
Listener Log File         /oracle/ora11gR2/diag/tnslsnr/secdb/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=secdb)(PORT=1521)))
The listener supports no services
The command completed successfully

此时,监听未检测到数据库实例信息。

4)手工强制将数据库实例注册到监听
sys@ora11g> alter system register;

System altered.

5)最后确认监听状态
sys@ora11g> !lsnrctl status

LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 18-JAN-2011 21:30:44

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

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 11.2.0.1.0 - Production
Start Date                18-JAN-2011 21:30:44
Uptime                    0 days 0 hr. 0 min. 0 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /oracle/ora11gR2/product/11.2.0/dbhome_1/network/admin/listener.ora
Listener Log File         /oracle/ora11gR2/diag/tnslsnr/secdb/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=secdb)(PORT=1521)))
Services Summary...
Service "ora11g" has 1 instance(s).
  Instance "ora11g", status READY, has 1 handler(s) for this service...
The command completed successfully

通过手工注册数据库实例的方法,立杆见影,实例旋即注册到了监听程序中。

第④种场景结论得到印证:
④如果不希望长时间等待动态监听注册的过程,可以使用“alter system register;”命令加速。

5.小结
如果您能将这个过程“躬亲”一下,也许会有这种很美妙的感觉:一切都是那样的自然而和谐。

再次将有关动态监听的结论附在这里:
①如果是先启动监听,后启动数据库实例,则动态监听会自动识别到启动的数据库实例;
②在数据库实例正常运行的情况下重启监听,则实例会等很长时间才能在动态监听中注册成功,大约需要1分钟的等待时间;
③如果是先启动数据库实例,后启动监听,效果和②一样;
④如果不希望长时间等待动态监听注册的过程,可以使用“alter system register;”命令加速。

【苏州IT外包经验】Ubuntu 17.10系统下配置PHP+Apache+Mysql

本文为Ubuntu 17.10系统下配置PHP7.1+Apache2.4+Mysql5.7

一、Apache2

    安装apache

    sudo apt-get apache2

 
    编辑apache主配置文件/etc/apache2/apache2.conf,修改KeepAlive设置

    KeepAlive Off

     Apache默认的multi-processing模块(MPM ) 是一个event 模块,但是 php默认是使用 prefork模块,禁用event模块,启用prefork模块

    sudo a2dismod mpm_event
    sudo a2enmod mpm_prefork

    重启Apache

    sudo service apache2 restart


    如果在重启Apache时,看见关于ServerName的报错,可以做如下修改
        编辑apache主配置文件/etc/apache2/apache2.conf
        添加一行ServerName localhost
        然后执行sudo service apache2 restart

二、Mysql5.7

    sudo apt-get install mysql-server mysql-client
    # 在安装过程中要输入root的密码

    安装完成后,执行mysql_secure_installation,根据提示完成安全设置

三、PHP7.0

    sudo apt-get install php7.0

四、LAMP

    整合PHP和MySQL
    
    sudo apt-get install php-gd php-mysql

    整合PHP和Apache

    sudo apt-get install libapache2-mod-php7.0
    sudo service apache2 restart


五、验证环境

    显示PHP的版本信息

    php -v

    Apache默认的网站根目录位于/var/www/html/,进入这个目录,并创建info.php

    sudo nano /var/www/html info.php

        <?php
            phpinfo();
        ?>

 在浏览器中输入http://localhost/info.php进行验证

【苏州IT外包经验】VMware Workstation pro 14 for Linux not usable with all the kernel 4.13-rc's

Ubuntu升级到17.10后,VMware workstation不能打开虚拟机,提示“The virtual machine is unable to reserve memory. If selecting Retry does not work, try powering off or suspending any other virtual machines first”

一、环境:

物理机:Ubuntu 17.10+VMware workstation Pro 14或12.5

虚拟机:Windows 10、Windows 7、macOS 12

二、解决方法如下 :

1、进入你的个人文件夹或你有修改权限的文件夹

cd ~

2、备份原vmmon.tar文件,胆子大的可忽略此步
cp /usr/lib/vmware/modules/source/vmmon.tar .                   //最后有个点,别忘了

3、提取压缩包
tar xf vmmon.tar

4、下载新的vmmon包

VMware workstation pro 14下载地址:

wget -O ./vmmon-only/linux/hostif.c https://raw.githubusercontent.com/mkubecek/vmware-host-modules/fadedd9c8a4dd23f74da2b448572df95666dfe12/vmmon-only/linux/hostif.c

本地下载

VMware workstation pro 12.5下载地址:

wget -O ./vmmon-only/linux/hostif.c https://raw.githubusercontent.com/mkubecek/vmware-host-modules/b50848c985f1a6c0a341187346d77f0119d0a835/vmmon-only/linux/hostif.c

本地下载

5、将新修改的文件包装成一个压缩包替换原始文件
sudo tar cf /usr/lib/vmware/modules/source/vmmon.tar vmmon-only

6、重新编译vmware内核模块
sudo vmware-modconfig --console --install-all

7、重启物理机
sudo reboot

订阅我们的电子报刊,掌握最新资讯

博文天下

Prev Next
关于柯瑞德信息系统有限公司

关于柯瑞德信息系统有限公司

将您企业中的IT部门的职能全部或部分外包,集中精力发展您企业的核心业务!           苏州柯瑞德信息系统有限公司是一家...

公司简介

苏州柯瑞德信息系统是一家优秀的专注于为中小型企业提供信息系统集成服务的企业。我们的IT工程师都具备国际认证的微软、思科等专家证书,我们以专业的服务、合...

弱电工程简介

综合布线 智能家居 程控数字电话 闭路监控 防盗报警 智能一卡通 背景音乐及公共广播

快速联系我们






智能家居

Prev Next
电子围栏与红外对射的区别

电子围栏与红外对射的区别

        随着我国经济建设的发展,周界安全防范工作正日益引起重视,电子围栏的出现彻底改变了人们对安全防护工作理念的认识。   我国周界安全...

智能一卡通管理系统

智能一卡通管理系统

  智能一卡通管理系统(Smart Manager) ,即一卡通行解决方案,本系统集合门禁、考勤、消费、停车场、电梯、巡更、电子地图、管理中...

什么是门禁 ? 当前常见门禁系统的种类有哪些?各有什么优缺点?

什么是门禁 ? 当前常见门禁系统的种类有哪些?各有什么优缺点…

门禁 , 又称出入管理控制系统 通道管理系统. 是一种管理人员进出的数字化智能管理系统 .原始的门禁系统概念其实早就在我们生活 中。例如:我们家家...

在线状态

目前有 22 游客 和 0个会员 在线