Skip to content

Instantly share code, notes, and snippets.

@allanjos
Last active November 5, 2018 17:46
Show Gist options
  • Save allanjos/8fc11d953fa1eb18ddb0ae50d557b446 to your computer and use it in GitHub Desktop.
Save allanjos/8fc11d953fa1eb18ddb0ae50d557b446 to your computer and use it in GitHub Desktop.
Oracle basic configuration (MS Windows)

Installation

Download Oracle from:

http://www.oracle.com/webfolder/technetwork/tutorials/obe/db/12c/r1/Windows_DB_Install_OBE/Installing_Oracle_Db12c_Windows.html

Configuration

Access SQLPlus console:

sqlplus sys/admin as sysdba

List databases:

SELECT NAME FROM v$database

Query tablespaces and corresponding users within them:

SELECT TABLESPACE_NAME FROM USER_TABLESPACES;

USER TO ACCESS REMOTE DATABASE:

ALTER SESSION SET "_ORACLE_SCRIPT"=true;

CREATE USER userweb IDENTIFIED BY passcode;

sqlplus sys/oracleuser as sysdba

GRANT create session TO userweb;
GRANT create table TO userweb;
GRANT create view TO userweb;
GRANT create any trigger TO userweb;
GRANT create any procedure TO userweb;
GRANT create sequence TO userweb;
GRANT create synonym TO userweb;
GRANT UNLIMITED TABLESPACE TO userweb;

Connect as the created user:

connect userweb

Test

Execute DDL:

CREATE TABLE product (
  id int PRIMARY KEY,
  name varchar(255)
);

Execute DML:

INSERT INTO product (id, name) VALUES ('1', 'Product 01');
INSERT INTO product (id, name) VALUES ('2', 'Product 02');
INSERT INTO product (id, name) VALUES ('3', 'Product 03');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment