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
|
|
|
|
|
|
|
|
|
|
|
|
Re: Import schema Statistics in different oracle database [message #663296 is a reply to message #663294] |
Mon, 29 May 2017 02:51 |
|
arin.oradba
Messages: 33 Registered: January 2016 Location: Kolkata
|
Member |
|
|
1. I have created stats table at source database the following.It is created successfully
begin
dbms_STATS.CREATE_STAT_TABLE(ownname =>'XYZ' ,stattab => 'XYZ_STATS_TABLE');
end;
/
2. Then we export the tables stats at source database using the following.It is executed successfully .
begin
dbms_STATS.export_schema_STATS(ownname =>'XYZ' ,stattab => 'XYZ_STATS_TABLE' , statid=>'CURRENT_STATS');
end;
/
3. After that we have taken export backup using the following syntax at source database.It is completed successfully .
expdp USERID/PASSWORD dumpfile=File1.dmp logfile=File1.log directory=DP_DIR tables=XYZ.XYZ_STATS_TABLE version=11.2.0.1.0
4. Copy the backup dump into destination server
In Destination Server we did the following:
5. In Destination Server, we have Created the stats table first using the following syntax as you said.It is created successfully at destination server.
begin
dbms_STATS.CREATE_STAT_TABLE(ownname =>'XYZ' ,stattab => 'XYZ_STATS_TABLE');
end;
/
6. Now we have Imported the tables from dump file with CONTENT=DATA_ONLY as you said.It is completed successfully at destination server.:
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
Result output-
...........................................................................
............................................................................
. . imported "XYZ"."XYZ_STATS_TABLE" 15.25 KB 4 rows
Job "SYS"."SYS_IMPORT_TABLE_01" successfully completed at 12:39:07
Now Please help me to understand where I am standing?
|
|
|