oracle export dmp file collection

Oracle export dmp file collection

  • Export all tables under a certain user
exp 用户名/用户密码@ORCL file=D:\dmp\DEMO_20220121.dmp owner=用户名 buffer=8192000 log=D:\dmp\DEMO_20220121_daochu.log
  • Export all tables under the specified table name
exp DEMO/DEMO@ORCL file=D:\dmp\DEMO_20220121_ep.dmp tables=('表名','表名','表名') buffer=8192000 log=D:\dmp\DEMO_20220121_ep_daochu.log
  • Export tables starting with ** (indicates exporting all tables starting with DEMO_ under the DEMO user)
exp 用户名/用户密码@ORCL_MDPC file=D:\dmp\DEMO_20220307_demo.dmp tables=(用户名.DEMO_%) buffer=8192000 log=D:\dmp\DEMO_20220307_demo_daochu.log

extension:

full = y export the whole library
owner = (user1, user2) export the specified user

The imp command imports the dmp file into the database

imp 用户名/密码@ORCL file=D:\dmp\DEMO_20220121.dmp full=y 

ORACLE These objects are exported by XXXX, not the current user

imp sa3/123456 file=xxx full=y ingore=y

EXP-00091: Exporting problematic statistics.

The reason for the problem is that the character encoding in Oracle on the server side is inconsistent with the character encoding on the client side, which leads to this problem.

Solution

  • Log in to sqlplus to query client-related information
select * from V$NLS_PARAMETERS
  • Query server code
SELECT * FROM NLS_DATABASE_PARAMETERS;

Pay attention to NLS_LANGUAGE (language), NLS_TERRITORY (region), NLS_CHARACTERSET (character set); the
value format of the environment variable setting is: language_region.Character set

Check whether the relevant character sets are the same, if they are different, please change them to one to

insert image description here

  • modification method
    • windows+R—>enter regedit to open the registry
    • Check the following path –> HKEY_LOCAL_MACHINE –> SOFTWARE –> Wow6432Node –> ORACLxEKEY_Oracle_11g

insert image description here

problem solved

expdp for dmp file export

Expdp export
Make sure that the data backup path has been created, if not, create it according to the instructions in the preparation work. (Note: If the CPU resources are sufficient, it is strongly recommended to enable the parallel parameter, which can greatly save the import and export time)
The first type: "full=y", to export the database in full:
expdp user/passwd@orcl dumpfile=expdp.dmp directory=data_dir full=y logfile=expdp.log;

The second type: schemas are exported by user:
expdp user/passwd@orcl schemas=user dumpfile=expdp.dmp directory=data_dir logfile=expdp.log;
Export the emp and dept tables under the SCOTT user
expdp scott/oracle directory=dump_dir dumpfile=scotttab.dmp tables=emp,dept

The third type: export by table space:
expdp sys/passwd@orcl tablespace=tbs1,tbs2 dumpfile=expdp.dmp directory=data_dir logfile=expdp.log;

The fourth type: export table:
expdp user/passwd@orcl tables=table1,table2 dumpfile=expdp.dmp directory=data_dir logfile=expdp.log;

The fifth type: import according to query conditions:
expdp user/passwd@orcl tables=table1=‘where number=1234’ dumpfile=expdp.dmp directory=data_dir logfile=expdp.log;

SQL Error [1940][42000]: ORA-01940: cannot drop the currently connected user

  • Query the user's process
select  username,sid,serial# from v$session;

insert image description here

  • kill the associated process
alter system kill session '234,12' ; 
  • Perform user deletion
drop user ZCGL_V8_20220628 cascade;

Create new users and tablespaces

select name from v$datafile;  --查询表空间的名称
CREATE TABLESPACE 名称 DATAFILE '路径+大写名称.DBF' SIZE 10M AUTOEXTEND ON NEXT 10M;
--创建表空间
create user 用户名 identified by 密码 default tablespace 表空间名称
--新用户授权
grant dba to 用户名;
grant connect, resource to 用户名;
grant select any table to 用户名;
grant update any table to 用户名;
grant create any table to 用户名;
grant delete any table to 用户名;

Precautions

nt update any table to username;
grant create any table to username;
grant delete any table to username;


### 注意事项

























Guess you like

Origin blog.csdn.net/qq_46524280/article/details/125617668