<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>oracle测试</title>
<style>
#div1{
position: fixed;
height: 400px;
width: 700px;
margin-top: 100px;
margin-left: 300px;
background-color: antiquewhite;
z-index: 1000; }
#div1 input{
width: 100px;
height: 75px;
margin: 50px;
border-radius: 15px;
}
#div2{
position: absolute;
top: 50%;
left: 50%;
margin-top: -67.5px;
margin-left: -122.5px;
z-index: 1001;
width: 245px;
height: 135px;
background-color: silver;
overflow: scroll;
font-weight: bolder;
}
.hide{
display: none;
}
.submit_right{
float: right;
}
</style>
</head>
<body>
<div id="div1">
<input type="button" value="连接虚拟机" onclick="func1()">
<input type="button" value="安装oracle" onclick="func2()">
<input type="button" value="优化oracle" onclick="func3()">
<input type="button" value="初始化数据" onclick="func4()">
<input type="button" value="测试TPM" onclick="func5()">
</div>
<div id="div2" class="hide">
<form action="/app1/home/" method="post">
地址: <input type="text" name="ip_address"><br/>
用户: <input type="text" name="user_name"><br/>
密码: <input type="password" name="user_pwd"><br/>
端口: <input type="text" name="user_port"><br/>
<input class="submit_right" type="submit" value="提交">
<input class="submit_right" type="button" value="取消" onclick="hide_ele()">
<input class="submit_right" type="reset" value="清空">
</form>
</div> <div id="div3" class="hide">
<form action="/app1/home/" method="post">
地址: <input type="text" name="ip_address"><br/>
用户: <input type="text" name="user_name"><br/>
密码: <input type="password" name="user_pwd"><br/>
端口: <input type="text" name="user_port"><br/>
<input class="submit_right" type="submit" value="提交">
<input class="submit_right" type="button" value="取消" onclick="hide_ele()">
<input class="submit_right" type="reset" value="清空">
</form>
</div>
<script>
function func1() {
var ele = document.getElementById("div2");
ele.classList.remove("hide") }
function hide_ele() {
var ele = document.getElementById("div2");
ele.classList.add("hide")
}
</script>
</body>
</html>

  

views

def home(request):
if request.method.lower() == "post":
host_add = request.POST.get("ip_address")
user_name = request.POST.get("user_name")
user_pwd = request.POST.get("user_pwd")
user_port = int(request.POST.get("user_port")) ret = core.change_mem(host_add,user_name,user_pwd,user_port)
return HttpResponse(ret)
return render(request,"home.html")

  

core

import sys
sys.path.append("D:\\python3\\lib\\site-packages")
import cx_Oracle
import paramiko
class all(object):
def __init__(self,host_add,user_name,user_pwd,user_port):
self.host_add = host_add
self.user_name = user_name
self.user_pwd = user_pwd
self.user_port = user_port def change_mem(self):
pass class oracle(all):
def __init__(self,host_add,user_name,user_pwd,user_port,sys_pwd,data_num,log_num,log_size):
super(oracle,self).__init__(host_add,user_name,user_pwd,user_port)
self.sys_pwd = sys_pwd
self.data_num = data_num
self.log_num = log_num
self.log_size = log_size def change_oracle_mem(self):
pass def change_oracle_datafile(self):
pass def change_oracle_logfile(self):
pass def change_mem(host_add,user_name,user_pwd,user_port):
try:
ssh = paramiko.SSHClient()
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
ssh.connect(hostname=host_add,port=user_port,username=user_name,password=user_pwd)
except Exception as e:
ret = "登陆失败" + str(e)
return ret
else:
# return "登陆成功"
# stdin, stdout, stderr = ssh.exec_command("sed -i '$ a vm.nr_hugepages = 30820' /root/test1.conf")
# stdin, stdout, stderr = ssh.exec_command("sed -i '$ a * soft memlock 90596966' /root/test1.conf")
# stdin, stdout, stderr = ssh.exec_command("sed -i '$ a * soft memlock 90596966' /root/test1.conf")
stdin, stdout, stderr = ssh.exec_command("cat /root/test1.conf | grep 'vm.nr_hugepages = 310820'")
stdin, stdout, stderr = ssh.exec_command("echo $?")
res = str(stdout.read(),encoding="utf-8").strip("\n")
res1 = str(0)
print(res,res1,sep="-----------")
print(res,type(res),sep="-------------------")
if res == "0":
print("ok")
else:
print("xxx")
ssh.close()

  

