Oracle如何匯出sys使用者下的系統資料表

來源:互聯網
上載者:User

Oracle如何匯出sys使用者下的系統資料表

環境:Solaris 10 + Oracle 10.2.0.4

  • 1.匯出執行個體
  • 2.參考內容
  • Reference
1.匯出執行個體

匯出sys使用者下的HIST_HEAD$WRI$_OPTSTAT_HISTHEAD_HISTORY兩張表:
由於expdp嘗試匯出失敗,改用傳統exp匯出,匯出命令如下:

% nohup exp system/******  file=/tmp/jy/system_exp_2tables.dmp log=/tmp/jy/exp_system_exp_2tables.log tables=sys.HIST_HEAD\$, sys.WRI\$_OPTSTAT_HISTHEAD_HISTORY &

傳統exp可以正常匯出,匯出過程顯示如下:

Export: Release 10.2.0.4.0 - Production on 星期五 10月 30 13:49:51 2015Copyright (c) 1982, 2007, Oracle.  All rights reserved.串連到: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit ProductionWith the Partitioning, OLAP, Data Mining and Real Application Testing options已匯出 ZHS16GBK 字元集和 AL16UTF16 NCHAR 字元集即將匯出指定的表通過常規路徑...當前的使用者已更改為 SYS. . 正在匯出表                      HIST_HEAD$匯出了   169225445 行. . 正在匯出表   WRI$_OPTSTAT_HISTHEAD_HISTORY
2.參考內容

文檔 ID 553402.1

APPLIES TO:Oracle Database - Enterprise Edition - Version 10.2.0.3 and laterInformation in this document applies to any platform.***Checked for relevance on 29-Jan-2015***SYMPTOMSDataPump export of table SYS.AUD$ fails with errors:ORA-39165: Schema SYS was not found.ORA-39166: Object AUD$ was not found.ORA-31655: no data or metadata objects selected for jobJob "SYS"."SYS_EXPORT_TABLE_01" completed with 3 error(s) at 13:49:47CAUSEThere is a restriction on dataPump export. It cannot export schemas like SYS, ORDSYS, EXFSYS, MDSYS, DMSYS, CTXSYS, ORDPLUGINS, LBACSYS, XDB, SI_INFORMTN_SCHEMA, DIP, DBSNMP and WMSYS in any mode. The Utilities Guide indicates the restriction only on full export mode, but the restriction actually applies to all modes.SOLUTIONExport the table SYS.AUD$ using the traditional export:#> exp system/<password> file=dumpfile.dmp log=logfile.log tables=sys.aud$
Reference
  • DataPump Export (EXPDP) Fails With Error ORA-39165: Schema SYS Was Not Found (文檔 ID 553402.1)

注意:即使不考慮效能問題,truncate table HIST_HEAD$也不被允許,只能delete你認為不需要的記錄。

SQL> truncate table WRI$_OPTSTAT_HISTHEAD_HISTORY;
 
表被截斷。
 
經過時間:  00: 00: 25.98
SQL> truncate table HIST_HEAD$;
truncate table HIST_HEAD$
              *
第 1 行出現錯誤:
ORA-00701: 無法變更暖開機資料庫所需的對象
 
% oerr ora 701
00701, 00000, "object necessary for warmstarting database cannot be altered"
// *Cause:  Attempt to alter or drop a database object (table, cluster, or
//          index) which are needed for warmstarting the database.
// *Action: None.

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.