查询数据库实例名,服务名,和oracle_sid


查询导出的job
select * from dba_datapump_jobs;
查询新建的逻辑目录
select * from dba_directories a where a.DIRECTORY_NAME=‘DUMPDIR_TEST‘;
查询oracle_id
select a.INSTANCE_NAME,a.HOST_NAME,a.VERSION from v$instance a
查询服务名
select value from v$parameter a where a.NAME=‘service_names‘
服务器当前数据库
echo $ORACLE_SID
切换数据库
export ORACLE_SID=dcscb2
为用户赋权
grant read,write on directory DUMPDIR_FINCHINA to finchina;
导出导入dmp文件
expdp finchina/finchina_CbPc1@dcsdb DIRECTORY=DUMPDIR_FINCHINA dumpfile=finchina_20200430.dmp LOGFILE=finchina_20200430.log
impdp finchina/finchina_CbPc1@dcsdb DIRECTORY=DUMPDIR_FINCHINA dumpfile=finchina_20200430.dmp LOGFILE=finchina_20200430.log table_exists_action=TRUNCATE
expdp test/test@215.8.7.57:11521/dcsdb DIRECTORY=DUMPDIR_TEST dumpfile=test_20200430.dmp LOGFILE=test_20200430.log
expdp dcm/Dcm_CbPc2@215.8.7.67:11521/dcscb DIRECTORY=DUMPDIR_TEST dumpfile=test_20200430.dmp LOGFILE=test_20200430.log TABLES=dcs_auto_task

 

查询数据库实例名,服务名,和oracle_sid

上一篇:数据库连接池


下一篇:Postgresql11.5单机部署标准化文档