Posted in 2016

RESTful Services

I am collecting information about REST..

http://crunchify.com/how-to-build-restful-service-with-java-using-jax-rs-and-jersey/
https://github.com/zorkian/nagios-api

Advertisements
Posted in 2017

Patching a RAC, OJVM is rolling installable!

I want to write only necessary steps which I have executed on the RAC and show the whole datapatch!
I do basically the same as opatchauto, but in a step by step manner.
Since January 2017 you can conditially rolling patch a RAC. So what I have done is, patching a 2 Node RAC with local homes with PSU Jul2016 with OJVM to the newest PSU (26636286)

See Note
RAC Rolling Install Process for the “Oracle JavaVM Component Database PSU” (OJVM PSU) Patches (Doc ID 2217053.1)

database owner
 srvctl stop home -o /u01/app/oracle/12.1.0.2 -s /tmp/status -n <node>

root
 /u01/app/grid/12.1.0.2/crs/install/rootcrs.sh -prepatch

grid owner
 runuser -l oracle -c '/u01/app/grid/12.1.0.2/OPatch/opatch apply -silent -oh /u01/app/grid/12.1.0.2 -local /u01/install/26636286/26635815/26392192'
 runuser -l oracle -c '/u01/app/grid/12.1.0.2/OPatch/opatch apply -silent -oh /u01/app/grid/12.1.0.2 -local /u01/install/26636286/26635815/26392164'
 runuser -l oracle -c '/u01/app/grid/12.1.0.2/OPatch/opatch apply -silent -oh /u01/app/grid/12.1.0.2 -local /u01/install/26636286/26635815/21436941'
 runuser -l oracle -c '/u01/app/grid/12.1.0.2/OPatch/opatch apply -silent -oh /u01/app/grid/12.1.0.2 -local /u01/install/26636286/26635815/26713565'

database owner
 runuser -l oracle -c '/u01/install/26636286/26635815/26392192/custom/scripts/prepatch.sh -dbhome /u01/app/oracle/12.1.0.2'
 runuser -l oracle -c '/u01/app/oracle/12.1.0.2/OPatch/opatch apply -silent -oh /u01/app/oracle/12.1.0.2 -local /u01/install/26636286/26635815/26392192'
 runuser -l oracle -c '/u01/app/oracle/12.1.0.2/OPatch/opatch apply -silent -oh /u01/app/oracle/12.1.0.2 -local /u01/install/26636286/26635815/26713565'
 runuser -l oracle -c '/u01/install/26636286/26635815/26392192/custom/scripts/postpatch.sh -dbhome /u01/app/oracle/12.1.0.2'
 runuser -l oracle -c '/u01/app/oracle/12.1.0.2/OPatch/opatch apply -silent -oh /u01/app/oracle/12.1.0.2 -local /u01/install/26636286/26635845'

root
 /u01/app/grid/12.1.0.2/rdbms/install/rootadd_rdbms.sh
 /u01/app/grid/12.1.0.2/crs/install/rootcrs.sh -postpatch

database owner
 srvctl start home -o /u01/app/oracle/12.1.0.2 -s /tmp/status -n <node>

oracle@rac1 [ cdb11 ] OPatch]$ ./datapatch -verbose -skip_upgrade_check
 SQL Patching tool version 12.1.0.2.0 Production on Tue Nov 14 13:28:43 2017
 Copyright (c) 2012, 2016, Oracle. All rights reserved.

Log file for this invocation: /u01/app/oracle/cfgtoollogs/sqlpatch/sqlpatch_7207_2017_11_14_13_28_43/sqlpatch_invocation.log

Connecting to database...OK
 Note: Datapatch will only apply or rollback SQL fixes for PDBs
 that are in an open state, no patches will be applied to closed PDBs.
 Please refer to Note: Datapatch: Database 12c Post Patch SQL Automation
 (Doc ID 1585822.1)
 Bootstrapping registry and package to current versions...done
 Determining current state...done

Current state of SQL patches:
 Patch 23177536 (Database PSU 12.1.0.2.160719, Oracle JavaVM Component (JUL2016)):
 Installed in CDB$ROOT ORCL PDB$SEED only
 Patch 26635845 (Database PSU 12.1.0.2.171017, Oracle JavaVM Component (OCT2017)):
 Installed in the binary registry only
 Bundle series PSU:
 ID 171017 in the binary registry and ID 160719 in PDB CDB$ROOT, ID 160719 in PDB PDB$SEED, ID 160719 in PDB ORCL

