Home » Other » General » Import schema Statistics in different oracle database (oracle 11.2.0.4 ,11.2.0.1RHEL6.0,windows server)
Import schema Statistics in different oracle database [message #663194] |
Thu, 25 May 2017 02:15  |
 |
arin.oradba
Messages: 33 Registered: January 2016 Location: Kolkata
|
Member |
|
|
We need to import schema Statistics from oracle 11.2.0.4 version to 11.2.0.1 version.
The following problem did not occur in same version of 11g.
We did the export here with mentioning the version parameter in expdp command. But the problem is still persist.
Create stats of table:
begin
dbms_STATS.CREATE_STAT_TABLE(ownname =>'XYZ' ,stattab => 'XYZ_STATS_TABLE');
end;
/
Export the tables stats:
begin
dbms_STATS.export_schema_STATS(ownname =>'XYZ' ,stattab => 'XYZ_STATS_TABLE' , statid=>'CURRENT_STATS');
end;
/
Export the tables into dump file:
expdp USERID/PASSWORD dumpfile=File1.dmp logfile=File1.log directory=DP_DIR tables=XYZ.XYZ_STATS_TABLE version=11.2.0.1.0
IMPORT SCHEMA STATS PROCESSES IN DIFFERENT DATABASE:
Import the stats
impdp USERID/PASSWORD directory=dp_dir dumpfile=File1.dmp logfile=impdp_File1.log tables=XYZ.XYZ_STATS_TABLE
Stats to import into respective schemas
begin
dbms_STATS.import_schema_STATS(ownname =>'XYZ' ,stattab => 'XYZ_STATS_TABLE' , statid=>'CURRENT_STATS');
end;
/
*
ERROR at line 1:
ORA-20002: Unknown error when using statistics table XYZ.XYZ_STATS_TABLE.
Please drop and recreate with dbms_stats.drop_stat_table and
dbms_stats.create_stat_table
ORA-06512: at "SYS.DBMS_STATS", line 9468
ORA-06512: at "SYS.DBMS_STATS", line 9484
ORA-06512: at "SYS.DBMS_STATS", line 10600
ORA-06512: at line 2
We did not create dbms_stat at destination database (11.2.0.1). During import,table itself create in it.Then we had executed dbms_stats.import_schema_stats command.
I have no metalink userid and password. So kindly help me.
|
|
|
|
|
|
|
|
Re: Import schema Statistics in different oracle database [message #663252 is a reply to message #663203] |
Sat, 27 May 2017 02:04   |
 |
arin.oradba
Messages: 33 Registered: January 2016 Location: Kolkata
|
Member |
|
|
Good afternoon sir. I did as your advice and successfully completed the following steps. Now how can I get information about the updated statistics.Please help once again.
Thanks a lots sir.
begin
dbms_STATS.CREATE_STAT_TABLE(ownname =>'XYZ' ,stattab => 'XYZ_STATS_TABLE');
end;
/
impdp directory=DP_DIR dumpfile=DB_SCHEMA_STATS-27052017.dmp logfile=impdp_DB_SCHEMA_STATS-27052017.log tables=XYZ.XYZ_STATS_TABLE CONTENT=DATA_ONLY
output :
..............................
..............................
. . imported "XYZ"."XYZ_STATS_TABLE" 15.25 KB 4 rows
Job "SYS"."SYS_IMPORT_TABLE_01" successfully completed at 12:39:07
[Updated on: Sat, 27 May 2017 02:24] Report message to a moderator
|
|
|
|
|
|
|
|
|
|
|
|
|
Goto Forum:
Current Time: Mon Apr 28 05:07:23 CDT 2025
|