sqlplus sys/password@orcl as sysdba ----cmd 进入Oracle sqlplus
1.删除用户
例子:drop user PT_CHENZHOU cascade;
:drop user 用户名 cascade;
2.删除表空间
例子:DROP TABLESPACE PT_CHENZHOU INCLUDING CONTENTS AND DATAFILES;
DROP TABLESPACE 表空间名字 INCLUDING CONTENTS AND DATAFILES;
3.创建表空间
例子:CREATE TABLESPACE PT_CHENZHOU DATAFILE 'D:\datasource\PT_CHENZHOU.DBF' SIZE 4096M EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO;
CREATE TABLESPACE 表空间名 DATAFILE '表空间存放路径' SIZE 表空间大小值M EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO;
4.创建用户
例子:CREATE USER PT_CHENZHOU IDENTIFIED BY PT_CHENZHOU DEFAULT TABLESPACE PT_CHENZHOU ;
CREATE USER 用户名 IDENTIFIED BY 密码 DEFAULT TABLESPACE PT_CHENZHOU ;
5.授权
例子:GRANT CONNECT, RESOURCE, DBA TO PT_CHENZHOU;
GRANT CONNECT, RESOURCE, DBA TO 用户名;
1、导入例子:
imp PT_CHENZHOU/PT_CHENZHOU@127.0.0.1:1521/orcl file=D:\datasource\PT_CHENZHOU201805311919.dmp full=y
imp 用户名/密码@127.0.0.1:1521/orcl file=D:\datasource\备份名字.dmp full=y
2、导出例子:
exp c##PT_CHENZHOU/PT_CHENZHOU@orcl file=d:\20180320.dmp owner=c##PT_CHENZHOU
exp 用户名/密码U@orcl file=备份路径.dmp owner=用户名
3 如何制作自动备份数据库