Adding patches to installation queue and performing prereq checks...
 Installation queue:
 For the following PDBs: CDB$ROOT PDB$SEED ORCL
 The following patches will be rolled back:
 23177536 (Database PSU 12.1.0.2.160719, Oracle JavaVM Component (JUL2016))
 The following patches will be applied:
 26635845 (Database PSU 12.1.0.2.171017, Oracle JavaVM Component (OCT2017))
 26713565 (DATABASE PATCH SET UPDATE 12.1.0.2.171017)

Installing patches...
 Patch installation complete. Total patches installed: 9

Validating logfiles...
 Patch 23177536 rollback (pdb CDB$ROOT): SUCCESS
 logfile: /u01/app/oracle/cfgtoollogs/sqlpatch/23177536/20400035/23177536_rollback_CDB1_CDBROOT_2017Nov14_13_29_44.log (no errors)
 Patch 26635845 apply (pdb CDB$ROOT): SUCCESS
 logfile: /u01/app/oracle/cfgtoollogs/sqlpatch/26635845/21564421/26635845_apply_CDB1_CDBROOT_2017Nov14_13_33_01.log (no errors)
 Patch 26713565 apply (pdb CDB$ROOT): SUCCESS
 logfile: /u01/app/oracle/cfgtoollogs/sqlpatch/26713565/21602269/26713565_apply_CDB1_CDBROOT_2017Nov14_13_33_04.log (no errors)
 Patch 23177536 rollback (pdb PDB$SEED): SUCCESS
 logfile: /u01/app/oracle/cfgtoollogs/sqlpatch/23177536/20400035/23177536_rollback_CDB1_PDBSEED_2017Nov14_13_35_07.log (no errors)
 Patch 26635845 apply (pdb PDB$SEED): SUCCESS
 logfile: /u01/app/oracle/cfgtoollogs/sqlpatch/26635845/21564421/26635845_apply_CDB1_PDBSEED_2017Nov14_13_38_18.log (no errors)
 Patch 26713565 apply (pdb PDB$SEED): SUCCESS
 logfile: /u01/app/oracle/cfgtoollogs/sqlpatch/26713565/21602269/26713565_apply_CDB1_PDBSEED_2017Nov14_13_38_25.log (no errors)
 Patch 23177536 rollback (pdb ORCL): SUCCESS
 logfile: /u01/app/oracle/cfgtoollogs/sqlpatch/23177536/20400035/23177536_rollback_CDB1_ORCL_2017Nov14_13_35_07.log (no errors)
 Patch 26635845 apply (pdb ORCL): SUCCESS
 logfile: /u01/app/oracle/cfgtoollogs/sqlpatch/26635845/21564421/26635845_apply_CDB1_ORCL_2017Nov14_13_38_17.log (no errors)
 Patch 26713565 apply (pdb ORCL): SUCCESS
 logfile: /u01/app/oracle/cfgtoollogs/sqlpatch/26713565/21602269/26713565_apply_CDB1_ORCL_2017Nov14_13_38_21.log (no errors)
 SQL Patching tool complete on Tue Nov 14 13:40:32 2017
Posted in 2017

12.2 SE2 Upgrade

Hi all,

after long time I am finally back with something very interresting.

Upgrade to 12c(12.1 /12.2) through RMAN Duplicate using BACKUP LOCATION with NOOPEN clause (Doc ID 2022820.1)

If you check this note, you get a pretty simple upgrade scenario. The funny thing is, as described here or in the docs, it simply does not work. with -l or -n it simply failed.

oracle@orcl [ ORCL ] admin]$ $ORACLE_HOME/perl/bin/perl catctl.pl –l /u01/app/oracle/admin/upgrade catupgrd.sql

Argument list for [catctl.pl]
Run in c = 0
Do not run in C = 0
Input Directory d = 0
Echo OFF e = 1
Simulate E = 0
Forced cleanup F = 0
Log Id i = 0
Child Process I = 0
Log Dir l = 0
Priority List Name L = 0
Upgrade Mode active M = 0
SQL Process Count n = 0
SQL PDB Process Count N = 0
Open Mode Normal o = 0
Start Phase p = 0
End Phase P = 0
Reverse Order r = 0
AutoUpgrade Resume R = 0
Script s = 0
Serial Run S = 0
RO User Tablespaces T = 0
Display Phases y = 0
Debug catcon.pm z = 0
Debug catctl.pl Z = 0

Invalid command line syntax in the vicinity of '–l' or '/u01/app/oracle/admin/upgrade'. Exiting.

