Database Reference
In-Depth Information
exeRCiSe 12.2
Connecting to a PDB Using SQl*Plus
In this exercise, you will create a new PDB user and connect to an existing PDB on a
Windows 7 server, using SQL*Plus at the command line.
1. Set the required environment variables. ORACLE_HOME is required on some operating
systems. Launch a command-line window and set the variable:
C:\>set ORACLE_HOME= C:\Oracle\product\12.1.0\dbhome_2
2. Confirm that the net service name exists and is valid for the target PDB.
By default, when you create a PDB using the DBCA or SQL*Plus, Oracle does not
automatically create an entry in the tnsnames.ora file If you are using TNSNAMES to
resolve service names, confirm that a valid entry exists in %ORACLE_HOME% \network\
admin\tnsnames.ora , for example:
PDB1 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = PDB1)
)
)
3. If you're connecting to a local system, confirm that the listener is up and that the tar-
get service is available. Also verify the connection to the PDB using tnsping :
C:\>lsnrctl stat
LSNRCTL for 64-bit Windows: Version 12.1.0.1.0 - Production on 29-NOV-2013
13:11:14
Copyright (c) 1991, 2013, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for 64-bit Windows: Version 12.1.0.1.0 -
Produ
ction
Start Date 24-NOV-2013 12:29:35
Uptime 5 days 0 hr. 41 min. 39 sec
Search WWH ::




Custom Search