Monday, November 23, 2020

How to allow row to break across lines in Oracle iLOM host console

When you used to access to host console via iLOM, you probably noticed that long command lines (over 80 symbols) do not break to new continuation line, the new characters just go over existed, already typed characters. It looks like the terminal string

[root@xxx-xxxx-xxx ~]# ddddddddddddddddddddddddddddddddddddddddddddddddddddd

transforms into

aaaat@xxx-xxx-xxx ~]# dddddddddddddddddddddddddddddddddddddddddddddddddddddaaa 

To resolve the issue, set tty parameters corresponding to your terminal, for example :

[root@xxx-xxxx-xxx ~]# stty rows 45 columns 158

You should also reopen iLOM console for proper terminal functioning.


Good Luck !

Saturday, November 21, 2020

Some features of implementation when using TNSNAMES connection descriptors

 1. You can double parameters in row, Oracle will you only last value. For example, when you use

             (ADDRESS=
                (PROTOCOL=tcp)
                (HOST=localhost)
                (port=1520)
                (PORT=1521)
              )

, the port 1521 which is the last in the group of values of the same group (address), and that one will be used in the connection (1520 will not be tried at all). This behavior is expected though, remember several addresses in the address_list group, but in case of address_list the client tries to establish the connection with every address until succeed, and in our case the client simply goes via the last parameter in the list.

2. You can use some abstract (not existed and not considered by oracle) parameters and values for debugging or for other purposes, for example,

            (CONNECT_DATA=
                (service_name = pdb1.db-01.site)
                (instance_name = cdb121)
                (instance_name = cdb_manual)
                (aaa = bbb)
            )

Here abstract parameter aaa is used. The listener entry in this case could be like this :

22-NOV-2020 09:22:31 * (CONNECT_DATA=(service_name=pdb1.db-01.site)(instance_name=cdb121)(instance_name=cdb_manual)(global_name=cdb121aaa)(aaa=bbb)(CID=(PROGRAM=sqlplus@db-01)(HOST=db-01)(USER=oracle))) * (ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=21799)) * establish * pdb1.db-01.site * 0

As we can see sqlplus established connection with instance_name=cdb_manual (the last of the group of instance_name parameters inside of tns descriptor, you can confirm it with help of select sys_context from dual statement)

3. Will be continued...

Good Luck !

Wednesday, October 21, 2020

dgmgrl validate database spfile and ORA-12154

I've got this error during execution of "validate database verbose db_name spfile ;" on Oracle 12.2. 

The error encountered when property DGConnectIdentifier for the database was set to easyconnect string with shared or dedicated connection type (like 'hostname/service_name:dedicated') or expanded tns entry was used (like '(description=...)'). 

 DataGuard Broker build the connection string with additional useless fragments of database dispatchers setting making the connection string invalid :

Unable to connect to database using hostname/service_name:dedicatedf)(connections=100)(sessions=100)

The error had gone when property DGConnectIdentifier was set to easyconnect string without ":dedicated" piece or to the name of the tns entry (from tnsnames.ora or from ldap).

Update : the issue can occur when validated database also has got dispatchers parameter set to non-default value.

Good Luck !

Friday, October 9, 2020

Bash : empty variable value outside of while loop using pipelines for input

Instead of the following which returns empty value of a :

$> a=0 ; find /dev/shm/ -uid 54321 -ls | awk '{print $7}' | while read line ; do let a+=${line}; done ; echo "a="${a}

try to use bash's process substitution like this :

a=0 ; while read line ; do let a+=$line ; done < <(find /dev/shm/ -uid 54321 -ls | awk '{print $7}') ; echo "a="$a

This will prevent using newly created shells for pipelines, using the current shell for all operands. Good Luck !

Monday, August 24, 2020

SSH escape sequences and disconnect from session

The default character of invoking ssh escape sequence is '~' (from new line of course). Twice typing of such character send the escape character itself. In situations where several sequential connections to terminal (or to console, like Oracle Solaris Zone console via zlogin -C) are made, you should know one 'trick' to disconnect only from last connection made. 

Let me explain below. Let's start with session A - a session of your local machine. Here B - proxy vpn machine, C - Solaris server, D - newly installed Oracle Solaris Zone, not configured yet. 

A -- ssh_via_vpn_to_B --> B -- ssh_to_server_C --> C -- login_to_zone_console --> D

When you type exit ssh sequence '~.' you immediately close your first ssh session from A to B.In order to close only zlogin session and stay in session on server C, you should type '~~~.' Doing it you transmit escape character to the appropriate deeper session in your 'connection stack'. Take it in your mind. 

P.S. this doesn't work when ssh jumping or configured ssh proxy connection is used.

Tuesday, August 4, 2020