So after being nervous I decided to call it simply from sqlplus, who cares, I can restore the db in 2 Minutes.

 SQL> @catupgrd.sql
DOC>######################################################################
DOC>######################################################################
DOC> ERROR
DOC>
DOC>
DOC> As of 12.2, customers must use the parallel upgrade utility, catctl.pl,
DOC> to invoke catupgrd.sql when upgrading the database dictionary.
DOC> Running catupgrd.sql directly from SQL*Plus is no longer supported.
DOC>
DOC> For Example:
DOC>
DOC> cd $ORACLE_HOME/rdbms/admin
DOC> catctl
DOC>
DOC> or
DOC>
DOC> cd $ORACLE_HOME/rdbms/admin
DOC> $ORACLE_HOME/perl/bin/perl catctl.pl catupgrd.sql
DOC>
DOC> Refer to the Oracle Database Upgrade Guide for more information.
DOC>
DOC>
DOC>######################################################################
DOC>######################################################################
DOC>#

And with the second defined command it works (I haven’t started the first). Interresting is, that the default value 4 was automatically set and the log location is by default $ORACLE_HOME/cfgtoollogs.

Now after waiting some time with these components to be upgraded

Components in [ORCL]
 Installed [APEX APS CATALOG CATJAVA CATPROC CONTEXT JAVAVM ORDIM OWM SDO XDB XML XOQ]
Not Installed [DV EM MGW ODM OLS RAC WK]

I am finishing after

Grand Total Upgrade Time: [0d:0h:34m:51s]

 

 

Posted in 2016

Purge Job for Auditing

There is not much to write about this. It’s a purge job for the audit trail 😀 E: it will not work 😅 i have changed it a little 😅

DECLARE
lat TIMESTAMP := TO_TIMESTAMP('30-06-17 00:00:00.00','DD-MM-YYYY HH24:MI:SS.FF');
BEGIN

dbms_audit_mgmt.init_cleanup(AUDIT_TRAIL_TYPE => dbms_audit_mgmt.audit_trail_aud_std, DEFAULT_CLEANUP_INTERVAL => 1);

DBMS_AUDIT_MGMT.SET_LAST_ARCHIVE_TIMESTAMP(audit_trail_type => DBMS_AUDIT_MGMT.AUDIT_TRAIL_AUD_STD,
last_archive_time => lat);

DBMS_AUDIT_MGMT.CREATE_PURGE_JOB(AUDIT_TRAIL_TYPE => DBMS_AUDIT_MGMT.AUDIT_TRAIL_AUD_STD,
AUDIT_TRAIL_PURGE_INTERVAL => 24,
AUDIT_TRAIL_PURGE_NAME => 'AUD_PURGE_JOB',
USE_LAST_ARCH_TIMESTAMP => TRUE );

dbms_audit_mgmt.deinit_cleanup(AUDIT_TRAIL_TYPE => dbms_audit_mgmt.audit_trail_aud_std);

END;
/

BEGIN
DBMS_SCHEDULER.create_job (
job_name => 'advance_archive_timestamp',
job_type => 'PLSQL_BLOCK',
job_action => 'BEGIN
-- Advance the archive timestamp
dbms_audit_mgmt.init_cleanup(AUDIT_TRAIL_TYPE => dbms_audit_mgmt.audit_trail_aud_std, DEFAULT_CLEANUP_INTERVAL => 1);

DBMS_AUDIT_MGMT.SET_LAST_ARCHIVE_TIMESTAMP(audit_trail_type => DBMS_AUDIT_MGMT.AUDIT_TRAIL_AUD_STD,
last_archive_time => systimestamp – 120);

dbms_audit_mgmt.deinit_cleanup(AUDIT_TRAIL_TYPE => dbms_audit_mgmt.audit_trail_aud_std);
END; ',
start_date => SYSDATE,
repeat_interval => 'freq=DAILY;BYHOUR=0' ,
enabled => true,
auto_drop => FALSE);
END;
/

Posted in 2016

Oracle FS 12.2 New Feature

.While reading Oracle 12.2 New Features I discovered that we can create filesystems on tablespaces. So I had to try it and it works, but somehow wrong.

Docs used:

Database PL/SQL Packages and Types Reference

In the Large Objects guide you will not find very much: 😀

Database SecureFiles and Large Objects Developer’s Guide

I am using ASM so I decided to create a new diskgroup, I used the /dev/sde1 device for the new diskgroup OFS, I like to have everything ordered.

