当前位置:Gxlcms > 数据库问题 > oracle常用命名总结

oracle常用命名总结

时间:2021-07-01 10:21:17 帮助过:2人阅读

声明:本文为博主在做项目中用到的一些常用命令,请勿转载。

oracle常用命名总结

创建表空间:

--create tablespace vms
--datafile ‘e:\vms.dbf‘
--size 32000M
--extent management local uniform size 100M;
drop user c##vms;
create user c##vms identified by vms2014
default tablespace vms;

删除表空间

DROP TABLESPACE tablespacename INCLUDING CONTENTS AND DATAFILES CASCADE CONSTRAINTS;
grant all privileges to c##vms;

授权

grant dba to c##vms;
alter user c##vms quota unlimited on vms;

导入

imp c##vms/vms2014@127.0.0.1/oracle file=E:\bkNew\daochu.dmp tables=S_COUNTRY grants=n fromuser=vms touser=c##vms buffer=100000000

imp MES/MES@MES file=E:\DB\oracle.dmp ignore=y tables=(ECUA2LFILEVER,ECUVERSION,ECUDCMFILE,ECUEWPFILE,ECUFILEINFO,ECUIMAGE,ECUMODELREFERENCE,ECUTESTREPORT) FULL=N

导入的时候:

CONSTRAINTS=n不导入约束
imp_tian.par

userid=system/password
file = exp_tian.dmp
fromuser=sasman
touser=oraver02
buffer=20000000
ignore=y
grants=n
CONSTRAINTS=n
rows=y
log=imp_tian.log
commit=y

nohup imp parfile=imp_tian.par 2>imp_tian.out 1>&2 &

很简单,查 dba_tablespaces 数据字典:
select tablespace_name from dba_tablespaces;

··如果有服务没启动。
alter database datafile ‘file_name‘ offline drop
这个file_name你要改成你删掉的那个文件路径加文件名。
追问
执行成功了 还是见不来其他的表空间啊
回答
执行成功了 你要 把数据库打开啊;
alter database open;

EXP SONIC/SONIC BUFFER=64000 FILE=C:\SONIC.DMP OWNER=SONIC TABLES=(SONIC) 
这样用户SONIC的表SONIC就被导出

删除有数据的表空间
alter tablespace vms offline

drop tablespace vms including contents;

设置自动增长的表空间

autoextend on next 1000M maxsize umlimited extent management local segment space management auto;

create tablespace "JYDB" logging datafile ‘d:\oracle\oradata\JYDB.dbf‘ size 5000M autoextend on next 1000M maxsize unlimited extent management local segment space management auto;

C:\Users\Administrator>imp ctbt/111111@127.0.0.1/orcl file=E:\imp\daochu.dmp fromuser=vms touser=ctbt constraints=n ignore=y buffer=819200;

例如: IMP SCOTT/TIGER IGNORE=Y TABLES=(EMP,DEPT) FULL=N

 

oracle常用命名总结

标签:

人气教程排行