oracle常用命名總結

來源:互聯網
上載者:User

標籤:

聲明:本文為博主在做項目中用到的一些常用命令,請勿轉載。

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/[email protected]/oracle file=E:\bkNew\daochu.dmp tables=S_COUNTRY grants=n fromuser=vms touser=c##vms buffer=100000000

imp MES/[email protected] 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/[email protected]/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常用命名總結

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.