Starten WLS Forms Reports unter Windows

unter Linux/Unix ist es ja recht einfach mal eben ein paar Start und Stop Skripte zu bauen. Da kann man die Skripte von Oracle nutzen und diese dann in den Hintergrund stellen. Unter Windows ohne PowerShell ist dass nun nicht wirklich angenehm. Ich habe mir dazu mal ein paar Skripte aufgebaut.

als erstes wird mit dem Skript von Oracle C:\oracle\user_projects\domains\FRDomain\bin\installNodeMgrSvc.cmd ein Windows Service für den Nodemanger erstellt. Dann läuft der schon einmal wenn der Server neu gestartet wird.

Ich habe mir jetzt erst einmal zwei *.cmd Skripte gebaut.

 

  1. startAll.cmd
  2. stopAll.cmd

Inhalt startAll.cmd

c:
cd C:\oracle\user_projects\domains\FRDomain\bin
C:\oracle\Middleware\oracle_common\common\bin\wlst.cmd startAll.py

das Python Skript dazu sieht wie folgt aus: Das selbe Skript nehme ich auch zum stoppen. So habe ich immer die Prozesse im Hintergrund und sie werden der Reihen nach gestartet.

Bei Stop bloss die Passagen umbauen.

Verfolgen tail -f unter Windows .-) : aus der Powershell heraus :Get-Content C:\oracle\user_projects\domains\FRDomain\nodemanager\nodemanager.log -Wait Dann kann ich sehr schön das ganze verfolgen.


def serverStatus(server):
 print "Server = "+server
 cd('/ServerLifeCycleRuntimes/'+server);
 return cmo.getState();
 
def ComponentStatus(server):
 print "Server = "+server
 cd('/SystemComponentLifeCycleRuntimes/'+server)
 return cmo.getState();
 
def startComponent(ComponentName):
 cd('/SystemComponentLifeCycleRuntimes/'+ComponentName)
 wert=cmo.start(None)
 
def stopComponent(ComponentName):
 cd('/SystemComponentLifeCycleRuntimes/'+ComponentName)
 wert=cmo.shutdown(None)
 
def startAdminserver():
 print "==============================================="
 print "Admin Server wird gestartet"
 print "Connect gegen NodeManager"
 nmConnect(v_username, v_password, v_host, v_port, v_domain, v_domainVZ)
 nmStart('AdminServer')
 nmDisconnect();
 
def stopAdminserver():
 print "==============================================="
 print "Admin Server wird gestoppt"
 print "Connect gegen NodeManager"
 try:
 nmConnect(v_username, v_password, v_host, v_port, v_domain, v_domainVZ)
 nmKill('AdminServer')
 nmDisconnect();
 except:
 print "Konnte mich nicht gegen NM"
 
def startAllWLS():
 print "==============================================="
 connect(v_username,v_password,v_connect)
 srvs = cmo.getServers()
 domainRuntime()
 for server in srvs:
 if server.getName() != "AdminServer":
 ServerName=server.getName();
 ##print "Server :"+ServerName
 serverState=serverStatus(ServerName)
 print ServerName +" ist im Status " + serverState
 if serverState !="RUNNING":
 start(ServerName,'Server');
 
def stopAllWLS():
 print "==============================================="
 connect(v_username,v_password,v_connect)
 srvs = cmo.getServers()
 domainRuntime()
 for server in srvs:
 if server.getName() != "AdminServer":
 ServerName=server.getName();
 ##print "Server :"+ServerName
 serverState=serverStatus(ServerName)
 print ServerName +" ist im Status " + serverState
 if serverState =="RUNNING":
 shutdown(ServerName,'Server','true',1000,block='true');
def startAllComponent():
 print "==============================================="
 connect(v_username,v_password,v_connect)
 srvs = cmo.getSystemComponents()
 domainRuntime()
 for systemComponents in srvs:
 if systemComponents.getName() != "forms1":
 ServerName=systemComponents.getName();
 serverState=ComponentStatus(ServerName)
 print "Status "+serverState
 if serverState !="RUNNING":
 print ServerName
 startComponent(ServerName);
 
def stopAllComponent():
 print "==============================================="
 connect(v_username,v_password,v_connect)
 srvs = cmo.getSystemComponents()
 domainRuntime()
 for systemComponents in srvs:
 if systemComponents.getName() != "forms1":
 ServerName=systemComponents.getName();
 serverState=ComponentStatus(ServerName)
 print "Status "+serverState
 if serverState =="RUNNING":
 print "stopping "+ServerName
 stopComponent(ServerName);
 serverState=ComponentStatus(ServerName)
 print "Status "+serverState
 
 
 
v_StartStop='Start';#os.environ('STARTSTOP');
v_username="weblogic"
v_password="welcome1"
v_host='localhost'
v_port='5556'
v_adminport='7101'
v_domain='FRDomain'
v_domainVZ='C:\oracle\user_projects\domains\FRDomain'
v_connect="t3://"+v_host+":"+v_adminport;
 
print "Check ";
print v_username;
print v_password;
print "v_connect "+v_connect;
startAdminserver()
startAllWLS()
startAllComponent()
#print "alles wieder stoppen"
#stopAllComponent()
#stopAllWLS()
#disconnect()
#stopAdminserver()

 

Eintragen als Windows Start/Stop

  1. starten gpedit.msc

To assign computer startup scripts

  1. Open the Local Group Policy Editor.
  2. In the console tree, click Scripts (Startup/Shutdown) . The path is Computer Configuration\Windows Settings\Scripts (Startup/Shutdown) .
  3. In the results pane, double-click Startup .
  4. In the Startup Properties dialog box, click Add .
  5. In the Add a Script dialog box, do the following:
    • In the Script Name box, type the path to the script, or click Browse to search for the script file in the Netlogon shared folder on the domain controller.
    • In the Script Parameters box, type any parameters that you want, the same way as you would type them on the command line. For example, if your script includes parameters called //logo (display banner) and //I (interactive mode), type //logo //I .
  6. In the Startup Properties dialog box, specify the options that you want:
    • Startup Scripts for <Group Policy object> : Lists all the scripts that currently are assigned to the selected Group Policy object (GPO). If you assign multiple scripts, the scripts are processed in the order that you specify. To move a script up in the list, click it and then click Up . To move a script down in the list, click it and then click Down .
    • Add : Opens the Add a Script dialog box, where you can specify any additional scripts to use.
    • Edit : Opens the Edit Script dialog box, where you can modify script information, such as name and parameters.
    • Remove : Removes the selected script from the Startup Scripts list.
    • Show Files : Displays the script files that are stored in the selected GPO.

 

 

 

 

 

 

 

Script eintragen

 

 

 

 

 

Werbung

Die Kommentarfunktion ist geschlossen.

%d Bloggern gefällt das: