我爱编程

Oracle相关

2017-07-10  本文已影响0人  zilanhu

Google一般比百度靠谱,英文资料一般比中文资料丰富、准确。所以还是建议遇到问题直接Google,不要在百度浏览大量的重复文章浪费时间。


Oracle相关资料


Oracle相关语法及函数

//几种有意思的用法
SELECT 7*9 FROM DUAL
63

DUAL is a table automatically created by Oracle Database along with the data dictionary. DUAL is in the schema of the user SYS but is accessible by the name DUAL to all users. It has one column, DUMMY, defined to be VARCHAR2(1), and contains one row with a value X. Selecting from the DUAL table is useful for computing a constant expression with the SELECT statement. Because DUAL has only one row, the constant is returned only once.
Alternatively, you can select a constant, pseudocolumn, or expression from any table, but the value will be returned as many times as there are rows in the table. Please refer to "SQL Functions" for many examples of selecting a constant value from DUAL.

SELECT LPAD('Page 1',15,'*.') "LPAD example" FROM DUAL;
LPAD example
*.*.*.*.*Page 1

Oracle遇到的相关问题

用户无法drop

今天在现场遇到一个问题,导致数据库崩溃,需要恢复数据库。在删除用户时使用命令:

DROP USER XX CASCADE;

一直提示无法删除当前用户,使用

SELECT USERNAME,SID,SERIAL#,STATUS FROM V$SESSION;

发现XX用户一旦被删除会重新连接,暂时不知道是什么原因。
后来发现,可以先锁定用户

ALTER USER XX ACCOUNT LOCK;
ALTER SYSTEM KILL SESSION'SID,SERIAL#';
DROP USER XX CASCADE;
上一篇下一篇

猜你喜欢

热点阅读