Programing/Database

[oracle] 데이터베이스 연결

개발자 2021. 5. 3. 10:44
반응형

외부에서 데이터베이스 원격 접속을 할 때에는 입력하는 양식이 정해져 있다

username/password@[//]host[:port][/service_name]

기본포트를 사용해서 oracle database XE에서 원격연결을 할 때

CONNECT system/mypassword@mydbserver.example.com

 

기본포트가 1521이 아닌 다른 포트번호일 때

CONNECT system/mypassword@mydbserver.example.com:1522

 

기본포트를 사용하지만 원격 연결 시 서비스이름이 다른 경우 (기본 서비스이름 : orcl)

CONNECT system/mypassword@mydbserver.example.com/XE

 

터미널에서 연결 시 굉장히매우 간편하다

CONNECT username/password
ex) CONNECT HR/PEOPLE

 

리눅스에서 환경변수가 설정이 되어있지 않은 경우에는 아래 주소 에서 설명된대로 하면 된다. docs.oracle.com/cd/E17781_01/server.112/e18804/connecting.htm#CHDJBIAH

 

Connecting to the Database

­Oracle Database XE supports connections between the SQL Command Line (SQL*Plus) and the database either locally, or remotely over a TCP/IP network. The method that you use to connect to Oracle Database XE with the SQL Command Line depends on whether you

docs.oracle.com

로그인을 나중에 하고, SQL을 즉시 시작하려면 아래 명령어 입력

sqlplus /nolog

이 방식으로도 연결이 가능하다

CONNECT username/password
ex) CONNECT HR/PEOPLE
반응형