使用win10导入 linux oarcle dmp文件 并部署web服务
环境:
1、虚拟机装了red hat 7.0 ,oracle11g
2、windows上安装oracle11g
3、工具:putty
一、创建linux oracle表空间和用户
1、打开putty连接虚拟机
2、进入oracle用户,并登录最高权限用户
输入:
su – oracle ‘回车’
sqlplus / as sysdba ‘回车’
启动数据库服务
输入:startup
3、创建表空间
输入:create tablespace guozhen datafile ‘/home/oracle/database/guozhen.dbf’ size 2000M;
4、创建用户
输入:create user zhen identified by zhen default tablespace guozhen;
5、给用户授权
输入:
grant exp_full_database to zhen;
grant imp_full_database to zhen;
grant resource to zhen;
grant connect to zhen;
grant dba to zhen;
记得多回车一次!
看到5条 Grant succeeded就行。
二、导入dmp文件
windows上要装好oracle不然办法搞!
1、打开cmd,进入oracle安装位置的imp路径
2、开始导入
输入:imp zhen/[email protected]:1521/orcl file=‘D:\oracle_1.0.dmp’ full=y
报错原因:
linux上的oracle没有启动监听
输入:lsnrctl start
现在就发现导入成功啦
三、使用Tomcat发布web应用
1、把程序包连接数据指向刚刚导入的dmp文件的用户。
略 。
2、找D:\apache-tomcat-9.0.38-windows-x64\apache-tomcat-9.0.38\bin路径下的startup程序双击
提示:startup.sh是在linux上执行的程序
3、打开浏览器查看