【大数据开发运维解决方案】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的热门话题分析
相关文章
|
SQL 分布式计算 DataWorks
DataWorks产品使用合集之如何开发ODPS Spark任务
DataWorks作为一站式的数据开发与治理平台,提供了从数据采集、清洗、开发、调度、服务化、质量监控到安全管理的全套解决方案,帮助企业构建高效、规范、安全的大数据处理体系。以下是对DataWorks产品使用合集的概述,涵盖数据处理的各个环节。
337 2
|
12月前
|
人工智能 DataWorks 大数据
大数据AI一体化开发再加速:DataWorks 支持GPU类型资源
大数据开发治理平台 DataWorks 的Serverless资源组支持GPU资源类型,以免运维、按需付费、弹性伸缩的Serverless架构,将大数据处理与AI开发能力无缝融合。面向大数据&AI协同开发场景,DataWorks提供了交互式开发和分析工具Notebook。开发者在创建个人开发环境时,可以选择GPU类型的资源作为Notebook运行环境,以支持进行高性能的计算工作。本教程将基于开源多模态大模型Qwen2-VL-2B-Instruct,介绍如何使用 DataWorks Notebook及LLaMA Factory训练框架完成文旅领域大模型的构建。
789 24
|
数据采集 机器学习/深度学习 DataWorks
DataWorks产品评测:大数据开发治理的深度体验
DataWorks产品评测:大数据开发治理的深度体验
537 1
|
监控 Ubuntu API
Python脚本监控Ubuntu系统进程内存的实现方式
通过这种方法,我们可以很容易地监控Ubuntu系统中进程的内存使用情况,对于性能分析和资源管理具有很大的帮助。这只是 `psutil`库功能的冰山一角,`psutil`还能够提供更多关于系统和进程的详细信息,强烈推荐进一步探索这个强大的库。
245 1
|
消息中间件 算法 安全
操作系统处理多进程的问题及解决方案
【8月更文挑战第23天】
830 1
|
存储 分布式计算 MaxCompute
构建NLP 开发问题之如何支持其他存储介质(如 HDFS、ODPS Volumn)在 transformers 框架中
构建NLP 开发问题之如何支持其他存储介质(如 HDFS、ODPS Volumn)在 transformers 框架中
|
SQL 分布式计算 大数据
代码编码原则和规范大数据开发
此文档详细规定了SQL代码的编写规范,包括代码的清晰度,执行效率,以及注释的必要性。它强调所有SQL关键字需统一使用大写或小写,并禁止使用select *操作。此外,还规定了代码头部的信息模板,字段排列方式,INSERT, SELECT子句的格式,运算符的使用,CASE语句编写规则,查询嵌套规范,表别名定义,以及SQL注释的添加方法。这些规则有助于提升代码的可读性和可维护性。
300 0
|
SQL 分布式计算 大数据
大数据开发SQL代码编码原则和规范
这段SQL编码原则强调代码的功能完整性、清晰度、执行效率及可读性,通过统一关键词大小写、缩进量以及禁止使用模糊操作如select *等手段提升代码质量。此外,SQL编码规范还详细规定了代码头部信息、字段与子句排列、运算符前后间隔、CASE语句编写、查询嵌套、表别名定义以及SQL注释的具体要求,确保代码的一致性和维护性。
549 0
|
数据可视化
Echarts数据可视化开发| 智慧数据平台
Echarts数据可视化开发| 智慧数据平台
|
数据可视化
Echarts数据可视化大屏开发| 大数据分析平台
Echarts数据可视化大屏开发| 大数据分析平台