Created
August 16, 2013 22:48
-
-
Save joshbode/6254167 to your computer and use it in GitHub Desktop.
Create tables in a schema
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @echo off | |
| setlocal enableextensions | |
| pushd "%~p1" | |
| set FILENAME="%~n1" | |
| echo @%FILENAME% exit; | sqlplus -l -s /nolog | |
| popd | |
| pause |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SET ESCAPE ON | |
| SET SERVEROUTPUT ON SIZE UNLIMITED | |
| SET LINESIZE 32767 | |
| SET VERIFY OFF FEEDBACK OFF ECHO OFF | |
| SET NEWPAGE 0 PAGESIZE 0 TRIMSPOOL ON HEADING OFF | |
| -- ignore existing tables | |
| WHENEVER SQLERROR CONTINUE | |
| BEGIN | |
| DBMS_OUTPUT.PUT_LINE('----------------------------------------------------------------------------'); | |
| DBMS_OUTPUT.PUT_LINE('Creating tables in ' || LOWER('&_user') || '@&_CONNECT_IDENTIFIER'); | |
| DBMS_OUTPUT.PUT_LINE('----------------------------------------------------------------------------'); | |
| END; | |
| / | |
| @@ users; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| CONNECT /@DB.world; -- uses wallet authentication to database | |
| CREATE TABLE abc123 ( | |
| n INTEGER | |
| ); | |
| GRANT SELECT, INSERT, UPDATE, DELETE ON abc123 TO &FOO_USERS; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- user groups | |
| DEFINE FOO_USERS = "andy, jimmy" | |
| DEFINE BAR_USERS = "kylie" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment