jueves, 5 de noviembre de 2015

WCP 12.2.1: Installation III (Oracle Database

Oracle Linux respositories brings a pre-package which configures all the pre-requisites needed by the instalation of Oracle Databases.

Note: This is the unique product installed in 12cR1 version. 12.2.1 is not yet released

Remember that we already installed the pre-package of Oracle Database in the chapter: WCP 12.2.1: Installation I (O.S)

If you did not installed then do it using: yum install oracle-rdbms-server-12cR1-preinstall

Unzip and launch the installed downloaded from: http://www.oracle.com/technetwork/database/enterprise-edition/downloads/index-092322.html

In this case we are installing a 12cR1 Standard Edition. Unzip the installer and execute the installation Wizard.

Oracle Database Installation Wizard

During the installation make sure that you use the same Oracle base as the future paths used by the other Fusion Middleware Products. By default PBD (Multitenant Arch) is selected, we will let it as selected as we can learn more about Multitenant Architecture!. If you do not want then remove it.

In addition, make sure the oraInventory is well located.

Start / Stop the database

By default, database starts and open the PDB properly with the O.S. However, if it is required a restart without restarting the O.S then the PDBs will remain in MOUNTED status (check following header to fix this).
Anyway, remember for starting a database you need:
  • Setup the UNIX variable ORACLE_HOME to the HOME of the DB (dbhome_1 folder path)  
  • Setup the UNIX variable ORACLE_SID to the SID configured!. In our case is orcl
  • Start the Listener using lsncrtl start in the path [ORACLE_HOME]/bin (in our case /oracle/product/db/12.1.0/dbhome_1/bin)
  • Start the instance of the database. Go to [ORACLE_HOME]/bin and execute
    "./sqlplus / as SYSBDA" In the SQLPLUS command line execture startup
  • To stop the database instance execute shutdown immediate
  • To stop the Listener lsnctrl stop
Note: In the chapter WCP 12.2.1: Installation XI (Custom scripts for stop/start) may I will share my famous easy scripts to start / stop all the services and forget to establish ORACLE_HOME and whatever! 

Enable the PDB Pluggable Service to be Open, Read, Write by default

PDB connection starts with O.S with Open, Read, Write permissions. However if you stop and start the database using the typical commands then maybe the PBD will remain in MOUNTED status and all SQL Data Sources will stop working.

To be sure that the PBDs are OPEN READ WRITE from start exectute the following commands as SYSDBA. Guessing the PID is orcl and the PDB pdborcl

SQL> alter pluggable database PDBORCL OPEN READ WRITE;Pluggable database altered.
SQL> alter pluggable database PDBORCL save state;

Pluggable database altered.
SQL> SELECT con_name, instance_name, state FROM dba_pdb_saved_states;


Extra configuration 

Edit the listener.ora in order to allow the RCU connect to the pdborcl instead of orcl 
Note: RCU will not be able to connect orcl if the database is using PDB and then a Multitenant Architecture!!!!!!!!

You can find the tnsnames.ora in [ORACLE_HOME]/network/admin path

Copy the same entry of ORCL and rename it to PDBORCL

Adding the PDBORCL in order to able to connect the database

 Restart the Listener after this change

Decreasing the amount of memory consumed by the Database

We are going to decrease the amount of RAM memory consumed by the database.

We will not use this machine for production, Nuclear Power Plants or sending someone to Mars!. It is just development and 1GB or 1,2GB is enough!!!!!!

To decrease the memory consumed we are going to limit the SGA and PGA memory assigned via MEMORY_TARGET parameters.

If you do not know yet how an Oracle Database distributes the memory between SGA and PGA take a look into: https://docs.oracle.com/database/121/ADMIN/memory.htm#ADMIN11197

I like to do it manually as following:
  • Export the SPFILE to a PFILE that can be edit manually with the following command in the SQLPLUS:

    create pfile from spfile;

  • The .ora file should be in [ORACLE_HOME]/dbs/initorcl.ora I use to set 1GB or 2 GB depending on the people working on the project. Take this values just as a reference

    orcl.__oracle_base='/oracle/db'#ORACLE_BASE set from environment
    *.dispatchers='(PROTOCOL=TCP) (SERVICE=orclXDB)'

  • Regenerate the SPFILE from the modified PFILE using

    create spfile from pfile;

  • Start again the database instance and check the memory consumption

    Database consuming less resources :)
Next step: WCP 12.2.1: Installation IV (Oracle WebLogic 12.2.1)

2 comentarios:

  1. Hi Daniel,
    I downloaded a new VM and installed a new version of Oracle Linux Server 7.2.
    My host is still running in Windows 7 and the Virtual Box is Linux.

    When I try to execute the ./runInstaller,

    I am getting this error
    "could not execute autocheck for display colors using command /usr/bin/xdpyinfo. check if DISPLAY variable is set"

    I am sorry if my question is really simple but being a developer, I was used to running with GUI and let my SYSADMIN guy do this task. My knowledge in Linux is really on simple file traversal and editing.

    I am getting stuck in this step. Any hints?

    Thanks as always

  2. Hi Mark.
    If you are with a terminal from your computer connecting to VM
    You just need to forward the DISPLAY to your host machine.
    I use to use http://mobaxterm.mobatek.net/ which I love it (better than putty sessions) that it makes it for yourself.
    If you are directly in a terminal inside of your VM it means that the X Server is not configured or running. Take a look into https://blogs.oracle.com/R/entry/howto_x11_forwarding_with_r or other links.

    I hope you found the solution already :).
    Sorry of being back late