Method 1:
Sqlplus SJTU/SJTU @'(Description = (address_list = (address = (Protocol = TCP) (host = 192.168.0.77) (Port = 1521) (CONNECT_DATA = (SERVICE_NAME = SJTU )))'
As shown in:
Method 2:
Sqlplus SJTU/SJTU192.168.0.77:1521/SJTU
As shown in:
3. Connection format
The format in method 1 is fixed. Search tnsnames. ora. sample in the oralce installation directory to find the corresponding format, as shown belowCodeAs shown in:
# ThisIs A sample tnsnames. ora that Contains The net8 parameters that are # needed To Connect To An HS agentdg4odbc = (Description = (Address = (Protocol = TCP) (host = Localhost) (Port = 1521 ) (CONNECT_DATA = (SID = Dg4odbc) (HS = OK ))
4. Log On As sysdba
C: \ Users \ xuwei > sqlplus / nologsql > conn / as sysdbasql > select name from V $ database ; name -- ------- orclsql > select * from global_name; global_name -- ------------ orcl