Wednesday, June 24, 2020 No buffer space available (maximum connections reached?)

I have come across an issue that Tableau server degraded suddenly. We had to restart the services to bring Tableau server online.

We see below errors from the log file and after research, we found that Tableau Server Port Exhaustion caused the issue

Errors in Server event log
TCP/IP failed to establish an outgoing connection because the selected local endpoint was recently used to connect to the same remote endpoint. This error typically occurs when outgoing connections are opened and closed at a high rate, causing all available local ports to be used and forcing TCP/IP to reuse a local port for an outgoing connection. To minimize the risk of data corruption, the TCP/IP standard requires a minimum time period to elapse between successive connections from a given local endpoint to a given remote endpoint.

Error in Tableau log files
2020-07-05 07:10:42.800 -0700 (,,,) StatusServerThread_dataserver_2 : INFO com.tableausoftware.service.thrift.win32.NamedPipeServerTransport - Awaiting client connection on \\.\pipe\dataserver_2-status, handle native@0x1a3c.
2020-07-05 07:10:49.990 -0700 (,,,) FilestoreHostLocatorThread : ERROR org.apache.curator.framework.imps.CuratorFrameworkImpl - Background exception was not retry-able or retry gave up Couldn't instantiate org.apache.zookeeper.ClientCnxnSocketNIO
at org.apache.zookeeper.ZooKeeper.getClientCnxnSocket(
at org.apache.zookeeper.ZooKeeper.<init>(
at org.apache.curator.utils.DefaultZookeeperFactory.newZooKeeper(
at org.apache.curator.framework.imps.CuratorFrameworkImpl$2.newZooKeeper(
at org.apache.curator.HandleHolder$1.getZooKeeper(
at org.apache.curator.HandleHolder.getZooKeeper(
at org.apache.curator.ConnectionState.reset(
at org.apache.curator.ConnectionState.start(
at org.apache.curator.CuratorZookeeperClient.start(
at org.apache.curator.framework.imps.CuratorFrameworkImpl.start(
at com.tableausoftware.tdfs.common.ZkConnection.<init>(
at com.tableausoftware.tdfs.common.ZkConnectionProvider.getConnection(
at com.tableausoftware.tdfs.common.HostLocator.lambda$initialize$1(
at java.util.concurrent.Executors$
at java.util.concurrent.FutureTask.runAndReset(
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(
at java.util.concurrent.ScheduledThreadPoolExecutor$
at java.util.concurrent.ThreadPoolExecutor.runWorker(
at java.util.concurrent.ThreadPoolExecutor$
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.GeneratedConstructorAccessor105.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(
at java.lang.reflect.Constructor.newInstance(
at org.apache.zookeeper.ZooKeeper.getClientCnxnSocket(
... 19 more
Caused by: Unable to establish loopback connection at$
at Method)
at org.apache.zookeeper.ClientCnxnSocketNIO.<init>(
... 23 more

Caused by: No buffer space available (maximum connections reached?): bind
1. To Identify the dynamic port range

Open a command prompt as an administrator, and run the following command to determine the dynamic port range:

netsh int ipv4 show dynamicportrange tcp
netsh int ipv6 show dynamicportrange tcp

The command will display the port number of the first dynamic port, and the number of ports. You need to add the number of ports to the start port to determine the port range.

2. Run below command to view ports currently in use
netstat –n 

3. Run the following command to increase the dynamic port range:

netsh int <ipv4|ipv6> set dynamicportrange <tcp|udp> start=number num=range store=<active/persistent>

Note that port 65535 is the maximum port number . You can start by setting the range to include ports 32767 through 65535

Also refer below article To determine port exhaustion caused the issue.,is%20the%20maximum%20port%20number.

Refer below article identify port-exhaustion at server side. 

Thanks & Regards,
Satishbabu Gunukula, Oracle ACE

Tuesday, June 16, 2020

Duplicating On-premise Database to Oracle Cloud in Oracle 18c

From Oracle 18c, by using DUPLICATE command you can duplicate an on-prem database to Oracle Could. Oracle databases on Oracle Cloud are always encrypted even if no encryption clause is specified during duplication.

Using Oracle RMAN you to perform two main types of database duplications.
  • Backup-based duplication – In this method we will use pre-existing RMAN backups or copies of the source database. 
  • Active database duplication - The database will be duplicated by copying the live source database over the network to the auxiliary instance. 
Follow the steps to migrate on-prem database to Cloud:
1. Ensure the prerequisites for the DUPLICATION technique are met, see Prerequisites for Duplicating a Database".
2. Configure Recovery Manager to use Oracle Database Backup Cloud Service as the backup destination. Use CONFIGURE command. Pls refer Oracle Cloud Using Oracle Database Backup Service for more details.

PARMS='SBT_LIBRARY= SBT-library-location-for-backup-module,
SBT_PARMS=(OPC_PFILE=location-of-the-configuration file)';


3. Complete the planning tasks, as described in "Planning to Duplicate a Database

4. Prepare the auxiliary instance, as described in "Preparing the Auxiliary Instance"

• You must create auxiliary instance as CDB and start instance with enable_pluggable_database=TRUE in the initialization parameter file
• When instructed to create an initialization parameter file for the auxiliary instance, user must copy the file from the source database. This ensures that the auxiliary instance is also a CDB. After you copy the file you need to perform the following steps:
   – Modify the DB_NAME parameter
   – Modify the various destination/location parameters
• Start the auxiliary instance in NOMOUNT mode.

5. Start RMAN and connect to the root as a common user with the SYSBACKUP privilege or SYSDBA.

6. If the source CDB uses encryption, then open the Oracle keystore that contains the master key on the source CDB.

7. Configure RMAN channels, if necessary, as described in "Configuring RMAN Channels for Use in Duplication".

8. On the destination CDB, open the Oracle keystore from the source CDB. If the destination CDB uses a password-based software keystore, then you must specify the password used to open this keystore


9. Use the DUPLICATE command to duplicate the source CDB.

Use one of the following options of the DUPLICATE command:
  • DUPLICATE DATABASE or DUPLICATE...ACTIVE DATABASE - Use this command for duplicating non-CDBs and CDBs.
  • DUPLICATE DATABASE ... FOR STANDBY - Use this command create a standby database by duplicating the source.
  • Use the DUPLICATE DATABASE ... FOR FARSYNC – Use this command to create an Oracle Data Guard far sync instance using duplication.
  • DUPLICATE PLUGGABLE DATABASE – Use this command to duplicate one or more PDBs while connected to the root.
You can also use SET NEWNAME command to specify alternate names for duplicate database files,

Note that Using duplication to create a standby database to Oracle Cloud is not supported

Satishbabu Gunukula, Oracle ACE