阿里云服务器搭建java环境(jdk+tomcat+oracle11g)
一、JDK配置
1、在centos 7的更新源中有JDK,使用yum即可下载安装
查看库中版本 [root@localhost ~]# yum search java|grep jdk 选择需要版本进行安装 [root@localhost ~]# yum install java-1.8.0-openjdk.x86_64 //安装目录是在: /usr/lib/jvm/java-1.8.0-openjdkXXX 设置环境变量 [root@localhost ~]# vi /etc/profile #set java environment 如果无效的话,加到 vim ~/.bash_profile JAVA_HOME=/usr/lib/jvm/java-1.8-openjdk //注意修改路径 JRE_HOME=$JAVA_HOME/jre CLASS_PATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$JRE_HOME/lib PATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/bin export JAVA_HOME JRE_HOME CLASS_PATH PATH [root@localhost java]# source /etc/profile //使修改生效
二、安装tomcat
下载好apache-tomcat-7.0.69.tar.gz,xhell上传Centos 7
1、解压:
tar -zxvf apache-tomcat-7.0.69.tar.gz -C /usr/java/tomcat7
解压完整后删除安装包:
rm –f apache-tomcat-7.0.69.tar.gz
首先我们来配置一下tomcat的环境变量和内存设置,进入tomcat的bin目录后通过vi命令打开catalina.sh文件,并在其中加入如下配置:
JAVA_OPTS="-Xms512m -Xmx1024m -Xss1024K -XX:PermSize=512m -XX:MaxPermSize=1024m"
export JAVA_HOME=/usr/java/jdk/jdk1.7.0_80
export CATALINA_HOME=/usr/java/tomcat7/apache-tomcat-7.0.69
export CATALINA_BASE=/usr/java/tomcat7/apache-tomcat-7.0.69
export CATALINA_TMPDIR=/usr/java/tomcat7/apache-tomcat-7.0.69/temp
2、修改server.xml ,修改端口号,添加域名。阿里云默认只开放商用80端口
3、查验(服务器响应时间,有延迟,等会就好)
[root@izuf64t2yduyjgxweag0f5z conf]# curl 127.0.0.1 //出现如下内容,表明外网地址对外发布。
<!DOCTYPE html> <html lang="en"> <head> <title>Apache Tomcat/7.0.69</title> <link href="favicon.ico" rel="icon" type="image/x-icon" /> <link href="favicon.ico" rel="shortcut icon" type="image/x-icon" /> <link href="tomcat.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="wrapper"> <div id="navigation" class="curved container"> <span id="nav-home"><a href="http://tomcat.apache.org/">Home</a></span> <span id="nav-hosts"><a href="/docs/">Documentation</a></span> <span id="nav-config"><a href="/docs/config/">Configuration</a></span> <span id="nav-examples"><a href="/examples/">Examples</a></span> <span id="nav-wiki"><a href="http://wiki.apache.org/tomcat/FrontPage">Wiki</a></span> <span id="nav-lists"><a href="http://tomcat.apache.org/lists.html">Mailing Lists</a></span> <span id="nav-help"><a href="http://tomcat.apache.org/findhelp.html">Find Help</a></span> <br class="separator" /> </div> <div id="asf-box"> <h1>Apache Tomcat/7.0.69</h1> </div> <div id="upper" class="curved container"> <div id="congrats" class="curved container"> <h2>If you're seeing this, you've successfully installed Tomcat. Congratulations!</h2> </div> <div id="notice"> <img src="tomcat.png" alt="[tomcat logo]" /> <div id="tasks"> <h3>Recommended Reading:</h3> <h4><a href="/docs/security-howto.html">Security Considerations HOW-TO</a></h4> <h4><a href="/docs/manager-howto.html">Manager Application HOW-TO</a></h4> <h4><a href="/docs/cluster-howto.html">Clustering/Session Replication HOW-TO</a></h4> </div> </div> <div id="actions"> <div class="button"> <a class="container shadow" href="/manager/status"><span>Server Status</span></a> </div> <div class="button"> <a class="container shadow" href="/manager/html"><span>Manager App</span></a> </div> <div class="button"> <a class="container shadow" href="/host-manager/html"><span>Host Manager</span></a> </div> </div> <!-- <br class="separator" /> --> <br class="separator" /> </div> <div id="middle" class="curved container"> <h3>Developer Quick Start</h3> <div class="col25"> <div class="container"> <p><a href="/docs/setup.html">Tomcat Setup</a></p> <p><a href="/docs/appdev/">First Web Application</a></p> </div> </div> <div class="col25"> <div class="container"> <p><a href="/docs/realm-howto.html">Realms & AAA</a></p> <p><a href="/docs/jndi-datasource-examples-howto.html">JDBC DataSources</a></p> </div> </div> <div class="col25"> <div class="container"> <p><a href="/examples/">Examples</a></p> </div> </div> <div class="col25"> <div class="container"> <p><a href="http://wiki.apache.org/tomcat/Specifications">Servlet Specifications</a></p> <p><a href="http://wiki.apache.org/tomcat/TomcatVersions">Tomcat Versions</a></p> </div> </div> <br class="separator" /> </div> <div id="lower"> <div id="low-manage" class=""> <div class="curved container"> <h3>Managing Tomcat</h3> <p>For security, access to the <a href="/manager/html">manager webapp</a> is restricted. Users are defined in:</p> <pre>$CATALINA_HOME/conf/tomcat-users.xml</pre> <p>In Tomcat 7.0 access to the manager application is split between different users. <a href="/docs/manager-howto.html">Read more...</a></p> <br /> <h4><a href="/docs/RELEASE-NOTES.txt">Release Notes</a></h4> <h4><a href="/docs/changelog.html">Changelog</a></h4> <h4><a href="http://tomcat.apache.org/migration.html">Migration Guide</a></h4> <h4><a href="http://tomcat.apache.org/security.html">Security Notices</a></h4> </div> </div> <div id="low-docs" class=""> <div class="curved container"> <h3>Documentation</h3> <h4><a href="/docs/">Tomcat 7.0 Documentation</a></h4> <h4><a href="/docs/config/">Tomcat 7.0 Configuration</a></h4> <h4><a href="http://wiki.apache.org/tomcat/FrontPage">Tomcat Wiki</a></h4> <p>Find additional important configuration information in:</p> <pre>$CATALINA_HOME/RUNNING.txt</pre> <p>Developers may be interested in:</p> <ul> <li><a href="http://tomcat.apache.org/bugreport.html">Tomcat 7.0 Bug Database</a></li> <li><a href="/docs/api/index.html">Tomcat 7.0 JavaDocs</a></li> <li><a href="http://svn.apache.org/repos/asf/tomcat/tc7.0.x/">Tomcat 7.0 SVN Repository</a></li> </ul> </div> </div> <div id="low-help" class=""> <div class="curved container"> <h3>Getting Help</h3> <h4><a href="http://tomcat.apache.org/faq/">FAQ</a> and <a href="http://tomcat.apache.org/lists.html">Mailing Lists</a></h4> <p>The following mailing lists are available:</p> <ul> <li id="list-announce"><strong><a href="http://tomcat.apache.org/lists.html#tomcat-announce">tomcat-announce</a><br /> Important announcements, releases, security vulnerability notifications. (Low volume).</strong> </li> <li><a href="http://tomcat.apache.org/lists.html#tomcat-users">tomcat-users</a><br /> User support and discussion </li> <li><a href="http://tomcat.apache.org/lists.html#taglibs-user">taglibs-user</a><br /> User support and discussion for <a href="http://tomcat.apache.org/taglibs/">Apache Taglibs</a> </li> <li><a href="http://tomcat.apache.org/lists.html#tomcat-dev">tomcat-dev</a><br /> Development mailing list, including commit messages </li> </ul> </div> </div> <br class="separator" /> </div> <div id="footer" class="curved container"> <div class="col20"> <div class="container"> <h4>Other Downloads</h4> <ul> <li><a href="http://tomcat.apache.org/download-connectors.cgi">Tomcat Connectors</a></li> <li><a href="http://tomcat.apache.org/download-native.cgi">Tomcat Native</a></li> <li><a href="http://tomcat.apache.org/taglibs/">Taglibs</a></li> <li><a href="/docs/deployer-howto.html">Deployer</a></li> </ul> </div> </div> <div class="col20"> <div class="container"> <h4>Other Documentation</h4> <ul> <li><a href="http://tomcat.apache.org/connectors-doc/">Tomcat Connectors</a></li> <li><a href="http://tomcat.apache.org/connectors-doc/">mod_jk Documentation</a></li> <li><a href="http://tomcat.apache.org/native-doc/">Tomcat Native</a></li> <li><a href="/docs/deployer-howto.html">Deployer</a></li> </ul> </div> </div> <div class="col20"> <div class="container"> <h4>Get Involved</h4> <ul> <li><a href="http://tomcat.apache.org/getinvolved.html">Overview</a></li> <li><a href="http://tomcat.apache.org/svn.html">SVN Repositories</a></li> <li><a href="http://tomcat.apache.org/lists.html">Mailing Lists</a></li> <li><a href="http://wiki.apache.org/tomcat/FrontPage">Wiki</a></li> </ul> </div> </div> <div class="col20"> <div class="container"> <h4>Miscellaneous</h4> <ul> <li><a href="http://tomcat.apache.org/contact.html">Contact</a></li> <li><a href="http://tomcat.apache.org/legal.html">Legal</a></li> <li><a href="http://www.apache.org/foundation/sponsorship.html">Sponsorship</a></li> <li><a href="http://www.apache.org/foundation/thanks.html">Thanks</a></li> </ul> </div> </div> <div class="col20"> <div class="container"> <h4>Apache Software Foundation</h4> <ul> <li><a href="http://tomcat.apache.org/whoweare.html">Who We Are</a></li> <li><a href="http://tomcat.apache.org/heritage.html">Heritage</a></li> <li><a href="http://www.apache.org">Apache Home</a></li> <li><a href="http://tomcat.apache.org/resources.html">Resources</a></li> </ul> </div> </div> <br class="separator" /> </div> <p class="copyright">Copyright ©1999-2017 Apache Software Foundation. All Rights Reserved</p> </div> </body> </html>
在win 7 cmd 下 ping 外网地址,telnet 外网地址 ,看看是否成功。
3、直接访问tomcat服务器,验证。
三、Centos 7 安装 oracle11gR2
准备工作
1、下载Oracle安装包:linux.x64_11gR2_database_1of2.zip 和 linux.x64_11gR2_database_2of2.zip ,可以下载到本地,通过ftp服务上传到Linux系统(参考CentOS7 FTP服务器搭建),也可以使用Linux系统的wget命令,下载文件包;
2、创建运行oracle数据库的系统用户和用户组:
用Root账号登录,运行下面指令,创建所需要用户和用户组,分组原因参考网址
groupadd oinstall #创建用户组oinstall
groupadd dba #创建用户组dba
useradd -g oinstall -g dba -m oracle #创建oracle用户,并加入到oinstall和dba用户组
groups oracle #查询用户组是否授权成功
passwd oracle #设置用户oracle的登陆密码,不设置密码,在CentOS的图形登陆界面没法登陆
id oracle #查看新建的oracle用户
3、创建oracle数据库安装目录(运行下面指令,创建账号和分配权限)
mkdir -p /data/oracle #oracle数据库安装目录
mkdir -p /data/oraInventory #oracle数据库配置文件目录
mkdir -p /data/database #oracle数据库软件包解压目录
cd /data
ls #创建完毕检查一下
chown -R oracle:oinstall /data/oracle #设置目录所有者为oinstall用户组的oracle用户
chown -R oracle:oinstall /data/oraInventory
chown -R oracle:oinstall /data/database
4、修改OS系统标识
oracle默认不支持CentOS系统安装, 修改文件 /etc/RedHat-release 内容为RedHat-7
vi /etc/redhat-release#修改成红色部分文字
redhat-7
5.安装oracle数据库所需要的软件包
以下是按照需要依赖的安装包,通过 yum install {包名} 来验证是否安装,例如yum install binutils
binutils-2.23.52.0.1-12.el7.x86_64
compat-libcap1-1.10-3.el7.x86_64
gcc-4.8.2-3.el7.x86_64
gcc-c++-4.8.2-3.el7.x86_64
glibc-2.17-36.el7.i686
glibc-2.17-36.el7.x86_64
glibc-devel-2.17-36.el7.i686
glibc-devel-2.17-36.el7.x86_64
ksh
libaio-0.3.109-9.el7.i686
libaio-0.3.109-9.el7.x86_64
libaio-devel-0.3.109-9.el7.i686
libaio-devel-0.3.109-9.el7.x86_64
libgcc-4.8.2-3.el7.i686
libgcc-4.8.2-3.el7.x86_64
libstdc++-4.8.2-3.el7.i686
libstdc++-4.8.2-3.el7.x86_64
libstdc++-devel-4.8.2-3.el7.i686
libstdc++-devel-4.8.2-3.el7.x86_64
libXi-1.7.2-1.el7.i686
libXi-1.7.2-1.el7.x86_64
libXtst-1.2.2-1.el7.i686
libXtst-1.2.2-1.el7.x86_64
make-3.82-19.el7.x86_64
sysstat-10.1.5-1.el7.x86_64
使用下面指令,检查依赖软件包
yum install binutils-2.* compat-libstdc++-33* elfutils-libelf-0.* elfutils-libelf-devel-* gcc-4.* gcc-c++-4.* glibc-2.* glibc-common-2.* glibc-devel-2.* glibc-headers-2.* ksh-2* libaio-0.* libaio-devel-0.* libgcc-4.* libstdc++-4.* libstdc++-devel-4.* make-3.* sysstat-7.* unixODBC-2.* unixODBC-devel-2.* pdksh*
6、关闭防火墙和selinux,具体操作可参考博客
7、修改内核参数
vi /etc/sysctl.conf #红色部分是要添加sysctl.conf内容
net.ipv4.icmp_echo_ignore_broadcasts = 1
net.ipv4.conf.all.rp_filter = 1
fs.file-max = 6815744 #设置最大打开文件数
fs.aio-max-nr = 1048576
kernel.shmall = 2097152 #共享内存的总量,8G内存设置:2097152*4k/1024/1024
kernel.shmmax = 2147483648 #最大共享内存的段大小
kernel.shmmni = 4096 #整个系统共享内存端的最大数
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 9000 65500 #可使用的IPv4端口范围
net.core.rmem_default = 262144
net.core.rmem_max= 4194304
net.core.wmem_default= 262144
net.core.wmem_max= 1048576
8、对oracle用户设置限制,提高软件运行性能(红色为添加部分)
vi /etc/security/limits.conf #红色部分要添加到Limits.conf内容
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
9、配置用户的环境变量(红色部分为添加代码)
vi /.bash_profile #红色部分是要追加bash_profile内容部分
export ORACLE_BASE=/data/oracle #oracle数据库安装目录
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1 #oracle数据库路径
export ORACLE_SID=orcl #oracle启动数据库实例名
export ORACLE_TERM=xterm #xterm窗口模式安装
export PATH=$PATH:$ORACLE_HOME/bin:/usr/sbin:$PATH #添加系统环境变量
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib #添加系统环境变量
export LANG=C #防止安装过程出现乱码
export NLS_LANG=AMERICAN_AMERICA.AL32UTF8 #设置Oracle客户端字符集,必须与Oracle安装时设置的字符集保持一致
配置完成,:wq!保存退出,运行source /.bash_profile时上述配置生效
10、获取安装包文件后解压安装包
获取安装包文件的方式,可通过ftp服务器,也可通过wget下载到指定目录,解压方式如下
unzip linux.x64_11gR2_database_1of2.zip -d /data/database/ #解压文件1
unzip linux.x64_11gR2_database_2of2.zip -d /data/database/ #解压文件2
chown -R oracle:oinstall /data/database/database/ #分配安装文件授权Oracle
Oracle安装
1、oracle用户登录系统,使用命令行跳转到data/database/database目录下,输入./runInstaller 调出安装页面;
下来是登陆oracle账户,可以在邮件里接收安全更新等信息,这里我取消了选择
yes确认
仅安装数据库软件,next:
单实例数据库安装,next:
在左边栏找到并添加简体中文的支持,next:
安装企业版,next:
默认,next:
依赖检查,这里点击忽略,因为我们安装了更高版本的对应软件,不影响后续进程,next:
点击finish开始安装:
等待。。。。。。。。。。。。。。。。。。。。。。。。。
根据提示
使用ROOT用户执行这两条命令
/home/oracle/oraInventory/orainstRoot.sh
/home/oracle/app/oracle/product/11.2.0/dbhome_1/root.sh
- 1
- 2
完成
vnc命令行中输入下命令创建监听
$netca
创建数据库
$dbca
这里的SID要与环境变量里的一致!!!!
启动数据库
$sqlplus "/as sysdba"
启动
SQL>startup
停止
SQL>shutdown immediate
查看监听状态:
$lsnrctl status
启动监听
$lsnrctl start
在数据库启动,开启监听后,就可以远程连
3、设置tomcat开机启动Tomcat脚本
5.1、执行指令vi /etc/rc.d/init.d/tomcat生成脚本文件,内容如下
#!/bin/bash
#
# /etc/rc.d/init.d/tomcat
# init script for tomcat precesses
#
# processname: tomcat
# description: tomcat is a j2se server
# chkconfig: 2345 86 16
# description: Start up the Tomcat servlet engine.
if [ -f /etc/init.d/functions ]; then
. /etc/init.d/functions
elif [ -f /etc/rc.d/init.d/functions ]; then
. /etc/rc.d/init.d/functions
else
echo -e "\atomcat: unable to locate functions lib. Cannot continue."
exit -1
fi
RETVAL=$?
CATALINA_HOME="/usr/java/tomcat7/apache-tomcat-7.0.69" #tomcat安装目录
case "$1" in
start)
if [ -f $CATALINA_HOME/bin/startup.sh ];
then
echo $"Starting Tomcat"
$CATALINA_HOME/bin/startup.sh
fi
;;
stop)
if [ -f $CATALINA_HOME/bin/shutdown.sh ];
then
echo $"Stopping Tomcat"
$CATALINA_HOME/bin/shutdown.sh
fi
;;
*)
echo $"Usage: $0 {start|stop}"
exit 1
;;
esac
exit $RETVAL
添加权限chmod 755 /etc/rc.d/init.d/tomcat,使得脚本文件可执行
运行:chkconfig --add /etc/rc.d/init.d/tomcat #将其加到服务中
启动tomcat服务: service tomcat start
停止tomcat服务: service tomcat stop
重启服务器验证:
4、CentOS Oracle11gR2 设置开机数据库和监听自启动
[1] 更改/etc/oratab
[root@localhost ~]# vi /etc/oratab # # This file is used by ORACLE utilities. It is created by root.sh # and updated by the Database Configuration Assistant when creating # a database. # A colon, ':', is used as the field terminator. A new line terminates # the entry. Lines beginning with a pound sign, '#', are comments. # # Entries are of the form: # $ORACLE_SID:$ORACLE_HOME:<N|Y>: # # The first and second fields are the system identifier and home # directory of the database respectively. The third filed indicates # to the dbstart utility that the database should , "Y", or should not, # "N", be brought up at system boot time. # # Multiple entries with the same $ORACLE_SID are not allowed. # # MFGS:/usr/oracle/app/product/11.2.0/dbhome_1:Y #改变此处默认N
[2] 更改启动脚本权限
# this is an example
#!/bin/bash
# oracle: Start/Stop Oracle Database 11g R2
#
# chkconfig: 345 90 10
# description: The Oracle Database is an Object-Relational Database Management System.
#
# processname: oracle
./etc/rc.d/init.d/functions
LOCKFILE=/var/lock/subsys/oracle
ORACLE_HOME=/data/oracle/product/11.2.0/dbhome_1
ORACLE_USER=oracle
case "$1" in
'start')
if [ -f $LOCKFILE ]; then
echo $0 already running.
exit 1
fi
echo -n $"Starting Oracle Database:"
su - $ORACLE_USER -c "$ORACLE_HOME/bin/lsnrctl start"
su - $ORACLE_USER -c "$ORACLE_HOME/bin/dbstart $ORACLE_HOME"
su - $ORACLE_USER -c "$ORACLE_HOME/bin/emctl start dbconsole"
touch $LOCKFILE
;;
'stop')
if [ ! -f $LOCKFILE ]; then
echo $0 already stopping.
exit 1
fi
echo -n $"Stopping Oracle Database:"
su - $ORACLE_USER -c "$ORACLE_HOME/bin/lsnrctl stop"
su - $ORACLE_USER -c "$ORACLE_HOME/bin/dbshut"
su - $ORACLE_USER -c "$ORACLE_HOME/bin/emctl stop dbconsole"
rm -f $LOCKFILE
;;
'restart')
$0 stop
$0 start
;;
'status')
if [ -f $LOCKFILE ]; then
echo $0 started.
else
echo $0 stopped.
fi
;;
*)
echo "Usage: $0 [start|stop|status]"
exit 1
esac
exit 0
[3] 更改启动脚本权限
[root@localhost ~]# chmod 755 /etc/rc.d/init.d/oracle
[root@localhost ~]# chkconfig oracle on
[4] 启动oracle数据库
[root@localhost ~]# service oracle start
相应关闭oracle数据库的命令为
[root@localhost ~]# service oracle stop
[6] 设置oracle为开机自启动
[root@localhost ~]# chkconfig --list oracle
oracle 0:off 1:off 2:on 3:on 4:on 5:on 6:off
【5】在阿里云控制台开发1521端口,不然无法链接oracle
【6】shell无法登陆阿里云服务器:添加白名单IP,在异常登陆里可以看到,,登陆历史可以查看到历史登陆IP(如下图),
二:Oracle用户
1,创建用户:
创建用户时,需要注意如下几个参数。
IDENTIFIED BY *** ,用户的密码。
DEFAULT TABLESPACE *** 默认用户表空间。
TEMPORARY TABLESPACE *** 默认临时空间。
CREATE USER xcj01 IDENTIFIED BY xcj01
DEFAULT TABLESPACE tsUserTest
TEMPORARY TABLESPACE tsTempTest;
2,修改密码:
alter user xcj01
identified by xcj01;
3,删除用户以及跟用户关联的对象:
drop user xcj01 CASCADE;
三:Oracle用户授权
1,Oralce的特殊权限
1.1,系统权限unlimited tablespace是隐含在dba, resource角色中的一个系统权限. 当用户得到dba或resource的角色时, unlimited tablespace系统权限也隐式受权给用户.
1.2,系统权限unlimited tablespace不能被授予role, 可以被授予用户.
1.3,系统权限unlimited tablespace不会随着resource, dba被授予role而授予给用户.
2,特殊角色
2.1,DBA角色,是授权数据库管理员的权限
2.2,CONNECT角色, 是授予最终用户的典型权利,最基本的 一个(CREATE SESSION)
2.3,RESOURCE角色,是授予开发人员的 默认有八个权限(CREATE SEQUENCE,CREATE TRIGGER,CREATE CLUSTER,CREATE PROCEDURE,CREATE TYPE,CREATE OPERATOR,CREATE TABLE,CREATE INDEXTYPE)
2.4,exp_full_database角色,拥有导出数据库的权限
2.5,imp_full_database角色,拥有导入数据库的权限
3,用户授权示
--授权
GRANT
CONNECT,
RESOURCE,
--DBA,
--unlimited tablespace,
CREATE SESSION,
CREATE ANY SEQUENCE,
CREATE ANY TABLE,
CREATE ANY VIEW ,
CREATE ANY INDEX,
CREATE ANY PROCEDURE,
CREATE ANY DIRECTORY,
ALTER SESSION,
ALTER ANY SEQUENCE,
ALTER ANY TABLE,
--ALTER ANY VIEW , --不能修改视图
ALTER ANY INDEX,
ALTER ANY PROCEDURE,
--ALTER ANY DIRECTORY, --不能修改目录
--DROP SESSION, --不能删除Session
DROP ANY SEQUENCE,
DROP ANY TABLE,
DROP ANY VIEW ,
DROP ANY INDEX,
DROP ANY PROCEDURE,
DROP ANY DIRECTORY,
SELECT ANY TABLE,
SELECT ANY DICTIONARY,
INSERT ANY TABLE,
UPDATE ANY TABLE,
DELETE ANY TABLE,
DEBUG ANY PROCEDURE,
DEBUG CONNECT SESSION,
exp_full_database,
imp_full_database
TO xcj01;
四:查询用户的权限
以下的查询中,基本都要以DBA的角色进行查询,如果权限不够,有可能查询不出来数据。
1,查看用户拥有那些角色
select * from dba_role_privs a where a.grantee='XCJ01';
--或
select * from dba_sys_privs a where a.grantee='XCJ01';
2,查看角色拥有那些权限
select ROLE, PRIVILEGE from role_sys_privs where role='RESOURCE'; --RESOURCE,CONNECT,DBA
--或
select grantee,privilege from dba_sys_privs where grantee='RESOURCE';
3,为用户取消角色
revoke resource from XCJ01;
4,为用户取消权限
revoke unlimited tablespace from XCJ01;
5,最后附加一个非常有用的技巧:查看Oracle的版本号。
select * from v$version where rownum <=1;
以上工作做完,就可以用navicat 迁移数据和表结构过来了、、、、、、、、、、、、、、、、、、、、、、
参考博客:
从安装系统到oracle数据库生产环境(centos6.8)搭建-完全版
CentOS7安装Oracle 11gR2 安装
Oracle表空间,用户,用户授权