【大数据开发运维解决方案】kill占用指定端口进程(定时自动重启weblogic脚本)

简介: 上面是总结的定时自动重启weblogic脚本以及如果不慎用root启动weblogic后如何恢复oracle用户的运维。1、通过ps-ef |grep命令找到想要杀死的进程信息,然后配合awk和sed组织好要杀死的进程清单对应的shell语句,并通过sh命令自动执行kill: ps -ef |grep /home/apache-tomcat-7.0.76/|awk 'NR>1 {print $2}' | sed -e "s/^/kill -9 /g" | sh -

一、kill占用指定端口进程(定时自动重启weblogic脚本)

1、通过ps-ef |grep命令找到想要杀死的进程信息,然后配合awk和sed组织好要杀死的进程清单对应的shell语句,并通过sh命令自动执行kill:

  ps -ef |grep /home/apache-tomcat-7.0.76/|awk 'NR>1 {print $2}' | sed -e "s/^/kill -9 /g" | sh -

2、停止weblogic时杀进程可以使用下面命令:

lsof -i:9001|awk 'NR>=2{print "kill -9 "$2}'|sh

根据上面两个案例,可以编写一个定期自动重启weblogic脚本案例,比如每周六重启一次:

 #!/bin/bash
    domain="/home/bea/weblogic/user_projects/domains/base_domain"
    relist_log=$domain/relist.log
    logdate=`date +%Y%m%d`
    bak_nohup_log=$domain/nohup_bk/nohup_${logdate}.out
    echo "========================== $logdate 日weblogic重启日志 ==========================" >> $relist_log
    cd $domain
    #先找到进程并杀掉
    lsof -i:9001|awk 'NR>=2{print "kill -9 "$2}'|sh
    #睡眠3秒
    sleep 3
    #然后统计现在占用9001端口的进程数
    cnt=`lsof -i:9001|wc -l`
    #如果cnt大于0,说明还有进程在占用,这时候不做任何操作,退出。如果等于零,再去启动进程
    if [ $cnt -gt 0 ];then
    echo "进程未杀成功,请检查,当前遗留进程如下:" >>$relist_log
    echo `lsof -i:9001` >>$relist_log
    else
    echo "进程成功杀死,接下来启动进程"  >>$relist_log
    #备份日志文件
    mv nohup.out $bak_nohup_log
    #启动进程,并将nohup信息输出至relist_log,进程启动信息还在nohup.out
    echo `nohup ./startWebLogic.sh >> /home/bea/weblogic/user_projects/domains/base_domain/nohup.out 2>&1 &` >>  $relist_log
    sleep 30
    cnt2=`lsof -i:9001|wc -l`
    if [ $cnt2 -gt 0 ];then
    echo "重启成功,占用端口进程数如下:" >>  $relist_log
    echo `lsof -i:9001|wc -l` -1 >>  $relist_log
    else
    sleep 60
    cnt3=`lsof -i:9001|wc -l`
    if [ $cnt3 -gt 0 ];then
    echo "重启成功,占用端口进程数如下:" >>  $relist_log
    echo `lsof -i:9001|wc -l` >>  $relist_log
    else
    echo "端口重启失败" >>  $relist_log
    fi
    fi
    fi

然后加入crontab定每周天凌晨1点定时重启

0 1  * * 0   /root/reboot.sh

二、如果不慎用root启动weblogic后如何恢复oracle用户的运维

问题现象及分析

问题现象

  • Weblogic启动后,日志卡在下面步骤:
