创建用户步骤
第1步:在windows的dos命令 登陆 oracle数据库
sqlplus system/123456@orcl
创建用户
create user matech identified by matech0102; (输入命令后,要点击键盘的 Enter键)
解释:create user 数据库用户名 identified by oracle数据库用户的密码;
创建表空间
create tablespace matech datafile ‘F:\Oracle-Not-Delete\oracle-tableSpace\matech.dbf’ size 20000M;
create tablespace matech_temp datafile ‘F:\Oracle-Not-Delete\oracle-tableSpace\matech_temp.dbf’ size 5000M;
解释:create tablespace oracle数据库表空间的名称 datafile 表空间的位置 size 表空间的大小;
授权用户使用表空间
alter user matech quota unlimited on matech;
alter user matech quota unlimited on matech_temp;
给用户授权
grant connect,resource,dba to matech;
grant create table to matech;
grant drop any table to matech;
grant insert any table to matech;
grant update any table to matech;
grant create session to matech;
oracle导入数据库的步骤
第1步:(如果已经创建则跳过这一步)
F:\Oracle-Not-Delete\databaseFile
create directory matech as ‘F:\Oracle-Not-Delete\databaseFile’;
第2步:
第一个 matech是目录
第二个matech 是 oracle用户
grant read,write on directory matech to matech;
第3步:
把备份好的数据库文件 matech_2019_05_21.dmp 拷贝到 matechDirectory 这个目录下(实际上是拷贝到 G:\oracle\databaseFile 这个文件夹下面)