Oracle 创建数据库并导入数据

oracle 数据库中如何新建实例,然后导入数据

         在工作经常需要建一个库,建个表空间,再新建用户,配置权限,导入数据。

  第一步 用DBCA新建数据库,这个就下一步好,没什么好说的,

  第二步 建表空间:create tablespace work datafile 'E:\ghoa\ldghTableSpace\work.dbf' size 400m autoextend on next 20m online;

  第三步 新建用户:create user work identified by work;

  第四步 付权:

Alter user work default tablespace work quota unlimited on work;
grant create session to work;
grant connect to work;
grant connect, resource, dba to work;
grant create table to work;
grant create view to work;
grant create trigger to work;
grant select any table to work;
grant create sequence to work;
grant create procedure to work;
grant create role to work;
grant create type to work;
grant GRANT ANY PRIVILEGE to work

这个是用命令,还有一种方式是用PLSQL,直接新建用户,然后编辑该用户,直接付权,

  第五步  是导入数据 在导入数据时,我也遇到一个问题,就是用system用户登录时导入的数据都导到system表了,只有用当前用户导入才导到当前的表中。

 

下面是平时还经常要用到的几个命令:
drop user usernam cascade;

sqlplus sys/gis@lxgh as sysdba

猜你喜欢

转载自wge838.iteye.com/blog/2183343