Connecting to Oracle AI Database Using Easy Connect Naming Method
You can connect to the database using the following Easy Connect strings:
- Multitenant container database:
host[:port] - Pluggable database:
host[:port]/service_name
FREEPDB1 is the service name defined for the first PDB created by default. You can replace FREEPDB1 with the name of another PDB you want to connect to.
Specifying the port is optional when the listener is setup with the default port 1521. You must specify the port number if you use another port.
Connection strings for local connections were provided on the final screen of the install. If you are connecting from a remote computer, you must enter the hostname (where Oracle AI Database Free is installed) instead of localhost.
The Net Services database listener must be running on the database host of the specified port for the connections to succeed.
For example, you can connect to the root container of the database from a client computer with SQL*Plus using the following commands:
$ cd $ORACLE_HOME/bin
$ ./sqlplus system@dbhost.example.com:1521
You can connect to the default PDB FREEPDB1 using the following commands:
$ cd $ORACLE_HOME/bin
$ ./sqlplus system@dbhost.example.com:1521/FREEPDB1
Replace dbhost.example.com with your database host name. If required, replace 1521 with the port number the listener listens on. You can replace FREEPDB1 with the name of another PDB that you want to connect to.
To shorten connect strings or to avoid hard coding of the host name and the port in the application code and DBA scripts, you can define an alias for the connect string in the configuration file ORACLE_HOME/network/admin/tnsnames.ora on the database clients. See Configuring the Local Naming Method for more details.
Related Topics