Tuesday, June 4, 2019

What is the admsi.pl utility that is used during EBS patching?



Thanks to the blog post by Atul Kumar for explain this.
It's a tool for generating instance-specific patch installation instructions.

This tool was refered to in the beginning of a readme-file for a particular patch. The readme-file stated:
Instructions For Applying This Patch
Execute the following command to generate your instance specific installation
instructions
Source the Applications environment file
Run the Patch Application Assistant by entering "admsi.pl".

A bit further down in the same readme-file:
Apply The Patch
For 12.0.X / 12.1.X / pre-upgrade patches (using adpatch), you must shut down all
Application tier services before performing the tasks in this section. For 12.2.X patches (using adop),
you can perform the tasks in this section without shutting down the Application tier services.

Apply patch [required]
This patch contains the following unified driver file to be applied with
AutoPatch:
u28389569.drv (This is the unified driver)


$ perl $AD_TOP/bin/admsi.pl -patch_top=/software/EBS/28389569
Gathering Information..
Enter the APPS user password:
Logfile for this session is located at admsi.log
Generating installation instructions for patch 28389569..
Updating database....
install_28389569.html generated successfully
install_28389569.txt generated successfully

The generated files will contain the exact patching instructions.

Thursday, May 30, 2019

How to create a new database in PostgreSQL


postgres=# create role music;
CREATE ROLE
postgres=# create database musicdb with owner = music;
CREATE DATABASE
postgres=# 

Documented here

Use can also use the wrapper "createdb" for convenience:
$ createdb -O music musicdb
CREATE DATABASE musicdb OWNER music;

A complete DDL for creating a database may look like this:
CREATE DATABASE memo
    WITH 
    OWNER = mysuperuser
    TEMPLATE = template0
    ENCODING = 'UTF8'
    TABLESPACE = pg_default
    CONNECTION LIMIT = -1;

COMMENT ON DATABASE memo
    IS 'my comment here';

Sunday, May 26, 2019

How to display Linux kernel and version information on debian platforms

Use the lsb (Linux Standard Base) utility:
lsb_release -a
Output:

No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 18.04.1 LTS
Release: 18.04
Codename: bionic
Replace the -a switch with the -d switch to limit the output to the version only.

or view the file /etc/os-release:
cat /etc/os-release:
NAME="Ubuntu"
VERSION="18.04.1 LTS (Bionic Beaver)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 18.04.1 LTS"
VERSION_ID="18.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=bionic
UBUNTU_CODENAME=bionic

Wednesday, May 22, 2019

Deprecated security parameter in Oracle 12c: SEC_CASE_SENSITIVE_LOGON


Oracle states:

"The use of the Oracle instance initialization parameter SEC_CASE_SENSITIVE_LOGON is deprecated in favor of setting the SQLNET.ALLOWED_LOGON_VERSION_SERVER parameter to 12 to ensure that passwords are treated in a case-sensitive fashion.
Disabling password case sensitivity is not supported in Exclusive mode (when SQLNET.ALLOWED_LOGON_VERSION_SERVER is set to 12 or 12a.)


See this post for an example used during implementation

Documentation here

Tuesday, May 21, 2019

How to lookup ip addresses from mac addresses on Windows



Use the arp utility (Adress Resolution Protocol).
arp -a

it will print the arp table for you, where you can map ip addresses to mac addresses.

Thursday, May 16, 2019

How to compress tables on import



Oracle 12c introduces a way to compress tables on the fly, during import using impdp.

Use the directive
transform=table_compression_clause:"row store compress advanced"
in your impdp parameter file.

Documentation here

Thursday, May 9, 2019

How to unlock users with expired password in postgreSQL


select now()+'90 days' as expiry;
 expiry
-------------------------------
 2019-08-07 10:07:01.172082+02
\gset
alter user jim valid until :'expiry';
ALTER ROLE

The command "\gset" sends the current query buffer to the server and stores the query's output into a psql variable.

After the change, use \du to verify that the password has the correct expiry time:
mydb01=# \du
                                            List of roles
     Role name     |                         Attributes                         |      Member of
-------------------+------------------------------------------------------------+---------------------
 postgres          | Superuser, Create role, Create DB, Replication, Bypass RLS+| {}
                   | Password valid until 2019-01-16 00:00:00+01                |
 superuser         | Superuser                                                 +| {}
                   | Password valid until 2019-08-04 00:00:00+02                |
 jim               | Password valid until 2019-08-07 10:07:03.237862+02         | {}

Use the "\list" command to list databases and access privileges, if desirable:
mydb01=# \list
                                    List of databases
   Name    |  Owner   | Encoding |  Collate   |   Ctype    |      Access privileges
-----------+----------+----------+------------+------------+------------------------------
 postgres  | postgres | UTF8     | en_US.utf8 | en_US.utf8 |
 template0 | postgres | UTF8     | en_US.utf8 | en_US.utf8 | =c/postgres                 +
           |          |          |            |            | postgres=CTc/postgres
 template1 | postgres | UTF8     | en_US.utf8 | en_US.utf8 | =c/postgres                 +
           |          |          |            |            | postgres=CTc/postgres
 mydb01    | jim      | UTF8     | en_US.utf8 | en_US.utf8 | =Tc/jim                     +
           |          |          |            |            | jim=CTc/jim                 +

To give the user a new password, use this syntax:
alter role jim password 'mynewpassword';

Consult the documentation for more information