You are on page 1of 13

IBM Security Guardium V10

DB Server Primer V1.4


An IBM Proof of Technology
PoT.0121.01

Contents
APACHE CASSANDRA DATABASE (V2.0.12) ............................................................................................................................. 3
APACHE COUCHDB (V1.6.1) ........................................................................................................................................................ 4
IBM DB2 (10.5.0.6 (FP6 - ADVANCED ENTERPRISE SERVER EDITION (AESE)) .................................................................... 5
EMC/VMWARE PIVOTAL GREENPLUM DATABASE (V4.2.2.4).................................................................................................. 6
IBM INFORMIX (V12.1) ................................................................................................................................................................... 7
10GEN MONGODB (V2.6.7) ........................................................................................................................................................... 8
ORACLE MYSQL (V5.6.22) – PART OF LAMP (LINUX, APACHE, MYSQL, PHP / PERL / PYTHON) ........................................ 9
ORACLE XE (V11.2.0.2.0) ............................................................................................................................................................ 10
POSTGRESQL (V9.4.0) ................................................................................................................................................................ 11
SYBASE ASE (V15.7) ................................................................................................................................................................... 12

© Copyright IBM Corporation, 2016


US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
IBM Software

Apache Cassandra database (v2.0.12)


Website: http://cassandra.apache.org
Documentation: www.datastax.com/documentation/cassandra/2.0
OS User / password: cassandra / guardium
DB User / password: cassandra / cassandra
DB Install Path: /usr/share/cassandra
DB Storage Path: /var/lib/cassandra
Executable: cqlsh, cassandra-cli

Database Commands
1) Database Server start / stop / restart / status (as root user):
service cassandra start / stop / restart / status
2) Connect:
cqlsh -u cassandra -p cassandra
cassandra-cli -u cassandra -pw cassandra
3) Show users:
list users;
4) Create database:
create keyspace demodb with replication = {'class' : 'SimpleStrategy', 'replication_factor': 3};
5) Show databases:
describe keyspaces;
6) Use database:
use demodb;
7) Show tables:
describe tables;
8) Create table:
create table creditcard (custid int, fname varchar, lname varchar, ccn varchar, primary key (custid));
9) Insert data:
insert into creditcard (custid, fname, lname, ccn) values (104, 'jane', 'smith','1111222233334444');
10) Select table:
select * from creditcard;
11) Alter table:
alter table creditcard add address varchar;
12) Drop table:
drop table creditcard;
13) Exit database:
exit / quit

DB Server Primer V1.4 Page 3


IBM Software

Apache CouchDB (v1.6.1)


Website: http://couchdb.apache.org
Documentation: http://docs.couchdb.org/en/latest
OS User / password: couchdb / guardium
DB User / password: admin / guardium
DB Install Path: /usr/local/share/couchdb
DB Storage Path: /usr/local/var/lib/couchdb
Executable: couchdb

Database Commands
1) Database Server start / stop / restart / status (as root user):
service couchdb start / stop / restart / status
2) Connect:
http://10.10.9.56:5984/_utils/ (Futon)
curl http://127.0.0.1:5984/
3) Show users:
curl -s http://127.0.0.1:5984/_users/_all_docs
4) Create database:
curl -X PUT http://127.0.0.1:5984/demodb
5) Show databases:
curl -X GET http://127.0.0.1:5984/_all_dbs
6) Use database:
curl http://127.0.0.1:5984/demodb
7) Show documents:
curl -X GET http://127.0.0.1:5984/demodb/_all_docs
8) Create document:
http://10.10.9.56:5984/_utils/ (Futon)
9) Insert data:
http://10.10.9.56:5984/_utils/ (Futon)
10) Select document:
http://10.10.9.56:5984/_utils/ (Futon)
11) Alter table:
http://10.10.9.56:5984/_utils/ (Futon)
12) Drop table:
http://10.10.9.56:5984/_utils/ (Futon)
13) Exit database:
Exit browser

Page 4 IBM Security Guardium V10