remmina throws "cannot connect to the 127.0.0.1 rdp server" over ssh tunnel

Hello !

    Remmina is one of my favorite desktop rdp/vnc client. Recently it's stopped to connect to MS Windows 2018 terminal server over ssh. The real cause was issued by xfreerdp which is called by Remmina. The error from freerdp was as :

[10:54:28:752] [8718:8719] [INFO][com.freerdp.core] - ERRINFO_LICENSE_HWID_DOESNT_MATCH_LICENSE (0x00000104):The Client Access License ([MS-RDPELE] section 1.1) stored by the client has been modified.
[10:54:28:752] [8718:8719] [ERROR][com.freerdp.core] - rdp_set_error_info:freerdp_set_last_error_ex  ERRINFO_LICENSE_HWID_DOESNT_MATCH_LICENSE [0x00010104]

Running xfreerdp over strace lead to the file in the directory ~/.config/freerdp/licenses. I've renamed it, and after that the problem has gone (new license file was created).

Good Luck !!!

Saturday, November 16, 2019

Oracle Net Configuration Assistant (netca) command line interface (CLI)

Everything is clear about using netca in graphical mode. Understandable questions and "transparent" interface do they job perfectly, although for comprehensive Oracle Net setup the Net Manager is more preferable (imho). But netca CLI has some specificities. 

There are several options of using netca CLI.

To configure listener and naming services via netca response file :

netca -silent -responsefile

The example of such file can be as following (the empty and commented lines was removed) :

[GENERAL]
RESPONSEFILE_VERSION="12.1"
CREATE_TYPE="CUSTOM"
LOG_FILE=""/tmp/netca.log""
[oracle.net.ca]
INSTALLED_COMPONENTS={"javavm","net8","cman","aso","client","server"}
INSTALL_TYPE=""custom""
LISTENER_NUMBER=0
LISTENER_NAMES={"LISTENER"}
LISTENER_PROTOCOLS={"TCP;1521"}
LISTENER_START=""LISTENER""
NAMING_METHODS={"EZCONNECT","TNSNAMES","ONAMES","HOSTNAME"}
NSN_NUMBER=1
NSN_NAMES={"ASM"}
NSN_SERVICE={"+ASM"}
NSN_PROTOCOLS={"TCP;db-01;1521"}


In the above some fields has 2 double quotes in a row in their values. It's required, else run-time error can occur.

The following lines are required :
[GENERAL]
RESPONSEFILE_VERSION="12.1"
CREATE_TYPE="CUSTOM"
[oracle.net.ca]


The listener only created when one of installed components is "server".

If you set INSTALL_TYPE=""minimal"" or ""typical"", then sqlnet.ora with NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)
is created and default listener named LISTENER on 1521 port also is created with appropriate entries in listener.ora file (if it was already there, the file is left as is).


Creation of TNS entries is possible only when INSTALL_TYPE=""custom"".

You can override entries from response file or add some more parameters using command line options. Thus, you can change install_type on the way, listener_name and listener port (only in custom install_type) etc.

netca -h
Usage: netca [-silent] { }

Perform network configuration by specifying the following arguments:
    [-silent]
        -responsefile ]
        [-local {Perform configuration on only local node}]
    -instype
        [-listener ]
        [-lisport ]
        [-lps ]
        [-lpe ]
        [-netnum ]
        [-nostartlsnr {Do not start listener}]
    [-crsupgrade {Upgrade default listener from lower version database home to Grid Infrastructure home (only for RAC)}]
    [-inscomp ]
    [-insprtcl ]
    [-orahome ]
    [-orahnam ]
    [-log ]
    [-h|-help {Print usage}]


As we can see there are no options for tnsnames.ora or sqlnet.ora entries. When install type is custom, tns entries are taken from response file.

You can add tns entries and listeners by running netca with another content of response file or command line options. The entries are added into listener.ora and tnsnames.ora.

Naming methods are updating only in custom install type from the response file.

P.S. When I tried default value for NSN_NAMES={"EXTPROC_CONNECTION_DATA"} in the response file, tns entries were not created. If this name is changed in one char only, tnsnames.ora is populated :)

P.P.S. netca creates appropriate listener configuration in grid infrastructure if it's running on the server.

Examples :

1. Does network service name settings according to response file parameters and add new listener bbb to those already registere, try to set listening port to first free between 1500 and 1505, without starting listener bbb after creating it.

$ netca -silent -responsefile /install/oracle/response/netca5.rsp -instype custom -listener bbb -lps 1500 -lpe 1505 -nostartlsnr

2. Create default listener LISTENER (-instype typical) on default port and start it not accounting it's existence.

$ netca -silent -responsefile /install/oracle/response/netca5.rsp -instype typical -lps 1500 -lpe 1505 -nostartlsnr