<2023-02-10 16:03:53> <Notice> <Log Management> <BEA-170027> <The server has successfully established a connection with the Domain level Diagnostic Service.>
<2023-02-10 16:03:54> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to ADMIN.>
<2023-02-10 16:03:54> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to RESUMING.>
<2023-02-10 16:03:54> <Notice> <JMX> <BEA-149535> <JMX Resiliency Activity Server=All Servers : Resolving connection list DomainRuntimeServiceMBean>
<2023-02-10 16:03:54> <Warning> <Server> <BEA-002611> <The hostname "localhost", maps to multiple IP addresses: 127.0.0.1, 0:0:0:0:0:0:0:1.>
<2023-02-10 16:03:54> <Notice> <Server> <BEA-002613> <Channel "Default[3]" is now listening on 127.0.0.1:7001 for protocols iiop, t3, ldap, snmp, http.>
<2023-02-10 16:03:54> <Notice> <Server> <BEA-002613> <Channel "Default" is now listening on **********:7001 for protocols iiop, t3, ldap, snmp, http.>
<2023-02-10 16:03:54> <Notice> <Server> <BEA-002613> <Channel "Default[2]" is now listening on 0:0:0:0:0:0:0:1%lo:7001 for protocols iiop, t3, ldap, snmp, http.>
<2023-02-10 16:03:54> <Notice> <Server> <BEA-002613> <Channel "Default[1]" is now listening on **************:7001 for protocols iiop, t3, ldap, snmp, http.>
<2023-02-10 16:03:54> <Notice> <WebLogicServer> <BEA-000329> <Started the WebLogic Server Administration Server "AdminServer" for domain "base_domain" runningin production mode.>
<2023-02-10 16:03:54> <Notice> <Server> <BEA-002613> <Channel "Default[3]" is now listening on 127.0.0.1:7001 for protocols iiop, t3, ldap, snmp, http.>
<2023-02-10 16:03:54> <Notice> <Server> <BEA-002613> <Channel "Default" is now listening on ********:7001 for protocols iiop, t3, ldap, snmp, http.>
<2023-02-10 16:03:54> <Notice> <Server> <BEA-002613> <Channel "Default[2]" is now listening on 0:0:0:0:0:0:0:1%lo:7001 for protocols iiop, t3, ldap, snmp, http.>
<2023-02-10 16:03:54> <Notice> <Server> <BEA-002613> <Channel "Default[1]" is now listening on ************:7001 for protocols iiop, t3, ldap, snmp, http.>
<2023-02-10 16:03:54> <Notice> <WebLogicServer> <BEA-000360> <The server started in RUNNING mode.>
<2023-02-10 16:03:54> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to RUNNING.>

问题分析

同事反馈说用root启动了weblogic,然后再用oracle运维出现上面的问题了。经过分析,weblogic本来一直是而且应该是Oracle用户运维,但是经过我检查weblog已经启动的进程,发现是root用户起来的!!!
也就是说他来回的用oracle&root来回切,切混了,用root起了weblogic然后又用oracle运维了一会的,那咋整?怎么进行恢复???
下面是我记录的恢复过程,供大家参考,毕竟是生产环境,小心为妙:

问题解决

修改tmp和logs目录属主

[root-smartbi-newliwh bin]# cd /oracle/weblogic/user_projects/domains/base_domain/servers/AdminServer
[root-smartbi-newliwh AdminServer]# ll
total 4
drwxr-xr-x. 3 oracle oracle   25 Mar 30  2021 cache
drwxr-xr-x. 6 oracle oracle   58 Mar 30  2021 data
drwxr-xr-x. 3 oracle oracle 4096 Feb 10 12:00 logs
drwxrwxr-x. 2 oracle oracle   29 Mar 30  2021 security
drwxr-xr-x. 5 root   root     82 Feb 10 10:02 tmp

