Thinking Out Loud

April 21, 2023

The Career 5 C’s

Filed under: Uncategorized — mdinh @ 2:42 am

Learned this long ago.

Compensation – happy being underpaid?

Challenge – want be be bored to death or have too high hurdles?

Colleagues – want to be on good team?

Commute – is sitting 2 hours in traffice okay?

Culture – corporate and team – do they help you grow?

Advertisement

March 20, 2023

Use The Right Tool

Filed under: Uncategorized — mdinh @ 12:38 pm

I think I may have blogged about how most read from left to right and down unless you are reading Chinese.

Look at how nice that is versus using text file.

Back to the grind.

February 19, 2023

Why Do You Read My Blog?

Filed under: Uncategorized — mdinh @ 4:32 pm

English is my second language (I always use this as an excuse but then I was one told “It doesn’t matter if you are right or wrong as long as you have an excuse – LOL”)

Reading and writing are my weakness.

Tell me?

LinkedIn Resume Builder

Filed under: Uncategorized — mdinh @ 4:20 pm

Imagine being laid off after working for 10ys at a company.

I don’t remembered what I had for dinner last night and how am I supposed to remember what I did in the last 10 years to update my resume?

LinkedIn Resume Builder is a great feature provided you used LinkedIn to keep track of all your major accomplishments.

This is mine Michael T. Dinh LinkedIn as an example and as you can see, I started slacking on the updates.

No mention of database upgrade using AutoUpgrade for RAC and Data Guard among other things.

Why does this matter?

I was let go on Thursday. Friday was still digesting. Saturday received communication from a company. We like to entertain the prospect of you joining our company. Send me your resume.

What resume! I am still in shock from the lay off.

Guess what? Resume sent. Wish me luck.

April 8, 2021

Who Can Access

Filed under: Uncategorized — mdinh @ 12:22 am

I had a request to list the users who have read access (or greater) to the APP schema.

Base on the results below:

User DINH has SELECT on APP.INTERVAL table (view)

Role APP_ROLE has SELECT/UPDATE on APP.INTERVAL table (view)

User DINH/APP/SYS has APP_ROLE

SQL> show con_name

CON_NAME
------------------------------
ORCLPDB1
SQL> show user
USER is "SYS"
SQL> @priv.sql

SQL> select username from dba_users where created  > (select created from v$database) order by 1;

USERNAME
------------------------------
APP
AUDIT_TEST
DINH
DINH099PD
PDBADMIN
WMS099PD

6 rows selected.

SQL> select * from DBA_TAB_PRIVS where owner='APP';

GRANTEE              OWNER                TABLE_NAME                GRANTOR              PRIVILEGE            GRANTABLE HIERARCHY COM TYPE                     INH
-------------------- -------------------- ------------------------- -------------------- -------------------- --------- --------- --- ------------------------ ---
DINH                 APP                  INTERVAL                  APP                  SELECT               NO        NO        NO  TABLE                    NO
APP_ROLE             APP                  INTERVAL                  APP                  SELECT               NO        NO        NO  TABLE                    NO
APP_ROLE             APP                  INTERVAL                  APP                  UPDATE               NO        NO        NO  TABLE                    NO

SQL> --- ROLE_TAB_PRIVS describes table privileges granted to roles.
SQL> --- Information is provided only about roles to which the user has access.
SQL> select * from ROLE_TAB_PRIVS where OWNER='APP';

ROLE                           OWNER                TABLE_NAME                COLUMN_NAME               PRIVILEGE            GRANTABLE COM INH
------------------------------ -------------------- ------------------------- ------------------------- -------------------- --------- --- ---
APP_ROLE                       APP                  INTERVAL                                            UPDATE               NO        NO  NO
APP_ROLE                       APP                  INTERVAL                                            SELECT               NO        NO  NO

SQL> select * from DBA_ROLE_PRIVS where GRANTED_ROLE='APP_ROLE' order by 1;

GRANTEE              GRANTED_ ADMIN DEL DEFAULT COM INH
-------------------- -------- ----- --- ------- --- ---
APP                  APP_ROLE YES   NO  YES     NO  NO
DINH                 APP_ROLE NO    NO  YES     NO  NO
SYS                  APP_ROLE NO    NO  YES     NO  NO

SQL>

I also used Pete Finnigan’s who_can_access.sql for comparison.

Note who_can_access.sql is per object vs per schema.

If there were hundreds / thousands of table, then not sure how this will scale.

who_can_access: Release 1.0.3.0.0 - Production on Wed Apr 07 19:00:04 2021
Copyright (c) 2004 PeteFinnigan.com Limited. All rights reserved.

NAME OF OBJECT TO CHECK       [USER_OBJECTS]: INTERVAL
OWNER OF THE OBJECT TO CHECK          [USER]: APP
OUTPUT METHOD Screen/File                [S]:
FILE NAME FOR OUTPUT              [priv.lst]:
OUTPUT DIRECTORY [DIRECTORY  or file (/tmp)]:
EXCLUDE CERTAIN USERS                    [N]:
USER TO SKIP                         [TEST%]:

Checking object => APP.INTERVAL
====================================================================


Object type is => TABLE (TAB)
        Privilege => SELECT is granted to =>
        Role => APP_ROLE (ADM = NO) which is granted to =>
                User => DINH (ADM = NO)
                User => SYS (ADM = NO)
                User => APP (ADM = YES)
        User => DINH (ADM = NO)
        Privilege => UPDATE is granted to =>
        Role => APP_ROLE (ADM = NO) which is granted to =>
                User => DINH (ADM = NO)
                User => SYS (ADM = NO)
                User => APP (ADM = YES)

PL/SQL procedure successfully completed.


For updates please visit http://www.petefinnigan.com/tools.htm

SQL>

Did I do this right?

This is not 100% accurate, missing the followings, and does not take into consideration recursive roles grant:

  1. Column grants: GRANT update (column_name) ON table_name TO user_name;
  2. Code based access control (CBAC)
  3. REFERENCES privileges: GRANT references ON table_name to user_name