使用web页面实现oracle的安装和测试的更多相关文章

  1. SpringBoot系列——Logback日志,输出到文件以及实时输出到web页面

    前言 SpringBoot对所有内部日志使用通用日志记录,但保留底层日志实现.为Java Util Logging.Log4J2和Logback提供了默认配置.在不同的情况下,日志记录器都预先配置为使 ...

  2. Jenkins安装时Web页面报错提示离线安装

    先跳过所有. 方法1 先看它的提示:”参考离线Jenkins安装文档“发现链接点不开,我还以为是被墙了呢,FQ以后还是打不开.看来这个参考文档是没有用滴.点击配置HTTP代理跳出如下界面:安装Jenk ...

  3. InfluxDB安装后web页面无法访问的解决方案

    本文属于<InfluxDB系列教程>文章系列,该系列共包括以下 16 部分: InfluxDB学习之InfluxDB的安装和简介 InfluxDB学习之InfluxDB的基本概念 Infl ...

  4. java web(一):tomcat服务器的安装和简单介绍,与eclipse关联

    一:下载tomcat安装包和安装 这个百度一下就可以了. 安装完以后进入tomcat的安装路径查看 如图所示:有几个目录简单介绍下 bin目录:   存放运行tomcat服务器的相关命令. conf目 ...

  5. JavaWeb-入门第一课-1.静态web动态web 2.web服务器 3.下载和安装Tomcat-web服务器

    文章来源:http://www.cnblogs.com/xdp-gacl/p/3729033.html 1.1.WEB开发的相关知识 WEB,在英语中web即表示网页的意思 静态web资源(如html ...

  6. 使用TreeDMS进行MySQL数据库的Web页面远程管理

    在互联网应用蓬勃发展的时代背景下,各种各样的网络平台,网络应用,移动应用层出不穷,那么这些应用及平台都需要使用到数据库.如何高效的对数据进行日常维护.管理.监控成为迫切需要解决的问题. 基于web的方 ...

  7. Microsoft.Office.Interop.Excel的用法以及利用Microsoft.Office.Interop.Excel将web页面转成PDF

    1.常见用法           using Microsoft.Office.Interop.Excel; 1)新建一个Excel ApplicationClass ExcelApp = New A ...

  8. CentOS7安装Oracle 11gR2 安装

    概述 Oracle 在Linux和window上的安装不太一样,公司又是Linux系统上的Oracle,实在没辙,研究下Linux下Oracle的使用,oracle默认不支持CentOS系统安装,所以 ...

  9. 基于Metronic的Bootstrap开发框架经验总结(9)--实现Web页面内容的打印预览和保存操作

    在前面介绍了很多篇相关的<Bootstrap开发框架>的系列文章,这些内容基本上覆盖到了我这个Bootstrap框架的各个主要方面的内容,总体来说基本达到了一个稳定的状态,随着时间的推移可 ...

随机推荐

  1. VMware vCenter Server安装

    SQL Server 2008 R2安装包:http://blog.sina.com.cn/s/blog_4aedf6370101j9tz.html SQL Server安装指导:http://www ...

  2. 1010 Radix (25 分)

    1010 Radix (25 分) Given a pair of positive integers, for example, 6 and 110, can this equation 6 = 1 ...

  3. vlc的应用之二:vlc的ActiveX及cab

    请移步https://higoge.github.io/,所有下载资料在那个博客都能找到.谢谢. http://jeremiah.blog.51cto.com/ 2009-05-14补充:8. Act ...

  4. 小朋友学Python(4)

    Mac下安装Python 3 Mac系统会自带Python 2.7.x.安装Python 3时,不要卸载Python 2.7.x,因为有Mac系统有一些库会依赖于Python 2.7.x. 安装步骤: ...

  5. solr 通过【配置、多值字段、动态字段】来解决文本表达式查询精确到句子的问题

    一.Solr Multivalue field属性positionIncrementGap理解 分类:Lucene 2014-01-22 10:39阅读(3596)评论(0) 参考:http://ro ...

  6. 并发基础(三) java线程优先级

      在不同的JVM中(JVM也算是一个操作系统),有着不同的CPU调度算法,对于大部分的JVM来说,优先级也是调度算法中的一个参数.所以,线程优先级在一定程度上,对线程的调度执行顺序有所影响,但不能用 ...

  7. OMIM 表型和基因如何关联

    OMIM数据库:大神私藏的数据库,99.9%的人都不知道! 2019-03-04 11:00乳腺癌/医生/肺癌 “ GEO.NCDB.TCGA.SEER数据库这些我都知道,但OMIM是什么鬼? OMI ...

  8. 2.Triangle (三角形)

    1.等腰直角三角形: https://www.cnblogs.com/FlyingLiao/p/9869040.html 2.1任意三角形: <!DOCTYPE html> <htm ...

  9. WPF 自定义属性

    做了一个自定义控件和一个自定义Grid,里面的元素可以随着绑定属性变化: 效果图(一定滑块): 关键代码: 1.自定义属性代码: public class MyGrid : Grid { public ...

  10. redis详解(二)-- 数据类型详解

    Redis常用数据类型详解 1,Redis最为常用的数据类型主要有以下: String Hash List Set Sorted set pub/sub Transactions 在具体描述这几种数据 ...