All technological notes.
Connection:
User session
# System authentication does not require user ID, password
# if supply one, it is totally ignored
# Connection is based on the user at the OS level.
# However, it is important to identify as whom a user logges into the operating system. Connection will be mapped through the OS user.
sqlplus / as sysdba
# slash "/" here identify to connect to the OS.
# sysdba: the role as whom the current user acts
# the owner of the databse with the highest previlige.
# the current operating system user must be a member of the privileged OSDBA group
# A safe way to log in using a paricular user name and pwd
sqlplus # then sql prompt will show up for user name and pwd.
Rules:
it is not safe to use command: sqlplus user_id/pwd, because user id and pwd will show in the command, which is not safe.
connect username/pwd@host_name:port/service_name
Support TCP protocol only (no SSL)
Syntax:
CONNECT username/password@host_name:port/service_name
sqlplus username/password@host_name:port/service_name
host_name:
port: optional
service_name: optional
EXIT
SQL*Plus
ORACLE_HOME/bin directory.sqlplus username/pwd@host_name @script.sql
@script.sql
sqlplus username/pwd <<EOF
select count(*) from employees;
update employees set salary = salary*1.10;
commit;
quit
EOF