October 7, 2019

Be Careful When Subscribing To Oracle Learning Subscription

Filed under: Uncategorized — mdinh @ 11:53 pm

Subscribing to Oracle Learning Subscription seems good in theory but bad in reality.

Oracle support informed. “Oracle University’s policy regarding Learning Subscription courseware materials is that they cannot be downloaded by customers.”

How convenience of Oracle as the info should have been stated at https://education.oracle.com/oracle-learning-subscriptions

Took for granted materials can be downloaded since they are made available to download for all other training formats.

This seems to be a deceptive process by not disclosing the information. because by the time one has subscribe to find the lack of full disclosure, it may be too late.

Hopefully, this will help anyone to avoid the same mistake.

 

May 27, 2019

Choiceology with Katy Milkman

Filed under: Uncategorized — mdinh @ 8:15 pm

Good listening I thought about sharing with you.

RSS Feed:
Choiceology with Katy Milkman – Exposing the psychological traps that lead to expensive mistakes

You can listen and subscribe to Choiceology with Katy Milkman for free in any podcast player—such as Apple Podcasts, Google Podcasts or Spotify.
How Do I Listen to Choiceology?

May 11, 2019

Create Mount Filesystem for Vagrant VirtualBox

Filed under: Uncategorized — mdinh @ 2:41 pm

Once again, I am using oravirt boxes.

If you just want to create the machine, and not run the provisioning step run this:

vagrant up

Since I don’t know ansible, it was much simpler to do the work manually.

Oracle Linux Server release 7.3

Review disks:

[root@MGOEM ~]# fdisk -l /dev/sd*

Disk /dev/sda: 52.4 GB, 52428800000 bytes, 102400000 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x000979b6

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048     2099199     1048576   83  Linux
/dev/sda2         2099200   102399999    50150400   8e  Linux LVM

Disk /dev/sda1: 1073 MB, 1073741824 bytes, 2097152 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/sda2: 51.4 GB, 51354009600 bytes, 100300800 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

### Disk is not partitioned since there are no # for device /dev/sdb and no Filesystem
Disk /dev/sdb: 187.9 GB, 187904819200 bytes, 367001600 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
[root@MGOEM ~]#

Create partition:

[root@MGOEM ~]# fdisk /dev/sdb
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 0x37a8a8de.

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

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

Calling ioctl() to re-read partition table.
Syncing disks.
[root@MGOEM ~]#

Review disk: Linux System

[root@MGOEM ~]# fdisk -l /dev/sdb

Disk /dev/sdb: 187.9 GB, 187904819200 bytes, 367001600 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x37a8a8de

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1            2048   367001599   183499776   83  Linux
[root@MGOEM ~]#

Create Filesystem:

[root@MGOEM ~]# mkfs.ext4 /dev/sdb1
mke2fs 1.42.9 (28-Dec-2013)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
11468800 inodes, 45874944 blocks
2293747 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=2193620992
1400 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
        32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
        4096000, 7962624, 11239424, 20480000, 23887872

Allocating group tables: done
Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done

[root@MGOEM ~]#

Create and mount /u01:

[root@MGOEM ~]# mkdir -p /u01
[root@MGOEM ~]# mount /dev/sdb1 /u01
[root@MGOEM ~]#
[root@MGOEM ~]# df -h
Filesystem            Size  Used Avail Use% Mounted on
devtmpfs              2.8G     0  2.8G   0% /dev
tmpfs                 2.8G     0  2.8G   0% /dev/shm
tmpfs                 2.8G  8.4M  2.8G   1% /run
tmpfs                 2.8G     0  2.8G   0% /sys/fs/cgroup
/dev/mapper/ol-root    46G  2.1G   44G   5% /
/dev/sda1            1014M  167M  848M  17% /boot
vagrant               932G  283G  650G  31% /vagrant
sf_working            420G  139G  281G  33% /sf_working
media_patch           3.7T  513G  3.2T  14% /media/patch
media_swrepo          3.7T  513G  3.2T  14% /media/swrepo
sf_OracleSoftware     3.7T  513G  3.2T  14% /sf_OracleSoftware
media_shared_storage  932G  283G  650G  31% /media/shared_storage
tmpfs                 571M     0  571M   0% /run/user/1000
/dev/sdb1             173G   61M  164G   1% /u01
[root@MGOEM ~]#

Update /etc/fstab:

[root@MGOEM ~]# tail /etc/fstab
# Created by anaconda on Tue Apr 18 08:50:14 2017
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
/dev/mapper/ol-root     /                       xfs     defaults        0 0
UUID=ed2996e5-e077-4e23-83a5-10418226a725 /boot                   xfs     defaults        0 0
/dev/mapper/ol-swap     swap                    swap    defaults        0 0
/swapfile1              swap                    swap    defaults        0 0
/dev/sdb1               /u01                    ext4    defaults        1 1
[root@MGOEM ~]#

May 1, 2019

VitualBox Cannot register the hard disk because a hard disk with UUID already exists

Filed under: Uncategorized — mdinh @ 1:03 pm

Here’s an issue I have faced multiple times and have finally able to find a reasonable resolution.

For the moment, it seems to be working and only time will tell as other predominant solutions on WWW did not work for me.

VBox version:

D:\VirtualBox>VBoxManage -version
6.0.4r128413

D:\VirtualBox>

Start VM failed after shutdown:

[oracle@racnode-dc2-1 dbca]$ logout
[vagrant@racnode-dc2-1 ~]$ logout
Connection to 127.0.0.1 closed.

dinh@CMWPHV1 MINGW64 /d/Vagrant2/vagrant-vbox-rac (master)
$ vagrant halt

==> racnode-dc2-1: Attempting graceful shutdown of VM...
==> racnode-dc2-1: Forcing shutdown of VM...
==> racnode-dc2-2: Unpausing the VM...
==> racnode-dc2-2: Attempting graceful shutdown of VM...
==> racnode-dc2-2: Forcing shutdown of VM...