[oracle@ora01 data]$ lsblk
NAME            MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sda               8:0    0   20G  0 disk
├─sda1            8:1    0  476M  0 part /boot
└─sda2            8:2    0 15.3G  0 part
  ├─ol-root     253:0    0   14G  0 lvm  /
  └─ol-products 253:2    0 23.3G  0 lvm  /products
sdb               8:16   0   12G  0 disk
└─sdb1            8:17   0   12G  0 part
sdc               8:32   0   12G  0 disk
└─sdc1            8:33   0   12G  0 part
sdd               8:48   0   30G  0 disk
└─sdd1            8:49   0 25.7G  0 part
  ├─ol-swap     253:1    0  3.7G  0 lvm  [SWAP]
  └─ol-products 253:2    0 23.3G  0 lvm  /products
sde               8:64   0   20G  0 disk
└─sde1            8:65   0   20G  0 part
sr0              11:0    1 1024M  0 rom

As you see it’s 20GB.

First we have to create a tablespace:

[oracle@ora01 ~]$ sqlplus / as sysdba

SQL*Plus: Release 12.2.0.1.0 Production on Wed Apr 12 12:24:37 2017

Copyright (c) 1982, 2016, Oracle.  All rights reserved.


Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production

SQL> show parameter create

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
create_bitmap_area_size              integer     8388608
create_stored_outlines               string
db_create_file_dest                  string      +DATA
db_create_online_log_dest_1          string
db_create_online_log_dest_2          string
db_create_online_log_dest_3          string
db_create_online_log_dest_4          string
db_create_online_log_dest_5          string
SQL> alter session set db_create_file_dest='+OFS' ;

Session altered.

SQL> create tablespace OFS datafile size 20000m ;

Tablespace created.

SQL> select file_name from dba_data_files ;

FILE_NAME
--------------------------------------------------------------------------------
+DATA/CDB1/DATAFILE/system.261.940672671
+DATA/CDB1/DATAFILE/sysaux.263.940672691
+DATA/CDB1/DATAFILE/undotbs1.265.940672693
+DATA/CDB1/DATAFILE/users.269.940672735
+OFS/CDB1/DATAFILE/ofs.256.941113555

So let’s create the ofs filesystem:

SQL> exec dbms_fs.make_oracle_fs(fstype=>'ofs',fsname=>'ofs_fs1',fsoptions=>'TABLESPACE=OFS')

PL/SQL procedure successfully completed.

Create the directory:

[oracle@ora01 ~]$ sudo mkdir -p /ofs/data
[oracle@ora01 ~]$ sudo chown -R oracle:oinstall /ofs/data

Mount it:

SQL> exec dbms_fs.mount_oracle_fs(fstype=>'ofs',fsname=>'ofs_fs1',mount_point=>'/ofs/data',mount_options=>'default_permissions, allow_other, persist');
BEGIN dbms_fs.mount_oracle_fs(fstype=>'ofs',fsname=>'ofs_fs1',mount_point=>'/ofs/data',mount_options=>'default_permissions, allow_other, persist'); END;

*
ERROR at line 1:
ORA-17676: Failed to mount 'ofs_fs1' with error:'Generic ofslib mount error'
ORA-06512: at "SYS.DBMS_FS", line 25
ORA-06512: at line 1

Ahh I forgot to install fuse

[root@ora01 ~]# yum install fuse
[root@ora01 ~]# usermod -a -G fuse oracle
[root@ora01 ~]# cat /etc/fuse.conf
# mount_max = 1000
user_allow_other

[root@ora01 ~]# reboot

Once the DB was up again I could create the filesystem

[oracle@ora01 ~]$ sqlplus / as sysdba

SQL*Plus: Release 12.2.0.1.0 Production on Wed Apr 12 12:51:15 2017

Copyright (c) 1982, 2016, Oracle.  All rights reserved.


Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production

SQL> exec dbms_fs.mount_oracle_fs(fstype=>'ofs',fsname=>'ofs_fs1',mount_point=>'/ofs/data',mount_options=>'default_permissions, allow_other, persist');

PL/SQL procedure successfully completed.

OK, great we have it! check it on OS

