---
title: "oracle笔记"
author: "deejay"
date: "2011-08-17T16:59:41Z"
tags: []
categories: ["数据库"]
slug: "oracle"
draft: false
lastmod: "2013-03-19T14:33:38Z"
id: 1151553
url: "https://deejay.iteye.com/blog/1151553"
---

//删除表空间  
DROP TABLESPACE gzgl\_temp INCLUDING CONTENTS AND DATAFILES;

//删除用户

DROP USER gzgl cascade  
create temporary tablespace GZGLPTDB\_TEMP   tempfile 'G:\\oracle\\oradata\\gzgl\_temp.dbf'  size 50m  autoextend on next 50m maxsize 20480m  extent management local;  

//创建数据表空间  

create tablespace GZGLPTDB\_DATA logging  datafile 'G:\\oracle\\oradata\\gzgl\_data.dbf'  size 50m  autoextend on next 50m maxsize 20480m extent management local;  

//创建用户并指定表空间  

create user gzglptdb identified by gzglptdb default tablespace GZGLPTDB\_DATA temporary tablespace GZGLPTDB\_TEMP;    
//给用户授予权限    
grant connect,resource,imp\_full\_database to gzglptdb;  

//导出DMP  
exp gzglptdb/gzglptdb @10.11.23.43:1521/orcl

//导入DMP  
imp gzglptdb/gzglptdb

 

二、创建和管理JOB没有权限

oracle中创建job是通过调用dbms\_scheduler.create\_job来做. 用户需要能创建job,管理job  
对应的权限:  
1\) create job  
2\) manager scheduler

相应命令如下：

grant create job to orace\_user1;  
grant manage scheduler to orace\_user1;

 

解锁用户

&lt;!--StartFragment --&gt;

alter user scott account unlock;