您好,登錄后才能下訂單哦!
這篇文章主要介紹“怎么將Expdp備份數據轉到ASM中”,在日常操作中,相信很多人在怎么將Expdp備份數據轉到ASM中問題上存在疑惑,小編查閱了各式資料,整理出簡單好用的操作方法,希望對大家解答”怎么將Expdp備份數據轉到ASM中”的疑惑有所幫助!接下來,請跟著小編一起來學習吧!
一、問題描述
需求要使用expdp備份數據,檢查系統空間很小,不夠放備份文件。直接給系統加空間不就得了,可是這樣一來就要耽誤時間,還要聯系一大堆人員。此時ASM空間是很充足的,可不可以使用呢。接著就有以下的操作了。
二、實驗
1.數據庫建立directory
SYS@PROD1 > create directory databk as '+data/backup'; Directory created. . [oracle@sam1 ~]$ expdp system/oracle direcotry=databk dumpfile=all.dmp full=y LRM-00101: unknown parameter name 'direcotry' [oracle@sam1 ~]$ expdp system/oracle directory=databk dumpfile=all.dmp full=y Export: Release 11.2.0.3.0 - Production on Sat Feb 15 08:13:57 2020 Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved. Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP, Data Mining and Real Application Testing options ORA-39002: invalid operation ORA-39070: Unable to open the log file. ORA-29283: invalid file operation ORA-06512: at "SYS.UTL_FILE", line 536 ORA-29283: invalid file operation
此時會有以上報錯,原因是日志無法寫入ASM當中導致。可以以下兩種方式解決:
A.使用NOLOGFILE=YES選項禁用日志。
B.將日志指定到系統的目錄。
2.測試NOLOGFILE=YES 成功完成備份
[oracle@sam1 ~]$ expdp system/oracle directory=databk dumpfile=all.dmp full=y NOLOGFILE=YES Export: Release 11.2.0.3.0 - Production on Mon Feb 24 01:22:35 2020 Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved. Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP, Data Mining and Real Application Testing options Starting "SYSTEM"."SYS_EXPORT_FULL_01": system/******** directory=databk dumpfile=all.dmp full=y NOLOGFILE=YES Estimate in progress using BLOCKS method... Processing object type DATABASE_EXPORT/SCHEMA/TABLE/TABLE_DATA Total estimation using BLOCKS method: 4.809 GB Processing object type DATABASE_EXPORT/TABLESPACE Processing object type DATABASE_EXPORT/PROFILE Processing object type DATABASE_EXPORT/SYS_USER/USER Processing object type DATABASE_EXPORT/SCHEMA/USER Processing object type DATABASE_EXPORT/ROLE Processing object type DATABASE_EXPORT/GRANT/SYSTEM_GRANT/PROC_SYSTEM_GRANT …... . . exported "SYSTEM"."REPCAT$_USER_PARM_VALUES" 0 KB 0 rows . . exported "SYSTEM"."SQLPLUS_PRODUCT_PROFILE" 0 KB 0 rows Master table "SYSTEM"."SYS_EXPORT_FULL_01" successfully loaded/unloaded ****************************************************************************** Dump file set for SYSTEM.SYS_EXPORT_FULL_01 is: +DATA/backup/all.dmp Job "SYSTEM"."SYS_EXPORT_FULL_01" completed with 1 error(s) at 01:25:42
3.測試將log寫到其他位置 成功完成備份
需要建立一個放log的directory
SYS@PROD1 > create directory logdump as '/home/oracle'; Directory created. [oracle@sam1 ~]$ expdp system/oracle directory=databk dumpfile=scott.dmp schemas=scott logfile=logdump:expdp_scott.log Export: Release 11.2.0.3.0 - Production on Mon Feb 24 04:50:37 2020 Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved. Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP, Data Mining and Real Application Testing options Starting "SYSTEM"."SYS_EXPORT_SCHEMA_01": system/******** directory=databk dumpfile=scott.dmp schemas=scott logfile=logdump:expdp_scott.log Estimate in progress using BLOCKS method... Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA Total estimation using BLOCKS method: 320 KB Processing object type SCHEMA_EXPORT/USER Processing object type SCHEMA_EXPORT/SYSTEM_GRANT Processing object type SCHEMA_EXPORT/ROLE_GRANT Processing object type SCHEMA_EXPORT/DEFAULT_ROLE Processing object type SCHEMA_EXPORT/PRE_SCHEMA/PROCACT_SCHEMA Processing object type SCHEMA_EXPORT/TABLE/TABLE Processing object type SCHEMA_EXPORT/TABLE/INDEX/INDEX Processing object type SCHEMA_EXPORT/TABLE/CONSTRAINT/CONSTRAINT Processing object type SCHEMA_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS Processing object type SCHEMA_EXPORT/TABLE/CONSTRAINT/REF_CONSTRAINT Processing object type SCHEMA_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS . . exported "SCOTT"."DEPT" 5.929 KB 4 rows . . exported "SCOTT"."EMP" 8.562 KB 14 rows . . exported "SCOTT"."SALGRADE" 5.859 KB 5 rows . . exported "SCOTT"."TABLE1" 5.835 KB 2 rows . . exported "SCOTT"."TEST" 5.421 KB 1 rows . . exported "SCOTT"."BONUS" 0 KB 0 rows Master table "SYSTEM"."SYS_EXPORT_SCHEMA_01" successfully loaded/unloaded ****************************************************************************** Dump file set for SYSTEM.SYS_EXPORT_SCHEMA_01 is: +DATA/backup/scott.dmp Job "SYSTEM"."SYS_EXPORT_SCHEMA_01" successfully completed at 04:51:03 [oracle@sam1 ~]$ ls -l expdp_scott.log -rw-r--r-- 1 oracle asmadmin 2080 Feb 24 04:51 expdp_scott.log
到此,關于“怎么將Expdp備份數據轉到ASM中”的學習就結束了,希望能夠解決大家的疑惑。理論與實踐的搭配能更好的幫助大家學習,快去試試吧!若想繼續學習更多相關知識,請繼續關注億速云網站,小編會繼續努力為大家帶來更多實用的文章!
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。