#Oracle
---
##倒库操作
###step1.用户文件导出DUMP:
```sql
exp gisnres/gisnres@GIS_NEW_RES owner=gisnres file=C:\TEMP\dmp\gisnres.dmp consistent=n feedback=10000 direct=y recordlength=65535 compress=n buffer=512000 log=C:\TEMP\dmp\log\gisnres.log
```
![导出成功提示](images\oracle_exp_demo.png)
###step2.新建用户
```sql
--新建用户
create user gisnres identified by gisnres;
--授予权限
grant dba to gisnres;--赋予所有权限(需要DBA)
grant create session to gisnres;--授予登录权限
--grant users tablespace to gisnres;--授予表空间权限
grant create table to gisnres;--建表权限
grant drop table to gisnres;--删除表权限
grant insert table to gisnres;--插入表权限
grant update table to gisnres;--更新表权限
```
###step3.导入数据
```sql
imp gisxzy/gisxzy@GIS_NEW_RES fromuser=gisxzy touser=gisnres file=C:\TEMP\dmp\gisxzy.dmp ignore=y
```
![导入](images\oracle_imp_demo.png)
````
CMD 命令:导出用户下所有文件
exp gisxzy/gisxzy@GIS_NEW_RES owner=gisxzy file=C:\TEMP\dmp\gisxzy.dmp consistent=n feedback=10000 direct=y recordlength=65535 compress=n buffer=512000 log=C:\TEMP\dmp\log\gisxzy.log
赋予权限
grant dba to gisnres;
导入到指定用户:
````sql
imp gisxzy/gisxzy@GIS_NEW_RES fromuser=gisxzy touser=gisnres file=C:\TEMP\dmp\gisxzy.dmp ignore=y
````