下面是要做的步骤
1.确保备库处于READ ONLY状态
2.在其它第三方库上创建到备库的dblink
SQL> create database link dblink_dpump connect to system identified by password using 'standby';
SQL> select db_unique_name from v$database;
SQL> select db_unique_name from v$database@dblink_dpump;
SQL> create directory dpump as '/opt/dpump';
3.在第三方库上执行导出即可
expdp system/password directory=dpump network_link=dblink_dpump dumpfile=racdb.dmp logfile=expdp_racdb.log schemas=abc parallel=10 filesize=10G cluster=n
如果碰到过类似下面的错误,说明备库的状态不对
UDE-01033: operation generated ORACLE error 1033 ORA-01033: ORACLE initialization or shutdown in progress UDE-00003: all allowable logon attempts failed ORA-39006: internal error ORA-39065: unexpected master process exception in DISPATCH ORA-01033: ORACLE initialization or shutdown in progress ORA-02063: preceding line from {database link} ORA-39097: Data Pump job encountered unexpected error -1033
还有一种方式就是,通过把physical standby暂时转化为snapshot standby,然后导出,最后再把snapshot standby转化为physical standby。这种方式不建议。
Reference
https://docs.oracle.com/en/database/oracle/oracle-database/18/sutil/datapump-import-utility.html
https://docs.oracle.com/en/database/oracle/oracle-database/18/sutil/release-changes.html