为导入数据库创建表空间和用户
sqlplus system/password
conn /as sysdba
create tablespace User datafile 'D:/Oracle10g/XXXX .dbf' size 500M;
create user User identified by password default tablespace User ;
grant dba to User ;
exit
导入数据库
imp User/password file=d.dmp full=y
导出
exp User/password@XE file=d:/d.dmp owner=(User)
逆向操作
连接数据库
sqlplus system/password
系统dba
conn /as sysdba
删除用户:
DROP TABLESPACE User INCLUDING CONTENTS AND DATAFILES;
drop user User cascade;
补充:
ubuntu:下设置jdk + tomcat + oralce 环境变量
终端输入 sudo gedit /etc/profile 在文件中添加如下的内容
#set java environment
JAVA_HOME=/home/username/java/jdk1.6.0_19
export JRE_HOME=/home/username/java/jdk1.6.0_19/jre
export CLASSPATH=.:$JAVA_HOME/lib:$JRE_HOME/lib
#set tomcat environment
export CATALINA_HOME="/home/username/java/apache-tomcat-6.0.26"
#oracle environment variable
export ORACLE_HOME=/usr/lib/oracle/xe/app/oracle/product/10.2.0/server/
#oracle database name
export ORACLE_SID=XE
#character and language set
export NLS_LANG=AMERICAN_AMERICA.AL32UTF8
#Search path for shared libraries
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
#Search path used by SQL Command Line
export SQLPATH=$ORACLE_HOME/sqlplus/admin
export PATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/bin:$CATALINA_HOME/bin:$ORACLE_HOME/bin
保存退出:在终端输入:java ,javac ,$CATALINA_HOME/bin/startup.sh , sqlplus system/password as sysdba
检测是否设在对即可。