새소식

RDBMS/ORACLE & TIBERO

sqlplus/tbsql에서 특수문자 암호 접속 하는 방법

  • -
728x90
반응형
  • 쉘 스크립트 환경에서는 일부 특수문자가 쉘 명령어와 같이 사용되는 경우가 있습니다.
  • 쉘 스크립트 유틸리티 암호를 입력할 때 오류가 발생하기도 합니다.

sqlplus

[oracle@oracle ~]$ sqlplus migration_user/test@2023

SQL*Plus: Release 12.2.0.1.0 Production on Mon Jul 31 03:38:21 2023

Copyright (c) 1982, 2016, Oracle.  All rights reserved.

ERROR:
ORA-12170: TNS:Connect timeout occurred


Enter user-name: 

[oracle@oracle ~]$ sqlplus migration_user/"test@2023"

SQL*Plus: Release 12.2.0.1.0 Production on Mon Jul 31 03:37:29 2023

Copyright (c) 1982, 2016, Oracle.  All rights reserved.

ERROR:
ORA-12170: TNS:Connect timeout occurred


Enter user-name:
[oracle@oracle ~]$ sqlplus migration_user/\"test@2023\"

SQL*Plus: Release 12.2.0.1.0 Production on Mon Jul 31 03:40:00 2023

Copyright (c) 1982, 2016, Oracle.  All rights reserved.

Last Successful login time: Mon Jul 31 2023 02:09:22 +00:00

Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production

SQL> 

[oracle@oracle ~]$ sqlplus migration_user/\"test\@2023\"

SQL*Plus: Release 12.2.0.1.0 Production on Mon Jul 31 02:09:22 2023

Copyright (c) 1982, 2016, Oracle.  All rights reserved.

Last Successful login time: Mon Jul 31 2023 02:08:57 +00:00

Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production

SQL>
  • @ 특수문자의 경우에도 일반적인 방법으로는 접속할 수 없습니다.
  • 앞뒤 \" 붙여주면 접속 가능 합니다.
  • 그 외 특수문자가 쉘 명령어로 처리되는 경우 앞뒤 \" 외에 특수문자 앞에 \ 역슬래시 처리 해주어야 합니다.
[oracle@oracle ~]$ sqlplus migration_user/test!2023
bash: !2023: event not found

[oracle@oracle ~]$ sqlplus migration_user/"test!2023"
bash: !2023: event not found
  • !의 경우에는 !뒤에 숫자가 쉘 history의 작업 번호에 대한 명령이기 때문에 정상적인 처리가 불가 합니다.
[oracle@oracle ~]$ sqlplus migration_user/\"test!2023\"
bash: !2023: event not found

[oracle@oracle ~]$ sqlplus migration_user/\"test\!2023\"

SQL*Plus: Release 12.2.0.1.0 Production on Mon Jul 31 02:08:57 2023

Copyright (c) 1982, 2016, Oracle.  All rights reserved.

Last Successful login time: Mon Jul 31 2023 01:09:51 +00:00

Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production

SQL>
  • !의 경우에는 앞뒤 \" 및 특수문자 \ 처리 해주어야 합니다.

연속적인 특수문자의 경우 

[oracle@oracle ~]$ sqlplus migration_user/\"test\!!2023\"
bash: !2023: event not found

[oracle@oracle ~]$ sqlplus migration_user/\"test\!\!2023\"

SQL*Plus: Release 12.2.0.1.0 Production on Mon Jul 31 03:42:34 2023

Copyright (c) 1982, 2016, Oracle.  All rights reserved.

Last Successful login time: Mon Jul 31 2023 03:40:00 +00:00

Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production

SQL>

tbsql

[root@tibero ~]$ tbsql tibero/test@2023

tbSQL 6  

TmaxData Corporation Copyright (c) 2008-. All rights reserved.

TBS-70003: Invalid command. Enter HELP or HELP <command>.
at line 1, column 21:
CONNECT tibero/test@2023
                    ^^^^

SQL> q
[root@tibero ~]$ tbsql tibero/"test@2023"

tbSQL 6  

TmaxData Corporation Copyright (c) 2008-. All rights reserved.

TBS-70003: Invalid command. Enter HELP or HELP <command>.
at line 1, column 21:
CONNECT tibero/test@2023
                    ^^^^

SQL> q
  • sqlplus와 마찬가지로 일반적인 방법으로는 암호를 정상적으로 입력하지 못합니다.
  • 특수문자의 별도 처리가 필요 합니다.
[root@tibero ~]$ tbsql tibero/\"test@2023\"

tbSQL 6  

TmaxData Corporation Copyright (c) 2008-. All rights reserved.

Connected to Tibero.

SQL> 

[root@tibero ~]$ tbsql tibero/\"test\@2023\"

tbSQL 6  

TmaxData Corporation Copyright (c) 2008-. All rights reserved.

Connected to Tibero.

SQL>

 

  • @ 특수문자의 경우에도 일반적인 방법으로는 접속할 수 없습니다.
  • 앞뒤 \" 붙여주면 접속 가능 합니다.
  • 그 외 특수문자가 쉘 명령어로 처리되는 경우 앞뒤 \" 외에 특수문자 앞에 \ 역슬래시 처리 해주어야 합니다.
[root@tibero ~]$ tbsql tibero/test!2023
bash: !2023: event not found

[root@tibero ~]$ tbsql tibero/"test!2023"
bash: !2023: event not found

[root@tibero ~]$ tbsql tibero/\"test!2023\"
bash: !2023: event not found
  • !의 경우에는 !뒤에 숫자가 쉘 history의 작업 번호에 대한 명령이기 때문에 정상적인 처리가 불가 합니다.
[root@tibero ~]$ tbsql tibero/\"test\!2023\"

tbSQL 6  

TmaxData Corporation Copyright (c) 2008-. All rights reserved.

Connected to Tibero.

SQL>
  • !의 경우에는 앞뒤 \" 및 특수문자 \ 처리 해주어야 합니다.

연속적인 특수문자의 경우

[root@tibero ~]$ tbsql tibero/\"test\!!2023\"
bash: !2023: event not found
[root@tibero ~]$ tbsql tibero/\"test\!\!2023\"

tbSQL 6  

TmaxData Corporation Copyright (c) 2008-. All rights reserved.

Connected to Tibero.

SQL>

728x90
반응형

포스팅 주소를 복사했습니다

이 글이 도움이 되었다면 공감 부탁드립니다.