Oracle 12c on Oracle Linux 6 – Step 21: Edit the oracle User’s .bash_profile and .bashrc

Part of this series of posts: Oracle Database 12c on Oracle Linux 6

21-01

Right-click the desktop and select Open in Terminal.

21-02

Type the following commands, pressing Enter after each command.

cd
gedit .bash_profile

21-03

The previous command will open the oracle user’s existing .bash_profile script.

21-04

Add the lines below to the .bash_profile file.

#Oracle install specific environment settings
umask 022
TMP=/tmp; export TMP
TMPDIR=$TMP; export TMPDIR
ORACLE_HOSTNAME=localhost.localdomain; export ORACLE_HOSTNAME
ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE
ORACLE_HOME=/u01/app/oracle/product/12.1.0/dbhome_1; export ORACLE_HOME
ORACLE_SID=orcl; export ORACLE_SID
ORACLE_TERM=xterm; export ORACLE_TERM
PATH=$ORACLE_HOME/bin:/usr/sbin:$PATH; export PATH
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY_PATH
CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATH

Click Save and select File -> Quit to close gedit.

Note:

What about the old code block that we’ve seen for years in the .bash_profile that looked like this:

if [ $USER = “oracle” ]; then
 if [ $SHELL = “/bin/ksh” ]; then
 ulimit -p 16384
 ulimit -n 65536
 else
 ulimit -u 16384 -n 65536
 fi
fi

Our preinstall script actually sets the correct settings for the oracle user (it puts a file into /etc/security/limits.d/) and not only that, the ‘use this setting when you use ksh as your shell’ is actually wrong. The -p flag is a read only flag, you can’t actually set this.

21-05

Type the following command and press Enter.

gedit .bashrc

21-06

Enter the following lines in the .bashrc file.

alias sqlplus=’rlwrap sqlplus’
alias rman=’rlwrap rman’
alias asmcmd=’rlwrap asmcmd’
alias adrci=’rlwrap adrci’
alias impdp=’rlwrap impdp
alias expdp=’rlwrap expdp

Click Save and select File -> Quit. If you get a pop-up stating that the backup file couldn’t be created, just click Save Anyway.

Note:

rlwrap allows the up arrow key to return the previously entered command. By default the up arrow doesn’t work in Linux (and other Unix’s) which is very annoying. rlwrap removes that annoyance.

21-07

Type the following commands, pressing Enter after each one.

source .bash_profile
source .bashrc

Note:

Sourcing the files will read their values into your current environment.

 


Oracle 12c on Oracle Linux 6 – Step 20: Download and Extract Oracle Database 12c Grid Infrastructure

Part of this series of posts: Oracle Database 12c on Oracle Linux 6

20-01

Click the Download button for Oracle Database 12c Release 1 Grid Infrastructure (12.1.0.1.0) for Linux x86_64 (Part 1 of 2).

20-02

Click OK to open the download with the Archive Manager.

20-03

Click Extract.

20-04

Again, navigate to the /stage/12.1.0 directory and click Extract.

Note:

See the steps in the previous step if you’ve forgotten how to use the extract dialog to navigate to the /stage/12.1.0 directory.

20-05

Once the extract is finished, click Quit.

20-06

Click the Download button for Oracle Database 12c Release 1 Grid Infrastructure (12.1.0.1.0) for Linux x86_64 (Part 2 of 2).

20-07

Click OK to open the download with the Archive Manager.

20-08

Click Extract.

20-09

Navigate to the /stage/12.1.0 directory and click Extract.

20-10

Once the extract is finished, click Quit.

 


Oracle 12c on Oracle Linux 6 – Step 19: Download and Extract Oracle Database 12c

Part of this series of posts: Oracle Database 12c on Oracle Linux 6

19-01

Click the Firefox icon in the menu bar to open Firefox.

19-02

Go to http://edelivery.oracle.com and click Sign In / Register.

Note:

Make sure that you go to edelivery.oracle.com and not edelivery.oracle.com/linux.

19-03

Enter your Oracle.com username and password and click Sign In.

19-04

Check both agreement terms and click Continue.

19-05

Choose Oracle Database for Select a Product Pack and Linux x86-64 for Platform and click Go.

19-06

Click the Oracle Database 12c Release 1 (12.1.0.1.0) Media Pack for Linux x86-64 link.

19-07

Click the Download button for Oracle Database 12c Release 1 (12.1.0.1.0) for Linux x86_64 (Part 1 of 2).

19-08

Click OK to open the download with the Archive Manager.

19-09

Click Extract.

19-10

The Extract dialog will appear. Click the left arrow icon in the Archive Manager.

19-11

Click the File System Disk icon and then double-click the stage directory.

19-12

Double-click the 12.1.0 directory (not shown) and you’ll see the File System icon followed by the stage icon followed by the 12.1.0 icon (which will be grey as it’s the directory we’ll extract to).
Click Extract.

Note:

It’s important for these extracts that we put everything into the right directories. Make sure that you are extracting the Database and Grid downloads to the /stage/12.1.0 directory. Each download will add either a database directory or a grid directory.

19-13

The file extracts…

19-14

Once the extract is finished click Quit.

19-15

Click the Download button for Oracle Database 12c Release 1 (12.1.0.1.0) for Linux x86_64 (Part 2 of 2).

19-16

Click OK to open the download with the Archive Manager.

19-17

Click Extract.

19-18

The Extract dialog will appear. Click the left arrow icon in the Archive Manager.

19-19

Click the File System Disk icon and then select the stage directory as you did previously.

