Import parameter: STATISTICS
What is the new value SAFE of the STATISTICS parameter at IMPORT ?
------------------------------------------------------------------
The 4 possible values for this parameter are :
-> ALWAYS : Always imports database optimizer statistics regardless of whether or not they are questionable.
無論是否有可疑資訊,都會匯入最佳化器的統計資訊
-> NONE : Does not import or recalculate the database optimizer statistics.
不匯入或重新計算最佳化器的統計資訊
-> SAFE : Imports database optimizer statistics back only if they are not questionable.
If they are questionable, recalculates the optimizer statistics.
如果無可疑資訊,則匯入原最佳化器統計資訊
如果有可疑資訊,則重新計算最佳化器的統計資訊
-> RECALCULATE : Does not import the database optimizer statistics. Instead, recalculates them on import.
不匯入最佳化器的統計資訊,在imp的時候重新收集最佳化器的統計資訊
---------------------------------------------------------------------
When are statistics questionable ?
(什麼是統計資訊可疑)
----------------------------------
The precalculated optimizer statistics are flagged as questionable at export
time if:
在exp時,如果出現以下幾種情況,那麼預先計算好的最佳化器的統計資訊被標記為可疑
-> There are row errors while exporting
exp時有行的錯誤
-> The client character set or NCHAR character set does not match the server character set or NCHAR character set
客戶端和server端的字符集不一致
-> A QUERY clause is specified
有查詢語句
-> Only certain partitions or subpartitions are exported
exp只匯出某一個分割槽或者子分割槽
e.g.
1. 匯出使用者 ecc_view2 的dmp檔案 (製造統計資訊不是最新的情況)
a. ECC_VIEW2 檢查統計資訊
select table_name, tablespace_name, status, num_rows, blocks,last_analyzed
from user_tables
table_name tablespace_name status num_rows blocks last_analyzed
----------------- ------------------------- --------- --------------- ---------- -----------------------
TEST USERS VALID 2 5 2009-6-23 13:47:05
b. 重新收集統計資訊
EXEC DBMS_STATS.gather_table_stats(ownname => 'ECC_VIEW2',tabname => 'TEST',cascade => TRUE);
select table_name, tablespace_name, status, num_rows, blocks,last_analyzed
from user_tables
table_name tablespace_name status num_rows blocks last_analyzed
----------------- ------------------------- --------- -------------- --------- -----------------------
TEST USERS VALID 5 5 2009-6-24 14:35:40
c. 插入5條記錄,exp
insert into test
select * from TEST
select count(*) from test -- 10 rows
d. exp ecc_view2
[oracle@rac1 ~]$ exp ecc_view2/ecc@devdb1 file=./ecc_view2.dmp ;
. about to export ECC_VIEW2's tables via Conventional Path ...
. . exporting table TEST 10 rows exported
Export terminated successfully without warnings.
2. 建立使用者 ecc_view3
create user ecc_view3
identified by ecc
default tablespace DATA03
grant connect, resource to ecc_view3
3. 匯入資料到ecc_view3
a. statistics = ALWAYS (default)
[oracle@rac1 ~]$ imp ecc_view3/ecc@devdb1 file=./ecc_view2.dmp fromuser=ecc_view2 touser=ecc_view3
import done in ZHS16GBK character set and AL16UTF16 NCHAR character set
. . importing table "TEST" 10 rows imported
Import terminated successfully without warnings.
select table_name, tablespace_name, status, num_rows, blocks,last_analyzed
from user_tables
table_name tablespace_name status num_rows blocks last_analyzed
------------------ ----------------------- ------ -------- ------ -----------------------
TEST USERS VALID 5 5 2009-6-24 14:42:44
b. statistics = none
drop table test
[oracle@rac1 ~]$ imp ecc_view3/ecc@devdb1 file=./ecc_view2.dmp fromuser=ecc_view2 touser=ecc_view3 statistics=none
select table_name, tablespace_name, status, num_rows, blocks,last_analyzed
from user_tables
table_name tablespace_name status num_rows blocks last_analyzed
---------- ------------------------------ ------ ------------- ------ -----------------------
TEST USERS VALID
c. statistics = safe
drop table test
[oracle@rac1 ~]$ imp ecc_view3/ecc@devdb1 file=./ecc_view2.dmp fromuser=ecc_view2 touser=ecc_view3 statistics=safe
select table_name, tablespace_name, status, num_rows, blocks,last_analyzed
from user_tables
table_name tablespace_name status num_rows blocks last_analyzed
--------------- --------------------------- ------ -------- ------ -----------------------
TEST USERS VALID 10 5 2009-6-24 14:54:51
d. statistics = RECALCULATE
drop table test
[oracle@rac1 ~]$ imp ecc_view3/ecc@devdb1 file=./ecc_view2.dmp fromuser=ecc_view2 touser=ecc_view3 statistics=RECALCULATE;
select table_name, tablespace_name, status, num_rows, blocks,last_analyzed
from user_tables
table_name tablespace_name status num_rows blocks last_analyzed
----------------- ---------------- -------- ------------ ------ ---------------------------
TEST USERS VALID 10 5 2009-6-24 14:56:03
參考文獻:
Subject: Import parameter: STATISTICS=SAFE
Doc ID: 159787.1 Type: BULLETIN
Modified Date : 11-NOV-2008 Status: PUBLISHED
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/9252210/viewspace-607446/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Required parameter $xxx follows optional parameter $yyyUI
- SciTech-Mathematics-Probability+Statistics-7 Key Statistics Concepts
- UNREFERENCED_PARAMETER
- v$parameter gv$parameter 檢視 DDL 與隱含引數
- SciTech-Mathmatics-Probability+Statistics-VI-Statistics:Quantifing Uncertainty + Regression Analysis)AI
- python parameter引數Python
- LTSPICE parameter設定
- Caused by: org.apache.ibatis.binding.BindingException: Parameter 'parameter' not found.解決ApacheBATException
- Understanding System Statistics(zt)
- Statistics and Data Analysis for BioinformaticsORM
- require()、import、import()有哪些區別?UIImport
- SciTech-Statistics-英語授課:Business Statistics商務統計
- Python import相關內容區別介紹( import *** as 、from***import )PythonImport
- how to show hidden parameter(zt)
- Field Parameter的設定
- MySQL中的Statistics等待MySql
- SCSS @importCSSImport
- CSS @importCSSImport
- export/importExportImport
- PostgreSQL DBA(86) - Table Parameter(fillfactor)SQL
- UNREFERENCED_PARAMETER的用處
- eslint-plugin-import 規則之 Import / OrderEsLintPluginImport
- Import Error: cannot import name ‘export_saved_modelImportErrorExport
- 徹底搞懂Python 中的 import 與 from importPythonImport
- @import註解Import
- idea import配置IdeaImport
- vite css importViteCSSImport
- DataTables 1.10錯誤: requested unknown parameter
- python基礎--自定義模組、import、from......import......PythonImport
- SciTech-Mathmatics-Probability+Statistics-VIII-Statistics:Quantifing Uncertainty+ANOCOVA(ANalysis of COVAriance)協方差分析原理AI
- link和@import引入css 區別,不建議使用@importImportCSS
- Oracle 12C Statistics on Column GroupsOracle
- MATH38161 Multivariate Statistics and Machine LearningMac
- openGauss lo_importImport
- from bson import ObjectIdImportObject
- from selenium import webdriverImportWeb
- pycharm import 報錯PyCharmImport
- IBM SPSS Statistics 26中文啟用資源+IBM SPSS Statistics 26補丁安裝教程IBMSPSS
- ORA-20005:object statistics are locked (stattype = ALL)Object