oracle表空間的建立及dmp 檔案的匯入

2022-07-18 02:30:17 字數 1769 閱讀 6132

--用oracle系統許可權的賬號 登陸 

-- 1.建立使用者

create user u_name identified by "

u_password

";

--2.賦予許可權

grant dba, resource, connect  to u_name;  

grant create session to u_name;

grant create table to u_name;

grant create view to u_name;

grant create tablespace to u_name;

grant unlimited tablespace to u_name;

grant select any table to u_name;

grant select any dictionary to u_name;

--3.建立目錄 dictionary

create directory directory_name  as 'd:\oracleenv\oracle\product\11.2.0\db\backup'; --路徑可以自己指定

--4.賦予目錄許可權

grant read,write on directory directory_name  to u_name;

--5.建立表空間

create tablespace table_space_name 

datafile 'd:\oracleenv\oracle\product\11.2.0\dbhome_1\oradata\table_space_name.dbf'

size 2500m

autoextend on next 500m maxsize 12000m;

--6.修改表空間配置

alter user table_space_name  default tablespace u_name;

--8.檢視表空間

select tablespace_name , file_id,bytes from dba_data_files where tablespace_name='my_table_space_name';

-- 9.匯入資料

-簡單版 

impdp u_name/u_password@orcl dumpfile=file_path full=y table_exists_action=replace

--常用版

impdp u_name/u_password@ip_address/space_name directory=my_director full=y dumpfile=my_dmp_file.dmp logfile=my_dmp_file.log table_exists_action=replace;

--高階版

impdp u_name/u_password@ip_address/space_name directory=my_director full=y dumpfile=my_dmp_file.dmp logfile=my_dmp_file.log 

[remap_schema=user_1:user_2] [remap_tablespace =table_space_1:table_space_2] [table_exists_action=replace]

oracle建立表空間 使用者 授權及匯入dmp

1.建立表空間和使用者 echo 登入sql plus 表空間使用者.sql 後面跟四個引數,依次為 表空間名,資料檔案路徑,新建使用者名稱,密碼 sqlplus system manager orcl as sysdba 表空間使用者.sql ts name d orcl oradata ts n...

oracle建立表空間及使用者

以system使用者登入後,建立表空間 connect system manager create tablespace 表空間名稱 datafile oracle base oradata oracle sid 資料檔案.dbf size 100m reuse autoextend on next...

oracle建立表空間及使用者

分為四步 第1步 建立臨時表空間 create temporary tablespace user temp tempfile d oracle oradata oracle9i user temp.dbf size 50m autoextend onnext 50m maxsize 20480m ...