Tag Archives: Oracle Linux

Oracle Database 12c on Oracle Linux 6 – Step 28: Log into Oracle Enterprise Manager Express

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

28-01

Click the Firefox icon in the menu bar.

28-02

Navigate to https://localhost:5500/em .

28-03

Click I Understand the Risks.

28-04

Click Add Exception….

28-05

Click Confirm Security Exception.

28-06

Select Edit -> Preferences, click Use Current page, and click Close.

28-07

Enter sys for User Name, oracle_4U for Password, check as sysdba and click Login.

28-08

Note:

For some reason the lower windows seem to error out…

28-09

Again… Errors.

Oracle Database 12c on Oracle Linux 6 – Step 27: Configure the Pluggable Database to Autostart on Reboot < Previous Post – Next Post > Oracle Database 12c on Oracle Linux 6 – Step 29: Create a Link to SQL Developer and Database Connections

 


Oracle Database 12c on Oracle Linux 6 – Step 27: Configure the Pluggable Database to Autostart on Reboot

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

27-01

Right-click the desktop and select Open in Terminal.

27-02

Type the following command and press Enter.

sqlplus / as sysdba

27-03

Type the following lines, pressing Enter after each one. The last line is a backslash, /. As you press enter after each line the prompt will change to show you your current line number.

create or replace trigger autostart_pdb
after startup on database
begin
execute immediate ‘alter pluggable database all open’;
end autostart_pdb;
/
  

Note:

For some reason pluggable databases don’t automatically start on reboot. Our container database (orcl) does as it is registered with Oracle Restart dynamically as it is created. The above trigger will automatically start our pluggable database (pdborcl) when the orcl database starts.

27-04

Type the following command and press Enter.

exit

Oracle Database 12c on Oracle Linux 6 – Step 26: Modify glogin.sql < Previous Post – Next Post > Oracle Database 12c on Oracle Linux 6 – Step 28: Log into Oracle Enterprise Manager Express


Oracle Database 12c on Oracle Linux 6 – Step 26: Modify glogin.sql

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

26-01

Type the following commands, pressing Enter after each command.

cd $ORACLE_HOME
cd sqlplus/admin/
gedit glogin.sql

26-02

The previous command will open the existing glogin.sql script.

26-03

Add the below lines to the glogin.sql file and then click Save.

set trimspool on
set long 5000
set linesize 100
set pagesize 9999
col table_name for a30
column global_name new_value gname
set termout off
define gname=idle
SELECT LOWER(user) || '@' ||
              SUBSTR ( global_name, 1, decode (dot, 0, length(global_name), dot-1)) 
             as global_name 
    from
             (select global_name, instr(global_name,'.') as dot from global_name );
set sqlprompt '&gname> '
set termout on

26-04

Select File -> Quit.

2016-02-15 Update: Laurent Schneider (laurentsch via twitter) suggested adding the col table_name for a30 which is always useful…

2015-04-10 Update:

While the above glogin.sql is really cool, it does have the side effect of not allowing Enterprise Manager Cloud Control 12c (12.1.0.4 at least) to start the database. It appears that the select statement (which of course errors out when the database is down, but since we turned off terminal output with the ‘set termout off’ and then back on with the ‘set termout on’ it really shouldn’t make a difference…) breaks EM. I’ve asked Oracle to log a bug on this.

2016-02-05 Update:

Very cool! I just tested this out with Enterprise Manager 13c and it’s fixed. I’ve got a login.sql (instead of glogin.sql) and a SQLPATH environment variable that points to it and was just able to start my database with EMCC 13c. Thanks Oracle!

Oracle Database 12c on Oracle Linux 6 – Step 25: Create the orcl and pdborcl databases < Previous Post – Next Post > Oracle Database 12c on Oracle Linux 6 – Step 27: Configure the Pluggable Database to Autostart on Reboot

 


Oracle Database 12c on Oracle Linux 6 – Step 25: Create the orcl and pdborcl databases

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

25-01

Open a new terminal window by right-clicking the desktop and select Open in Terminal.

25-02

Type the following command and press Enter.

dbca

25-03

The installer will start after a while (Java has to start up on the machine).

25-04

Click Next.

25-05

Choose Advanced Mode and click Next.

Note:

If you don’t want to install the sample schemas then you can just create a database with the default configuration, however do make sure to change the default character set to AL32UTF8.

