13.16 CONFIG
Syntax
CONFIG EXPORT TNS [<tnsnames.ora file location>] [ AZURE ] [ [ FILE ] [<JSON filename>] ]
Generates the Centralized Configuration Provider JSON file from the tnsnames.ora
file located at the default path. The default file name, oraconfig.json
, will be used if you do not specify the name of the JSON file. You can override the default path of the tnsnames.ora
file by providing it explicitly in this command.
By default, the CONFIG
command generates the Centralized Configuration Provider JSON file for OCI cloud service. It also generates Centralized Configuration Provider JSON file for Azure cloud service.
Terms
tnsnames.ora file location
Path of the tnsnames.ora
file. This path overrides the default location of the tnsnames.ora
file in the environment.
AZURE
Generates the Centralized Configuration Provider JSON file for Oracle Database Service for Azure.
FILE [JSON filename]
Stores the generated JSON content in a file. If you do not specify the file name, the JSON file is created with the default file name, which is oraconfig.json
. Otherwise, the file name provided with the FILE
clause is used.
Note:
To generate the JSON file, theCONFIG
command must include either the file name or the FILE
keyword. When both the file name and the FILE
keyword are not specified, the generated JSON content is displayed on the console only.
Examples
tnsnames.ora
file:CONFIG EXPORT TNS FILE
The following output shows the successful generation of the JSON file:Generating config store JSON for Local Net Naming configuration file /opt/oracle/tnsnames.ora
Config store JSON file generated successfully (/home/orcl/oraconfig.json)
The following output shows the content of the JSON file: {
"cdb1_pdb1": {
"connect_descriptor": "(DESCRIPTION=(CONNECT_DATA=(SERVICE_NAME=cdb1_pdb1))(ADDRESS=(PROTOCOL=tcp)(HOST=host1.customer.domain.com)(PORT=1521)))"
}
}
tnsnames.ora
file: CONFIG EXPORT TNS AZURE FILE
The following output shows the successful generation of the JSON file:Generating config store JSON for Local Net Naming configuration file /opt/oracle/tnsnames.ora
Config store JSON file generated successfully (/home/orcl/oraconfig.json)
The following output shows the content of the oraconfig.json
file:{
"orcl/cdb1_pdb1/connect_descriptor": "(DESCRIPTION=(CONNECT_DATA=(SERVICE_NAME=cdb1_pdb1))(ADDRESS=(PROTOCOL=tcp)(HOST=host1.customer.domain.com)(PORT=1521)))"}
myconfig.json
from the tnsnames.ora
file present at the default location:CONFIG EXPORT TNS FILE myconfig.json
The following output shows the successful generation of the JSON file:Generating config store JSON for Local Net Naming configuration file /opt/oracle/tnsnames.ora
Config store JSON file generated successfully (/home/orcl/oraconfig.json)
mynewconfig.json
from the tnsnames.ora
file that is present at a different location:CONFIG EXPORT TNS c:\temp\tnsnames.ora FILE mynewconfig.json
The following output shows the successful generation of the JSON file:Generating config store JSON for Local Net Naming configuration file c:\temp\tnsnames.ora
Config store JSON file generated successfully (C:\Users\USER1\mynewconfig.json)
CONFIG EXPORT TNS
The following shows the JSON content:Generating config store JSON for Local Net Naming configuration file /opt/oracle/tnsnames.ora
{
"cdb1_pdb1": {
"connect_descriptor": "(DESCRIPTION=(CONNECT_DATA=(SERVICE_NAME=cdb1_pdb1))(ADDRESS=(PROTOCOL=tcp)(HOST=host1.customer.domain.com)(PORT=1521)))"
}
}