19-20

Double-click the 12.1.0 directory (not shown) and click Extract.

Note:

Make sure you stop at the 12.1.0 directory and don’t extract files into the database directory. The download already has a database directory in it and it will just add to the existing database directory. In short, make sure your extract location appears as above.

19-21

The file will extract. When the extract is finished, click Quit.

 


Oracle 12c on Oracle Linux 6 – Step 18: Reboot the System to Run the Latest Patched Kernel

Part of this series of posts: Oracle Database 12c on Oracle Linux 6

18-01

Note:

You don’t actually need to run the commands in the above screen shot.
Notice that uname –r has a different kernel version (…400.17.1) than the kernel in /usr/src/kernels (…400.209.1). We’ll have to reboot to get the new kernel loaded so that we can build the Oracle VirtualBox extensions on our system. This is a common problem that folks have when the install the VirtualBox guest extensions (one of our future steps). They don’t reboot the machine after updating the kernel and the guest extensions won’t compile correctly. There is a VERY good chance that your kernel version will be different from the one above.
Rebooting also makes sure that SELINUX is disabled (one of our earlier steps).

18-02

Select System -> Shut Down… from the menu.18-03

Click Restart.

Note:

You’ll see a lot of messages from the system as it goes down and then comes back up. Eventually you’ll see the below screen.

18-04

Click oracle.

18-05

Type oracle in the password field and click Log In.

Note:

Optionally jump ahead to Step 30 and then come back here if you want to do the rest of the install with a full screen guest.

 


Oracle 12c on Oracle Linux 6 – Step 17: Create the Directories for Installing Oracle Software

Part of this series of posts: Oracle Database12c on Oracle Linux 6

17-01

Type the following commands in a terminal window pressing Enter after each line.

cd /
mkdir -p /stage/12.1.0
chown -R oracle:oinstall /stage
chmod -R 775 /stage
mkdir -p /u01/app/oracle/product/12.1.0/dbhome_1
mkdir -p /u01/app/oracle/product/12.1.0/grid
chown -R oracle:oinstall /u01
chmod -R 775 /u01
mkdir /tape
chown -R oracle:oinstall /tape
chmod -R 775 /tape

Note:

We can use the /tape directory to simulate a tape drive for use with rman. After the Oracle Database is installed, running the following command within rman will give you a virtual tape device:

configure channel device type sbt parms=’SBT_LIBRARY=oracle.disksbt,ENV=(BACKUP_DIR=/tape)’;

When you do a backup to this location, rman will act as if this was a backup to tape.

 


Oracle 12c on Oracle Linux 6 – Step 16: Configure ASM and Create the 13 ASM Disks

Part of this series of posts: Oracle Database 12c on Oracle Linux 6

16-01

Type the following command and press Enter.

oracleasm configure -i

Type oracle at the Default user prompt and press Enter.
Type dba at the Default group prompt and press Enter.
Type y at the Start Oracle ASM library driver on boot prompt and press Enter.
Type y at the Scan for Oracle ASM disks on boot prompt and press Enter.

Note:

You don’t have to be in the Desktop directory to run the above command, it will work from anywhere.

16-02

Enter the following commands pressing Enter after each line.

oracleasm init
oracleasm createdisk ASMDISK01 /dev/sdb1
oracleasm createdisk ASMDISK02 /dev/sdc1
oracleasm createdisk ASMDISK03 /dev/sdd1
oracleasm createdisk ASMDISK04 /dev/sde1
oracleasm createdisk ASMDISK05 /dev/sdf1
oracleasm createdisk ASMDISK06 /dev/sdg1
oracleasm createdisk ASMDISK07 /dev/sdh1
oracleasm createdisk ASMDISK08 /dev/sdi1
oracleasm createdisk ASMDISK09 /dev/sdj1
oracleasm createdisk ASMDISK10 /dev/sdk1
oracleasm createdisk ASMDISK11 /dev/sdl1
oracleasm createdisk ASMDISK12 /dev/sdm1
oracleasm createdisk ASMDISK13 /dev/sdn1

Note:

The up arrow is your friend. After running each command use the up arrow and you can change the last letter and then use the arrow keys to move back to the disk name and change that too. You don’t have to move your cursor to the end of the line before you press Enter. The command will run no matter where your cursor is when you press Enter.
If you see any errors when entering the above commands, there’s a good chance you forgot to type oracleasm init before you created the disks.

 


Oracle 12c on Oracle Linux 6 – Step 15: Format the 13 Linux Disks using the Linux Disk Utility

Part of this series of posts: Oracle Database 12c on Oracle Linux 6

15-01

Select Applications -> System Tools -> Disk Utility from the menu bar.

15-02

Select the 2nd drive (/dev/sdb) and click Create Partition.

Note:

You’re looking for the 2nd drive under the SATA Host Adaptor. When you select it you’ll see /dev/sdb in the Device: field (highlighted yellow and pointed to by the yellow arrow).

15-03

Type ASMDISK01 and uncheck the Take ownership of filesystem box and click Create.
Do this for ALL of the ASM disks, incrementing the name from ASMDISK01 through ASMDISK13.

Note:

If you forget which disk you are creating (disk partition creation takes a while) just look at the Location field. Decrement the port number by one to get the correct ASMDISK number. For example; If it reads Port 10 of SATA Host Adapter, then you are on ASMDISK09. I highlighted the Location field in the above screen shot.

15-04

Once you are finished with all 13 ASM disks, Select File -> Quit to exit the Disk Utility.


Follow

Get every new post delivered to your Inbox.