[TIL][SQL]サーバへの接続
10840 ワード
Oracleプログラムがインストールされている場合、
Oracle Server
に管理者アカウントSYS
、SYSTEM
、およびエクササイズ時に使用されるエクササイズアカウントSCOTT
が生成されます.C:\Users\user>sqlplus scott/tiger
SQL*Plus: Release 11.2.0.1.0 Production on 월 10월 26 15:34:46 2020
Copyright (c) 1982, 2010, Oracle. All rights reserved.
다음에 접속됨:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
データベースが閉じており、練習アカウントに接続できません.エラーが発生しました.C:\Users\user>sqlplus scott/tiger
SQL*Plus: Release 11.2.0.1.0 Production on 월 10월 26 15:34:46 2020
Copyright (c) 1982, 2010, Oracle. All rights reserved.
ERROR:
ORA-01034: ORACLE not available
ORA-27101: shared memory realm does not exist
上記のエラーが発生した場合は、次のユーザー名入力部に管理者アカウントsys
を入力して接続し、startup
コマンドを使用してDBを起動します.C:\Users\user>sqlplus
SQL*Plus: Release 11.2.0.1.0 Production on 월 10월 26 15:40:19 2020
Copyright (c) 1982, 2010, Oracle. All rights reserved.
사용자명 입력: sys/oracle as sysdba
다음에 접속됨:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
15:40:28 SQL> startup
ORACLE instance started.
Total System Global Area ~~~~~~ bytes
~~~~
~~~~
~~~~
~~~~
Database mounted.
Database opened.
15:40:37 SQL> CONN scott/tiger
Connected.
現在接続されているアカウントshow user
コマンドを確認します.SET sqlprompt "USER>"
と入力すると、プロンプトの外観が現在の接続のアカウント名に変更されます.15:43:55 SQL> set sqlpromp "_USER>"
15:44:13 SCOTT>
練習用口座に接続された時にORA-28000: the account is locked
という情報が出ると、セキュリティ上の問題で練習用口座scott
の使用が阻止されるからだ.管理者アカウントに接続し、適切な操作を行った後、練習アカウントに再接続します.C:\Users\user>sqlplus scott/tiger
SQL*Plus: Release 11.2.0.1.0 Production on 월 10월 26 15:34:46 2020
Copyright (c) 1982, 2010, Oracle. All rights reserved.
ERROR:
ORA-28000: the account is locked
Enter user-name: sys/oracle as sysdba
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SYS>ALTER USER scott
2 IDENTIFIED BY tiger
3 ACCOUNT UNLOCK ;
User altered.
SYS>CONN scott/tiger
Connected.
SCOTT>
sys
はoracleに対して最も高い権限を持つアカウントであり、/
の後ろのoracle
はsys
アカウントのパスワードでoracleを設定する際にsys
アカウントに指定されたパスワードである.別のビル番号を設定したら、そのパスワードを入力すればいいです.Reference
この問題について([TIL][SQL]サーバへの接続), 我々は、より多くの情報をここで見つけました https://velog.io/@asgowon/TILSQL서버에-접속하기テキストは自由に共有またはコピーできます。ただし、このドキュメントのURLは参考URLとして残しておいてください。
Collection and Share based on the CC Protocol