dinh@CMWPHV1 MINGW64 /d/Vagrant2/vagrant-vbox-rac (master)
$ vagrant up
There was an error while executing `VBoxManage`, a CLI used by Vagrant
for controlling VirtualBox. The command and stderr is shown below.

Command: ["showvminfo", "1d72cea4-f728-44d4-b69e-b2dd45064969"]

Stderr: VBoxManage.exe: error: Failed to create the VirtualBox object!
VBoxManage.exe: error: Cannot register the hard disk 'D:\VirtualBoxVM\vbox-rac-dc2\racnode-dc2-2\packer-ol75-disk001.vmdk' {b507fc35-1c3c-46ab-9e0e-91f192c5b935} because a hard disk 'D:\VirtualBoxVM\vbox-rac-dc2\racnode-dc2-2\packer-ol75-disk001.vmdk' with UUID {c748d54e-3cd2-4087-82dd-65324f4365f7} already exists
VBoxManage.exe: error: Details: code E_INVALIDARG (0x80070057), component VirtualBoxWrap, interface IVirtualBox

dinh@CMWPHV1 MINGW64 /d/Vagrant2/vagrant-vbox-rac (master)
$ vagrant status
There was an error while executing `VBoxManage`, a CLI used by Vagrant
for controlling VirtualBox. The command and stderr is shown below.

Command: ["showvminfo", "1d72cea4-f728-44d4-b69e-b2dd45064969"]

Stderr: VBoxManage.exe: error: Failed to create the VirtualBox object!
VBoxManage.exe: error: Cannot register the hard disk 'D:\VirtualBoxVM\vbox-rac-dc2\racnode-dc2-2\packer-ol75-disk001.vmdk' {b507fc35-1c3c-46ab-9e0e-91f192c5b935} because a hard disk 'D:\VirtualBoxVM\vbox-rac-dc2\racnode-dc2-2\packer-ol75-disk001.vmdk' with UUID {c748d54e-3cd2-4087-82dd-65324f4365f7} already exists
VBoxManage.exe: error: Details: code E_INVALIDARG (0x80070057), component VirtualBoxWrap, interface IVirtualBox

dinh@CMWPHV1 MINGW64 /d/Vagrant2/vagrant-vbox-rac (master)
$ 

VBoxManage internalcommands sethduuid / clonevdi failed: UUID {c748d54e-3cd2-4087-82dd-65324f4365f7} already exists

D:\VirtualBox>VBoxManage.exe internalcommands sethduuid "D:\VirtualBoxVM\vbox-rac-dc2\racnode-dc2-2\packer-ol75-disk001.vmdk"
VBoxManage.exe: error: Failed to create the VirtualBox object!
VBoxManage.exe: error: Cannot register the hard disk 'D:\VirtualBoxVM\vbox-rac-dc2\racnode-dc2-2\packer-ol75-disk001.vmdk' {b507fc35
-1c3c-46ab-9e0e-91f192c5b935} because a hard disk 'D:\VirtualBoxVM\vbox-rac-dc2\racnode-dc2-2\packer-ol75-disk001.vmdk' with UUID {c748d54e-3cd2-4087-82dd-65324f4365f7} already exists
VBoxManage.exe: error: Details: code E_INVALIDARG (0x80070057), component VirtualBoxWrap, interface IVirtualBox

D:\VirtualBox>VBoxManage clonevdi "D:\VirtualBoxVM\vbox-rac-dc2\racnode-dc2-2\packer-ol75-disk001.vmdk" "D:\VirtualBoxVM\vbox-rac-dc
2\racnode-dc2-2\packer-ol75-disk002.vmdk"
VBoxManage.exe: error: Failed to create the VirtualBox object!
VBoxManage.exe: error: Cannot register the hard disk 'D:\VirtualBoxVM\vbox-rac-dc2\racnode-dc2-2\packer-ol75-disk001.vmdk' {b507fc35
-1c3c-46ab-9e0e-91f192c5b935} because a hard disk 'D:\VirtualBoxVM\vbox-rac-dc2\racnode-dc2-2\packer-ol75-disk001.vmdk' with UUID {c
748d54e-3cd2-4087-82dd-65324f4365f7} already exists
VBoxManage.exe: error: Details: code E_INVALIDARG (0x80070057), component VirtualBoxWrap, interface IVirtualBox

D:\VirtualBox>

Check UUID {c748d54e-3cd2-4087-82dd-65324f4365f7} exists in VirtualBox.xml and VirtualBox.xml-prev:

dinh@CMWPHV1 MINGW64 ~/.VirtualBox
$ grep c748d54e-3cd2-4087-82dd-65324f4365f7 *
VBoxSVC.log:00:00:00.390000          ERROR [COM]: aRC=E_INVALIDARG (0x80070057) aIID={d0a0163f-e254-4e5b-a1f2-011cf991c38d} aComponent={VirtualBoxWrap} aText={Cannot register the hard disk 'D:\VirtualBoxVM\vbox-rac-dc2\racnode-dc2-2\packer-ol75-disk001.vmdk' {b507fc35-1c3c-46ab-9e0e-91f192c5b935} because a hard disk 'D:\VirtualBoxVM\vbox-rac-dc2\racnode-dc2-2\packer-ol75-disk001.vmdk' with UUID {c748d54e-3cd2-4087-82dd-65324f4365f7} already exists}, preserve=false aResultDetail=0
VBoxSVC.log.1:00:00:00.376400          ERROR [COM]: aRC=E_INVALIDARG (0x80070057) aIID={d0a0163f-e254-4e5b-a1f2-011cf991c38d} aComponent={VirtualBoxWrap} aText={Cannot register the hard disk 'D:\VirtualBoxVM\vbox-rac-dc2\racnode-dc2-2\packer-ol75-disk001.vmdk' {b507fc35-1c3c-46ab-9e0e-91f192c5b935} because a hard disk 'D:\VirtualBoxVM\vbox-rac-dc2\racnode-dc2-2\packer-ol75-disk001.vmdk' with UUID {c748d54e-3cd2-4087-82dd-65324f4365f7} already exists}, preserve=false aResultDetail=0
VBoxSVC.log.2:00:00:00.391000          ERROR [COM]: aRC=E_INVALIDARG (0x80070057) aIID={d0a0163f-e254-4e5b-a1f2-011cf991c38d} aComponent={VirtualBoxWrap} aText={Cannot register the hard disk 'D:\VirtualBoxVM\vbox-rac-dc2\racnode-dc2-2\packer-ol75-disk001.vmdk' {b507fc35-1c3c-46ab-9e0e-91f192c5b935} because a hard disk 'D:\VirtualBoxVM\vbox-rac-dc2\racnode-dc2-2\packer-ol75-disk001.vmdk' with UUID {c748d54e-3cd2-4087-82dd-65324f4365f7} already exists}, preserve=false aResultDetail=0
VBoxSVC.log.3:00:00:00.390000          ERROR [COM]: aRC=E_INVALIDARG (0x80070057) aIID={d0a0163f-e254-4e5b-a1f2-011cf991c38d} aComponent={VirtualBoxWrap} aText={Cannot register the hard disk 'D:\VirtualBoxVM\vbox-rac-dc2\racnode-dc2-2\packer-ol75-disk001.vmdk' {b507fc35-1c3c-46ab-9e0e-91f192c5b935} because a hard disk 'D:\VirtualBoxVM\vbox-rac-dc2\racnode-dc2-2\packer-ol75-disk001.vmdk' with UUID {c748d54e-3cd2-4087-82dd-65324f4365f7} already exists}, preserve=false aResultDetail=0
VBoxSVC.log.4:00:00:00.374400          ERROR [COM]: aRC=E_INVALIDARG (0x80070057) aIID={d0a0163f-e254-4e5b-a1f2-011cf991c38d} aComponent={VirtualBoxWrap} aText={Cannot register the hard disk 'D:\VirtualBoxVM\vbox-rac-dc2\racnode-dc2-2\packer-ol75-disk001.vmdk' {b507fc35-1c3c-46ab-9e0e-91f192c5b935} because a hard disk 'D:\VirtualBoxVM\vbox-rac-dc2\racnode-dc2-2\packer-ol75-disk001.vmdk' with UUID {c748d54e-3cd2-4087-82dd-65324f4365f7} already exists}, preserve=false aResultDetail=0
VBoxSVC.log.5:00:00:00.374400          ERROR [COM]: aRC=E_INVALIDARG (0x80070057) aIID={d0a0163f-e254-4e5b-a1f2-011cf991c38d} aComponent={VirtualBoxWrap} aText={Cannot register the hard disk 'D:\VirtualBoxVM\vbox-rac-dc2\racnode-dc2-2\packer-ol75-disk001.vmdk' {b507fc35-1c3c-46ab-9e0e-91f192c5b935} because a hard disk 'D:\VirtualBoxVM\vbox-rac-dc2\racnode-dc2-2\packer-ol75-disk001.vmdk' with UUID {c748d54e-3cd2-4087-82dd-65324f4365f7} already exists}, preserve=false aResultDetail=0
VBoxSVC.log.6:00:00:00.436800          ERROR [COM]: aRC=E_INVALIDARG (0x80070057) aIID={d0a0163f-e254-4e5b-a1f2-011cf991c38d} aComponent={VirtualBoxWrap} aText={Cannot register the hard disk 'D:\VirtualBoxVM\vbox-rac-dc2\racnode-dc2-2\packer-ol75-disk001.vmdk' {b507fc35-1c3c-46ab-9e0e-91f192c5b935} because a hard disk 'D:\VirtualBoxVM\vbox-rac-dc2\racnode-dc2-2\packer-ol75-disk001.vmdk' with UUID {c748d54e-3cd2-4087-82dd-65324f4365f7} already exists}, preserve=false aResultDetail=0

Entry Removed from VirtualBox.xml
------------------------------------------------------------------------------------------------------------------------
VirtualBox.xml:        <HardDisk uuid="{c748d54e-3cd2-4087-82dd-65324f4365f7}" location="D:/VirtualBoxVM/vbox-rac-dc2/racnode-dc2-2/packer-ol75-disk001.vmdk" format="VMDK" type="Normal">
------------------------------------------------------------------------------------------------------------------------

VirtualBox.xml-prev:        <HardDisk uuid="{c748d54e-3cd2-4087-82dd-65324f4365f7}" location="D:/VirtualBoxVM/vbox-rac-dc2/racnode-dc2-2/packer-ol75-disk001.vmdk" format="VMDK" type="Normal">

dinh@CMWPHV1 MINGW64 ~/.VirtualBox
$

Remove entry from VirtualBox.xml:

dinh@CMWPHV1 MINGW64 ~/.VirtualBox
$ grep c748d54e-3cd2-4087-82dd-65324f4365f7 *
VBoxSVC.log.2:00:00:00.391000          ERROR [COM]: aRC=E_INVALIDARG (0x80070057) aIID={d0a0163f-e254-4e5b-a1f2-011cf991c38d} aComponent={VirtualBoxWrap} aText={Cannot register the hard disk 'D:\VirtualBoxVM\vbox-rac-dc2\racnode-dc2-2\packer-ol75-disk001.vmdk' {b507fc35-1c3c-46ab-9e0e-91f192c5b935} because a hard disk 'D:\VirtualBoxVM\vbox-rac-dc2\racnode-dc2-2\packer-ol75-disk001.vmdk' with UUID {c748d54e-3cd2-4087-82dd-65324f4365f7} already exists}, preserve=false aResultDetail=0
VBoxSVC.log.3:00:00:00.390000          ERROR [COM]: aRC=E_INVALIDARG (0x80070057) aIID={d0a0163f-e254-4e5b-a1f2-011cf991c38d} aComponent={VirtualBoxWrap} aText={Cannot register the hard disk 'D:\VirtualBoxVM\vbox-rac-dc2\racnode-dc2-2\packer-ol75-disk001.vmdk' {b507fc35-1c3c-46ab-9e0e-91f192c5b935} because a hard disk 'D:\VirtualBoxVM\vbox-rac-dc2\racnode-dc2-2\packer-ol75-disk001.vmdk' with UUID {c748d54e-3cd2-4087-82dd-65324f4365f7} already exists}, preserve=false aResultDetail=0
VBoxSVC.log.4:00:00:00.376400          ERROR [COM]: aRC=E_INVALIDARG (0x80070057) aIID={d0a0163f-e254-4e5b-a1f2-011cf991c38d} aComponent={VirtualBoxWrap} aText={Cannot register the hard disk 'D:\VirtualBoxVM\vbox-rac-dc2\racnode-dc2-2\packer-ol75-disk001.vmdk' {b507fc35-1c3c-46ab-9e0e-91f192c5b935} because a hard disk 'D:\VirtualBoxVM\vbox-rac-dc2\racnode-dc2-2\packer-ol75-disk001.vmdk' with UUID {c748d54e-3cd2-4087-82dd-65324f4365f7} already exists}, preserve=false aResultDetail=0
VBoxSVC.log.5:00:00:00.391000          ERROR [COM]: aRC=E_INVALIDARG (0x80070057) aIID={d0a0163f-e254-4e5b-a1f2-011cf991c38d} aComponent={VirtualBoxWrap} aText={Cannot register the hard disk 'D:\VirtualBoxVM\vbox-rac-dc2\racnode-dc2-2\packer-ol75-disk001.vmdk' {b507fc35-1c3c-46ab-9e0e-91f192c5b935} because a hard disk 'D:\VirtualBoxVM\vbox-rac-dc2\racnode-dc2-2\packer-ol75-disk001.vmdk' with UUID {c748d54e-3cd2-4087-82dd-65324f4365f7} already exists}, preserve=false aResultDetail=0
VBoxSVC.log.6:00:00:00.390000          ERROR [COM]: aRC=E_INVALIDARG (0x80070057) aIID={d0a0163f-e254-4e5b-a1f2-011cf991c38d} aComponent={VirtualBoxWrap} aText={Cannot register the hard disk 'D:\VirtualBoxVM\vbox-rac-dc2\racnode-dc2-2\packer-ol75-disk001.vmdk' {b507fc35-1c3c-46ab-9e0e-91f192c5b935} because a hard disk 'D:\VirtualBoxVM\vbox-rac-dc2\racnode-dc2-2\packer-ol75-disk001.vmdk' with UUID {c748d54e-3cd2-4087-82dd-65324f4365f7} already exists}, preserve=false aResultDetail=0
VBoxSVC.log.7:00:00:00.374400          ERROR [COM]: aRC=E_INVALIDARG (0x80070057) aIID={d0a0163f-e254-4e5b-a1f2-011cf991c38d} aComponent={VirtualBoxWrap} aText={Cannot register the hard disk 'D:\VirtualBoxVM\vbox-rac-dc2\racnode-dc2-2\packer-ol75-disk001.vmdk' {b507fc35-1c3c-46ab-9e0e-91f192c5b935} because a hard disk 'D:\VirtualBoxVM\vbox-rac-dc2\racnode-dc2-2\packer-ol75-disk001.vmdk' with UUID {c748d54e-3cd2-4087-82dd-65324f4365f7} already exists}, preserve=false aResultDetail=0
VBoxSVC.log.8:00:00:00.374400          ERROR [COM]: aRC=E_INVALIDARG (0x80070057) aIID={d0a0163f-e254-4e5b-a1f2-011cf991c38d} aComponent={VirtualBoxWrap} aText={Cannot register the hard disk 'D:\VirtualBoxVM\vbox-rac-dc2\racnode-dc2-2\packer-ol75-disk001.vmdk' {b507fc35-1c3c-46ab-9e0e-91f192c5b935} because a hard disk 'D:\VirtualBoxVM\vbox-rac-dc2\racnode-dc2-2\packer-ol75-disk001.vmdk' with UUID {c748d54e-3cd2-4087-82dd-65324f4365f7} already exists}, preserve=false aResultDetail=0
VBoxSVC.log.9:00:00:00.436800          ERROR [COM]: aRC=E_INVALIDARG (0x80070057) aIID={d0a0163f-e254-4e5b-a1f2-011cf991c38d} aComponent={VirtualBoxWrap} aText={Cannot register the hard disk 'D:\VirtualBoxVM\vbox-rac-dc2\racnode-dc2-2\packer-ol75-disk001.vmdk' {b507fc35-1c3c-46ab-9e0e-91f192c5b935} because a hard disk 'D:\VirtualBoxVM\vbox-rac-dc2\racnode-dc2-2\packer-ol75-disk001.vmdk' with UUID {c748d54e-3cd2-4087-82dd-65324f4365f7} already exists}, preserve=false aResultDetail=0

dinh@CMWPHV1 MINGW64 ~/.VirtualBox
$

Start VM:

dinh@CMWPHV1 MINGW64 /d/Vagrant2/vagrant-vbox-rac (master)
$ vagrant up
Bringing machine 'racnode-dc2-2' up with 'virtualbox' provider...
Bringing machine 'racnode-dc2-1' up with 'virtualbox' provider...

dinh@CMWPHV1 MINGW64 /d/Vagrant2/vagrant-vbox-rac (master)
$ vagrant status
Current machine states:

racnode-dc2-2             running (virtualbox)
racnode-dc2-1             running (virtualbox)

This environment represents multiple VMs. The VMs are all listed
above with their current state. For more information about a specific
VM, run `vagrant status NAME`.

dinh@CMWPHV1 MINGW64 /d/Vagrant2/vagrant-vbox-rac (master)
$ vagrant ssh racnode-dc2-1
Last login: Wed May  1 14:40:57 2019 from 192.168.7.100

----------------------------------------
Welcome to racnode-dc2-1
OracleLinux 7.5 x86_64

FQDN: racnode-dc2-1.internal.lab
IP's:
enp0s3: 10.0.2.15
enp0s8: 192.168.7.100
enp0s9: 172.16.7.10

