Note_Tech

All technological notes.


Project maintained by simonangel-fong Hosted on GitHub Pages — Theme by mattgraham

Oracle DBA 1 - Connecting to Oracle Database Instance

Back


Connecting to an Oracle Database Instance


Connecting to CDB by using operating system authentication

# 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.

Connecting to PDBs by using Easy Connect Systax in SQL*Plus


connect username/pwd@host_name:port/service_name
CONNECT username/password@host_name:port/service_name
sqlplus username/password@host_name:port/service_name

Disconnecting from the database instance

EXIT

Oracle Tools


SQL*Plus


Calling a SQL Script from SQL*Plus

sqlplus username/pwd@host_name @script.sql
@script.sql

Calling SQL*Plus from a Shell Script

sqlplus username/pwd <<EOF
select count(*) from employees;
update employees set salary = salary*1.10;
commit;
quit
EOF

TOP