oracle 建立表空間和使用者流程

2021-07-15 07:46:38 字數 4652 閱讀 5874

--用oralce sys使用者執行以下語句

--create tablespace

--確保路徑資料夾存在,不存在需建立且用chmod語句授權777

create tablespace fmss

logging

datafile

create tablespace dlt

logging

datafile

create tablespace work

logging

datafile

create tablespace metabase

logging

datafile

create tablespace report

logging

datafile

--create user fmss

create user fmss identified by fmss

default tablespace fmss

temporary tablespace temp

profile default account unlock;

grant "connect" to fmss;

grant "resource" to fmss;

grant unlimited tablespace to fmss;

grant create any view to fmss;

grant drop any view to fmss;

alter user fmss default role all;

grant create any table to fmss;

grant debug connect session to fmss;

grant create public synonym to fmss;

grant drop public synonym to fmss;

--create user dlt

create user dlt identified by dlt

default tablespace dlt

temporary tablespace temp

profile default account unlock;

grant "connect" to dlt;

grant "resource" to dlt;

grant unlimited tablespace to dlt;

grant create any view to dlt;

grant drop any view to dlt;

alter user dlt default role all;

grant create any table to dlt;

grant debug connect session to dlt;

grant create public synonym to dlt;

grant drop public synonym to dlt;

--create user work

create user work identified by work

default tablespace work

temporary tablespace temp

profile default account unlock;

grant "connect" to work;

grant "resource" to work;

grant unlimited tablespace to work;

grant create any view to work;

grant drop any view to work;

alter user work default role all;

grant create any table to work;

grant debug connect session to work;

grant create public synonym to work;

grant drop public synonym to work;

--create user metabase

create user metabase identified by metabase

default tablespace metabase

temporary tablespace temp

profile default account unlock;

grant "connect" to metabase;

grant "resource" to metabase;

grant unlimited tablespace to metabase;

grant create any view to metabase;

grant drop any view to metabase;

alter user metabase default role all;

grant create any table to metabase;

grant debug connect session to metabase;

grant create public synonym to metabase;

grant drop public synonym to metabase;

--create user report

create user report identified by report

default tablespace report

temporary tablespace temp

profile default account unlock;

grant "connect" to report;

grant "resource" to report;

grant unlimited tablespace to report;

grant create any view to report;

grant drop any view to report;

alter user report default role all;

grant create any table to report;

grant debug connect session to report;

grant create public synonym to report;

grant drop public synonym to report;

--建立資料幫浦檔案目錄

create or replace directory dir_dmp as '/dir_dmp/dump';

grant read,write on directory dir_dmp to fmss,dlt,work,metabase,report;

上傳檔案到/dir_dmp/dump目錄下,然後解壓檔案

tar -xvzf fmss_dlt_20160526.tar.gz

然後使用資料幫浦匯入dmp

impdp fmss/fmss directory=dir_dmp dumpfile=fmss_201607141650.dump log=fmss_201607141650.log;

impdp dlt/dlt directory=dir_dmp dumpfile=dlt_201607141650.dump log=dlt_201607141650.log

impdp work/work directory=dir_dmp dumpfile=work_201607141650.dump log=work_201607141650.log

impdp report/report directory=dir_dmp dumpfile=report_201607141650.dump log=report_201607141650.log

impdp metabase/metabase directory=dir_dmp dumpfile=metabase_201607141650.dump log=metabase_201607141650.log

在匯入資料的過程中,如果出現警告或者由於使用者不存在而提示的錯誤,可以忽略;

刪除 使用者和表空間:

drop user fmss cascade;

drop user dlt cascade;

drop user metabase cascade;

drop user work cascade;

drop user report cascade;

drop tablespace fmss including contents and datafiles;

drop tablespace dlt including contents and datafiles;

drop tablespace metabase including contents and datafiles;

drop tablespace work including contents and datafiles;

drop tablespace report including contents and datafiles;

如果windows客戶端

Oracle建立表空間和使用者

oracle建立表空間和使用者 sql view plain copy 建立表空間和使用者的步驟 使用者 建立 create user 使用者名稱 identified by 密碼 授權 grant create session to 使用者名稱 grant create table to 使用者名...

Oracle建立表空間和使用者

oracle建立表空間和使用者 sql view plain copy 建立表空間和使用者的步驟 使用者 建立 create user 使用者名稱 identified by 密碼 授權 grant create session to使用者名稱 grant create table to使用者名稱 ...

Oracle建立表空間和使用者

oracle建立表空間和使用者 sql view plain copy 建立表空間和使用者的步驟 使用者 建立 create user 使用者名稱 identified by 密碼 授權 grant create session to使用者名稱 grant create table to使用者名稱 ...