[root-smartbi-newliwh AdminServer]# chown -R oracle:oracle tmp
[root-smartbi-newliwh AdminServer]# cd logs/
[root-smartbi-newliwh logs]# ll
total 1265980
-rw-r--r--. 1 root   root     3057869 Feb 10 15:55 access.log
-rw-r--r--. 1 oracle oracle   5167276 Feb  7 23:59 access.log01303
-rw-r--r--. 1 oracle oracle   5020625 Feb  8 12:00 access.log01304
-rw-r--r--. 1 oracle oracle   5974375 Feb  8 23:59 access.log01305
-rw-r--r--. 1 oracle oracle   5816061 Feb  9 12:00 access.log01306
-rw-r--r--. 1 oracle oracle   3987454 Feb 10 00:00 access.log01307
-rw-r--r--. 1 root   root     4632038 Feb 10 12:00 access.log01308
-rw-r--r--. 1 root   root      619726 Feb 10 15:54 AdminServer.log
-rw-r--r--. 1 oracle oracle   1220805 Feb  8 11:58 AdminServer.log01327
-rw-r--r--. 1 oracle oracle   1400153 Feb  8 23:58 AdminServer.log01328
-rw-r--r--. 1 oracle oracle   7049410 Feb  9 11:58 AdminServer.log01329
-rw-r--r--. 1 oracle oracle   7514330 Feb  9 23:58 AdminServer.log01330
-rw-r--r--. 1 root   root   524288149 Feb 10 09:59 AdminServer.log01331
-rw-r--r--. 1 root   root    96098034 Feb 10 11:58 AdminServer.log01332
-rw-r--r--. 1 root   root      558574 Feb 10 15:49 base_domain.log
-rw-r--r--. 1 oracle oracle   1059795 Feb  8 11:24 base_domain.log01068
-rw-r--r--. 1 oracle oracle   1236267 Feb  8 19:40 base_domain.log01069
-rw-r--r--. 1 oracle oracle   2423907 Feb  9 11:27 base_domain.log01070
-rw-r--r--. 1 oracle oracle   1679914 Feb  9 20:19 base_domain.log01071
-rw-r--r--. 1 root   root   524288258 Feb 10 09:59 base_domain.log01072
-rw-r--r--. 1 root   root    93195017 Feb 10 11:27 base_domain.log01073
drwxr-xr-x. 2 oracle oracle         6 Mar 30  2021 diagnostic_images
[root-smartbi-newliwh logs]#  cd ..
[root-smartbi-newliwh AdminServer]# chown -R oracle:oracle logs

修改ldapfiles

[root-smartbi-newliwh AdminServer]# cd /oracle/weblogic/user_projects/domains/base_domain/servers/AdminServer/data/ldap/ldapfiles
[root-smartbi-newliwh ldapfiles]# ll
total 316
-rw-r--r--. 1 oracle oracle 225769 Feb 10 10:04 EmbeddedLDAP.data
-rw-r--r--. 1 oracle oracle    360 Nov  9  2021 EmbeddedLDAP.delete
-rw-r--r--. 1 oracle oracle   1044 Nov  9  2021 EmbeddedLDAP.index
-rw-r--r--. 1 oracle oracle      0 Feb 10 10:02 EmbeddedLDAP.lok
-rw-r--r--. 1 root   root    76197 Feb 10 10:04 EmbeddedLDAP.tran
-rw-r--r--. 1 oracle oracle      8 Feb 10 10:04 EmbeddedLDAP.trpos
-rw-r--r--. 1 oracle oracle      8 Feb 10 10:04 EmbeddedLDAP.twpos

[root-smartbi-newliwh ldapfiles]# chown -R oracle:oracle EmbeddedLDAP.lok
[root-smartbi-newliwh ldapfiles]# chown -R oracle:oracle EmbeddedLDAP.tran
[root-smartbi-newliwh ldapfiles]# ll
total 316
-rw-r--r--. 1 oracle oracle 225769 Feb 10 10:04 EmbeddedLDAP.data
-rw-r--r--. 1 oracle oracle    360 Nov  9  2021 EmbeddedLDAP.delete
-rw-r--r--. 1 oracle oracle   1044 Nov  9  2021 EmbeddedLDAP.index
-rw-r--r--. 1 oracle oracle      0 Feb 10 10:02 EmbeddedLDAP.lok
-rw-r--r--. 1 oracle oracle  76197 Feb 10 10:04 EmbeddedLDAP.tran
-rw-r--r--. 1 oracle oracle      8 Feb 10 10:04 EmbeddedLDAP.trpos
-rw-r--r--. 1 oracle oracle      8 Feb 10 10:04 EmbeddedLDAP.twpos

修改ldap/log

