Oracle SQL Lesson (1) - 使用SQL Select语句获取数据

时间:2022-06-30 12:43:52

第一节课:

启动数据库并且使用特定用户连接:
su - oracle;

启动sqlplus并且使用sys连接:
conn / as sysdba;

启动数据库:
startup;

解锁用户:
alter user hr identified by hr;
alter user hr account unlock;

使用hr连接:
conn hr/hr;
select * from tab;
desc employees;
select * from departments;

开发工具:
plsql developer;
toad

特殊字符:
SELECT department_name || q'[ Department's Manager Id: ]' || manager_id
AS "Department and Manager"
FROM departments;

在sqlplus中调用vi:
cd $ORACLE_HOME/sqlplus/admin
vi glogin.sql--加入一行:
define _editor='vi'