oracle 11g expdb autoextend tablespace and create directory error;
今天,試了一把Data Pump和original Exopot and Import的實用性,在途中遇到的以下錯誤:
ORA-39006: internal error
ORA-39068: invalid master table data in row with PROCESS_ORDER=-3
ORA-01658: unable to create INITIAL extent for segment in tablespace PANFENG
ORA-39097: Data Pump job encountered unexpected error -1658
Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, 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
以下是關於上述錯誤的解釋以及相關過程:
SQL> create directory dump_dir1 as '/u01/dump_dir1'; --建立預設目錄
Directory created.
oracle@Ray:/u01>sqlplus / as sysdba
SQL> grant read,write on directory dump_dir1 to u1;--授予許可權
Grant succeeded.
匯出u1使用者中一張名為u1TI的表。
oracle@Ray:/home/oracle>expdp u1/u1 directory=dump_dir1 dumpfile=u1TI.dmp logfile=u1TI.log tables=u1TI;--匯出u1TI的一張表,預設目錄為dump_dir1 dumpfile=u1TI.log
Export: Release 11.2.0.3.0 - Production on Sun Nov 17 02:22:39 2013
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, OLAP, Data Mining and Real Application Testing options
ORA-39006: internal error
ORA-39068: invalid master table data in row with PROCESS_ORDER=-3
ORA-01658: unable to create INITIAL extent for segment in tablespace PANFENG
ORA-39097: Data Pump job encountered unexpected error -1658
上述報錯貌似和表空間為panfeng的有關係,所以我們可以檢視panfeng的表空間。
--根據上述資料,我們可以看到名為panfeng的表空閒空間為0%。所以我們需要開啟預設增加表空間。
SQL> alter database datafile '/u01/app/oracle/oradata/ora11g/panfeng01.dbf' autoextend on;
Database altered.
oracle@Ray:/home/oracle>expdp u1/u1 directory=dump_dir1 dumpfile=u1TI.dmp logfile=u1TI.log tables=u1TI;
Export: Release 11.2.0.3.0 - Production on Sun Nov 17 03:16:35 2013
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, 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
上述的“ORA-39070”提到的“Unable to open the log file.”初看非常的“詭異”,到底無法開啟什麼日誌檔案呢?難道是沒有許可權在這個目錄下寫檔案?經過“touch”測試排除了這種可能性。
不管怎麼說,這個問題與檔案操作相關。順著這個思路繼續前行,終於發現原來資料庫中的directory資料庫物件所指向的目錄為dump_dir1,而在該作業系統中根本沒有這個目錄,因目錄不存在,日誌檔案也就理所當然的無處可寫,所以,必須要在作業系統上建立相關目錄。
oracle@Ray:/u01>mkdir dump_dir1;
那麼怎麼知道資料庫中的directory資料庫物件所指向的目錄呢?我們可以檢視下面檢視:
導致該問題的潛在原因
在11g環境中即使在建立directory資料庫物件的過程中即使所引用的目錄不存在,該命令也是可以正常建立的,這就是容易誤操作的根本原因。
oracle@Ray:/home/oracle>expdp u1/u1 directory=dump_dir1 dumpfile=u1TI.dmp logfile=u1TI.log tables=u1TI;
Export: Release 11.2.0.3.0 - Production on Sun Nov 17 03:22:07 2013
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, OLAP, Data Mining and Real Application Testing options
Starting "U1"."SYS_EXPORT_TABLE_01": u1/******** dumpfile=u1TI.dmp directory=dump_dir6 tables=u1TI
Estimate in progress using BLOCKS method...
Processing object type TABLE_EXPORT/TABLE/TABLE_DATA
Total estimation using BLOCKS method: 64 KB
Processing object type TABLE_EXPORT/TABLE/TABLE
Processing object type TABLE_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
. . exported "U1"."U1TI" 5.421 KB 1 rows
Master table "U1"."SYS_EXPORT_TABLE_01" successfully loaded/unloaded
******************************************************************************
Dump file set for U1.SYS_EXPORT_TABLE_01 is:
/u01/u1TI.dmp
Job "U1"."SYS_EXPORT_TABLE_01" successfully completed at 03:24:07
如此,我們的表為u1TI就匯出來了。
總結:在運算元據庫時,一定要注意想清楚為什麼?關於處理問題,首先要考慮為什麼造成這樣的錯誤,然後在分析定位。
歡迎大家批評指正:
QQ交流群:300392987
論 壇:http://www.oraclefreebase.com
ORA-39006: internal error
ORA-39068: invalid master table data in row with PROCESS_ORDER=-3
ORA-01658: unable to create INITIAL extent for segment in tablespace PANFENG
ORA-39097: Data Pump job encountered unexpected error -1658
Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, 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
SQL> create directory dump_dir1 as '/u01/dump_dir1'; --建立預設目錄
Directory created.
oracle@Ray:/u01>sqlplus / as sysdba
SQL> grant read,write on directory dump_dir1 to u1;--授予許可權
Grant succeeded.
匯出u1使用者中一張名為u1TI的表。
oracle@Ray:/home/oracle>expdp u1/u1 directory=dump_dir1 dumpfile=u1TI.dmp logfile=u1TI.log tables=u1TI;--匯出u1TI的一張表,預設目錄為dump_dir1 dumpfile=u1TI.log
Export: Release 11.2.0.3.0 - Production on Sun Nov 17 02:22:39 2013
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, OLAP, Data Mining and Real Application Testing options
ORA-39006: internal error
ORA-39068: invalid master table data in row with PROCESS_ORDER=-3
ORA-01658: unable to create INITIAL extent for segment in tablespace PANFENG
ORA-39097: Data Pump job encountered unexpected error -1658
上述報錯貌似和表空間為panfeng的有關係,所以我們可以檢視panfeng的表空間。
點選(此處)摺疊或開啟
-
SQL> select
-
2 f.tablespace_name,
-
3 a.total,
-
4 f.free,(a.total-f.free)/1024 \"used SIZE(G)\"
-
5 ,round((f.free/a.total)*100) \"% Free\"
-
6 from
-
7 (select tablespace_name, sum(bytes/(1024*1024)) total from dba_data_files group by
-
8 tablespace_name) a,
-
9 (select tablespace_name, round(sum(bytes/(1024*1024))) free from dba_free_space
-
10 group by tablespace_name) f
-
11 WHERE a.tablespace_name = f.tablespace_name(+)
-
12 order by \"% Free\";
-
-
-
TABLESPACE_NAME TOTAL FREE used SIZE(G) % Free
-
------------------------------ ---------- ---------- ------------ ----------
-
PANFENG 30 0 .029296875 0
-
SYSTEM 750 9 .723632813 1
-
SYSAUX 720 42 .662109375 6
-
EXAMPLE 337.5 27 .303222656 8
-
UNDO01 50 31 .018554688 62
-
UNDOTBS1 165 137 .02734375 83
-
USERS 66.25 62 .004150391 94
-
PANFENG2 50 49 .000976563 98
-
RMAN_TBS 1024 1017 .006835938 99
-
-
- 9 rows selected.
--根據上述資料,我們可以看到名為panfeng的表空閒空間為0%。所以我們需要開啟預設增加表空間。
SQL> alter database datafile '/u01/app/oracle/oradata/ora11g/panfeng01.dbf' autoextend on;
Database altered.
oracle@Ray:/home/oracle>expdp u1/u1 directory=dump_dir1 dumpfile=u1TI.dmp logfile=u1TI.log tables=u1TI;
Export: Release 11.2.0.3.0 - Production on Sun Nov 17 03:16:35 2013
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, 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
上述的“ORA-39070”提到的“Unable to open the log file.”初看非常的“詭異”,到底無法開啟什麼日誌檔案呢?難道是沒有許可權在這個目錄下寫檔案?經過“touch”測試排除了這種可能性。
不管怎麼說,這個問題與檔案操作相關。順著這個思路繼續前行,終於發現原來資料庫中的directory資料庫物件所指向的目錄為dump_dir1,而在該作業系統中根本沒有這個目錄,因目錄不存在,日誌檔案也就理所當然的無處可寫,所以,必須要在作業系統上建立相關目錄。
oracle@Ray:/u01>mkdir dump_dir1;
那麼怎麼知道資料庫中的directory資料庫物件所指向的目錄呢?我們可以檢視下面檢視:
點選(此處)摺疊或開啟
- SQL>select directory_name,directory_path from dba_directories
- DIRECTORY_NAME DIRECTORY_PATH
- ------------------------------ --------------------------------------------------
- DUMP_DIR1 /u01/dump_dir1
- SUBDIR /u01/app/oracle/products/11.2.0/demo/schema/order_
- entry//2002/Sep
- SS_OE_XMLDIR /u01/app/oracle/products/11.2.0/demo/schema/order_
- entry/
- LOG_FILE_DIR /u01/app/oracle/products/11.2.0/demo/schema/log/
- MEDIA_DIR /u01/app/oracle/products/11.2.0/demo/schema/produc
- t_media/
- DIRECTORY_NAME DIRECTORY_PATH
- ------------------------------ --------------------------------------------------
- XMLDIR /u01/app/oracle/products/11.2.0/rdbms/xml
- DATA_FILE_DIR /u01/app/oracle/products/11.2.0/demo/schema/sales_
- history/
- DATA_PUMP_DIR /u01/app/oracle/admin/ora11g/dpdump/
- ORACLE_OCM_CONFIG_DIR /u01/app/oracle/products/11.2.0/ccr/state
在11g環境中即使在建立directory資料庫物件的過程中即使所引用的目錄不存在,該命令也是可以正常建立的,這就是容易誤操作的根本原因。
oracle@Ray:/home/oracle>expdp u1/u1 directory=dump_dir1 dumpfile=u1TI.dmp logfile=u1TI.log tables=u1TI;
Export: Release 11.2.0.3.0 - Production on Sun Nov 17 03:22:07 2013
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, OLAP, Data Mining and Real Application Testing options
Starting "U1"."SYS_EXPORT_TABLE_01": u1/******** dumpfile=u1TI.dmp directory=dump_dir6 tables=u1TI
Estimate in progress using BLOCKS method...
Processing object type TABLE_EXPORT/TABLE/TABLE_DATA
Total estimation using BLOCKS method: 64 KB
Processing object type TABLE_EXPORT/TABLE/TABLE
Processing object type TABLE_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
. . exported "U1"."U1TI" 5.421 KB 1 rows
Master table "U1"."SYS_EXPORT_TABLE_01" successfully loaded/unloaded
******************************************************************************
Dump file set for U1.SYS_EXPORT_TABLE_01 is:
/u01/u1TI.dmp
Job "U1"."SYS_EXPORT_TABLE_01" successfully completed at 03:24:07
如此,我們的表為u1TI就匯出來了。
總結:在運算元據庫時,一定要注意想清楚為什麼?關於處理問題,首先要考慮為什麼造成這樣的錯誤,然後在分析定位。
歡迎大家批評指正:
QQ交流群:300392987
論 壇:http://www.oraclefreebase.com
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29210156/viewspace-776797/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- alter tablespace ts_name autoextend_clause
- Oracle OCP(48):UNDO TABLESPACEOracle
- pg_basebackup 報錯could not create directory
- 解決IDEA Error:Output directory is not specifiedIdeaError
- psql: error: could not connect to server: No such file or directorySQLErrorServer
- Error: Cannot find configuration directory: /etc/hadoopErrorHadoop
- 【TABLESPACE】Oracle表空間最佳實踐Oracle
- fatal error: libmemcached/memcached.h: No such file or directoryErrorIBM
- fatal error: openssl/sha.h: No such file or directoryError
- fatal error: sys/cdefs.h: No such file or directoryError
- Fatal error in launcher: Unable to create process using '"'Error
- 【TABLESPACE】Oracle 表空間結構說明Oracle
- ERROR 1410 (42000): You are not allowed to create a user with GRANTError
- ssh-add 報錯:Error connecting to agent No such file or directoryError
- 【Oracle】Linux7安裝11g 86%報錯:Error in invoking target 'agent nmhs' of makefileOracleLinuxError
- [FATAL] [INS-32012] Unable to create directory: /u01/app/19.3.0/grid,APP
- Oracle之11g DataGuardOracle
- ORACLE STREAM ERROROracleError
- 【BUG】Oracle12c tablespace io statistics missing from awr reportOracle
- Oracle 11G 安裝文件Oracle
- benchmark 壓測Oracle 11gOracle
- sysbench壓測Oracle 11gOracle
- OGG-15050 Error loading Java VM runtime library: (2 No such file or directory)ErrorJava
- Ubuntu下 fatal error: Python.h: No such file or directory 解決方法UbuntuErrorPython
- docker mysql mysqld: Error on realpath() on ‘/var/lib/mysql-files‘ No such file or directoryDockerMySqlError
- Linux 無許可權建立資料夾( 報錯:Unable to create ... directory.)Linux
- mysqld: Can‘t create directory ‘E:\Software\mysql-5.7.24-winx64\data\‘ (Errcode: 2 - NoMySql
- mac 下vscode 更新時提示:Could not create temporary directory: 許可權被拒絕MacVSCode
- nginx: [error] open() “/var/run/nginx/nginx.pid“ failed (2: No such file or directory)NginxErrorAI
- mysql 5.7.21 CMake Error: The source directory "/data/server/mysql" does not appear to contain CMakMySqlErrorServerAPPAI
- Oracle 11G 安裝 bbed 工具Oracle
- oracle 11g data guard維護Oracle
- oracle 11g OEM在哪裡找到???Oracle
- oracle 11g 常用命令Oracle
- Oracle 11g RAC Silent Install For NFSOracleNFS
- Oracle 11g刪除庫重建Oracle
- Oracle 11G 修改scan_ipOracle
- ubuntu下pig報錯ERROR 2999: Unexpected internal error. Failed to create DataStorage的解決UbuntuErrorAIAST
- Oracle 11G RAC叢集安裝(3)——安裝OracleOracle