[oracle@ora01 ~]$ df -hT
Filesystem              Type      Size  Used Avail Use% Mounted on
/dev/mapper/ol-root     xfs        14G  3.8G   11G  28% /
devtmpfs                devtmpfs  986M     0  986M   0% /dev
tmpfs                   tmpfs    1001M     0 1001M   0% /dev/shm
tmpfs                   tmpfs    1001M  8.5M  992M   1% /run
tmpfs                   tmpfs    1001M     0 1001M   0% /sys/fs/cgroup
/dev/mapper/ol-products xfs        24G   20G  3.7G  85% /products
/dev/sda1               xfs       473M  194M  280M  41% /boot
12.2.0.1                vboxsf    3.4T  2.3T  1.2T  67% /media/sf_12.2.0.1
tmpfs                   tmpfs     201M     0  201M   0% /run/user/54321
/dev/fuse               fuse       32G     0   32G   0% /ofs/data
[oracle@ora01 data]$ ls -ld /ofs/
drwxr-xr-x. 3 oracle oinstall 17 Apr 12 12:36 /ofs/
[oracle@ora01 data]$ ls -ld /ofs/data/
drwxrwxrwx. 1 nobody nobody 2048 Apr 12 12:30 /ofs/data/

It’s there, but do you see it???

/dev/fuse               fuse       32G     0   32G   0% /ofs/data

My diskgroup and tablespace is only 20GB.. and that’s a problem I think.

To have it complete, I unmount it too.

SQL> exec dbms_fs.unmount_oracle_fs(fsname=>'ofs_fs1',mount_point=>'/ofs/data')

PL/SQL procedure successfully completed.

Wow, I generated an ORA-600, after dropping the tablespace without unmounting it, creating this error:

ORA-00600: internal error code, arguments: [ksfsmLookup-p], [942], [ORA-00942: table or view does not exist

----- Abridged Call Stack Trace -----
ksedsts()+346<-kjzduptcctx()+868<-kjzdicrshnfy()+1113<-ksuitm_opt()+1678<-ksbrdp()+4494<-opirip()+609<-opidrv()+602<-sou2o()+145<-opimai_real()+202<-ssthrdmain()+417<-skgp_thread_async_main()+338<-start_thread()+197

Posted in 2017

Installing GI for Standalone

Yesterday I have installed GI for Standalone, I wanted to install my VBox with AFD, but I got this error. I don’t know, it’s sad I think.

AFD-620: AFD is not supported on this operating system version: 3.10.0-514.10.2.el7.x86_64

So I had to install asmlib and continue with. I don’t understand why I had to restart my machine, it was restarted before I started ./gridSetup.sh so it’s strange.

I had disks sdb and sdc prepared with fdisk. I don’t write about it again, it’s always the same.

[oracle@ora01 oracle]$ lsblk
NAME            MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sda               8:0    0   20G  0 disk
├─sda1            8:1    0  476M  0 part /boot
└─sda2            8:2    0 15.3G  0 part
  ├─ol-root     253:0    0   14G  0 lvm  /
  └─ol-products 253:2    0 23.3G  0 lvm  /products
sdb               8:16   0   12G  0 disk
sdc               8:32   0   12G  0 disk
sdd               8:48   0   30G  0 disk
└─sdd1            8:49   0 25.7G  0 part
  ├─ol-swap     253:1    0  3.7G  0 lvm  [SWAP]
  └─ol-products 253:2    0 23.3G  0 lvm  /products
sr0              11:0    1 1024M  0 rom

Now install the rpms

[root@ora01 ~]# yum install oracleasm-support 
[root@ora01 ~]# rpm -i /media/sf_12.2.0.1/oracleasmlib-2.0.12-1.el7.x86_64.rpm

Configuring oracleasm is always the same

[root@ora01 ~]# oracleasm configure -i
Configuring the Oracle ASM library driver.

This will configure the on-boot properties of the Oracle ASM library
driver.  The following questions will determine whether the driver is
loaded on boot and what permissions it will have.  The current values
will be shown in brackets ('[]').  Hitting <ENTER> without typing an
answer will keep that current value.  Ctrl-C will abort.

Default user to own the driver interface []: oracle
Default group to own the driver interface []: dba
Start Oracle ASM library driver on boot (y/n) [n]: y
Scan for Oracle ASM disks on boot (y/n) [y]: y
Writing Oracle ASM library driver configuration: done

While initializing it I forgot a package

[root@ora01 ~]# oracleasm init
Creating /dev/oracleasm mount point: /dev/oracleasm
Loading module "oracleasm": failed
Unable to load module "oracleasm"
[root@ora01 ~]#
[root@ora01 ~]# yum install kmod-oracleasm

Initialize oracleasm!

[root@ora01 ~]# oracleasm init
Loading module "oracleasm": oracleasm
Configuring "oracleasm" to use device physical block size
Mounting ASMlib driver filesystem: /dev/oracleasm
[root@ora01 ~]#
[root@ora01 ~]# oracleasm createdisk disk1 /dev/sdb1
Writing disk header: done
Instantiating disk: done
[root@ora01 ~]# oracleasm createdisk disk2 /dev/sdc1
Writing disk header: done
Instantiating disk: done
[root@ora01 ~]#
[root@ora01 ~]#
[root@ora01 ~]# oracleasm scandisks
Reloading disk partitions: done
Cleaning any stale ASM disks...
Scanning system for ASM disks...
[root@ora01 ~]# oracleasm listdisks
DISK1
DISK2

Now everything is prepared for the gridSetup.sh

[oracle@ora01 oracle]$ cd grid_12.2.0.1/
[oracle@ora01 grid_12.2.0.1]$ ./gridSetup.sh
Launching Oracle Grid Infrastructure Setup Wizard...

You can find the log of this install session at:
 /tmp/GridSetupActions2017-04-06_05-37-53PM/gridSetupActions2017-04-06_05-37-53PM.log
Moved the install session logs to:
 /products/oraInventory/logs/GridSetupActions2017-04-06_05-37-53PM

The root.sh exection failed of course and it wrote I need to restart the machine to continue.

Now I had to manually execute the steps when this error happens, nice thing Oracle, it’s documented and it worked without problems.

[root@ora01 oraInventory]# ./orainstRoot.sh
Changing permissions of /products/oraInventory.
Adding read,write permissions for group.
Removing read,write,execute permissions for world.

Changing groupname of /products/oraInventory to oinstall.
The execution of the script is complete.
[root@ora01 oraInventory]# cd ../
[root@ora01 products]# cd ora
oracle/       oraInventory/
[root@ora01 products]# cd oracle/grid_12.2.0.1/
[root@ora01 grid_12.2.0.1]# ./root.sh
Performing root user operation.

The following environment variables are set as:
    ORACLE_OWNER= oracle
    ORACLE_HOME=  /products/oracle/grid_12.2.0.1
   Copying dbhome to /usr/local/bin ...
   Copying oraenv to /usr/local/bin ...
   Copying coraenv to /usr/local/bin ...

Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root script.
Now product-specific root actions will be performed.
Using configuration parameter file: /products/oracle/grid_12.2.0.1/crs/install/crsconfig_params
The log of current session can be found at:
  /products/oracle/crsdata/ora01/crsconfig/roothas_2017-04-06_05-46-45PM.log
2017/04/06 17:46:46 CLSRSC-363: User ignored prerequisites during installation
2017/04/06 17:46:52 CLSRSC-330: Adding Clusterware entries to file 'oracle-ohasd.service'
CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on 'ora01'
CRS-2673: Attempting to stop 'ora.evmd' on 'ora01'
CRS-2677: Stop of 'ora.evmd' on 'ora01' succeeded
CRS-2793: Shutdown of Oracle High Availability Services-managed resources on 'ora01' has completed
CRS-4133: Oracle High Availability Services has been stopped.
CRS-4123: Oracle High Availability Services has been started.

ora01     2017/04/06 17:47:42     /products/oracle/grid_12.2.0.1/cdata/ora01/backup_20170406_174742.olr     0
2017/04/06 17:47:43 CLSRSC-327: Successfully configured Oracle Restart for a standalone server

Now the last part was to generate a response file and run this type of command

[root@ora01 cfgtoollogs]# pwd
/products/oracle/grid_12.2.0.1/cfgtoollogs
[root@ora01 cfgtoollogs]# ./configToolAllCommands RESPONSE_FILE=/products/oracle/grid_12.2.0.1/cfgtoollogs/cfg.props
This script must not be run as root.
[oracle@ora01 ~]$ cat /products/oracle/grid_12.2.0.1/cfgtoollogs/cfg.props
oracle.assistants.asm|S_ASMPASSWORD=oracle
[oracle@ora01 cfgtoollogs]$ ./configToolAllCommands RESPONSE_FILE=/products/oracle/grid_12.2.0.1/cfgtoollogs/cfg.props

Finally it finished with a lot of warnings. But warnings are not problems.

After this I could start my asmca and create my ASM, it went smoothly. What I like to do on my VMs is to set these parameters, Oracle automatically sets AMM for GI to 1000MB and you cannot resize it to a lower value, it’s hardcoded. So you have to use ASMM

[oracle@ora01 trace]$ sqlplus / as sysasm

SQL*Plus: Release 12.2.0.1.0 Production on Thu Apr 6 18:06:42 2017

Copyright (c) 1982, 2016, Oracle.  All rights reserved.


Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production

SQL> show parameter memor

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
memory_max_target                    big integer 1076M
memory_target                        big integer 1076M
SQL> show parameter spf

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
spfile                               string      +DATA/ASM/ASMPARAMETERFILE/reg
                                                 istry.253.940615485
SQL> alter system set sga_target=300m scope=spfile ;

System altered.

SQL> alter system set memory_max_target=0 scope=spfile ;

System altered.

SQL> alter system set memory_target=0 scope=spfile ;

System altered.

SQL> Disconnected from Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production
[oracle@ora01 trace]$ crsctl stop has
CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on 'ora01'
CRS-2673: Attempting to stop 'ora.evmd' on 'ora01'
CRS-2673: Attempting to stop 'ora.DATA.dg' on 'ora01'
CRS-2673: Attempting to stop 'ora.FRA.dg' on 'ora01'
CRS-2673: Attempting to stop 'ora.LISTENER.lsnr' on 'ora01'
CRS-2677: Stop of 'ora.FRA.dg' on 'ora01' succeeded
CRS-2677: Stop of 'ora.DATA.dg' on 'ora01' succeeded
CRS-2673: Attempting to stop 'ora.asm' on 'ora01'
CRS-2677: Stop of 'ora.LISTENER.lsnr' on 'ora01' succeeded
CRS-2677: Stop of 'ora.evmd' on 'ora01' succeeded
CRS-2677: Stop of 'ora.asm' on 'ora01' succeeded
CRS-2673: Attempting to stop 'ora.cssd' on 'ora01'
CRS-2677: Stop of 'ora.cssd' on 'ora01' succeeded
CRS-2793: Shutdown of Oracle High Availability Services-managed resources on 'ora01' has completed
CRS-4133: Oracle High Availability Services has been stopped.
[oracle@ora01 trace]$ crsctl start has
CRS-4123: Oracle High Availability Services has been started.
[oracle@ora01 ~]$ sqlplus / as sysasm

SQL*Plus: Release 12.2.0.1.0 Production on Thu Apr 6 18:18:23 2017

Copyright (c) 1982, 2016, Oracle.  All rights reserved.


Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production

SQL> show sga

Total System Global Area  314572800 bytes
Fixed Size                  8620224 bytes
Variable Size             280786752 bytes
ASM Cache                  25165824 bytes

 

Posted in 2017

dNFS Oracle 12.2

First let’s check my disks.

[root@nfs01 ~]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 20G 0 disk
├─sda1 8:1 0 500M 0 part /boot
└─sda2 8:2 0 19.5G 0 part
├─ol-root 252:0 0 17.5G 0 lvm /
└─ol-swap 252:1 0 2G 0 lvm [SWAP]
sdb 8:16 0 30G 0 disk
└─sdb1 8:17 0 30G 0 part
└─vg_oracle-product 252:2 0 20G 0 lvm /u01
sdc 8:32 0 50G 0 disk
sr0 11:0 1 1024M 0 rom

As we see my sdc is not used, so we can partition it

[root@nfs01 ~]# fdisk /dev/sdc
Welcome to fdisk (util-linux 2.23.2).

Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

Device does not contain a recognized partition table
Building a new DOS disklabel with disk identifier 0x592b4f7f.

Command (m for help): n
Partition type:
p primary (0 primary, 0 extended, 4 free)
e extended
Select (default p): p
Partition number (1-4, default 1): 1
First sector (2048-104857599, default 2048):
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-104857599, default 104857599):
Using default value 104857599
Partition 1 of type Linux and of size 50 GiB is set

