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, the CONFIG 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

Execute the following command to generate a JSON file in the default directory using the default file name from the 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)))"
    }
}
Execute the following command to generate a JSON file for Oracle Database Service for Azure in the default directory using the default file name from the 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)))"}
Execute the following command to generate a JSON file with the file name 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)
Execute the following command to generate a JSON file with the file name 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)
Execute the following command to generate JSON content and display it on the console:
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)))"
    }
}