25-06

Click Next.

25-07

Enter orcl.localdomain for Global Database Name. This will auto populate orcl for the SID.

Check Create As Container Database and enter pdborcl for PDB Name.

Click Next.

Note:

If you are in my Oracle Database 11g Admin I or II course at Austin Community College and you are using 12c for your own test server at home, you may want to skip the pluggable database part and just stick with a ‘regular’ orcl instance so your environment matches the Oracle training materials more closely. If so, don’t check the Create As Container Database check box.

25-08

Click Next.

25-09

Choose Use the Same Administrative Password for All Accounts and enter oracle_4U for Password and Confirm Password.

Click Next.

25-10

Click Next.

Note:

Our ASM listener (notice LISTENER is in the grid home) supports dynamic instance registration.

25-11

Change both Storage Type dropdowns to Automatic Storage Management.

Change Database File Locations from +FRA to +DATA.

Change Fast Recovery Area from +DATA to +FRA.

Click Next.

Note:

In any type of production situation you’d be enabling archiving. However since this is a learning environment we’re going to leave that unchecked for now.

25-12

Check Sample Schemas and click Next.

25-13

Confirm that Use Automatic Memory Management is checked. Enter 2048 for the Target database memory. Don’t click next, but instead click the Character sets tab.

Note:

Why so little memory? Two reasons: First, this is just a test or classroom system. Second, if the memory size is too large then you’ll get an error because /dev/shm will need to be resized to potentially fit the amount of memory allocated to Oracle. For very large amounts of memory you’ll want to look into enabling HugePages on Linux which means that you won’t be able to use Automatic Memory Management (AMM).

25-14

On the Character sets tab, choose Use Unicode (AL32UTF8) and click Next.

Note:

These days Unicode should be used for your Oracle databases. Oracle is requiring Unicode for some products and Java applications use Unicode natively so you won’t have to do character set conversions between the database and your application if you use Unicode.

25-15

Click Next.

25-16

Click Finish.

25-17

The installer will run for a while…

25-18

Click Exit.

25-19

Click Close.

Oracle Database 12c on Oracle Linux 6 – Step 24: Install the Oracle Database Software Only < Previous Post – Next Post > Oracle Database 12c on Oracle Linux 6 – Step 26: Modify glogin.sql

 


Oracle Database 12c on Oracle Linux 6 – Step 24: Install the Oracle Database Software Only

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

24-01

Right-click the desktop and select Open in Terminal to open a new terminal window.

Note:

This will reset all environment variables back to what we set them in the .bashrc.

24-02

Type the following commands and press Enter after each one.

unset ORACLE_SID
cd /stage/12.1.0/database/
./runInstaller

24-03

Uncheck I wish to receive security updates via My Oracle Support and click Next.

24-04

Click Yes.

24-05

Choose Skip software updates and click Next.

24-06

Choose Install database software only and click Next.

Note:

Yep, the Create and configure a database wizards still don’t do what you want them to do, so we’ll be using dbca after we’ve installed the software.

24-07

Choose Single instance database installation and click Next.

24-08

Click Next.

24-09

Choose Enterprise Edition and click Next.

24-10

Confirm that Oracle base is /u01/app/oracle and Software location is /u01/app/oracle/product/12.1.0/dbhome_1. Click Next.

24-11

Choose dba for all dropdowns and click Next.

24-12

The installer verifies requirements.

24-13

Click Install.

24-14

The installer extracts files, links libraries and does the setup.

24-15

The install will progress for a while and then the above dialog will pop up.

Note that we need to run a script as root…

24-16

Right-click the desktop (you may have to minimize the terminal window you started the installer with) and select Open in Terminal.

24-17

Type the following command (note, there is a dash at the end of the line) and press Enter.

su -

Enter root at the Password prompt and press Enter.

Type the following commands and press Enter after each one.

cd /u01/app/oracle/product/12.1.0/dbhome_1
./root.sh

Press Enter at the Enter the full pathname… prompt.

Optionally type exit twice to close down the terminal window.

24-18

Click OK.

24-19

Click Close.

Oracle Database 12c on Oracle Linux 6 – Step 23: Create the FRA Disk Group < Previous Post – Next Post > Oracle Database 12c on Oracle Linux 6 – Step 25: Create the orcl and pdborcl databases

 