IBM Software

IBM DB2 (10.5.0.6 (FP6 - Advanced Enterprise Server Edition


(AESE))
Website: www.ibm.com/software/data/db2/express-c
Documentation: http://pic.dhe.ibm.com/infocenter/db2luw/v10r5/index.jsp
OS User / password: db2inst1 / guardium
DB User / password: db2inst1 / guardium
DB Install Path: /opt/ibm/db2/V10.5
DB Storage Path: /home/db2inst1/db2inst1/NODE0000/SAMPLE
Executable: db2

Database Commands
1) Database Server start / stop / restart / status (as root user):
service IBMdb2 start / stop / restart / status
2) Connect:
db2
3) Show users:
select grantee from syscat.dbauth
4) Create database:
create database sample
5) Show databases:
list database directory
6) Use database:
connect to sample
7) Show tables:
list tables
8) Create table:
create table creditcard (custid integer not null, fname varchar(25), lname varchar(25), ccn varchar(25),
primary key (custid))
9) Insert data:
insert into creditcard (custid, fname, lname, ccn) values (104, 'jane', 'smith','1111222233334444')
10) Select table:
select * from creditcard;
11) Alter table:
alter table creditcard add address varchar(50)
12) Drop table:
drop table creditcard
13) Exit database:
quit

DB Server Primer V1.4 Page 5


IBM Software

EMC/VMware Pivotal Greenplum Database (v4.2.2.4)


Website: www.pivotal.io/big-data/pivotal-greenplum-database
Documentation: http://gpdb.docs.pivotal.io/4340/pdf/GPDB43AdminGuide.pdf
OS User / password: gpadmin / guardium
DB User / password: gpadmin
DB Install Path: /usr/local/greenplum-db
DB Storage Path: /data/master, /data/primary
Executable: db2

Database Commands
1) Database Server start / stop / restart (as root user):
service greenplum start / stop / restart
2) Connect:
psql -U gpadmin
3) Show users:
select rolname from pg_roles where rolcanlogin is true;
4) Create database (gpadmin database):
create database demodb \g
5) Show databases:
\l
6) Use database:
\c gpadmin
7) Show tables:
\dt
8) Create table:
create table creditcard (custid integer not null, fname varchar, lname varchar, ccn varchar, primary key
(custid)) \g
9) Insert data:
insert into creditcard (custid, fname, lname, ccn) values (104, 'jane', 'smith','1111222233334444') \g
10) Select table:
select * from creditcard \g
11) Alter table:
alter table creditcard add address varchar \g
12) Drop table:
drop table creditcard \g
13) Exit database:
\q

Page 6 IBM Security Guardium V10


IBM Software

IBM Informix (v12.1)


Website: www.ibm.com/software/data/informix
Documentation: http://pic.dhe.ibm.com/infocenter/informix/v121/index.jsp
OS User / password: informix / guardium
DB User / password: informix / guardium
DB Install Path: /opt/IBM/informix
DB Storage Path: /opt/IBM/informix/storage
Executable: dbaccess

Database Commands
1) Database Server start / stop / restart / status (as root user):
service informix start / stop / restart / status
2) Connect (Menu Driven Client):
dbaccess
3) Show users:
select * from sysusers
4) Create database:
Database->Create-><Database Name>-><Dbspace>-><Choose Dbspace>->Exit->Create-new-database
5) Show databases:
Database->Select-><List of databases>
6) Use database:
Database->Select->stores_demo
7) Show tables:
select tabname from systables
8) Create table:
Table->stores_demo->Create->creditcard->Add->Add-><Enter>->Exit->Build-new-table->Exit->Commit
9) Insert data:
Table->Alter->creditcard->Add->Add-><Enter>->Exit->Build-new-table->Exit->Commit
10) Select table:
Query-language->New->Type ‘select * from orders’-><ESC>->Run
11) Alter table:
Table->Alter->creditcard->Add->Add-><Enter>->Exit->Build-new-table->Exit->Commit
12) Drop table:
Table->Drop->creditcard->Exit->Commit
13) Exit database:
Exit