Processor: Intel(R) Core(TM) i7-2640M CPU @ 2.80GHz
#CPU's:    2
Memory:    5708 MB
Kernel:    4.1.12-112.16.4.el7uek.x86_64

----------------------------------------
[vagrant@racnode-dc2-1 ~]$ sudo su - oracle
Last login: Wed May  1 14:42:47 CEST 2019
[oracle@racnode-dc2-1 ~]$ . /media/patch/gi.env
The Oracle base has been set to /u01/app/oracle
ORACLE_SID=+ASM1
ORACLE_BASE=/u01/app/oracle
GRID_HOME=/u01/app/12.2.0.1/grid
ORACLE_HOME=/u01/app/12.2.0.1/grid
Oracle Instance alive for sid "+ASM1"
[oracle@racnode-dc2-1 ~]$
[oracle@racnode-dc2-1 ~]$ ps -ef|grep [p]mon
oracle   17637     1  0 14:42 ?        00:00:00 asm_pmon_+ASM1
oracle   17987     1  0 14:43 ?        00:00:00 ora_pmon_hawk1
[oracle@racnode-dc2-1 ~]$ ssh racnode-dc2-2
Last login: Wed May  1 14:42:24 2019

----------------------------------------
Welcome to racnode-dc2-2
OracleLinux 7.5 x86_64

FQDN: racnode-dc2-2.internal.lab
IP's:
enp0s3: 10.0.2.15
enp0s8: 192.168.7.101
enp0s9: 172.16.7.11

Processor: Intel(R) Core(TM) i7-2640M CPU @ 2.80GHz
#CPU's:    2
Memory:    5708 MB
Kernel:    4.1.12-112.16.4.el7uek.x86_64

----------------------------------------
[oracle@racnode-dc2-2 ~]$ ps -ef|grep pmon
oracle   16172     1  0 14:41 ?        00:00:00 asm_pmon_+ASM2
oracle   17229     1  0 14:41 ?        00:00:00 mdb_pmon_-MGMTDB
oracle   17368     1  0 14:41 ?        00:00:00 ora_pmon_hawk2
oracle   25901 25533  0 14:46 pts/0    00:00:00 grep --color=auto pmon
[oracle@racnode-dc2-2 ~]$

Check packer-ol75-disk001.vmdk from VirtualBox.xml:

dinh@CMWPHV1 MINGW64 ~/.VirtualBox
$ grep packer-ol75-disk001.vmdk VirtualBox.xml
        <HardDisk uuid="{b507fc35-1c3c-46ab-9e0e-91f192c5b935}" location="D:/VirtualBoxVM/vbox-rac-dc2/racnode-dc2-2/packer-ol75-disk001.vmdk" format="VMDK" type="Normal"/>
        <HardDisk uuid="{1e5667ab-69a7-49fc-aa76-7b6249aba862}" location="D:/VirtualBoxVM/vbox-rac-dc2/racnode-dc2-1/packer-ol75-disk001.vmdk" format="VMDK" type="Normal"/>

dinh@CMWPHV1 MINGW64 ~/.VirtualBox
$

Before and after:

dinh@CMWPHV1 MINGW64 /d/VirtualBoxVM/vbox-rac-dc2/racnode-dc2-2
$ ll
total 4566352
drwxr-xr-x 1 dinh 197121          0 Apr 30 20:04 Logs/
-rw-r--r-- 1 dinh 197121 4675928064 May  1 07:54 opacker-ol75-disk001.vmdk
-rw-r--r-- 1 dinh 197121       6433 May  1 07:54 racnode-dc2-2.vbox
-rw-r--r-- 1 dinh 197121       6433 Apr 30 20:04 racnode-dc2-2.vbox-prev

dinh@CMWPHV1 MINGW64 /d/VirtualBoxVM/vbox-rac-dc2/racnode-dc2-2
$ ll
total 4768592
drwxr-xr-x 1 dinh 197121          0 May  1 08:38 Logs/
-rw-r--r-- 1 dinh 197121 4883021824 May  1 08:43 packer-ol75-disk001.vmdk
-rw-r--r-- 1 dinh 197121       6433 May  1 08:38 racnode-dc2-2.vbox
-rw-r--r-- 1 dinh 197121       6433 May  1 08:38 racnode-dc2-2.vbox-prev

dinh@CMWPHV1 MINGW64 /d/VirtualBoxVM/vbox-rac-dc2/racnode-dc2-2
$

April 30, 2019

First Time Learning Screen

Filed under: Uncategorized — mdinh @ 7:58 pm

So there I was, learning screen for the first time and was not liking the inability to scroll within screen session.

After a lot of googling, I believe to have found the solution as shown in .screenrc

DEMO:

Screen customization:

[oracle@racnode-dc1-1 ~]$ cat .screenrc
# Set scrollback buffer to 100000
defscrollback 100000

# Customize the status line
hardstatus alwayslastline
hardstatus string '%{= kG}[ %{G}%H %{g}][%= %{= kw}%?%-Lw%?%{r}(%{W}%n*%f%t%?(%u)%?%{r})%{w}%?%+Lw%?%?%= %{g}][%{B} %m-%d %{W}%c %{g}]'

# Enable mouse scrolling and scroll bar history scrolling
termcapinfo xterm* ti@:te@
[oracle@racnode-dc1-1 ~]$

Start screen session name testing and log to screenlog.0
I was informed screenlog.0 would overwrite but in my test case, it did not.

[oracle@racnode-dc1-1 ~]$ ls -l
total 0
[oracle@racnode-dc1-1 ~]$
[oracle@racnode-dc1-1 ~]$ screen -SL testing

In screen session


### Line below is from customization and blank lines above removed
[ racnode-dc1-1 ][                                                                                               (0*$(L)bash)                                                                                                ][ 04-30 21:32 ]

[oracle@racnode-dc1-1 ~]$ echo $TERM
screen
[oracle@racnode-dc1-1 ~]$ screen -ls
There is a screen on:
        17983.testing   (Attached)
1 Socket in /var/run/screen/S-oracle.

