数据库导入
sqlplus / as sysdba;
创建表空间:
1、临时表空间:
create temporary tablespace hnyygk_temp tempfile 'D:\Oracle\orcl\hnyygk_temp.dbf' size 50m autoextend on next 50m maxsize 20480m extent management local;
2、表空间:
CREATE TABLESPACE hnyygk LOGGING DATAFILE 'D:\Oracle\orcl\hnyygk.DBF' SIZE 32M AUTOEXTEND ON NEXT 32M MAXSIZE UNLIMITED EXTENT MANAGEMENT LOCAL;
3、创建用户:
create user c##hnyxgk identified by dmis1234 DEFAULT TABLESPACE hnyygk TEMPORARY TABLESPACE hnyygk_temp;
注:hnyygk需要和表空间的hnyygk一致
注:create user hnyxgk identified by dmis1234:用户名是hnyxgk,密码是:dmis1234
注:DEFAULT TABLESPACE hnyygk TEMPORARY TABLESPACE hnyygk_temp:告诉数据库让指定用户使用上方创建的表空间
注:如果是12C数据库,用户名前面需要加c##,如c##hnyxgk
4、授予权限:
grant dba,resource,connect to hnyxgk;
5、导入数据库:
imp hnyxgk/dmis1234 file=D:\GitCode\海南运营管控\data20180325.dmp full=y ignore=y statistics=none buffer=81920
exp hnyxgk/dmis1234@127.0.0.1:1521/hnyygk file=D:\hn.dmp owner=hnyxgk
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
导入导出:
exp hnyxgk/dmis12345@172.16.8.196:1521/orcl file=D:\databak\hnyygk2018888.dmp owner=hnyxgk
imp hnyxgk/dmis12345@172.16.8.196:1521/orcl file=D:\databak\hnyygk2018888.dmp full=y ignore=y statistics=none buffer=81920
因为用户和密码都加在参数里面了