Oracle Database 12c on Oracle Linux 6 – Step 23: Create the FRA Disk Group

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

23-01

Open a terminal window (right-click the desktop and select Open Terminal).

Type the following command and press Enter.

. oraenv

At the ORACLE_SID = [ orcl] ? prompt type +ASM and press Enter.

Type the following command and press Enter.

asmca

Note:

. oraenv (period space oraenv, usually said dot space oraenv) is a command that sets your ORACLE_SID environment variable. If you run oraenv by itself (without the period and a space in front of it) then the command will run just fine. However, you’ll only set the ORACLE_SID for the duration of that single command. If you use the period space, then the change will persist for future commands.
You should get really used to typing . oraenv.

23-02

It may take a while for the ASM Configuration Assistant to appear. When it does click Create.

23-03

Enter FRA for the Disk Group Name, choose External (None) for Redundancy, check ASMDISK05 through ASMDISK08 and click OK.

Note:

We’re only choosing External (None) for Redundancy here so that our fast recovery area (FRA disk group) will be larger than our DATA disk group. Normally you’d want to stick with at least Normal redundancy for your FRA.

23-04

The disk group is created…

23-05

Click OK.

23-06

Click Exit.

23-07

Click Yes.

23-08

Type the following command and press Enter.

exit

Oracle Database 12c on Oracle Linux 6 – Step 22: Install Oracle Grid Infrastructure, Oracle Restart and ASM < Previous Post – Next Post > Oracle Database 12c on Oracle Linux 6 – Step 24: Install the Oracle Database Software Only


Oracle Database 12c on Oracle Linux 6 – Step 22: Install Oracle Grid Infrastructure, Oracle Restart and ASM

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

22-01

Type the following commands, pressing Enter after each one.

cd /stage/12.1.0/grid/
./runInstaller

22-02
You’ll see some output from the script about Temp space, swap space and monitor checks. It may take a while for the next screen to pop up.

22-03

Choose Skip software updates and click Next.

22-04

Choose Install and Configure Oracle Grid Infrastructure for a Standalone Server and click Next.

22-05

Click Next.

22-06

Check the first 4 ASM disks, ORCL:ASMDISK01 through ORCL:ASMDISK04 and click Next.

Note:

If you are not using ASMLib on Oracle Linux during this step you’ll have to use the Change Discovery Path… button and navigate to /dev/oracleasm/disks/ to find your ASM disks.

22-07

Choose Use same passwords for these accounts, enter oracle_4U for both fields and click Next.

Note:

oracle_4U meets the password complexity requirements for the database, but it’s a bad password to use because it’s based on a dictionary word (oracle) and it’s used in the Oracle training material. It is an easy password to remember once you’ve typed it a few hundred times.

22-08

Choose dba from all three dropdowns and click Next.

22-09

Click Yes.

Note:

The value of using multiple groups for each of the potential roles is to allow for the possibility of separation of responsibilities. In large shops some personnel could be assigned to each of the different groups and would then only be able to perform certain ASM functions

22-10

Change Software location from /u01/app/oracle/product/12.1.0/dbhome_1 to /u01/app/oracle/product/12.1.0/grid as in the next screenshot.

22-11

Click Next.

22-12

Click Next.

22-13

Make sure that Automatically run configuration scripts is checked and Use ‘root’ user credentials is selected and type root in the password field. Click Next.

22-14

Prerequisite checks are run…

22-15

Check Ignore All if you get a memory error and click Next.

Note:

You shouldn’t get this error if you allocate a bit more than 4 GB of ram. I went with 6 GB of ram for the VM the 2nd time around and didn’t get this error. There is probably an amount of ram that is too small for you to be able to continue.

22-16

Click Yes.

22-17

Optional: Click Save Response File.

Note:

It’s never a bad idea to have a response file from your install as it contains all of your install information and it can be used for future installs. It’s a simple text file that can be updated with any text editor.

22-18

Optional: Click Save.

22-19

Click Install.

22-20

The grid infrastructure installs…

22-21

Click Yes.

22-22

Click Close.

Oracle Database 12c on Oracle Linux 6 – Step 21: Edit the oracle User’s .bash_profile and .bashrc < Previous Post – Next Post > Oracle Database 12c on Oracle Linux 6 – Step 23: Create the FRA Disk Group