jueves, 5 de noviembre de 2015

WCP 12.2.1: Installation III (Oracle Database 12.1.0.2)

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;


CON_NAME
--------------------------------------------------------------------------------
INSTANCE_NAME
--------------------------------------------------------------------------------
STATE
--------------
PDBORCL
orcl
OPEN

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.

Why?
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.__data_transfer_cache_size=0
    orcl.__db_cache_size=390070272
    orcl.__java_pool_size=4194304
    orcl.__large_pool_size=125829120
    orcl.__oracle_base='/oracle/db'#ORACLE_BASE set from environment
    orcl.__pga_aggregate_target=339738624
    orcl.__sga_target=734003200
    orcl.__shared_io_pool_size=29360128
    orcl.__shared_pool_size=176160768
    orcl.__streams_pool_size=0
    *._catalog_foreign_restore=FALSE
    *.audit_file_dest='/oracle/db/admin/orcl/adump'
    *.audit_trail='db'
    *.compatible='12.1.0.2.0'
    *.control_files='/oracle/db/oradata/orcl/control01.ctl','/oracle/db/oradata/orcl/control02.ctl'
    *.db_block_size=8192
    *.db_domain=''
    *.db_name='orcl'
    *.diagnostic_dest='/oracle/db'
    *.dispatchers='(PROTOCOL=TCP) (SERVICE=orclXDB)'
    *.enable_pluggable_database=true
    *.memory_max_target=1673741824
    *.memory_target=1673741824
    *.open_cursors=300
    *.pga_aggregate_target=782m
    *.processes=300
    *.remote_login_passwordfile='EXCLUSIVE'
    *.sga_target=700m
    *.undo_tablespace='UNDOTBS1'

  • 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

    ResponderEliminar
  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

    ResponderEliminar