修改密码方法:1.SQL>; grant connect to USRNAME identified by USRPWD ;2.SQL>; alter user USRNAME identified by USRPWD ;3.SQL>; password USRNAME ;更改 USRNMAE 的口令旧口令:××××××新口令:××××××重新键入新口令:××××××
修改成oracle认证方法:
1.修改参数文件中remote_login_passwordfile=EXCLUSIVE 或SHARED 2.修改/home/network/admin/SQLNET.ORA 文件增加 sqlnet.authentication_services=(NFS)
ORACLE_SID是操作系统级的参数INSTANCE_NAME是数据库级的参数SPFILE 是服务器参数文件PFILE 是文本参数文件create pfile='/oracle/test.ora' from spfile ;show parameter spfile ; 后如果VALUE值是零,则没有使用spfile.启动数据库是可以指定是用pfile还是用spfile启动 如下:startup pfile='/oracle/test.ora'
show parameter instance show parameter db
alter system set job_queue_processes=50 comment ='temporaty change on' scope = memory|spfile|both ;
alter session set
CONCAT('Good', 'String') GoodString SUBSTR('String',1,3) Str LENGTH('String') 6 INSTR('String', 'r') 3 LPAD(sal,10,'*') ******5000
union union all minus 第一个查询减去第二个查询intersect 交集
SQL>; select replace('itpub oracle','oracle','training') itpub from dual /
ITPUB
--------------
itpub training
Translate SQL>; select translate('This is second trianing of itpub in Beijing!','abcde','12345') itpub 2 from dual;
ITPUB
--------------------------------------------
This is s53on4 tri1ning of itpu2 in B5ijing!
Floor SQL>; select floor(4.55) from dual;
FLOOR(4.55)
-----------
4 Ceil SQL>; select ceil(4.55) from dual;CEIL(4.55)
----------
5
ROUND: 4舍5入到指定的小数位ROUND(45.926, 2) 45.93 TRUNC: 将值截断到指定的小数位TRUNC(45.926, 2) 45.92 MOD: 返回相除后的余数MOD(1600, 300) 100
select trunc(sysdate, 'D') - 3 from dual;
trunc(sysdate, 'D'), 截取到本周的第一天(0:00)
trunc(sysdate, 'M'), 截取到本月的第一天(0:00)
trunc(sysdate, 'DD'), 截取到本日的0:00 trunc(sysdate,'yyyy')得到今年的第一天的0:00.
十进制与十六进制EYGLE@vilen>; select to_char(2463,'xxxx') from dual;
TO_CH
-----
99f
已选择 1 行。
十六进制与十进制EYGLE@vilen>; select to_number('99f','xxxx') from dual;
TO_NUMBER('99F','XXXX')
-----------------------
2463
SQL>; select ename,sal,2 case job WHEN 'MANAGER' THEN 1.1*sal 3 WHEN 'ANALYST' THEN 1.2*SAL 4 WHEN 'CLERK' THEN 1.5*SAL 5 ELSE sal END "NEW_SAL" 6 from emp;
ENAME SAL NEW_SAL
---------- ---------- ----------
SMITH 800 1200 ALLEN 1600 1600 WARD 1250 1250 JONES 2975 3272.5 MARTIN 1250 1250 BLAKE 2850 3135 CLARK 2450 2695 SCOTT 3000 3600 KING 5000 5000 TURNER 1500 1500 ADAMS 1100 1650 JAMES 950 1425 FORD 3000 3600 MILLER 1300 1950
SQL>; SELECT job, sal,2 DECODE(job, 'ANALYST' SAL*1.1,3 'CLERK', SAL*1.15,4 'MANAGER', SAL*1.20,5 SAL)
6 REVISED_SALARY 7 FROM emp;JOB SAL REVISED_SALARY
--------- --------- --------------
PRESIDENT 5000 5000 MANAGER 2850 3420 MANAGER 2450 &