How to add swap in Solaris?

This blog will help you to add swap space on Solaris. If you are installating Oracle and running out of swap than these procedure will help you to add swap.  

First login as root: and check how much swap space you have from the following command.

# swap -l

As root, use mkfile to create a swap file.

# mkfile filesize /path/file

e.g.# mkfile 2048m /usr/local/swap

Add the file create above in the swap area.

# swap -a /path/file

e.g. # swap -a /usr/local/swap

Check the swap space again

# swap -l 

You will see new swap space in output.

How to change IP address in Oracle RAC ?

Let's do the exercise to change the IP address of RAC.

Note that due to the change of the public IP address the virtual IP address (VIP) may be required to change as well as it must remain in the same subnet as the public IP address.

Current Configuration

NetworkHostCurrent IP AddressChanged IP Address
Public IP host1192.168.10.101 192.168.20.121
Public IPhost2192.168.10.100 192.168.20.120
VIPhost1-vip192.168.10.111 192.168.20.111
VIPhost2-vip192.168.10.110 192.168.20.110

Basic Steps
The change of the private IP address is performed in the following basic steps
1) Shut down everything except the CRS stack
2) Change the public interface
3) Modify the VIP address
4) Shut down CRS
5) Modify IP address on OS level and reconfigure /etc/hosts, listener,..
6) Restart

How to change character set from AL16UTF16 to UTF8 ?

The national character set is used for data that is stored in table columns of the types NCHAR, NVARCHAR2, and NCLOB. 

In contrast, the database character set is used for data stored in table columns of the types CHAR, VARCHAR2 and CLOB.

Before doing this activity it is recommended to take backup first.

$sqlplus / as sysdba

SQL> Select property_value from database_properties
     where upper(property_name) = 'NLS_NCHAR_CHARACTERSET';

SQL> Select owner, table_name, column_name
     from dba_tab_columns
     where (data_type = 'NCHAR' or data_type = 'NVARCHAR2' or data_type = 'NCLOB') and
     owner != 'SYS' and owner != 'SYSTEM';

Note: If there are no table columns of the types NCHAR, NVARCHAR2 or NCLOB on the database, you can change the national character set without encountering any problems. However, if the database contains tables with NCHAR data type columns, you should perform a check to see whether these columns also contain data.

SQL> SHUTDOWN IMMEDIATE
SQL> STARTUP MOUNT
SQL> ALTER SYSTEM ENABLE RESTRICTED SESSION;
SQL> ALTER SYSTEM SET JOB_QUEUE_PROCESSES=0 SCOPE = MEMORY;
SQL> ALTER SYSTEM SET AQ_TM_PROCESSES=0 SCOPE = MEMORY;
SQL> ALTER DATABASE OPEN;

SQL> ALTER DATABASE NATIONAL CHARACTER SET UTF8;
SQL> SHUTDOWN IMMEDIATE
SQL> STARTUP 

On the other hand, oracle recommendation is that you create your database with the AL32UTF8 database character set, and move all your national character set data to normal VARCHAR2 and CHAR columns.

It is always not better choice to use 'ALTER DATABASE' command to change the character set. Check the Documentation for better solution:

NTP Configuration on Solaris

First rename or copy ntp.server to ntp.conf as given below

# cp /etc/inet/ntp.server /etc/inet/ntp.conf

Edit below lines

# vi /etc/inet/ntp.conf

#### NTP Server IPs ####
server 10.110.20.72
server 10.110.20.82

# svcadm enable ntp
 #svcadm restart ntp
# svcs ntp

#ntpq -p  ----To Check NTP

List of common Ports in Linux

Just giving the list of common ports.

21       FTP
22       SSH
23       Telnet
25       SMTP
53       DNS (Domain Name Service)
68       DHCP
80       HTTP (HyperText Transfer Protocol)
110     POP3 (Post Office Protocol, version 3)
115     SFTP (Secure File Transfer Protocol)
119     NNTP (Network New Transfer Protocol)
123     NTP (Network Time Protocol)
137     NetBIOS-ns
138     NetBIOS-dgm
139     NetBIOS
143     IMAP (Internet Message Access Protocol)
161     SNMP (Simple Network Management Protocol)
194     IRC (Internet Relay Chat)
220     IMAP3 (Internet Message Access Protocol 3)
389     LDAP (Lightweight Directory Access Protocol)
443     SSL (Secure Socket Layer)
445     SMB (NetBIOS over TCP)
993     SIMAP (Secure Internet Message Access Protocol)
995     SPOP (Secure Post Office Protocol)
4000   ICQ
5010   Yahoo! Messenger
5190   AOL Instant Messenger
5632   PC Anywhere
5800 + 5900   VNC (Remote Admin Software)
8080   HTTP Proxy

How to verify No Accounts Have Empty Passwords?

Below command will help you to get details of empty password for any accounts in Linux.

# awk -F: '($2 == "") {print}' /etc/shadow

Lock all empty password accounts with below command


# passwd -l accountname

Unlock users:

#pam_tally2 --user oracle --reset    --->Here Oracle is username 

Daily Oracle DBA Taks

  • Verify all database, instances, listener status
  • Identify bad growth projections
  • Clear the trace files in the udump and bdump directory as per the policy
  • Verify all the monitoring agent, including OEM agent and third party monitoring agents
  • Verify the status of daily scheduled jobs/daily backups in the morning very first hour
  • Check the database performance, periodic basis usually in the morning very first hour after the night shift schedule backup has been completed
  • Verify the success of archive log backups, based on the backup interval
  • Check the space usage of the archive log file system for both primary and standby DB
  • Check the space usage and verify all the tablespace usage is below critical level once in a day
  • Verify Rollback segments
  • Check the sync between the primary database and standby database, every 20 min
  • Make a habit to check out the new alert.log entry hourly specially if getting any error
  • Check the system performance, periodic basis
  • Check for the invalid objects
  • Check out the audit files for any suspicious activities
  • Make a daily habit to learn something new from any technology


How to check datatype consistency between two environments ?

Below script will help you to check datatype consistency between to environment.

SELECT table_name, column_name, data_type, data_length,data_precision,data_scale,nullable
FROM all_tab_columns   #### First Environment
WHERE owner = '&OWNER'
MINUS
SELECT table_name,column_name,data_type,data_length,data_precision,data_scale,nullable
FROM all_tab_columns@&db_link  #### Second Environment
WHERE owner = '&OWNER2'
order by table_name, column_name;