Oracle 使用者、資料表空間、授權、備份、匯入等操作相關

來源:互聯網
上載者:User

標籤:grant   資料表空間   刪除表   cto   impdp   set   ati   local   figure   

一、基礎操作

閑來無事,整理oracle資料庫相關操作,以後備用。。。。。

ps: satp 為使用者   satp_data 為資料表空間   

 1 1.刪除資料表空間 2  DROP TABLESPACE satp_data INCLUDING CONTENTS AND DATAFILES; 3  4 2.刪除使用者 5 drop user satp cascade; 6  7 3.建立資料表空間   --此命令裡面   ‘F:\app....’   此為資料表空間隱藏檔位置   8  9 CREATE TABLESPACE SATP_DATA10  LOGGING11  DATAFILE ‘F:\app\SATP1_DATA01.DBF ‘ 12  SIZE 1024M 13  AUTOEXTEND ON 14  NEXT 512M MAXSIZE 20480M15  EXTENT MANAGEMENT LOCAL;16 17  4.建立使用者18 19 CREATE USER satp IDENTIFIED BY satp DEFAULT TABLESPACE SATP_DATA;        指定預設資料表空間20 21 --給已存在的使用者指定資料表空間22 alter user username  default tablespace userspace;23 24 25 --給使用者授權26 grant connect,resource to satp;27 28 grant dba to satp;29 30 grant create any table to satp;31 32 --建立匯入匯出目錄33 create directory satpimp as ‘f:\app\satpimp‘;34 35 36 --給使用者授權使用匯入匯出目錄37 grant read,write on directory satpimp to satp;38 39 --設定oracle11g下匯入空表40 alter system set deferred_segment_creation=false scope=both;41 42 show parameter deferred_segment_creation;43 44 --修改rman的預設參數,自動備份控制檔案45 CONFIGURE CONTROLFILE AUTOBACKUP ON;46 47 --修改rman的預設參數,備份控制檔案的路徑48 RMAN> CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO ‘d:\backup\%F‘

二、備份匯入匯出

一、匯出ps:當設定CONTENT為ALL 時,將匯出對象定義及其所有資料.為DATA_ONLY時,只匯出對象資料,為METADATA_ONLY時,只匯出對象定義,其中使用METADATA_ONLY匯出資料表結構--匯出全部資料(僅資料)expdp name/password@database  dumpfile=xxx.dmp content=data_only--匯出某些表(表之間用逗號隔開)expdp name/password@database  tables=tablename,tablename dumpfile=xxx.dmp content=data_only二、匯入ps:   remap_schema當你從A使用者匯出的資料,想要匯入到B使用者中去,就使用這個:remap_schema=A:B      remap_tablespace 類似用法--匯入備份檔案          impdp name/password@database DIRECTORY=impdir(建立的匯入匯出檔案夾  見-中33行)  DUMPFILE=dump.DMP(備份檔案名) remap_schema=satp:fcg remap_tablespace=SATP_DATA:FCG_DATA

 

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.