1,首先创建用户
语法[创建用户]: create user 用户名 identified by 口令[即密码];
例子:create user zhengxin identified by zhengxin;
2.给用户赋予dba权限 grant dba to zhengxin
3.打开cmd命令行
语法:mp 用户名/密码@主机IP:端口号/实例 file=dmp文件所在的路径 full=y.
输入:imp zhengxin/zhengxin@localhost:1521/orcl file="e:\个人业务数
据.dmp" full=y;
例子:C:\Users\Administrator> imp zhengxin/zhengxin@localhost:1521/orcl file="e:\个人业务数
据.dmp" full=y;
这样数据就导入成功了。
如果oracle密码忘记了,打开cmd
直接输入:>sqlplus /nolog
>conn /as sysdba;
>alter user sys identified by sys;
会提示你密码修改成功。记得在此之前,oralce服务一定要打开
创建临时表空间
create temporary tablespace yuhang_temp
tempfile 'D:\oracledata\yuhang_temp.dbf'
size 50m
autoextend on
next 50m maxsize 20480m
extent management local;
创建表空间,我这是创建了2个表空间
CREATE TABLESPACE loan
LOGGING
DATAFILE 'D:\oracledata\yinhang_data.dbf'
SIZE 256M
AUTOEXTEND ON;
CREATE TABLESPACE xindai
LOGGING
DATAFILE 'D:\oracledata\xindai_data.dbf'
SIZE 256M
AUTOEXTEND ON;
创建用户并指定表空间
create user minsheng identified by minsheng
default tablespace loan
temporary tablespace yuhang_temp;
alter user minsheng default tablespace xindai;
给用户授予权限
grant connect,resource,dba to minsheng;
导出空表
Select 'alter table '||table_name||' allocate extent;' from user_tables where num_rows=0