[oracle@racnode-dc1-1 ~]$ /media/patch/lspatches.sh
+ . /media/patch/gi.env
++ set +x
The Oracle base has been set to /u01/app/oracle
ORACLE_SID=+ASM1
ORACLE_BASE=/u01/app/oracle
GRID_HOME=/u01/18.3.0.0/grid_2
ORACLE_HOME=/u01/18.3.0.0/grid_2
Oracle Instance alive for sid "+ASM1"
+ /u01/18.3.0.0/grid_2/OPatch/opatch version
OPatch Version: 12.2.0.1.17

OPatch succeeded.
+ /u01/18.3.0.0/grid_2/OPatch/opatch lspatches
29302264;OCW RELEASE UPDATE 18.6.0.0.0 (29302264)
29301643;ACFS RELEASE UPDATE 18.6.0.0.0 (29301643)
29301631;Database Release Update : 18.6.0.0.190416 (29301631)
28547619;TOMCAT RELEASE UPDATE 18.0.0.0.0 (28547619)
28435192;DBWLM RELEASE UPDATE 18.0.0.0.0 (28435192)
27908644;UPDATE 18.3 DATABASE CLIENT JDK IN ORACLE HOME TO JDK8U171
27923415;OJVM RELEASE UPDATE: 18.3.0.0.180717 (27923415)

OPatch succeeded.
+ . /media/patch/hawk.env
++ set +x
The Oracle base remains unchanged with value /u01/app/oracle
ORACLE_UNQNAME=hawk
ORACLE_SID=hawk1
ORACLE_BASE=/u01/app/oracle
ORACLE_HOME=/u01/app/oracle/12.1.0.1/db1
Oracle Instance alive for sid "hawk1"
+ /u01/app/oracle/12.1.0.1/db1/OPatch/opatch version
OPatch Version: 12.2.0.1.17

OPatch succeeded.
+ /u01/app/oracle/12.1.0.1/db1/OPatch/opatch lspatches
28731800;Database Bundle Patch : 12.1.0.2.190115 (28731800)
28729213;OCW PATCH SET UPDATE 12.1.0.2.190115 (28729213)

OPatch succeeded.
+ exit
[oracle@racnode-dc1-1 ~]$ exit
exit

[screen is terminating]

Review screenlog.0

[oracle@racnode-dc1-1 ~]$ ls -l
total 4
-rw-r--r-- 1 oracle oinstall 1774 Apr 30 21:33 screenlog.0

[oracle@racnode-dc1-1 ~]$ cat screenlog.0
oracle@racnode-dc1-1:~[oracle@racnode-dc1-1 ~]$ echo $TERM
screen
oracle@racnode-dc1-1:~[oracle@racnode-dc1-1 ~]$ screen -ls
There is a screen on:
        17983.testing   (Attached)
1 Socket in /var/run/screen/S-oracle.

oracle@racnode-dc1-1:~[oracle@racnode-dc1-1 ~]$ /media/patch/lspatches.sh
+ . /media/patch/gi.env
++ set +x
The Oracle base has been set to /u01/app/oracle
ORACLE_SID=+ASM1
ORACLE_BASE=/u01/app/oracle
GRID_HOME=/u01/18.3.0.0/grid_2
ORACLE_HOME=/u01/18.3.0.0/grid_2
Oracle Instance alive for sid "+ASM1"
+ /u01/18.3.0.0/grid_2/OPatch/opatch version
OPatch Version: 12.2.0.1.17

OPatch succeeded.
+ /u01/18.3.0.0/grid_2/OPatch/opatch lspatches
29302264;OCW RELEASE UPDATE 18.6.0.0.0 (29302264)
29301643;ACFS RELEASE UPDATE 18.6.0.0.0 (29301643)
29301631;Database Release Update : 18.6.0.0.190416 (29301631)
28547619;TOMCAT RELEASE UPDATE 18.0.0.0.0 (28547619)
28435192;DBWLM RELEASE UPDATE 18.0.0.0.0 (28435192)
27908644;UPDATE 18.3 DATABASE CLIENT JDK IN ORACLE HOME TO JDK8U171
27923415;OJVM RELEASE UPDATE: 18.3.0.0.180717 (27923415)

OPatch succeeded.
+ . /media/patch/hawk.env
++ set +x
The Oracle base remains unchanged with value /u01/app/oracle
ORACLE_UNQNAME=hawk
ORACLE_SID=hawk1
ORACLE_BASE=/u01/app/oracle
ORACLE_HOME=/u01/app/oracle/12.1.0.1/db1
Oracle Instance alive for sid "hawk1"
+ /u01/app/oracle/12.1.0.1/db1/OPatch/opatch version
OPatch Version: 12.2.0.1.17

OPatch succeeded.
+ /u01/app/oracle/12.1.0.1/db1/OPatch/opatch lspatches
28731800;Database Bundle Patch : 12.1.0.2.190115 (28731800)
28729213;OCW PATCH SET UPDATE 12.1.0.2.190115 (28729213)

OPatch succeeded.
+ exit
oracle@racnode-dc1-1:~[oracle@racnode-dc1-1 ~]$ exit
exit
[oracle@racnode-dc1-1 ~]$

Start screen session name testing2 and log to screenlog.0

[oracle@racnode-dc1-1 ~]$ screen -SL testing2

In screen session

### Line below is from customization and blank lines above removed
[ racnode-dc1-1 ][                                                                                               (0*$(L)bash)                                                                                                ][ 04-30 21:35 ]

[oracle@racnode-dc1-1 ~]$ echo $TERM
screen
[oracle@racnode-dc1-1 ~]$ screen -ls
There is a screen on:
        19256.testing2  (Attached)
1 Socket in /var/run/screen/S-oracle.

