By design, we split the entire installation into several clear sections and make the job easy to troubleshoot.
- Install Oracle Software Only in Silent Mode
- Configure a Listener by NETCA in Silent Mode
- Create a Database by DBCA in Silent Mode
This is the second section of Oracle installation in silent mode.
NETCA
In case that we can't use GUI to finish our job, e.g. no X window system, we can still use silent mode to call Net Configure Assistant (NETCA).
NETCA Response File
We extract only useful parameters from the template of NETCA.
[oracle@test ~]$ egrep -v "(^#|^$)" $ORACLE_HOME/assistants/netca/netca.rsp > ~/netca.rsp
Let's see its content.
[oracle@test ~]$ cat ~/netca.rsp
[GENERAL]
RESPONSEFILE_VERSION="19.0"
CREATE_TYPE="CUSTOM"
[oracle.net.ca]
INSTALLED_COMPONENTS={"server","net8","javavm"}
INSTALL_TYPE=""typical""
LISTENER_NUMBER=1
LISTENER_NAMES={"LISTENER"}
LISTENER_PROTOCOLS={"TCP;1521"}
LISTENER_START=""LISTENER""
NAMING_METHODS={"TNSNAMES","ONAMES","HOSTNAME"}
NSN_NUMBER=1
NSN_NAMES={"EXTPROC_CONNECTION_DATA"}
NSN_SERVICE={"PLSExtProc"}
NSN_PROTOCOLS={"TCP;HOSTNAME;1521"}
To meet your own requirements, you can modify some values in the file for your needs.
Run NETCA Silent Mode
Let's see how we use the response file.
[oracle@test ~]$ netca -silent -responsefile ~/netca.rsp
Parsing command line arguments:
Parameter "silent" = true
Parameter "responsefile" = /home/oracle/netca.rsp
Done parsing command line arguments.
Oracle Net Services Configuration:
Profile configuration complete.
Oracle Net Listener Startup:
Running Listener Control:
/u01/app/oracle/product/19.0.0/dbhome_1/bin/lsnrctl start LISTENER
Listener Control complete.
Listener started successfully.
Listener configuration complete.
Oracle Net Services configuration successful. The exit code is 0
Both flags -silent and -responsefile are required to run NETCA in silent mode.
The installation logs of NETCA can be found in $ORACLE_BASE.
lsnrctl status
NETCA also starts the listener service once the database networking has been configured correctly.
[oracle@test ~]$ lsnrctl status
...
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=test)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 19.0.0.0.0 - Production
Start Date 18-JAN-2023 23:54:48
Uptime 0 days 0 hr. 0 min. 36 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/oracle/product/19.0.0/dbhome_1/network/admin/listener.ora
Listener Log File /u01/app/oracle/diag/tnslsnr/test/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=test)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
The listener supports no services
The command completed successfully
The message "The listener supports no services" is pretty normal, since we haven't create any database.
listener.ora and sqlnet.ora
Let's see what files it creates.
[oracle@test ~]$ cd $ORACLE_HOME/network/admin
[oracle@test admin]$ ls -l
total 12
-rw-r----- 1 oracle oinstall 339 Jan 18 23:54 listener.ora
drwxr-xr-x. 2 oracle oinstall 64 Apr 17 2019 samples
-rw-r--r--. 1 oracle oinstall 1536 Feb 14 2018 shrept.lst
-rw-r----- 1 oracle oinstall 195 Jan 18 23:54 sqlnet.ora
As you can see, NETCA creates listener.ora and sqlnet.ora, they are all key files for database networking. But how about tnsnames.ora?
tnsnames.ora
Basically, the file tnsnames.ora will be created in the post phase of a database creation by DBCA, so you don't have to worry about it at this moment. But if you are required to have it now, you can copy a sample of tnsnames.ora from Oracle software instantly.
[oracle@test admin]$ cp ./samples/tnsnames.ora ./
[oracle@test admin]$ ls -l
total 16
-rw-r----- 1 oracle oinstall 339 Jan 18 23:54 listener.ora
drwxr-xr-x. 2 oracle oinstall 64 Apr 17 2019 samples
-rw-r--r--. 1 oracle oinstall 1536 Feb 14 2018 shrept.lst
-rw-r----- 1 oracle oinstall 195 Jan 18 23:54 sqlnet.ora
-rw-r--r-- 1 oracle oinstall 2939 Jan 18 23:57 tnsnames.ora
We can now customize tnsnames.ora for our needs.
Next, let's see How to Create a Database in Silent Mode.