Skip to content

Instantly share code, notes, and snippets.

@mortenbra
mortenbra / oracle_upload_software.sh
Last active August 31, 2015 13:44
Copy Oracle installation files from client to server using SCP
# copy files from client to server
# assumes you have downloaded everything into an "install" folder
# adjust SSH port number, file paths, server/host name and version numbers as appropriate
cd /users/yourname/install/oracle
scp -P 22 oracle-xe-11.2.0-1.0.x86_64.rpm.zip root@server-name-or-ip:/u01/download/
scp -P 22 apex_5.0.1_en.zip root@server-name-or-ip:/u01/download/
scp -P 22 jdk-7u79-linux-x64.rpm root@server-name-or-ip:/u01/download/
scp -P 22 ords.2.0.10.289.08.09.zip root@server-name-or-ip:/u01/download/
@mortenbra
mortenbra / centos_firewall.sh
Last active January 10, 2023 02:41
Basic firewall (iptables) script for CentOS with openings for SSH, HTTP and HTTPS
#!/bin/bash
# see http://oracle-base.com/articles/linux/linux-firewall.php
# Set the default policies to allow everything while we set up new rules
# Prevents cutting yourself off when running from remote SSH
iptables -P INPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -P OUTPUT ACCEPT
@mortenbra
mortenbra / centos_update.sh
Last active August 29, 2015 14:22
Update CentOS packages via yum
# check what updates are available
yum check-update
# update everything
yum update -y
# update everything except the kernel
#yum update -y --exclude=kernel*
@mortenbra
mortenbra / ora_network_acl_verify.sql
Created June 4, 2015 14:39
Verify network ACL settings in Oracle
-- check/verify network ACL settings
select host, lower_port, upper_port, acl
from dba_network_acls;
select *
from dba_network_acl_privileges;
@mortenbra
mortenbra / apex_workspace_verify.sql
Created June 4, 2015 14:30
Verify Apex workspaces
-- check setup of Apex workspaces
select *
from apex_workspaces;
select *
from apex_workspace_schemas;
@mortenbra
mortenbra / apex_install_runtime.sql
Created June 4, 2015 14:29
Install Apex runtime
-- install Apex (runtime only)
@apxrtins.sql SYSAUX SYSAUX TEMP /i/
@mortenbra
mortenbra / xe_post_install_cleanup.sql
Last active May 9, 2017 08:04
Clean up unused features in Oracle XE after installation
-- do some cleanup after Oracle XE installation
-- run as SYS
-- disable XDB server
-- assumes we will use ORDS or other web listener instead
exec dbms_xdb.sethttpport(0);
exec dbms_xdb.setftpport(0);
-- anonymous user is not needed when we don't use XDB
alter user anonymous account lock;
@mortenbra
mortenbra / xe_post_install_verify.sh
Last active August 29, 2015 14:22
Post-install test of Oracle XE
# initial test of Oracle XE database after install
# become the "oracle" user
su - oracle
# connect to database
sqlplus /nolog
connect sys as sysdba
-- basic query to see stuff working
@mortenbra
mortenbra / centos_swapfile.sh
Last active October 29, 2021 14:51
Creating a swapfile suitable for Oracle XE on CentOS
# Oracle XE requires a swap file of at least twice the size of physical memory
# see https://www.digitalocean.com/community/tutorials/how-to-add-swap-on-centos-6
# check current swap file
swapon -s
# check available space
df
# setup 2GB swap file
dd if=/dev/zero of=/swapfile bs=1024 count=2048k
@mortenbra
mortenbra / centos_ntp.sh
Last active August 29, 2015 14:22
Setup Network Time Protocol (NTP) for CentOS
# setup Network Time Protocol (NTP)
# see http://www.uptimemadeeasy.com/networking/setup-ntp-on-centos-linux/
# check current date/time
date
# setup time zone
mv /etc/localtime /etc/localtime.bkp
cp /usr/share/zoneinfo/Europe/Oslo /etc/localtime