java 导入导出的 命令
$exp lddba/ld_321@192.168.1.3/testora file=E:\db_bak\ld20170219_1testora.dmp log=E:\db_bak\ld20170219_1testora.log full=y;
$imp lddba/ld_321@127.0.0.1/ldora file=E:\ld20170225_1test.dmp log=E:\ld20170225_1testimp.log fromuser=lddba touser=lddba statistics=none;
/***********************************************************************
Oracle11g 空表处理
*************************************************************/
statistics=none是为了不导入统计信息,如果表很大,导入统计信息会花很长时间;
rows:表示导出数据行full( 全库导出): 导出除ORDSYS,MDSYS,CTXSYS,ORDPLUGINS,LBACSYS 这些系统用户之外的所有用户的数据.下面这个应该是imp时的参数,exp没有ignore=y 表示忽略创建错误,继续后面的操作
show parameter deferred_segment_creation
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
deferred_segment_creation boolean TRUE
SQL> alter system set deferred_segment_creation=false;
系统已更改。
SQL> show parameter deferred_segment_creation
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
deferred_segment_creation boolean FALSE
处理后需要重启 才能生效
select 'alter table '|| table_name|| ' allocate extent ; ' from user_tables where NUM_rows =0;
/********************************************************************/
----创建数据库
----创建数据库表空间
----赋值对应的权限
-- Create the user
create user SCMDBA
identified by "scm_321" --密码
default tablespace USERS
temporary tablespace TEMP
profile DEFAULT
password expire;
-- Grant/Revoke object privileges
grant select on DUAL to SCMDBA;
grant select on PENDING_TRANS$ to SCMDBA;
-- Grant/Revoke role privileges
grant connect to SCMDBA;
grant dba to SCMDBA with admin option;
grant exp_full_database to SCMDBA;
grant imp_full_database to SCMDBA;
grant resource to SCMDBA;
-- Grant/Revoke system privileges
grant administer any sql tuning set to SCMDBA with admin option;
grant alter user to SCMDBA;
grant create any view to SCMDBA;
grant create session to SCMDBA;
grant create user to SCMDBA;
grant drop any view to SCMDBA;
grant drop user to SCMDBA;
grant unlimited tablespace to SCMDBA with admin option;