[root-smartbi-newliwh ldapfiles]#  cd /oracle/weblogic/user_projects/domains/base_domain/servers/AdminServer/data/ldap/log
[root-smartbi-newliwh log]# ll
total 0
-rw-r--r--. 1 root   root   0 Feb 10 00:10 EmbeddedLDAPAccess.log
-rw-r--r--. 1 oracle oracle 0 Feb  9 00:10 EmbeddedLDAPAccess.log.0
-rw-r--r--. 1 oracle oracle 0 Feb  8 00:10 EmbeddedLDAPAccess.log.1
-rw-r--r--. 1 oracle oracle 0 Feb  7 00:10 EmbeddedLDAPAccess.log.2
-rw-r--r--. 1 oracle oracle 0 Feb  6 00:10 EmbeddedLDAPAccess.log.3
-rw-r--r--. 1 oracle oracle 0 Feb  5 00:10 EmbeddedLDAPAccess.log.4
-rw-r--r--. 1 oracle oracle 0 Feb  4 00:10 EmbeddedLDAPAccess.log.5
-rw-r--r--. 1 oracle oracle 0 Feb  3 00:10 EmbeddedLDAPAccess.log.6
-rw-r--r--. 1 root   root   0 Feb 10 00:10 EmbeddedLDAP.log
-rw-r--r--. 1 oracle oracle 0 Feb  9 00:10 EmbeddedLDAP.log.0
-rw-r--r--. 1 oracle oracle 0 Feb  8 00:10 EmbeddedLDAP.log.1
-rw-r--r--. 1 oracle oracle 0 Feb  7 00:10 EmbeddedLDAP.log.2
-rw-r--r--. 1 oracle oracle 0 Feb  6 00:10 EmbeddedLDAP.log.3
-rw-r--r--. 1 oracle oracle 0 Feb  5 00:10 EmbeddedLDAP.log.4
-rw-r--r--. 1 oracle oracle 0 Feb  4 00:10 EmbeddedLDAP.log.5
-rw-r--r--. 1 oracle oracle 0 Feb  3 00:10 EmbeddedLDAP.log.6
[root-smartbi-newliwh log]#  chown  oracle:oracle EmbeddedLDAPAccess.log
[root-smartbi-newliwh log]#  chown  oracle:oracle EmbeddedLDAP.log
[root-smartbi-newliwh log]# ll
total 0
-rw-r--r--. 1 oracle oracle 0 Feb 10 00:10 EmbeddedLDAPAccess.log
-rw-r--r--. 1 oracle oracle 0 Feb  9 00:10 EmbeddedLDAPAccess.log.0
-rw-r--r--. 1 oracle oracle 0 Feb  8 00:10 EmbeddedLDAPAccess.log.1
-rw-r--r--. 1 oracle oracle 0 Feb  7 00:10 EmbeddedLDAPAccess.log.2
-rw-r--r--. 1 oracle oracle 0 Feb  6 00:10 EmbeddedLDAPAccess.log.3
-rw-r--r--. 1 oracle oracle 0 Feb  5 00:10 EmbeddedLDAPAccess.log.4
-rw-r--r--. 1 oracle oracle 0 Feb  4 00:10 EmbeddedLDAPAccess.log.5
-rw-r--r--. 1 oracle oracle 0 Feb  3 00:10 EmbeddedLDAPAccess.log.6
-rw-r--r--. 1 oracle oracle 0 Feb 10 00:10 EmbeddedLDAP.log
-rw-r--r--. 1 oracle oracle 0 Feb  9 00:10 EmbeddedLDAP.log.0
-rw-r--r--. 1 oracle oracle 0 Feb  8 00:10 EmbeddedLDAP.log.1
-rw-r--r--. 1 oracle oracle 0 Feb  7 00:10 EmbeddedLDAP.log.2
-rw-r--r--. 1 oracle oracle 0 Feb  6 00:10 EmbeddedLDAP.log.3
-rw-r--r--. 1 oracle oracle 0 Feb  5 00:10 EmbeddedLDAP.log.4
-rw-r--r--. 1 oracle oracle 0 Feb  4 00:10 EmbeddedLDAP.log.5
-rw-r--r--. 1 oracle oracle 0 Feb  3 00:10 EmbeddedLDAP.log.6

修改dynamicLibraryPath_temp/smartbiDynamicLib

cd /oracle/weblogic/user_projects/domains/base_domain/SmartBI/dynamicLibraryPath_temp/smartbiDynamicLib
chown -R oracle:oracle smartbiDynamicLib/

修改exts-smartbi及smartbi.log*