[oracle@racnode-dc1-1 ~]$ /media/patch/crs_Query.sh
+ . /media/patch/gi.env
++ set +x
The Oracle base has been set to /u01/app/oracle
ORACLE_SID=+ASM1
ORACLE_BASE=/u01/app/oracle
GRID_HOME=/u01/18.3.0.0/grid_2
ORACLE_HOME=/u01/18.3.0.0/grid_2
Oracle Instance alive for sid "+ASM1"
+ crsctl query crs releaseversion
Oracle High Availability Services release version on the local node is [18.0.0.0.0]
+ crsctl query crs softwareversion
Oracle Clusterware version on node [racnode-dc1-1] is [18.0.0.0.0]
+ crsctl query crs softwarepatch
Oracle Clusterware patch level on node racnode-dc1-1 is [2056778364].
+ crsctl query crs releasepatch
Oracle Clusterware release patch level is [2056778364] and the complete list of patches [27908644 27923415 28090523 28090553 28090557 28256701 28435192 28547619 28822489 28864593 28864607 29301631 29301643 29302264 ] have been applied on the local node. The release patch string is [18.6.0.0.0].
+ crsctl query crs activeversion -f
Oracle Clusterware active version on the cluster is [18.0.0.0.0]. The cluster upgrade state is [NORMAL]. The cluster active patch level is [2056778364].
+ exit
[oracle@racnode-dc1-1 ~]$ exit
exit

[screen is terminating]
[oracle@racnode-dc1-1 ~]$ screen -ls
No Sockets found in /var/run/screen/S-oracle.

Review screenlog.0
Notice contents from testing and testing2

[oracle@racnode-dc1-1 ~]$ ll screenlog.0
-rw-r--r-- 1 oracle oinstall 3451 Apr 30 21:35 screenlog.0

[oracle@racnode-dc1-1 ~]$ cat screenlog.0
oracle@racnode-dc1-1:~[oracle@racnode-dc1-1 ~]$ echo $TERM
screen
oracle@racnode-dc1-1:~[oracle@racnode-dc1-1 ~]$ screen -ls
There is a screen on:
        17983.testing   (Attached)
1 Socket in /var/run/screen/S-oracle.

oracle@racnode-dc1-1:~[oracle@racnode-dc1-1 ~]$ /media/patch/lspatches.sh
+ . /media/patch/gi.env
++ set +x
The Oracle base has been set to /u01/app/oracle
ORACLE_SID=+ASM1
ORACLE_BASE=/u01/app/oracle
GRID_HOME=/u01/18.3.0.0/grid_2
ORACLE_HOME=/u01/18.3.0.0/grid_2
Oracle Instance alive for sid "+ASM1"
+ /u01/18.3.0.0/grid_2/OPatch/opatch version
OPatch Version: 12.2.0.1.17

OPatch succeeded.
+ /u01/18.3.0.0/grid_2/OPatch/opatch lspatches
29302264;OCW RELEASE UPDATE 18.6.0.0.0 (29302264)
29301643;ACFS RELEASE UPDATE 18.6.0.0.0 (29301643)
29301631;Database Release Update : 18.6.0.0.190416 (29301631)
28547619;TOMCAT RELEASE UPDATE 18.0.0.0.0 (28547619)
28435192;DBWLM RELEASE UPDATE 18.0.0.0.0 (28435192)
27908644;UPDATE 18.3 DATABASE CLIENT JDK IN ORACLE HOME TO JDK8U171
27923415;OJVM RELEASE UPDATE: 18.3.0.0.180717 (27923415)

OPatch succeeded.
+ . /media/patch/hawk.env
++ set +x
The Oracle base remains unchanged with value /u01/app/oracle
ORACLE_UNQNAME=hawk
ORACLE_SID=hawk1
ORACLE_BASE=/u01/app/oracle
ORACLE_HOME=/u01/app/oracle/12.1.0.1/db1
Oracle Instance alive for sid "hawk1"
+ /u01/app/oracle/12.1.0.1/db1/OPatch/opatch version
OPatch Version: 12.2.0.1.17

OPatch succeeded.
+ /u01/app/oracle/12.1.0.1/db1/OPatch/opatch lspatches
28731800;Database Bundle Patch : 12.1.0.2.190115 (28731800)
28729213;OCW PATCH SET UPDATE 12.1.0.2.190115 (28729213)

OPatch succeeded.
+ exit
oracle@racnode-dc1-1:~[oracle@racnode-dc1-1 ~]$ exit
exit
oracle@racnode-dc1-1:~[oracle@racnode-dc1-1 ~]$ echo $TERM
screen
oracle@racnode-dc1-1:~[oracle@racnode-dc1-1 ~]$ screen -ls
There is a screen on:
        19256.testing2  (Attached)
1 Socket in /var/run/screen/S-oracle.

oracle@racnode-dc1-1:~[oracle@racnode-dc1-1 ~]$ /media/patch/crs_Query.sh
+ . /media/patch/gi.env
++ set +x
The Oracle base has been set to /u01/app/oracle
ORACLE_SID=+ASM1
ORACLE_BASE=/u01/app/oracle
GRID_HOME=/u01/18.3.0.0/grid_2
ORACLE_HOME=/u01/18.3.0.0/grid_2
Oracle Instance alive for sid "+ASM1"
+ crsctl query crs releaseversion
Oracle High Availability Services release version on the local node is [18.0.0.0.0]
+ crsctl query crs softwareversion
Oracle Clusterware version on node [racnode-dc1-1] is [18.0.0.0.0]
+ crsctl query crs softwarepatch
Oracle Clusterware patch level on node racnode-dc1-1 is [2056778364].
+ crsctl query crs releasepatch
Oracle Clusterware release patch level is [2056778364] and the complete list of patches [27908644 27923415 28090523 28090553 28090557 28256701 28435192 28547619 28822489 28864593 28864607 29301631 29301643 29302264 ] have been applied on the local node. The release patch string is [18.6.0.0.0].
+ crsctl query crs activeversion -f
Oracle Clusterware active version on the cluster is [18.0.0.0.0]. The cluster upgrade state is [NORMAL]. The cluster active patch level is [2056778364].
+ exit
oracle@racnode-dc1-1:~[oracle@racnode-dc1-1 ~]$ exit
exit
[oracle@racnode-dc1-1 ~]$
Next Page »

Create a free website or blog at WordPress.com.