使用web页面实现oracle的安装和测试
<!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的安装和测试的更多相关文章
- SpringBoot系列——Logback日志,输出到文件以及实时输出到web页面
前言 SpringBoot对所有内部日志使用通用日志记录,但保留底层日志实现.为Java Util Logging.Log4J2和Logback提供了默认配置.在不同的情况下,日志记录器都预先配置为使 ...
- Jenkins安装时Web页面报错提示离线安装
先跳过所有. 方法1 先看它的提示:”参考离线Jenkins安装文档“发现链接点不开,我还以为是被墙了呢,FQ以后还是打不开.看来这个参考文档是没有用滴.点击配置HTTP代理跳出如下界面:安装Jenk ...
- InfluxDB安装后web页面无法访问的解决方案
本文属于<InfluxDB系列教程>文章系列,该系列共包括以下 16 部分: InfluxDB学习之InfluxDB的安装和简介 InfluxDB学习之InfluxDB的基本概念 Infl ...
- java web(一):tomcat服务器的安装和简单介绍,与eclipse关联
一:下载tomcat安装包和安装 这个百度一下就可以了. 安装完以后进入tomcat的安装路径查看 如图所示:有几个目录简单介绍下 bin目录: 存放运行tomcat服务器的相关命令. conf目 ...
- 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 ...
- 使用TreeDMS进行MySQL数据库的Web页面远程管理
在互联网应用蓬勃发展的时代背景下,各种各样的网络平台,网络应用,移动应用层出不穷,那么这些应用及平台都需要使用到数据库.如何高效的对数据进行日常维护.管理.监控成为迫切需要解决的问题. 基于web的方 ...
- Microsoft.Office.Interop.Excel的用法以及利用Microsoft.Office.Interop.Excel将web页面转成PDF
1.常见用法 using Microsoft.Office.Interop.Excel; 1)新建一个Excel ApplicationClass ExcelApp = New A ...
- CentOS7安装Oracle 11gR2 安装
概述 Oracle 在Linux和window上的安装不太一样,公司又是Linux系统上的Oracle,实在没辙,研究下Linux下Oracle的使用,oracle默认不支持CentOS系统安装,所以 ...
- 基于Metronic的Bootstrap开发框架经验总结(9)--实现Web页面内容的打印预览和保存操作
在前面介绍了很多篇相关的<Bootstrap开发框架>的系列文章,这些内容基本上覆盖到了我这个Bootstrap框架的各个主要方面的内容,总体来说基本达到了一个稳定的状态,随着时间的推移可 ...
随机推荐
- REST-assured 3发送图片
上传图片,需要media_id,从上传临时素材获取:https://work.weixin.qq.com/api/doc#10112 https://qyapi.weixin.qq.com/cgi-b ...
- Linux设置默认shell脚本效果
效果如图: 实现方法:在当前用户的家目录下新建文件.vimrc [root@nodchen-db01-test ~]# pwd/root [root@nodchen-db01-test ~]# fil ...
- javascript节点操作insertBefor()
如果想要把节点放在某个特定的位置,而不是放在末尾,就可以使用insertBefore(a,b) 参数a:要插入的节点 参数b:作为参照的节点. var oDiv = document.getEleme ...
- move操作
move一个表到另外一个表空间时,索引不会跟着一起move,而且会失效.(LOB类型例外) 表move,我们分为: *普通表move *分区表move *LONG,LOB大字段类型move来进行测试和 ...
- 网络虚拟化中的 offload 技术:LSO/LRO、GSO/GRO、TSO/UFO、RSS、VXLAN
offload offload特性,主要是指将本来在操作系统协议栈中进行的一些数据包处理(如IP分片.TCP分片.重组.checksum校验等)放到网卡硬件中去做,降低系统 CPU 消耗,提高处理的性 ...
- Java面向对象之抽象类
内容: 1.抽象类的产生 2.抽象类和抽象方法的定义与使用 3.抽象类和抽象方法的注意事项 4.实例分析 1.抽象类的产生 当编写一个类时,我们往往会为该类定义一些方法,这些方法是用来描述该类的功能具 ...
- stdio.h头文件中申明的基本函数
调用scanf函数时,需传入变量的地址作为参数,scanf函数会等待标准输入设备(键盘等)输入数据,并且将输入的数据赋值给地址对应的变量. #include<stdio.h> #inclu ...
- 为挂载到/home的RAID磁盘组扩容
公司一台DELL服务器,安装的Ubuntu16.04系统,原来是6块1.2T的SAS盘做RAID-5挂载到/home,现在/home空间不够用了,需要扩容,再增加2块1.2T的盘.整个操作不复杂,但有 ...
- SparkSession
在2.0版本之前,使用Spark必须先创建SparkConf和SparkContext catalog:目录 Spark2.0中引入了SparkSession的概念,SparkConf.SparkCo ...
- Spring MVC 运行流程图