Overblog
Editer l'article Suivre ce blog Administration + Créer mon blog
22 juillet 2013 1 22 /07 /juillet /2013 09:44

Hello,
Continuons un peu avec datapump et ses nouveautés que peut être un jour vous auriez aimé avoir dans une version précédente. Il m'est déjà arrivé lors de batch de nuit incluant des exports / imports d'avoir des temps de traitement différents d'un jour sur l'autre que ce soit sur un export ou un import, et j'avoue que j'aurai assez apprécié avoir dans mes logs associés un peu plus d'informations.... Et bien maintenant c'est possible

Bienvenue à LOGTIME et METRICS !

le premier paramètre "LOGTIME" va ajouter au debut de chaque ligne l'heure de fin du traitement de l'opération en cours... Cool !

Ce paramètre peut prendre 4 valeurs.
-1/ NONE => aucun logs supplémentaire, si vous préférez rester dans le brouillard.
-2/ STATUS => l'information ne sera qu'à l'écran, mais pas dans le fichier de log.
-3/ LOGFILE => Vous l'aurez compris, cette fois l'information en sera que le fichier de log.
-4/ ALL => la totale... à l'écran et dans le log !

Un petit exemple...

 impdp system/****** dumpfile=exp.dmp logfile=exp.log schemas=lao remap_schema=lao:lao_imp directory=exports logtime=ALL Import: Release 12.1.0.1.0 - Production on Mon Jul 22 09:57:52 2013 Copyright (c) 1982, 2013, Oracle and/or its affiliates. All rights reserved. Connected to: Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options 22-JUL-13 09:57:55.271: Master table "SYSTEM"."SYS_IMPORT_SCHEMA_01" successfully loaded/unloaded 22-JUL-13 09:57:55.545: Starting "SYSTEM"."SYS_IMPORT_SCHEMA_01": system/******** dumpfile=exp.dmp logfile=exp.log schemas=lao remap_schema=lao:lao_imp directory=exports logtime=ALL 22-JUL-13 09:57:55.581: Processing object type SCHEMA_EXPORT/USER 22-JUL-13 09:57:55.662: Processing object type SCHEMA_EXPORT/SYSTEM_GRANT 22-JUL-13 09:57:55.690: Processing object type SCHEMA_EXPORT/DEFAULT_ROLE 22-JUL-13 09:57:55.707: Processing object type SCHEMA_EXPORT/TABLESPACE_QUOTA 22-JUL-13 09:57:55.729: Processing object type SCHEMA_EXPORT/PRE_SCHEMA/PROCACT_SCHEMA 22-JUL-13 09:57:55.811: Processing object type SCHEMA_EXPORT/TABLE/TABLE 22-JUL-13 09:57:55.901: Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA 22-JUL-13 09:58:09.093: . . imported "LAO_IMP"."T" 133.2 MB 14999990 rows 22-JUL-13 09:58:22.674: . . imported "LAO_IMP"."T1" 133.2 MB 14999990 rows 22-JUL-13 09:58:22.692: Processing object type SCHEMA_EXPORT/TABLE/INDEX/INDEX 22-JUL-13 09:58:51.236: Processing object type SCHEMA_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS 22-JUL-13 09:58:51.245: Processing object type SCHEMA_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS 22-JUL-13 09:58:51.249: Processing object type SCHEMA_EXPORT/STATISTICS/MARKER 22-JUL-13 09:59:01.170: Job "SYSTEM"."SYS_IMPORT_SCHEMA_01" successfully completed at Mon Jul 22 09:59:01 2013 elapsed 0 00:01:07 

 

Pas belle la vie... enfin presque, car pour avoir la durée d'une étape, je suis obligé de faire des soustractions entre des heures. Pas de panique, c'est maintenant qu'intervient le paramètre METRICS qui peut prendre la valeur YES ou NO(par défaut).
On remet ca !

 sqlplus /nolog SQL*Plus: Release 12.1.0.1.0 Production on Mon Jul 22 09:40:10 2013 Copyright (c) 1982, 2013, Oracle. All rights reserved. SQL> connect / As sysdba Connected. SQL> drop user lao_imp cascade; User dropped. exit; impdp system/***** dumpfile=exp.dmp logfile=exp.log schemas=lao remap_schema=lao:lao_imp directory=exports logtime=ALL metrics=yes Import: Release 12.1.0.1.0 - Production on Mon Jul 22 10:07:22 2013 Copyright (c) 1982, 2013, Oracle and/or its affiliates. All rights reserved. Connected to: Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options 22-JUL-13 10:07:24.503: Startup took 1 seconds 22-JUL-13 10:07:25.111: Master table "SYSTEM"."SYS_IMPORT_SCHEMA_01" successfully loaded/unloaded 22-JUL-13 10:07:25.319: Starting "SYSTEM"."SYS_IMPORT_SCHEMA_01": system/******** dumpfile=exp.dmp logfile=exp.log schemas=lao remap_schema=lao:lao_imp directory=exports logtime=ALL metrics=yes 22-JUL-13 10:07:25.350: Processing object type SCHEMA_EXPORT/USER 22-JUL-13 10:07:25.427: Completed 1 USER objects in 0 seconds 22-JUL-13 10:07:25.429: Processing object type SCHEMA_EXPORT/SYSTEM_GRANT 22-JUL-13 10:07:25.457: Completed 2 SYSTEM_GRANT objects in 0 seconds 22-JUL-13 10:07:25.458: Processing object type SCHEMA_EXPORT/DEFAULT_ROLE 22-JUL-13 10:07:25.475: Completed 1 DEFAULT_ROLE objects in 0 seconds 22-JUL-13 10:07:25.477: Processing object type SCHEMA_EXPORT/TABLESPACE_QUOTA 22-JUL-13 10:07:25.495: Completed 1 TABLESPACE_QUOTA objects in 0 seconds 22-JUL-13 10:07:25.497: Processing object type SCHEMA_EXPORT/PRE_SCHEMA/PROCACT_SCHEMA 22-JUL-13 10:07:25.565: Completed 1 PROCACT_SCHEMA objects in 0 seconds 22-JUL-13 10:07:25.584: Processing object type SCHEMA_EXPORT/TABLE/TABLE 22-JUL-13 10:07:25.667: Completed 2 TABLE objects in 0 seconds 22-JUL-13 10:07:25.676: Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA 22-JUL-13 10:07:36.248: . . imported "LAO_IMP"."T" 133.2 MB 14999990 rows in 11 seconds 22-JUL-13 10:07:49.402: . . imported "LAO_IMP"."T1" 133.2 MB 14999990 rows in 13 seconds 22-JUL-13 10:07:49.419: Processing object type SCHEMA_EXPORT/TABLE/INDEX/INDEX 22-JUL-13 10:08:18.834: Completed 1 INDEX objects in 29 seconds 22-JUL-13 10:08:18.835: Processing object type SCHEMA_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS 22-JUL-13 10:08:18.839: Completed 1 INDEX_STATISTICS objects in 0 seconds 22-JUL-13 10:08:18.845: Processing object type SCHEMA_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS 22-JUL-13 10:08:18.849: Completed 2 TABLE_STATISTICS objects in 0 seconds 22-JUL-13 10:08:18.850: Processing object type SCHEMA_EXPORT/STATISTICS/MARKER 22-JUL-13 10:08:28.793: Completed 1 MARKER objects in 10 seconds 22-JUL-13 10:08:28.815: Completed 2 SCHEMA_EXPORT/TABLE/TABLE_DATA objects in 24 seconds 22-JUL-13 10:08:28.841: Job "SYSTEM"."SYS_IMPORT_SCHEMA_01" successfully completed at Mon Jul 22 10:08:28 2013 elapsed 0 00:01:05 

 

Plutôt sympa tout cela... des heures de début et de fin, des durées... Tout ce dont on à besoin pour investiguer...

@++ 

LAO

Partager cet article
Repost0

commentaires

F
Merci.
Répondre