Skip to content

Instantly share code, notes, and snippets.

@Tracnac
Last active September 7, 2023 12:37
Show Gist options
  • Select an option

  • Save Tracnac/da8d3ce398169db025c03861407304bd to your computer and use it in GitHub Desktop.

Select an option

Save Tracnac/da8d3ce398169db025c03861407304bd to your computer and use it in GitHub Desktop.

Revisions

  1. Tracnac revised this gist Sep 7, 2023. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions local.md
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,4 @@
    ```sql
    DECLARE
    CURSOR c1
    IS
    @@ -28,3 +29,4 @@ BEGIN
    CLOSE c1;
    END;
    /
    ```
  2. Tracnac revised this gist Sep 7, 2023. 1 changed file with 30 additions and 1 deletion.
    31 changes: 30 additions & 1 deletion local.md
    Original file line number Diff line number Diff line change
    @@ -1 +1,30 @@
    ‎‎​
    DECLARE
    CURSOR c1
    IS
    SELECT 'alter user '
    || username
    || ' LOCAL TEMPORARY TABLESPACE '
    || TEMPORARY_TABLESPACE
    FROM dba_users
    WHERE username NOT IN ('XS$NULL')
    AND local_temp_tablespace = 'SYSTEM';
    execme VARCHAR2(32767);

    BEGIN
    DBMS_OUTPUT.enable(32767);
    OPEN c1;
    LOOP
    FETCH c1 INTO execme;
    EXIT WHEN c1%NOTFOUND;
    BEGIN
    execute immediate execme;
    EXCEPTION
    WHEN OTHERS
    THEN
    DBMS_OUTPUT.PUT_LINE ('Error code: ' || SQLCODE || ': ' || SUBSTR(SQLERRM, 1, 64));
    DBMS_OUTPUT.put_line ('Error sql: ' || execme);
    END;
    END LOOP;
    CLOSE c1;
    END;
    /
  3. Tracnac created this gist Sep 7, 2023.
    1 change: 1 addition & 0 deletions local.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    ‎‎​