【大数据开发运维解决方案】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的热门话题分析
本实验围绕社交用户发布的文章做了详尽的分析,通过分析能得到用户群体年龄分布,性别分布,地理位置分布,以及热门话题的热度。
SaaS 模式云数据仓库必修课
本课程由阿里云开发者社区和阿里云大数据团队共同出品,是SaaS模式云原生数据仓库领导者MaxCompute核心课程。本课程由阿里云资深产品和技术专家们从概念到方法,从场景到实践,体系化的将阿里巴巴飞天大数据平台10多年的经过验证的方法与实践深入浅出的讲给开发者们。帮助大数据开发者快速了解并掌握SaaS模式的云原生的数据仓库,助力开发者学习了解先进的技术栈,并能在实际业务中敏捷的进行大数据分析,赋能企业业务。 通过本课程可以了解SaaS模式云原生数据仓库领导者MaxCompute核心功能及典型适用场景,可应用MaxCompute实现数仓搭建,快速进行大数据分析。适合大数据工程师、大数据分析师 大量数据需要处理、存储和管理,需要搭建数据仓库?学它! 没有足够人员和经验来运维大数据平台,不想自建IDC买机器,需要免运维的大数据平台?会SQL就等于会大数据?学它! 想知道大数据用得对不对,想用更少的钱得到持续演进的数仓能力?获得极致弹性的计算资源和更好的性能,以及持续保护数据安全的生产环境?学它! 想要获得灵活的分析能力,快速洞察数据规律特征?想要兼得数据湖的灵活性与数据仓库的成长性?学它! 出品人:阿里云大数据产品及研发团队专家 产品 MaxCompute 官网 https://www.aliyun.com/product/odps&nbsp;
相关文章
|
6天前
|
监控 Shell
在Shell中自动重启进程
在Shell中自动重启进程
169 1
|
6天前
|
存储 物联网 大数据
助力工业物联网,工业大数据之脚本开发【五】
助力工业物联网,工业大数据之脚本开发【五】
42 0
|
8月前
|
分布式计算 安全 Hadoop
HBase启动时有进程webUI不显示HRegionServer各种情况解决方案
HBase启动时有进程webUI不显示HRegionServer各种情况解决方案
243 0
|
6天前
|
分布式计算 DataWorks 大数据
MaxCompute产品使用合集之大数据计算MaxCompute如何实现通过离线同步脚本模式
MaxCompute作为一款全面的大数据处理平台,广泛应用于各类大数据分析、数据挖掘、BI及机器学习场景。掌握其核心功能、熟练操作流程、遵循最佳实践,可以帮助用户高效、安全地管理和利用海量数据。以下是一个关于MaxCompute产品使用的合集,涵盖了其核心功能、应用场景、操作流程以及最佳实践等内容。
|
6天前
|
SQL 分布式计算 大数据
MaxCompute产品使用合集之数据倾斜导致JOB运行时间过长导致系统会自动kill掉job,如何解决
MaxCompute作为一款全面的大数据处理平台,广泛应用于各类大数据分析、数据挖掘、BI及机器学习场景。掌握其核心功能、熟练操作流程、遵循最佳实践,可以帮助用户高效、安全地管理和利用海量数据。以下是一个关于MaxCompute产品使用的合集,涵盖了其核心功能、应用场景、操作流程以及最佳实践等内容。
|
6天前
|
SQL 分布式计算 资源调度
常用大数据组件的Web端口号总结
这是关于常用大数据组件Web端口号的总结。通过虚拟机名+端口号可访问各组件服务:Hadoop HDFS的9870,YARN的ResourceManager的8088和JobHistoryServer的19888,Zeppelin的8000,HBase的10610,Hive的10002。ZooKeeper的端口包括客户端连接的2181,服务器间通信的2888以及选举通信的3888。
24 2
常用大数据组件的Web端口号总结
|
6天前
|
监控 Java Linux
linux下监控java进程 实现自动重启服务
linux下监控java进程 实现自动重启服务
|
6天前
|
Shell
Shell脚本检测服务器或者ip哪些端口是开放的都是开放了哪些端口
Shell脚本检测服务器或者ip哪些端口是开放的都是开放了哪些端口
8 0
|
7月前
|
运维 搜索推荐 Shell
Ansible自动化运维工具之个性化定制SSH连接登录端口(3)
Ansible自动化运维工具之个性化定制SSH连接登录端口(3)
200 0
|
6天前
|
存储 JSON 运维
【运维】Powershell 服务器系统管理信息总结(进程、线程、磁盘、内存、网络、CPU、持续运行时间、系统账户、日志事件)
【运维】Powershell 服务器系统管理信息总结(进程、线程、磁盘、内存、网络、CPU、持续运行时间、系统账户、日志事件)
57 0

热门文章

最新文章