Category Archives: utility

TMUX Screen Utility for UNIX/Linux

The screen utility in Unix/linux has been replaced by the tmux utility as of Release 9. Thus, to have a persistent connection while executing system process such as installation, you will have to migrate to the new tmux utility. In this article we will show the installation of the tmux utility into a linux environment and the general use of tmux.

Installation

The tmux utility is located in the majority of OS repositories and can be retrieved using the dnf command as the root user:

[oracle@localhost test]$ su 
Password: 
[root@localhost test]# /usr/bin/dnf install tmux

[root@localhost bin]# /usr/bin/dnf install tmux
Last metadata expiration check: 0:29:38 ago on Wed 19 Mar 2025 05:23:15 PM UTC.
Dependencies resolved.
===================================================================================================================================================================================================================
 Package                                       Architecture                                    Version                                            Repository                                                  Size
===================================================================================================================================================================================================================
Installing:
 tmux                                          x86_64                                          2.7-3.el8                                          ol8_baseos_latest                                          316 k

Transaction Summary
===================================================================================================================================================================================================================
Install  1 Package

Total download size: 316 k
Installed size: 726 k
Is this ok [y/N]: y
Downloading Packages:
tmux-2.7-3.el8.x86_64.rpm                                                                                                                                                          712 kB/s | 316 kB     00:00    
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                                                              698 kB/s | 316 kB     00:00     
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                                                                                                                           1/1 
  Installing       : tmux-2.7-3.el8.x86_64                                                                                                                                                                     1/1 
  Running scriptlet: tmux-2.7-3.el8.x86_64                                                                                                                                                                     1/1 
  Verifying        : tmux-2.7-3.el8.x86_64                                                                                                                                                                     1/1 

Installed:
  tmux-2.7-3.el8.x86_64                                                                                                                                                                                            

Complete!
[root@localhost bin]# 

You can view the full usage and instruction by accessing the man page for tmux.

# usage of tmux

man tmux

To create a new tmux session simple use the new clause and -s tag to name your session

# creating tmux socket session test1

tmux new -s test1

To execute your active tmux session without closing, user Ctrl-b d

# exit active tmux socket session from within the current session

Ctrl-b d

Create an additional tmux session and exit the session.

# creating tmux socket session test2

tmux new -s test2
Ctrl-b d

To list all existing tmux sessions use the command: tmux list-sessions

# listing active tmux socket sessions

tmux list-sessions

[root@localhost bin]# tmux list-sessions
test1: 1 windows (created Wed Nov 2 15:39:47 2022) [211x58]
test2: 1 windows (created Wed Nov 2 15:41:45 2022) [211x58]
[root@localhost bin]#

To re-attach to tmux session use the command: tmux a -t test2

# attach to test2 session

tmux a -t test2

To kill a tmux session user the command: tmux kill-ses -t test2

# kill session test2

[root@localhost bin]# tmux kill-ses -t test2
[root@localhost bin]# tmux list-sessions
test1: 1 windows (created Wed Nov 2 15:39:47 2022) [211x58]
[root@localhost bin]# 

Use of rconfig to modify a single instance 11g database to RAC

This article covers the conversion of a pre-existing Oracle 11g single instance database into a two node RAC. The following assumptions are made for this procedure to execute correctly:
1. Oracle 11g GRID has been installed on both RAC nodes.
2. Oracle 11g RDBMS has been installed on both RAC nodes.
3. Oracle 11g single instance database has been copied to RAC node 1 and operates correctly as a single instance database.

1. Logon to node 1 of your Oracle RAC server as the RDBMS owner.

2. Copy the file $ORACLE_HOME/assistants/rconfig/sampleXMLs/ConvertToRAC_AdminManaged.xml

[oracle@mylinux1 dbhome_1]$ cp $ORACLE_HOME/assistants/rconfig/sampleXMLs/ConvertToRAC_AdminManaged.xml orcl.xml
[oracle@mylinux1 dbhome_1]$

2. The sample XML file gives detailed instruction on how to edit the file for your specific use. In this example edit the following lines:

SourceDBHome = Single instance Oracle Home directory
TargetDBHome = RAC instance Oracle Home, this could be the same as the single instance Oracle Home directory
SourceDBInfo SID= SID of the Source database.
Password = SYS password
Node name= node1 name, normally this is the machine name.
Node name= node2 name, normally this is the machine name.
InstancePrefix = prefix of your RAC database, normally this is equal to the SID of your source database.
SharedStorage type=”ASM” or “OCFS”

3. Ensure that the single instance database is up and running.

[oracle@mylinux1 dbhome_1]$ ps -ef|grep smon
oracle 18508 1 0 02:12 ? 00:00:00 ora_smon_orcl
oracle 26774 7777 0 02:46 pts/1 00:00:00 grep smon
[oracle@mylinux1 dbhome_1]$

4. Execute the rconfig command and pass your edited xml file to it.
[oracle@mylinux1 bin]$ ./rconfig ./orcl.xml
Converting Database “orcl” to Cluster Database. Target Oracle Home: /u01/app/oracle/product/11.2.0/dbhome_1. Database Role: PRIMARY.
Setting Data Files and Control Files
Adding Database Instances
Adding Redo Logs
Enabling threads for all Database Instances
Setting TEMP tablespace
Adding UNDO tablespaces
Adding Trace files
Setting Flash Recovery Area
Updating Oratab
Creating Password file(s)
Configuring Listeners
Configuring related CRS resources
Starting Cluster Database
< ?xml version=”1.0″ ?>

Operation Succeeded

/u01/app/oracle/product/11.2.0/dbhome_1

[oracle@mylinux1 bin]$>

5. Now the database can be confirmed in rac mode on both nodes.

[oracle@mylinux1 bin]$ ps -ef|grep smon
oracle 16544 1 0 03:04 ? 00:00:00 ora_smon_orcl1
oracle 21072 7777 0 03:07 pts/1 00:00:00 grep smon
[oracle@mylinux1 bin]$

[root@mylinux2 ~]# ps -ef|grep smon
oracle 27298 1 0 03:03 ? 00:00:00 ora_smon_orcl2
root 29474 23387 0 03:07 pts/4 00:00:00 grep smon
[root@mylinux2 ~]#

This completes configuration of single instance to Oracle 11g RAC.

Larry J. Catt, OCP
oracle@allcompute.com
www.allcompute.com

Remove Oracle Database with DBCA from command line

The following procedure shows how to remove an Oracle database with dbca utility from the command line.

1. Logon as the oracle software owner.

[root@mylinux2 root]# su – oracle
[oracle@mylinux2 ~]$

2. Change directories to $ORACLE_HOME/bin

[oracle@mylinux2 ~]$ cd $ORACLE_HOME/bin
[oracle@mylinux2 bin]$

3. Obtain the ORACLE_SID of the database you wish to delete.

[oracle@mylinux2 bin]$ ps -ef|grep smon
oracle 4746 1 0 Feb09 ? 00:00:00 ora_smon_orcl
oracle 7839 7796 0 00:39 pts/1 00:00:00 grep smon
[oracle@mylinux2 bin]$

4. Obtain the userid and password of a user with sysdba privileges, normally this would be sys.

5. Logon to the database if open with the immediate option and exit.

SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL>
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 – 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@mylinux2 bin]$

6. Ensure that no oracle database processes are running for the ORACLE_SID you wish to delete


[oracle@mylinux2 bin]$ ps -ef|grep orcl
oracle 11485 7796 0 01:46 pts/1 00:00:00 grep orcl
[oracle@mylinux2 bin]$

7. Execute the command dbca -deleteDatabase -sourceDB -sysDBAUserName -sysDBAPassword


[oracle@mylinux2 bin]$ ./dbca -silent -deleteDatabase -sourceDB orcl – sysDBAUserName larry -sysDBAPassword larry
Connecting to database
4% complete
9% complete
14% complete
19% complete
23% complete
28% complete
47% complete
Updating network configuration files
48% complete
52% complete
Deleting instance and datafiles
76% complete
100% complete
Look at the log file “/u01/app/oracle/cfgtoollogs/dbca/orcl.log” for
further details.
[oracle@mylinux2 bin]$

This completes deleting an oracle database from command line with dbca.

Larry J. Catt, OCP
oracle@allcompute.com
www.allcompute.com