1. 程式人生 > >oracle創建表空間、創建用戶、授權角色和導入導出用戶數據

oracle創建表空間、創建用戶、授權角色和導入導出用戶數據

con user esp pac miss font ora sql mission

使用數據庫管理員身份登錄

-- log as sysdba
sqlplus / as sysdba;

創建臨時表空間

-- create temporary tablespace
create temporary tablespace szdt_temp_data
tempfile d:\szdt-environment\oracle-datafiles\szdt_temp_data.dbf
size 32m
autoextend on
next 32m maxsize unlimited
extent management local;

創建表空間

--
create tablespace create tablespace szdt_data logging datafile d:\szdt-environment\oracle-datafiles\szdt_data.dbf size 32m autoextend on next 32m maxsize unlimited extent management local;

創建用戶

-- create user 
create user szdt identified by szdt
account unlock
default tablespace szdt_data
temporary tablespace szdt_temp_data;

給用戶授予權限

-- grant permission to user
grant dba,connect,resource to szdt;

連接到用戶

-- connect to user
conn szdt/szdt@127.0.0.1:1521/orcl

導出dmp文件

-- export to dmp file
exp szdt/szdt@orcl file=d:/szdt-environment/backup-dmps/szdt.dmp

導入dmp文件

-- import from dmp file
imp szdt/szdt@orcl file=d:/szdt-environment/backup-dmps/szdt.dmp full=y

這些就是oracle在命令行下創建表空間、創建用戶、授權角色和導入導出用戶數據的所有操作命令。

oracle創建表空間、創建用戶、授權角色和導入導出用戶數據