Posts

Posts mit dem Label "datapump" werden angezeigt.

Statistiken entsperren / ORA-20005: object statistics are locked (stattype = ALL)

Aktueller Fall: Nach dem Import eines Schemas aus einer anderen Datenbank (per DataPump) waren alle Tabellen und Daten wie gewünscht vorhanden. Die Statistiken wurden vom alten System übernommen. Dies ist grundsätzlich auch sinnvoll, da die Daten ja unverändert übernommen wurden. Hier waren aber "frische" Statistiken gewünscht. Problem: Es wurden keine neuen Statistiken erstellt. Die Prüfung hat ergeben, dass die übernommenen Statistiken gelocked waren ( stattype_locked = 'All' ). Eine einfache Neuerstellung meldete: ORA-20005: object statistics are locked (stattype = ALL) . Nach dem Entsperren mit dbms_stats.unlock_schema_stats lief die Neuerstellung problemlos durch. Hier der Code dazu: -- Prüfen, ob Statistiken gelocked sind (= stattype_locked nicht leer) select table_name, stattype_locked from user_tab_statistics; -- Statistiken ggfs. entsperren exec dbms_stats.unlock_schema_stats('abc'); ...

Datapump - Verzeichnis erstellen

siehe auch Metalink-Doc: 266875.1 HOW TO SPECIFY A DIRECTORY IN ORACLE10G EXPORT/IMPORT DATAPUMP -------------------------------------------------------------- 1. SERVER-BASED OR CLIENT-BASED ---------------------------- The parameter DIRECTORY specifies the location to which Export DataPump or Import DataPump can write the dump file set, the log file, and the SQL file (Import DataPump only). As export DataPump and import DataPump are server-based, rather than client-based, the output files are accessed relative to server-based directory paths. Data Pump requires you to specify directory paths as directory objects. A directory object maps a name to a directory path on the file system. 2. HOW TO CREATE A DIRECTORY ------------------------- To create a directory, you must have the DBA role or you must have been granted the CREATE ANY DIRECTORY privilege. Example (a DBA creates directories on the Windows platform and grants access to user scott): SQL> CONNECT ...