
Organizations are continuously looking for ways to modernize their database platforms to improve agility, reduce operational overhead, and take advantage of cloud-native capabilities. Oracle offers multiple pathways to modernize your database estate, and one of the latest innovations is Oracle Autonomous Database Serverless (ADB-S)@Google Cloud.
By bringing Oracle Autonomous Database closer to Google Cloud workloads, organizations can leverage the power of Oracle’s self-managing, self-securing, and self-repairing database while benefiting from the scalability and ecosystem of Google Cloud.
In this blog series, we will explore a practical approach to performing a manual database migration to Autonomous Database Serverless (ADB-S)@Google Cloud. We’ll walk through the key steps involved in provisioning the target environment, configuring a custom NFS server, and migrating the database using Oracle Data Pump.
This is part 2 of the blog series which deals with creating custom NFS server and attaching it to source database and ADB-S.
I have divided the blog as below sections.
Prerequisites
Step 1 – Provision a VM
Step 2 – Configure NFS server
Step 3 – Attach NFS to Source Database
Step 4 – Attach NFS to ADB-S
Prerequisites
Ensure that you have completed the steps in Part 1 of the blog.
It is important to have the required roles for creating a VM in Google Cloud and also the required access in OCI to modify the DNS resolver.
Step 1 – Provision a VM
We need a VM with in the same region and VPC as our ADB-S which we can configure as a NFS server.
I will use Oracle Linux 9 as the OS , however you can choose any Linux of your choice.
Navigate to VM Instances from the main menu.

Select Create Instance on VM instances page to get started.

Provide below details on Machine configuration page.
Name – Name of the VM instance
Region – Select same region as your target ADB-S@Google Cloud.
Zone – You can leave it to the default.

Select Machine type and leave everything to default on the Machine configuration page.

On the Operating system and storage page , select change to modify the Image , Disk Type and size.

I have made below changes. Please make selections based on your requirement.

On Networking page , I have selected same VPC as our ADB-S and also selected a subnet under the VPC.

I haven’t made any changes in any other sections .
Select Create to proceed with VM creation.

Our VM will be available in few minutes.
Step 2 – Configure NFS server
We now have a VM which we can configure as a NFS server.
ADB-S has some specific requirement when it comes to the configuration of NFS.
Proceed to create directories with permissions as below.
#sudo su -
#mkdir /exports
#chown nobody /exports
#chgrp nobody /exports
#mkdir /exports/data
#chown nobody /exports/data
#chgrp nobody /exports/data
#chmod 777 /exports/data
Modify /etc/exports using below command .Replace the IP address(aa.bb.cc.dd) with ADB-S private IP.
# tee -a /etc/exports <<'EOF'
/exports/data *(rw,insecure)
/exports/data aa.bb.cc.dd(rw,insecure)
EOF
Start the NFS server using below commands.
#systemctl start nfs-server
#systemctl enable nfs-server
Modify the firewall settings as below. For me the default zone name was trusted . Please modify your commands based on your default zone.
# firewall-cmd --get-default-zone
# firewall-cmd --zone=trusted --add-service=nfs
# firewall-cmd --permanent --zone=trusted --add-service=nfs
# firewall-cmd --reload
Check the directories NFS server is exporting using below command.
# showmount -e
Below is a successful output.
Export list for ap-nfs:
/exports/data (everyone)
Step 3 – Attach NFS to Source Database Server
3.1 Network connectivity
Ensure that your source database can perform egress to the NFS server port (2049).
In my case both source database and NFS server are in same VPC and subnet and there was no need to have any egress rule specifically for this.
3.2 Mount the NFS share
Perform below actions as root user on the source database server.
mkdir -p /mnt/exp
mount -t nfs aa.bb.cc.dd:/exports/data /mnt/exp -o vers=4,minorversion=1,sec=sys
chown oracle:oinstall /mnt/exp
Replace aa.bb.cc.dd with NFS server private IP.
Below is the output of the mounted NFS.
[raj@ap-src-db tmp]$ df -h | grep mnt
10.10.0.2:/exports/data 200G 15G 186G 8% /mnt/exp
Ensure that you add the mount to /etc/fstab so that you don’t have to mount it again after VM restart.
3.3 Create database directory
Create a database directory pointing to NFS share which we can use for Data Pump Export.
Execute below statement.
create directory DATA_PUMP_DIR_EXP as '/mnt/exp';
Step 4 – Attach NFS to ADB-S
4.1 Add an A record in OCI DNS by following below steps.
- Select Manage in OCI from your ADB-S@Google Cloud page to go to Oracle Autonomous AI Database details page in OCI, click on the virtual cloud network in the Network section.
- On the network details page, click on the DNS Resolver.
- On the private resolver details page, click on the default private view.
- Click the create zone button and create a new zone using the name of your choice . I have chosen custom.nfs.
- Click on the newly created zone, manage records, and add a record. Give the record a name and provide the private IP of NFS VM . I have provided the name as cnfs.
- Publish the changes.
We now have an FQDN (cnfs.custom.nfs) defined in OCI DNS pointing to the private IP of NFS server.
4.2 Add the NFS mount FQDN to the access control list (ACL) of ADB-S.
Login to ADB-S and execute below statement (Modify the host as per your NFS FQDN ).
exec DBMS_NETWORK_ACL_ADMIN.APPEND_HOST_ACE(host => 'cnfs.custom.nfs', ace => xs$ace_type(privilege_list => xs$name_list('connect', 'resolve'), principal_name => 'ADMIN', principal_type => xs_acl.ptype_db));
This will create an ACL in ADB-S allowing it to communicate with NFS server.
Note : I have installed Oracle Instant Client on the NFS VM server and used it to connect to ADB-S.
4.3 Allow Ingress on port 2049 for traffic from ODB network.
Navigate to our VPC and select Create VPC firewall rule.

