Enabling Database 12c in write mode

SQL> select name, open_mode from v$pdbs;

NAME OPEN_MODE
—————————— ———-
PDB$SEED READ ONLY
PDBORCL MOUNTED

SQL> alter pluggable database PDBORCL open;

Pluggable database altered.

SQL> select name, open_mode from v$pdbs;

NAME OPEN_MODE
—————————— ———-
PDB$SEED READ ONLY
PDBORCL READ WRITE

#.

> alter system set session_cached_cursors=100 scope=spfile;
> alter system set processes=500 scope=spfile;
> shutdown immediate;
> startup;
> alter system set aq_tm_processes=1 scope=both;
> alter system set open_cursors=800 scope=both;

Oracle Database – Installing on OL7

# A couple of points to note :

# Make sure following package is installed :

$ yum install compat-libstdc*

# Check for relevant packages by the following command :


$ rpm -q --qf '%{NAME}-%{VERSION}-%{RELEASE}(%{ARCH})\n' binutils \
gcc \
gcc-c++ \
glibc \
glibc-common \
glibc-devel \
glibc-headers \
ksh \
libaio \
libaio-devel \
libgcc \
libstdc++ \
libstdc++-devel \
libXext \
libXtst \
libX11 \
libXau \
libXi \
make \
sysstat \
unixODBC \
unixODBC-devel \
zlib-devel

# During the installation perform the following when you get em related error :

1. Edit this file: /u01/app/oracle/product/11.2.0/dbhome_1/sysman/lib/ins_emagent.mk

2. Change the following:
OLD: $(MK_EMAGENT_NMECTL)
NEW: $(MK_EMAGENT_NMECTL) -lnnz11

3. Retry.

# unset proxy variables

$ export unset http_proxy
$ export no_proxy

# First install the software and then set the configuration variable to configure netca and dbca

Database – Create Env


#!/bin/bash
#############################################################
# Created on: 2/17/09
# Last Updated: 07/09/09
# Version 2.1.6
#############################################################
#clear the screen
clear
#check for root user (this script must be run as root)
if [[ $EUID -ne 0 ]]; then
echo “This script must be run as root” 1>&2
exit 1
fi
# Confirm Start of Installation
echo -n “Are you sure that you want to continue? [y/n] “
read resp
if [ $resp != "Y" ] || [ $resp != "y" ]
then
echo “Exiting Installation”
exit
fi
# Create the Oracle User
echo “Creating ‘oracle’ user and groups”
echo “check if group oinstall exist:”
egrep “oinstall” /etc/group >/dev/null
if [ $? -eq 0 ]; then
echo “group: oinstall already exists”
else
groupadd oinstall
echo “group: oinstall added.”
fi
echo “check if dba group exists:”
egrep “dba” /etc/group >/dev/null
if [ $? -eq 0 ]; then
echo “group: dba already exists”
else
groupadd dba
echo “group: dba added.”
fi
echo “check to see if ‘oracle’ exists”
egrep “oracle” /etc/passwd >/dev/null
if [ $? -eq 0 ]; then
echo “oracle already exists.”
else
useradd -g oinstall -G dba -d /home/oracle -m -s /bin/bash oracle
echo “user: oracle added.n”
passwd oracle
fi
# Creating Oracle Base Directory
echo “Create Oracle_Base directory”echo “Create Oracle_Base directory”
echo -e “Please enter the full of the Oracle Home”
read oh
mkdir -p $oh
chown -R oracle:oinstall $oh
# Kernel Parameter Modifications.
echo “Making kernel changes permanant by modifying /etc/sysctl.conf”
echo “# Kernel parameters required by Oracle” >> /etc/sysctl.conf
echo “kernel.msgmni = 2878″ >> /etc/sysctl.conf
echo “kernel.msgmax = 8192″ >> /etc/sysctl.conf
echo “kernel.msgmnb = 65535″ >> /etc/sysctl.conf
echo “kernel.sem = 256 32000 100 142″ >> /etc/sysctl.conf
echo “kernel.shmall = 2097152″ >> /etc/sysctl.conf
echo “kernel.shmmax = 4294967295″ >> /etc/sysctl.conf
echo “kernel.shmmni = 4096″ >> /etc/sysctl.conf
echo “fs.file-max = 131072″ >> /etc/sysctl.conf
echo “net.ipv4.ip_local_port_range = 20000 65000″ >> /etc/sysctl.conf
echo “Finished modifying /etc/sysctl.conf”
# Flush the sysctl.conf file after making the above changes.
/sbin/sysctl -p
# change to the oracle home directory
cd /home/oracle
echo “Create Environment source file:”
touch /home/oracle/infra.env
echo “ORACLE_BASE=/opt/oracle; export ORACLE_BASE” >> /home/oracle/infra.env
echo “ORACLE_HOME=$ORACLE_BASE/ias1; export ORACLE_HOME” >> /home/oracle/infra.env
echo “LD_LIBRARY_PATH=$ORACLE_HOME/lib:$ORACLE_HOME/lib32:/lib:/user/local/bin; export LD_LIBRARY_PATH” >> /home/oracle/infra.env
echo “ORACLE_SID=orcl; export ORACLE_SID” >> /home/oracle/infra.env
echo “PATH=/usr/bin:$ORACLE_HOME/bin:$ORACLE_HOME/opmn/bin:$PATH; export PATH” >> /home/oracle/infra.env
# Change ownership of infra.env to oracle:oinstall
chown oracle:oinstall /home/oracle/infra.env
clear
echo -e “Oracle Environment Setup is Complete.”
exit 1

Oid Bulk Load

# Set the env:

$ export ORACLE_HOME=path/Oracle_IDM1/
$ export ORACLE_INSTANCE=path/asinst_1

# A sample ldif file to import

$ cat > testuser.ldif
dn: cn=testuser,cn=Users, dc=us,dc=example,dc=com
objectclass:inetorgperson
sn:test
cn:test-cn

# Import

$ $ORACLE_INSTANCE/bin/opmnctl stopall

$ bulkload connect=OIDDB check=true generate=true append=true file=testuser.ldif
$ bulkload connect=OIDDB append=true load=true file=testuser.ldif
$ bulkload connect=OIDDB index="TRUE"

$ $ORACLE_INSTANCE/bin/opmnctl startall
$ $ORACLE_INSTANCE/bin/opmnctl status -l

# Other links to read :
http://onlineappsdba.com/index.php/2014/05/07/backing-up-and-restoring-a-small-directory-oid-11g/