越是薄弱,越要勇敢面对
干了这行都快两年半了,一直知道自己的薄弱点是什么,但是都没有系统得去加强这方面,每个人都有不足的地方,就是要面对不足,才会变的更完美,之前在学校学过mysql,sql sever, oracle等数据库,上家公司都是用得MySQL,不过现在主要做得银行项目,就用到了oracle,就方便之余把经常用得oracle操作记录下来,方便以后需要得时候查找
1.oracle创建用户及表空间
-- 先登陆数据库
sqlplus / as sysdba
-- 创建临时表空间
create temporary tablespace "表空间名" tempfile '/oradata/orcl/fms_test_temp.dbf' size 200M;
-- 创建数据表空间
create tablespace "表空间名" datafile '/oradata/oracl/fms_test_data.dbf' size 200M autoextend on next 200M maxsize 10G;
-- 创建用户并设定表空间
create user fms_test identified by fms_test default tablespace fms_test_data temporary tablespace fms_test_temp;
2.oracle 导入导出命令
-- 首先创建dump路径
create directory fms_test_dump as '/oradata/dumo';
-- 赋予读写权限给用户
grant read, write on directory fms_test_dump to fms_test;
-- 导出 dump
expdp \'/ as sysdba\' directory=fms_test_dump dumpfile=fms_test.dmp schemas=fms_test compression=all
-- 导入 dump
impdp \'/ as sysdba\' directory=fms_test_dump dumpfile=fms_test.dmp remap_schema=fms_test:fms_test2