DB Server Primer V1.4 Page 7


IBM Software

10gen MongoDB (v2.6.7)


** as root, run startWAS to start to run the application for MongoDB
Website: www.10gen.com/products/mongodb
Documentation: http://docs.mongodb.org/manual/
OS User / password: root / guardium
DB User / password: mongo / guardium
DB Install Path: /usr/bin
DB Storage Path: /var/lib/mongo
Executable: mongo

Database Commands
1) Database Server start / stop / restart / status (as root user):
service mongod start / stop / restart / status
2) Connect (admin database):
mongo osprey/admin -u mongo -p guardium
3) Show users:
show users
4) Create database (Implicitly created on first reference):
use <new database name>
5) Show databases:
show dbs
6) Use database:
var mydb = connect('osprey/admin')
7) Show tables:
show tables
8) Create table (This command or implicitly created on first insert):
db.createCollection("creditcard")
9) Insert data:
db.creditcard.insert ({custid: 104, fname: "jane", lname: "smith", ccn: "1111222233334444"})
10) Select table:
db.creditcard.find()
11) Alter table:
db.creditcard.update ({}, { $set: { address: "123 Parkway"}})
12) Drop table:
db.creditcard.drop()
13) Exit database:
exit

Page 8 IBM Security Guardium V10


IBM Software

Oracle MySQL (v5.6.22) – Part of LAMP (Linux, Apache, MySQL,


PHP / Perl / Python)
Website: www.mysql.com
Documentation: http://dev.mysql.com/doc/refman/5.6/en/index.html
OS User / password: root / guardium
DB User / password: root / guardium
DB Install Path: /usr/bin
DB Storage Path: /var/lib/mysql
Executable: mysql

Database Commands
1) Database Server start / stop / restart / status (as root user):
service mysql start / stop / restart / status
2) Connect:
mysql -uroot -pguardium mysql
3) Show users:
select user from mysql.user;
4) Create database:
create database demodb;
5) Show databases:
show databases;
6) Use database:
use mysql;
7) Show tables:
show tables;
8) Create table:
create table creditcard (custid int, fname varchar(25), lname varchar(25), ccn varchar(16), primary key
(custid));
9) Insert data:
insert into creditcard (custid, fname, lname, ccn) values (104, 'jane', 'smith','1111222233334444');
10) Select table:
select * from creditcard;
11) Alter table:
alter table creditcard add address varchar(50);
12) Drop table:
drop table creditcard;
13) Exit database:
exit / quit / \q

DB Server Primer V1.4 Page 9


IBM Software

Oracle XE (v11.2.0.2.0)
Website: www.oracle.com/us/products/database/overview/index.html
Documentation: www.oracle.com/pls/db121/homepage
OS User / password: oracle / guardium
DB User / password: system / guardium
DB Install Path: /u01/app/oracle/product/11.2.0/xe
DB Storage Path: /u01/app/oracle/oradata/XE
Executable: sqlplus

Database Commands
1) Database Server start / stop / restart / status (as root user):
service oracle-xe start / stop / restart / status
2) Connect (Default is XE):
sqlplus system/guardium
3) Show users:
select * from all_users
4) Create database (Requires new instance specification, and configuration file after shutdown):
shutdown;
startup nomount;
create database demodb;
5) Show databases:
select name from v$database; / select instance_name from v$instance;
6) Use database:
N/A – based upon SID when Logging on;
7) Show tables:
select table_name from dba_tables; / select table_name from user_tables; / select table_name from
all_tables;
8) Create table:
create table creditcard (custid int, fname varchar(25), lname varchar(25), ccn varchar(16), primary key
(custid));
9) Insert data:
insert into creditcard (custid, fname, lname, ccn) values (104, 'jane', 'smith','1111222233334444');
10) Select table:
select * from creditcard;
11) Alter table:
alter table creditcard add address varchar(50);
12) Drop table:
drop table creditcard;
13) Exit database:
exit / quit

