第0章:oracle_sql語句之基本操作
spool /tmp/a.txt
******執行任何sql操作
spool off
ho cat /tmp/a.txt
啟動sqlplus工具:
su - oracle
$lsnrctl status/start/stop 查看監聽狀態以及啟動停止監聽
sqlplus / as sysdba
sqlplus工具啟動成功,進入SQL提示符!
SQL>
進入SQL提示符要做的第一件事是登錄:
SQL>conn scott/tiger
查看當前使用哪一個用戶登錄的
SQL> show user
在命令行為scott用戶解鎖:
SQL>conn / as sysdba
SQL>alter user scott identified by tiger account unlock;
SQL>conn scott/tiger
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ERROR:
ORA-01034: ORACLE not available
ORA-27101: shared memory realm does not exist
Linux Error: 2: No such file or directory
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
查看數據庫相關的系統進程:
ps -ef | grep ora_
查看數據庫的共享內存是否分配:
ipcs -sm
系統reboot後怎麽啟動數據庫?
su - oracle
sqlplus / as sysdba
SQL>startup或者shutdown immediate
SQL>select status from v$instance; 查看實例狀態,正常為open
SQL>conn scott/tiger
第0章:oracle_sql語句之基本操作