数据库创建,用户管理,导入dmp文件

创建数据库文件
CREATE TABLESPACE toolset LOGGING DATAFILE '/home/oracle/app/oracle/oradata/orcl/toolset.dbf' SIZE 100M AUTOEXTEND ON NEXT 32M MAXSIZE 500M EXTENT MANAGEMENT LOCAL;

创建数据库临时文件
create temporary TABLESPACE toolset_temp tempfile '/home/oracle/app/oracle/oradata/orcl/toolset_temp.dbf' SIZE 100M AUTOEXTEND ON NEXT 32M MAXSIZE 500M EXTENT MANAGEMENT LOCAL;

创建用户与两个文件之间的映射关系
CREATE USER toolset IDENTIFIED BY Aa111111 DEFAULT TABLESPACE toolset TEMPORARY TABLESPACE toolset_temp;

添加用户权限
grant connect,resource,dba to toolset;
grant create session to toolset;

删除数据库
conn sys/dwh as sysdba;
drop tablespace MyDataBase including contents and datafiles;
drop tablespace MyDataBase_temp including contents and datafiles;

删除用户
drop user username cascade;

imp usename/password@SID full=y file= d:\data\xxxx.dmp ignore=y

导入dmp文件,在命令行模式下,需要切换到oracle用户,而且文件需要可读
imp toolset/Aa111111@127.0.0.1/orcl file=/root/oracle11g_AMERICAN_AMERICA.ZHS16GBK.dmp full=y ignore=y;

上一篇:js求时间差,两个日期月份差


下一篇:2 Oracle用户和表空间