# sails-oracledb-sp-example

> a Sails application

Latest version **0.2.1** (published 2016-12-04) · MIT license · 0 weekly downloads

## Install

```sh
npm install sails-oracledb-sp-example
pnpm add sails-oracledb-sp-example
yarn add sails-oracledb-sp-example
bun add sails-oracledb-sp-example
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.1 |
| Published | 2016-12-04 |
| First published | 2016-12-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 17 |
| Known vulnerabilities | 0 (+11 in 3 direct dependencies) |
| Install scripts | no |
| Author | ben |
| Maintainers | nethoncho |

## Links

- npm: https://www.npmjs.com/package/sails-oracledb-sp-example
- Repository: https://github.com/ben/sails-oracledb-sp-example
- Homepage: https://github.com/ben/sails-oracledb-sp-example#readme
- Issues: https://github.com/ben/sails-oracledb-sp-example/issues
- npm.io page: https://npm.io/package/sails-oracledb-sp-example

## Dependencies (17)

- [rc](https://npm.io/package/rc.md) ~0.5.0
- [ejs](https://npm.io/package/ejs.md) ~0.8.4
- [grunt](https://npm.io/package/grunt.md) 0.4.2
- [sails](https://npm.io/package/sails.md) ^0.11.2
- [grunt-sync](https://npm.io/package/grunt-sync.md) ~0.0.4
- [include-all](https://npm.io/package/include-all.md) ~0.1.3
- [sails-oracle-sp](https://npm.io/package/sails-oracle-sp.md) ^0.5.3
- [grunt-contrib-jst](https://npm.io/package/grunt-contrib-jst.md) ~0.6.0
- [grunt-contrib-copy](https://npm.io/package/grunt-contrib-copy.md) ~0.5.0
- [grunt-contrib-less](https://npm.io/package/grunt-contrib-less.md) 0.11.1
- [grunt-sails-linker](https://npm.io/package/grunt-sails-linker.md) ~0.9.5
- [grunt-contrib-clean](https://npm.io/package/grunt-contrib-clean.md) ~0.5.0
- [grunt-contrib-watch](https://npm.io/package/grunt-contrib-watch.md) ~0.5.3
- [grunt-contrib-coffee](https://npm.io/package/grunt-contrib-coffee.md) ~0.10.1
- [grunt-contrib-concat](https://npm.io/package/grunt-contrib-concat.md) ~0.3.0
- [grunt-contrib-cssmin](https://npm.io/package/grunt-contrib-cssmin.md) ~0.9.0
- [grunt-contrib-uglify](https://npm.io/package/grunt-contrib-uglify.md) ~0.4.0

## Recent versions

- 0.2.1 (latest) — 2016-12-04

## README

# sails-oracledb-sp-example

## About
Example sails project using the [sails-oracledb-sp](https://github.com/Buto/sails-oracledb-sp) adapter

The current version exposes the Oracle HR Employee table via a REST API and websockets.
It includes an Angular UI.


#Installation
The setup procedure relies on Oracle's VM.

install VirtualBox
Download and install [Oracle VM VirtualBox](http://www.oracle.com/technetwork/server-storage/virtualbox/downloads/index.html "download VirtualBox") on your host system

##Download the Oracle 12c VM
The Oracle 12c VM is provided in an Open Virtual Appliance (OVA) file.  An OVA is essentially an archive that includes a disk image and other supporting files that are suitable to be imported into VirtualBox as a VM.  The VM provided by this OVA includes Oracle Linux 7 and Oracle Database 12c Release 1 Enterprise Edition.

Download the [Oracle 12c OVA](http://www.oracle.com/technetwork/database/enterprise-edition/databaseappdev-vm-161299.html "Oracle DB Developer VM"), which is the Oracle DB Developer VM. Launch it by double clicking it and then import it into VirtualBox.

After the VM is launched then it needs a bit of configuration.

Enable the Oracle 12c's VM's bidirectional clipboard.

In the VM's menu: Devices->shared clipboard->bidirectional.

Set the VM's memory for 3GB. Set the VM's memory for 3GB.

In the VM's menu: Machine->settings->system and configure for 3GB of memory.

Database Information:
* Oracle SID    : cdb1
* Pluggable DB  : orcl
* ALL PASSWORDS ARE : oracle
* The Linux Username and password is oracle.

## Install Node

```javascript
$sudo su -
# cd Downloads
# wget https://nodejs.org/dist/v0.12.7/node-v0.12.7-linux-x64.tar.gz
# tar xzf node-v0.12.7-linux-x64.tar.gz
# cd node-v0.12.7-linux-x64
```
Node.js is installed in /usr/local directory. The following command copies the files to the correct sub-directotories in /usr/local:
```ada
#for dir in bin include lib share; do cp -par ${dir}/* /usr/local/${dir}/; done
```
To verify version of node and npm, type:
```javascript
#node --version
v0.12.7
#npm --version
3.3.8
```
Now install npm

```javascript
#npm install -g npm
```

##Install the Oracle Instant Client 'Basic' and 'SDK' RPMs
The Oracle VM comes with FireFox preinstalled.


## Download both the Oracle Instant Client 'Basic' and Oracle Instant Client 'SDK' RPMs

[Download Oracle Instant Client 'Basic' and Oracle Instant Client 'SDK' RPMs](http://www.oracle.com/technetwork/topics/linuxx86-64soft-092277.html#ic_x64_inst "download Instant Client RPMs")

After the download has completed then copy the downloaded rpms to /home/oracle/rpms and then install the packages as root
```ada
$mkdir /home/oracle/rpms
$mv /home/oracle/Downloads/*.rpm /home/oracle/rpms
$sudo su -
#cd /home/oracle/rpms
#rpm -ivh oracle-instantclient12.1-basic-12.1.0.2.0-1.x86_64.rpm
#rpm -ivh oracle-instantclient12.1-devel-12.1.0.2.0-1.x86_64.rpm
#exit
```
Add the following lines to /home/oracle/.bashrc:
```javascript
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATH
export PATH=/opt/node-v4.1.0-linux-x64/bin:$PATH
```

##Install git
```javascript
sudo su -
#yum install git
exit
```

## Installation

```bash
$ git clone https://github.com/nethoncho/sails-oracledb-sp-example.git
$ cd sails-oracledb-sp-example
$ npm install
$ bower install
```

## Configuration

Edit the oraclehr adapter in the config/connections.js file to match your needs

```javascript
module.exports.connections = {
  oraclehr: {
    adapter: 'oracle-sp',
    user: 'scott',
    password: 'tiger',
    package: 'HR',
    cursorName: 'DETAILS',
    connectString: 'localhost/orcl'
  }
};
```

Apply the stored procedures to the HR schema in db/

```bash
$ cd db
```

The order is important

```bash
sqlplus "scott/tiger@localhost/orcl" < create_pkg_hr-child.pls
sqlplus "scott/tiger@localhost/orcl" < create_pkgbdy_hr-child.plb
sqlplus "scott/tiger@localhost/orcl" < create_pkg_hr.pls
sqlplus "scott/tiger@localhost/orcl" < create_pkgbdy_hr.plb
sqlplus "scott/tiger@localhost/orcl" < create_type_retcodes.sql
```

```bash
$ cd ..
```

## Run the application

launch Sails:

```bash
$ cd ~/sails-oracledb-sp-example
$ sails lift
```

Point your browser to http://localhost:1337/#/employees to start UI

#### License

**[MIT](./LICENSE)**
&copy; 2015

---
_Source: https://npm.io/package/sails-oracledb-sp-example · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