Specify a name , description and priority . Ensure that direction of traffic is Ingress.

Select below required fields.
Targets – Can be all instances or target with specific tags .
Source filter and Source IPv4 – I have provided entire ODB CIDR range.
Specified protocol and ports – I have mentioned TCP and 2049.

Leave everything else to default and select Create to complete the rule creation.

4.4 Modify outbound connection property of ADB-S.
Modify the outbound connection property using below SQL.
ALTER DATABASE PROPERTY SET ROUTE_OUTBOUND_CONNECTIONS = 'ENFORCE_PRIVATE_ENDPOINT';
This is required for both enhanced security and also for reaching NFS private end point.
4.5 Check whether NFS FQDN is resolvable from ADB-S.
Let’s check whether ADB-S can resolve the NFS FQDN using below command.
select utl_inaddr.get_host_address('cnfs.custom.nfs') from dual;
Below is the output of a successful check.
SQL> select utl_inaddr.get_host_address(‘cnfs.custom.nfs’) from dual;
UTL_INADDR.GET_HOST_ADDRESS(‘CNFS.CUSTOM.NFS’)
——————————————————————————–
254.152.0.58
Output of above command will be Public IP instead of private IP (of NFS server) , however this behavior is normal based on my experience.
4.6 Check network connectivity from ADB-S to NFS FQDN
Let’s check whether we can reach NFS end point from ADB-S using below PL/SQL.
SET SERVEROUTPUT ON
DECLARE
c UTL_TCP.CONNECTION;
BEGIN
c := UTL_TCP.OPEN_CONNECTION(
remote_host => '<NFS_FQDN>',
remote_port => 2049,
tx_timeout => 10
);
DBMS_OUTPUT.PUT_LINE('TCP 2049 reachable from ADB');
UTL_TCP.CLOSE_CONNECTION(c);
EXCEPTION
WHEN OTHERS THEN
DBMS_OUTPUT.PUT_LINE('TCP 2049 failed: ' || SQLERRM);
END;
/
Below is a successful output.
TCP 2049 reachable from ADB
PL/SQL procedure successfully completed.
4.7 Create database directory.
Create a database directory using below SQL.
CREATE or replace DIRECTORY CUSTOM_NFS AS 'customnfs';
3.8 Attach NFS to ADB-S.
Use below PL/SQL to attach NFS to ADB-S. NFS will be mounted to the database directory created in previous step.
BEGIN
DBMS_CLOUD_ADMIN.ATTACH_FILE_SYSTEM(
file_system_name => 'CUSTOMNFS',
file_system_location => 'cnfs.custom.nfs:/exports/data',
directory_name => 'CUSTOM_NFS',
description => 'Attach Custom NFS',
params => JSON_OBJECT('nfs_version' value 4)
);
END;
/
file_system_name – Name of your choice.
file_system_location – Combination of NFS FQDN with export share path.
directory name – Name of the database directory created in 3.7.
Below is a successful output.
SQL> BEGIN
DBMS_CLOUD_ADMIN.ATTACH_FILE_SYSTEM(
file_system_name => ‘CUSTOMNFS’,
file_system_location => ‘cnfs.custom.nfs:/exports/data’,
directory_name => ‘CUSTOM_NFS’,
description => ‘Attach Custom NFS’,
params => JSON_OBJECT(‘nfs_version’ value 4)
);
END;
/ 2 3 4 5 6 7 8 9 10
PL/SQL procedure successfully completed.
That’s it.
We have successfully configured a custom NFS server , attached it to source database server and ADB-S .
Continue with Part 3 where we perform the migration to ADB-S.
Tip : For Production migrations , it is recommended to choose a machine type that can support your requirement.
Leave a Reply