When running forms on application server as a production everyone is setting FORMS_MMAP=TRUE or leave it unassignet to relieve memory demands on a server. The rule is to put new or updated forms to server at designeted time (I am doing that at midnight when restarting Forms services). But what happened when programmer need to update some forms immediately during peek time.
Suppose that we have multiple forms (100+) from different enviroments. The problem is how to copy requested forms on form server.
One idea is to put FORMS_MMAP to FALSE but that could be too heavy on server memory demands for Forms services. Another idea is to stop OC4J_BI_FORMS through enterprise management but than we hace to disconnect all users, not only that use particular form.
I made a solution in form of a VBS script which create batch file (Windows) to kill only those processes that uses enviroment of a form i need to replace:
'First input name of Forms server (could use InputBox if more than one server)
strComputer = "server_name"
'Define arguments
Dim arg
Dim pass
Dim argpass
'Define passwords
pass="******"
'Get user to write a password
argpass=InputBox("Unesite Password:")
'Define output file
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.CreateTextFile("output.bat", True)
'Set WmiService
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
'Get frmwebprocesses
Set colItems = objWMIService.ExecQuery("Select * from Win32_Process where name='frmweb.exe'")
If pass = argpass Then
'Get the name of env file
arg = InputBox("What application you need to stop?")
arg=LCase(arg)
'Fill the output.bat file
For Each objItem in colItems
proc=objItem.ProcessID
'Get command line
'(actually you get webfile=HTTP-0,0,1,name_of_app_from_env,ip_address)
line = objItem.CommandLine
linesplit=Split(line,",",5) 'Extract the name of aplication from command line
app=linesplit(3)
app=LCase(app)
If arg=app Then
objFile.WriteLine "pskill.exe " & proc 'Write the output.bat file
End if
Next
End if
Output of a VBS script is a batch file output.bat which consists:
pskill.exe 1345
pskill.exe 1328
pskill.exe 1479
pskill.exe 1511
Pskill can be downloaded from: http://technet.microsoft.com/en-us/sysinternals/bb896683.aspx
Nema komentara:
Objavi komentar