[root-smartbi-newliwh smartbiDynamicLib]# cd /oracle/weblogic/user_projects/domains/base_domain
[root-smartbi-newliwh base_domain]# ll
total 33095908
drwxr-x---.  2 oracle oracle          24 Dec 21  2017 autodeploy
drwxr-x---.  2 oracle oracle          31 Feb  3  2021 backup_config
drwxr-x---.  7 oracle oracle        4096 Feb 10 15:28 bin
drwxr-xr-x.  3 oracle oracle          16 Dec 21  2017 common
drwxr-x---.  9 oracle oracle         173 Feb 10 16:03 config
drwxr-xr-x.  2 oracle oracle          37 Feb  6 10:36 connpool-smartbi
drwxr-x---.  2 oracle oracle          24 Dec 21  2017 console-ext
-rw-r--r--.  1 oracle oracle         279 Dec 21  2017 derby.log
-rw-r--r--.  1 oracle oracle          84 Dec 21  2017 derbyShutdown.log
drwxr-xr-x.  4 oracle oracle          47 Sep  6  2021 dynamicLibraryPath
drwxrwxr-x.  2 oracle oracle           6 Apr 19  2021 dynamicLibraryPath1
-rw-r--r--.  1 oracle oracle         145 Feb 10 16:03 edit.lok
drwxr-xr-x. 33 root   root          4096 Feb 10 10:04 exts-smartbi
drwxr-xr-x. 24 oracle oracle        4096 Apr  9  2021 exts-smartbi2
-rw-r-----.  1 oracle oracle         327 Jul 19  2017 fileRealm.properties
drwxr-xr-x.  2 oracle oracle       12288 Jul  2  2021 Font-smartbi
drwxr-xr-x.  3 oracle oracle        4096 Feb 10 13:59 Index-smartbi
drwxr-x---.  3 oracle oracle        4096 Feb  3  2021 init-info
-rw-------.  1 oracle oracle 33793779559 Jan 11 09:26 java_pid52762.hprof
drwxr-x---.  2 oracle oracle          88 Sep  6  2018 lib
-rw-r--r--.  1 oracle oracle     3997271 Feb 10 10:04 MaskRule.log
drwxr-xr-x.  7 oracle oracle          81 Sep 27  2021 mlogs-smartbi
drwxr-x---.  2 oracle oracle          63 Dec 21  2017 nodemanager
drwxr-xr-x.  3 oracle oracle          22 Dec 21  2017 orchestration
drwxr-xr-x.  2 oracle oracle           6 Jan 23  2018 original
drwxr-xr-x.  2 oracle oracle           6 Jan 23  2018 pending
drwxr-x---.  2 oracle oracle           6 Jul 19  2017 resources
drwxr-x---.  2 oracle oracle         167 Mar 30  2021 security
drwxrwxr-x.  3 oracle oracle          25 Mar 30  2021 servers
-rw-r-----.  1 oracle oracle         236 Mar 30  2021 shutdown-AdminServer.py
drwxr-xr-x. 11 oracle oracle        4096 Feb 10 09:35 SmartBI
drwxr-xr-x.  4 oracle oracle         160 Mar 30  2021 SmartBI.bak
-rw-rw-r--.  1 oracle oracle        3519 Dec 20  2021 smartbi-config.xml
drwxr-xr-x.  2 oracle oracle        4096 Mar  3  2022 smartbi_extBackup
drwxr-xr-x.  2 oracle oracle           6 Feb 10 10:04 smartbi-ExtractData
-rw-r--r--.  1 oracle oracle       32534 Mar 31  2021 Smartbi-License.0331.xml
lrwxrwxrwx.  1 oracle oracle          78 Sep  6  2021 Smartbi-License.xml -> /oracle/weblogic/user_projects/domains/base_domain/SmartBI/Smartbi-License.xml
-rw-rw-r--.  1 oracle oracle       31368 Aug 30  2021 Smartbi-License.xml.bak
-rw-r--r--.  1 root   root      10108334 Feb 10 15:50 smartbi.log
-rw-r--r--.  1 root   root      10485851 Feb 10 09:58 smartbi.log.1
-rw-r--r--.  1 root   root      10485868 Feb 10 09:59 smartbi.log.2
-rw-r--r--.  1 root   root      10485849 Feb 10 09:59 smartbi.log.3
-rw-r--r--.  1 root   root      10485851 Feb 10 10:00 smartbi.log.4
-rw-r--r--.  1 root   root      10485798 Feb 10 10:01 smartbi.log.5
lrwxrwxrwx.  1 oracle oracle          77 Feb  3  2021 smartbi.properties -> /oracle/weblogic/user_projects/domains/base_domain/SmartBI/smartbi.properties
drwxr-xr-x.  2 oracle oracle        4096 Mar  3  2022 smartbi_repoBackup
drwxr-xr-x.  2 oracle oracle        4096 Feb 10 05:00 SmartBI_repoBackup
-rw-r--r--.  1 oracle oracle       51104 Aug 24 10:59 Smartbi-security.patches
drwxr-xr-x.  2 oracle oracle        4096 Mar  3  2022 smartbi_warBackup
-rw-r--r--.  1 oracle oracle    10500466 Sep 28  2021 smartbix.1.log
-rw-r--r--.  1 oracle oracle    10497773 Nov 10  2021 smartbix.2.log
-rw-r--r--.  1 oracle oracle     8640504 Aug 19 14:19 smartbix.log
-rwxr-x---.  1 oracle oracle         266 Dec 21  2017 startWebLogic.sh
drwxr-xr-x.  2 oracle oracle          35 Jun  5  2019 tmp
-rw-r--r--.  1 oracle oracle        2540 Feb 10 10:03 tmp_ehcache.xml
[root-smartbi-newliwh base_domain]# chown -R oracle:oracle exts-smartbi
[root-smartbi-newliwh base_domain]# chown oracle:oracle smartbi.log
[root-smartbi-newliwh base_domain]# chown oracle:oracle smartbi.log.1
[root-smartbi-newliwh base_domain]# chown oracle:oracle smartbi.log.2
[root-smartbi-newliwh base_domain]# chown oracle:oracle smartbi.log.3
[root-smartbi-newliwh base_domain]# chown oracle:oracle smartbi.log.4
[root-smartbi-newliwh base_domain]# chown oracle:oracle smartbi.log.5
[root-smartbi-newliwh base_domain]# ll
total 33095904
drwxr-x---.  2 oracle oracle          24 Dec 21  2017 autodeploy
drwxr-x---.  2 oracle oracle          31 Feb  3  2021 backup_config
drwxr-x---.  7 oracle oracle        4096 Feb 10 15:28 bin
drwxr-xr-x.  3 oracle oracle          16 Dec 21  2017 common
drwxr-x---.  9 oracle oracle         173 Feb 10 16:06 config
drwxr-xr-x.  2 oracle oracle          37 Feb  6 10:36 connpool-smartbi
drwxr-x---.  2 oracle oracle          24 Dec 21  2017 console-ext
-rw-r--r--.  1 oracle oracle         279 Dec 21  2017 derby.log
-rw-r--r--.  1 oracle oracle          84 Dec 21  2017 derbyShutdown.log
drwxr-xr-x.  4 oracle oracle          47 Sep  6  2021 dynamicLibraryPath
drwxrwxr-x.  2 oracle oracle           6 Apr 19  2021 dynamicLibraryPath1
-rw-r--r--.  1 oracle oracle         145 Feb 10 16:06 edit.lok
drwxr-xr-x. 24 oracle oracle        4096 Apr  9  2021 exts-smartbi2
-rw-r-----.  1 oracle oracle         327 Jul 19  2017 fileRealm.properties
drwxr-xr-x.  2 oracle oracle       12288 Jul  2  2021 Font-smartbi
drwxr-xr-x.  3 oracle oracle        4096 Feb 10 13:59 Index-smartbi
drwxr-x---.  3 oracle oracle        4096 Feb  3  2021 init-info
-rw-------.  1 oracle oracle 33793779559 Jan 11 09:26 java_pid52762.hprof
drwxr-x---.  2 oracle oracle          88 Sep  6  2018 lib
-rw-r--r--.  1 oracle oracle     3997271 Feb 10 10:04 MaskRule.log
drwxr-xr-x.  7 oracle oracle          81 Sep 27  2021 mlogs-smartbi
drwxr-x---.  2 oracle oracle          63 Dec 21  2017 nodemanager
drwxr-xr-x.  3 oracle oracle          22 Dec 21  2017 orchestration
drwxr-xr-x.  2 oracle oracle           6 Jan 23  2018 original
drwxr-xr-x.  2 oracle oracle           6 Jan 23  2018 pending
drwxr-x---.  2 oracle oracle           6 Jul 19  2017 resources
drwxr-x---.  2 oracle oracle         167 Mar 30  2021 security
drwxrwxr-x.  3 oracle oracle          25 Mar 30  2021 servers
-rw-r-----.  1 oracle oracle         236 Mar 30  2021 shutdown-AdminServer.py
drwxr-xr-x. 11 oracle oracle        4096 Feb 10 09:35 SmartBI
drwxr-xr-x.  4 oracle oracle         160 Mar 30  2021 SmartBI.bak
-rw-rw-r--.  1 oracle oracle        3519 Dec 20  2021 smartbi-config.xml
drwxr-xr-x.  2 oracle oracle        4096 Mar  3  2022 smartbi_extBackup
drwxr-xr-x.  2 oracle oracle           6 Feb 10 10:04 smartbi-ExtractData
-rw-r--r--.  1 oracle oracle       32534 Mar 31  2021 Smartbi-License.0331.xml
lrwxrwxrwx.  1 oracle oracle          78 Sep  6  2021 Smartbi-License.xml -> /oracle/weblogic/user_projects/domains/base_domain/SmartBI/Smartbi-License.xml
-rw-rw-r--.  1 oracle oracle       31368 Aug 30  2021 Smartbi-License.xml.bak
-rw-r--r--.  1 oracle oracle    10108334 Feb 10 15:50 smartbi.log
-rw-r--r--.  1 oracle oracle    10485851 Feb 10 09:58 smartbi.log.1
-rw-r--r--.  1 oracle oracle    10485868 Feb 10 09:59 smartbi.log.2
-rw-r--r--.  1 oracle oracle    10485849 Feb 10 09:59 smartbi.log.3
-rw-r--r--.  1 oracle oracle    10485851 Feb 10 10:00 smartbi.log.4
-rw-r--r--.  1 oracle oracle    10485798 Feb 10 10:01 smartbi.log.5
lrwxrwxrwx.  1 oracle oracle          77 Feb  3  2021 smartbi.properties -> /oracle/weblogic/user_projects/domains/base_domain/SmartBI/smartbi.properties
drwxr-xr-x.  2 oracle oracle        4096 Mar  3  2022 smartbi_repoBackup
drwxr-xr-x.  2 oracle oracle        4096 Feb 10 05:00 SmartBI_repoBackup
-rw-r--r--.  1 oracle oracle       51104 Aug 24 10:59 Smartbi-security.patches
drwxr-xr-x.  2 oracle oracle        4096 Mar  3  2022 smartbi_warBackup
-rw-r--r--.  1 oracle oracle    10500466 Sep 28  2021 smartbix.1.log
-rw-r--r--.  1 oracle oracle    10497773 Nov 10  2021 smartbix.2.log
-rw-r--r--.  1 oracle oracle     8640504 Aug 19 14:19 smartbix.log
-rwxr-x---.  1 oracle oracle         266 Dec 21  2017 startWebLogic.sh
drwxr-xr-x.  2 oracle oracle          35 Jun  5  2019 tmp
-rw-r--r--.  1 oracle oracle        2540 Feb 10 10:03 tmp_ehcache.xml

[root-smartbi-newliwh base_domain]# cd /oracle/weblogic/user_projects/domains/base_domain/mlogs-smartbi/sql/
[root-smartbi-newliwh sql]# ll
total 88
-rw-r--r--. 1 root root 87982 Feb 10 15:12 sqls.log
[root-smartbi-newliwh sql]# chown oracle:oracle sqls.log
[root-smartbi-newliwh sql]# ll
total 88
-rw-r--r--. 1 oracle oracle 87982 Feb 10 15:12 sqls.log

修改完成后,重启weblogic,成功启动!!!


总结

上面是总结的定时自动重启weblogic脚本以及如果不慎用root启动weblogic后如何恢复oracle用户的运维。

相关实践学习
基于MaxCompute的热门话题分析
Apsara Clouder大数据专项技能认证配套课程:基于MaxCompute的热门话题分析
相关文章
|
6月前
|
存储 人工智能 运维
别再靠脚本“救火”了!让智能数据治理接管你的运维世界
别再靠脚本“救火”了!让智能数据治理接管你的运维世界
351 14
|
9月前
|
机器学习/深度学习 消息中间件 人工智能
别只会写脚本了!看看机器学习是怎么帮运维“摸鱼”的
别只会写脚本了!看看机器学习是怎么帮运维“摸鱼”的
236 13
|
弹性计算 运维 监控
基于进程热点分析与系统资源优化的智能运维实践
智能服务器管理平台提供直观的可视化界面,助力高效操作系统管理。核心功能包括运维监控、智能助手和扩展插件管理,支持系统健康监控、故障诊断等,确保集群稳定运行。首次使用需激活服务并安装管控组件。平台还提供进程热点追踪、性能观测与优化建议,帮助开发人员快速识别和解决性能瓶颈。定期分析和多维度监控可提前预警潜在问题,保障系统长期稳定运行。
568 17
|
JavaScript 前端开发 Java
Idea启动SpringBoot程序报错:Veb server failed to start. Port 8082 was already in use;端口冲突的原理与解决方案
本文解决了Idea启动SpringBoot程序报错:Veb server failed to start. Port 8082 was already in use的问题,并通过介绍端口的使用原理和操作系统的端口管理机制,可以更有效地解决端口冲突问题,并确保Web服务器能够顺利启动和运行。 只有锻炼思维才能可持续地解决问题,只有思维才是真正值得学习和分享的核心要素。如果这篇博客能给您带来一点帮助,麻烦您点个赞支持一下,还可以收藏起来以备不时之需,有疑问和错误欢迎在评论区指出~
|
运维 自然语言处理 算法
云栖实录 | 大模型在大数据智能运维的应用实践
云栖实录 | 大模型在大数据智能运维的应用实践
1509 3
|
网络协议 Java Shell
java spring 项目若依框架启动失败,启动不了服务提示端口8080占用escription: Web server failed to start. Port 8080 was already in use. Action: Identify and stop the process that’s listening on port 8080 or configure this application to listen on another port-优雅草卓伊凡解决方案
java spring 项目若依框架启动失败,启动不了服务提示端口8080占用escription: Web server failed to start. Port 8080 was already in use. Action: Identify and stop the process that’s listening on port 8080 or configure this application to listen on another port-优雅草卓伊凡解决方案
1001 7
|
机器学习/深度学习 人工智能 运维
智能化运维:AI与大数据在IT运维中的应用探索####
本文旨在探讨人工智能(AI)与大数据分析技术如何革新传统IT运维模式,提升运维效率与服务质量。通过具体案例分析,揭示AI算法在故障预测、异常检测及自动化修复等方面的实际应用成效,同时阐述大数据如何助力实现精准运维管理,降低运营成本,提升用户体验。文章还将简要讨论实施智能化运维面临的挑战与未来发展趋势,为IT管理者提供决策参考。 ####
|
运维 监控 Ubuntu
【运维】如何在Ubuntu中设置一个内存守护进程来确保内存不会溢出
通过设置内存守护进程,可以有效监控和管理系统内存使用情况,防止内存溢出带来的系统崩溃和服务中断。本文介绍了如何在Ubuntu中编写和配置内存守护脚本,并将其设置为systemd服务。通过这种方式,可以在内存使用超过设定阈值时自动采取措施,确保系统稳定运行。
629 4
|
运维 Kubernetes Devops
自动化运维:从脚本到工具的演进之旅
在数字化浪潮中,自动化运维成为提升效率、保障系统稳定的关键。本文将探索自动化运维的发展脉络,从基础的Shell脚本编写到复杂的自动化工具应用,揭示这一技术变革如何重塑IT运维领域。我们将通过实际案例,展示自动化运维在简化工作流程、提高响应速度和降低人为错误中的重要作用。无论你是初学者还是资深专家,这篇文章都将为你提供宝贵的洞见和实用的技巧。

热门文章

最新文章