Command (m for help): t
Selected partition 1
Hex code (type L to list all codes): 8e
Changed type of partition 'Linux' to 'Linux LVM'

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.

Make a filesystem on this device

[root@nfs01 ~]# mkfs.xfs /dev/sdc1
meta-data=/dev/sdc1 isize=256 agcount=4, agsize=3276736 blks
= sectsz=512 attr=2, projid32bit=1
= crc=0 finobt=0, sparse=0
data = bsize=4096 blocks=13106944, imaxpct=25
= sunit=0 swidth=0 blks
naming =version 2 bsize=4096 ascii-ci=0 ftype=0
log =internal log bsize=4096 blocks=6399, version=2
= sectsz=512 sunit=0 blks, lazy-count=1
realtime =none extsz=4096 blocks=0, rtextents=0

Small preparations
[root@nfs01 ~]# mkdir /oraclenfs
[root@nfs01 ~]# id oracle
uid=54321(oracle) gid=54321(oinstall) groups=54321(oinstall),54322(dba),982(vboxsf)
[root@nfs01 ~]# cat /etc/fstab
/dev/mapper/ol-root / xfs defaults 0 0
UUID=52f425c5-8649-49e7-a899-b68ff9d75451 /boot xfs defaults 0 0
/dev/mapper/ol-swap swap swap defaults 0 0
/dev/mapper/vg_oracle-product /u01 xfs defaults 0 0
/dev/sdc1 /oraclenfs xfs defaults 0 0
[root@nfs01 ~]# mount -a
[root@nfs01 ~]#
[root@nfs01 ~]#
[root@nfs01 ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/ol-root 18G 8.6G 8.9G 50% /
devtmpfs 987M 0 987M 0% /dev
tmpfs 1002M 84K 1002M 1% /dev/shm
tmpfs 1002M 8.9M 993M 1% /run
tmpfs 1002M 0 1002M 0% /sys/fs/cgroup
/dev/mapper/vg_oracle-product 20G 4.2G 16G 21% /u01
/dev/sda1 497M 287M 211M 58% /boot
12.2.0.1 4.8T 2.3T 2.6T 47% /media/sf_12.2.0.1
tmpfs 201M 16K 201M 1% /run/user/42
tmpfs 201M 0 201M 0% /run/user/0
/dev/sdc1 50G 33M 50G 1% /oraclenfs
[root@nfs01 ~]# chown 54321:54321 /oraclenfs/
[root@nfs01 ~]# cat /etc/exports
/oraclenfs *(rw,sync,all_squash,insecure,anonuid=54321,anongid=54321)
[root@nfs01 ~]# chkconfig --level 345 nfs on
Note: Forwarding request to 'systemctl enable nfs.service'.
Created symlink from /etc/systemd/system/multi-user.target.wants/nfs-server.service to /usr/lib/systemd/system/nfs-server.service.
[root@nfs01 ~]# service nfs start
Redirecting to /bin/systemctl start nfs.service
[root@nfs01 ~]# systemctl status nfs
● nfs-server.service - NFS server and services
Loaded: loaded (/usr/lib/systemd/system/nfs-server.service; enabled; vendor preset: disabled)
Active: active (exited) since Tue 2017-03-07 13:49:12 CET; 9s ago
Process: 2097 ExecStart=/usr/sbin/rpc.nfsd $RPCNFSDARGS (code=exited, status=0/SUCCESS)
Process: 2096 ExecStartPre=/usr/sbin/exportfs -r (code=exited, status=0/SUCCESS)
Main PID: 2097 (code=exited, status=0/SUCCESS)
CGroup: /system.slice/nfs-server.service

Mar 07 13:49:12 nfs01.example.com systemd[1]: Starting NFS server and servic....
Mar 07 13:49:12 nfs01.example.com systemd[1]: Started NFS server and services.
Hint: Some lines were ellipsized, use -l to show in full.
[root@ora01 ~]# mkdir -p /dnfs/oradata
[root@ora01 ~]# chown -R oracle:dba /dnfs/oradata/
[root@ora01 oradata]$ grep nfs /etc/fstab
192.168.56.102:/oraclenfs /dnfs/oradata nfs rw,bg,hard,nointr,rsize=32768,wsize=32768,tcp,actimeo=0,vers=3,timeo=600 0 0
[oracle@ora01 oradata]$ cat /u01/app/oracle/product/12.2.0.1/dbs/oranfstab
server: 192.168.56.102
path: 192.168.56.102
local: 192.168.56.101
export: /oraclenfs mount: /dnfs/oradata

Relink the Oracle Home!
[oracle@ora01 ~]$ . oraenv
ORACLE_SID = [oracle] ?
ORACLE_HOME = [/home/oracle] ? /u01/app/oracle/product/12.2.0.1
The Oracle base has been set to /u01/app/oracle
[oracle@ora01 ~]$ cd $ORACLE_HOME/rdbms/lib
[oracle@ora01 lib]$ make -f /u01/app/oracle/product/12.2.0.1/rdbms/lib/ins_rdbms.mk dnfs_on ORACLE_HOME=/u01/app/oracle/product/12.2.0.1

Now you can create a database with dbca, don’t forget to set filesystem_options=setall and you use dnfs. In the alert.log will be a message under this text displayed, this means you have it done successfully.

[oracle@ora01 trace]$ grep Direct alert_cdb1.log
Oracle instance running with ODM: Oracle Direct NFS ODM Library Version 4.0
Direct NFS: channel id [0] path [192.168.56.102] to filer [192.168.56.102] via local [] is UP