Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Log Files erzeugen

Empfohlene Antworten

Veröffentlicht

Hallo,

Neuer Tag neues problem.

Also ich habe ein SQL Script, in welchem ich weitere SQL Skripte aufrufe.

Nun möchte ich folgendes erreichen.

NAch jedem SQL skript soll das ergebnis in ein Logfile geschrieben werden.

In einer Batchdatei funktioniert das ganz einfach, wie geht das bei einem SQL Statement??

Beispiel Batchdatei

@D:\production\kunden.sql >D:\production\log\kunden.log

usw

Wie geht das ganze, wenn ich als Grundlage eine SQL Dateio habe

Danke

Hallo,

Neuer Tag neues problem.

Also ich habe ein SQL Script, in welchem ich weitere SQL Skripte aufrufe.

Nun möchte ich folgendes erreichen.

NAch jedem SQL skript soll das ergebnis in ein Logfile geschrieben werden.

In einer Batchdatei funktioniert das ganz einfach, wie geht das bei einem SQL Statement??

Beispiel Batchdatei

@D:\production\kunden.sql >D:\production\log\kunden.log

usw

Wie geht das ganze, wenn ich als Grundlage eine SQL Dateio habe

Danke

- Hallo, mal ein Beispiel, wie wir das lösen. Das Script erzeugt eine Log-Datei (Spooldatei), welche den aktuellen Schemanamen, Datum/Zeit und Oracle Intanz als Bezeichnung verwendet.



PROMPT ==============================================================

PROMPT  DBMS name:   ORACLE Version 9i R2 9.2.0.8.0

PROMPT  Created:  16.04.2009

PROMPT  User:	xxx

PROMPT  Roles:	Connect / Resource

PROMPT  Usage:	Masterscript 

PROMPT  xxxxxxxxxx

PROMPT  Release 3.0.4 Build 005

PROMPT  Target Platform "xxxxx

PROMPT ==============================================================


PROMPT SET the Spoolfile


column spool_name new_value S


set termout off


SELECT LOWER(G.global_name)||'_'||

       LOWER(U.username)||'_'||

       TO_CHAR(SYSDATE,'DD.MM.YYYY')  ||'.lst'

                                 spool_name

  FROM user_users  U,

       global_name G

 WHERE ROWNUM < 2;


set termout on

spool &S


SELECT U.username||' - '||

       G.global_name||' - '||

       TO_CHAR(SYSDATE,'DD.MM.YYYY HH24:MI:SS')  

                                 START_run_info

  FROM user_users  U,

       global_name G

 WHERE ROWNUM < 2;


PROMPT : Recompile SCHEMA xxxx


exec dbms_utility.compile_schema( 'xxxx')


PROMPT : Tables


@m_tables.sql



PROMPT : Views


@m_views.sql


PROMPT : Recompile SCHEMA xxxxx


exec dbms_utility.compile_schema( 'xxx' );


PROMPT : Updateing Packages


@m_packages.sql


PROMPT : Recompile SCHEMA xxxx


exec dbms_utility.compile_schema( 'xxxx' );


PROMPT --> End of m_master...


SELECT U.username||' - '||

       G.global_name||' - '||

       TO_CHAR(SYSDATE,'DD.MM.YYYY HH24:MI:SS')  

                                 STOP_run_info

  FROM user_users  U,

       global_name G

 WHERE ROWNUM < 2;


PROMPT LOGFILE writen : &S


spool off

- In diesem Beispiel ruft das Masterscript 3 weitere Scripte auf

- Das Log - File steht im aufrufenden Verzeichnis, du musst also Schreibrechte darauf haben

- Nach einpielen von Views, PL/SQL etc compilieren wir das Schema jeweils komplet, das kannst du natürlich weglassen, wenn du es nicht benötigst....

gruss

Bearbeitet von dbwizard

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.