Page 10 IBM Security Guardium V10


IBM Software

PostgreSQL (v9.4.0)
Website: www.postgresql.org
Documentation: www.postgresql.org/docs/9.4/static/index.html
OS User / password: postgres / guardium
DB User / password: postgres
DB Install Path: /usr/pgsql-9.4
DB Storage Path: /var/lib/pgsql/9.4/data
Executable: psql

Database Commands
1) Database Server start / stop / restart / status (as root user):
service postgresql-9.4 start / stop / restart / status
2) Connect:
psql -U postgres
3) Show users:
select rolname from pg_roles where rolcanlogin is true;
4) Create database (postgres database):
create database postgres \g
5) Show databases:
\l
6) Use database:
\c postgres
7) Show tables:
\dt
8) Create table:
create table creditcard (custid integer not null, fname varchar, lname varchar, ccn varchar, primary key
(custid)) \g
9) Insert data:
insert into creditcard (custid, fname, lname, ccn) values (104, 'jane', 'smith','1111222233334444') \g
10) Select table:
select * from creditcard \g
11) Alter table:
alter table creditcard add address varchar \g
12) Drop table:
drop table creditcard \g
13) Exit database:
\q

DB Server Primer V1.4 Page 11


IBM Software

Sybase ASE (v15.7)


Website: www.sybase.com/products/databasemanagement/adaptiveserverenterprise
Documentation: http://sybooks.sybase.com/sybooks/sybooks.xhtml
OS User / password: sybase / guardium
DB User / password: sa / guardium
DB Install Path: /opt/sybase/OCS-15_0
DB Storage Path: /opt/sybase/data
Executable: isql

Database Commands
1) Database Server start / stop / restart / status (as root user):
service sybase start / stop / restart / status
2) Connect (Default is XE):
isql -S OSPREY -U sa -P guardium
3) Show users (Type "go" to execute all commands):
select name as user_name from sysusers / select name from master.dbo.sysdatabases
4) Create database:
Create database demodb
5) Show databases (Type "go" to execute all commands):
sp_helpdb
6) Use database (Type "go" to execute all commands):
use master
7) Show tables (Type "go" to execute all commands):
select name from sysobjects where type = 'U' / sp_tables
8) Create table (Type "go" to execute all commands):
create table creditcard (custid int, fname varchar, lname varchar, ccn varchar, primary key (custid))
9) Insert data (Type "go" to execute all commands):
insert into creditcard (custid, fname, lname, ccn) values (104, 'jane', 'smith','1111222233334444')
10) Select table (Type "go" to execute all commands):
select * from creditcard
11) Alter table (Type "go" to execute all commands):
alter table creditcard add address varchar
12) Drop table (Type "go" to execute all commands):
drop table creditcard;
13) Exit database:
exit / quit

Page 12 IBM Security Guardium V10


© Copyright IBM Corporation 2016.

The information contained in these materials is provided for


informational purposes only, and is provided AS IS without warranty
of any kind, express or implied. IBM shall not be responsible for any
damages arising out of the use of, or otherwise related to, these
materials. Nothing contained in these materials is intended to, nor
shall have the effect of, creating any warranties or representations
from IBM or its suppliers or licensors, or altering the terms and
conditions of the applicable license agreement governing the use of
IBM software. References in these materials to IBM products,
programs, or services do not imply that they will be available in all
countries in which IBM operates. This information is based on
current IBM product plans and strategy, which are subject to change
by IBM without notice. Product release dates and/or capabilities
referenced in these materials may change at any time at IBM’s sole
discretion based on market opportunities or other factors, and are not
intended to be a commitment to future product or feature availability
in any way.

IBM, the IBM logo, and ibm.com are trademarks of International


Business Machines Corp., registered in many jurisdictions
worldwide. Other product and service names might be trademarks of
IBM or other companies. A current list of IBM trademarks is
available on the Web at “Copyright and trademark information” at
www.ibm.com/legal/copytrade.shtml.

You might also like