oracle±Ê¼Ç
sqlplus sys/password as sysdba;ϵͳ¹ÜÀíÔ±µÇ¼
alter user scott account unlock; ¸ü¸ÄÓû§
desc £¨±íÃû£©
select * from (table name);
select distinct ename from emp;
select ename,sal from emp;
select ename,sal*12 'annual_sal' from emp;
select ename,sal from emp where sal>1000;
select ename,sal from emp where sal<>1000;
select ename,sal from emp where ename>'CBA';
select ename,sal from emp where sal between 800 and 1500;
select ename,sal from emp where ename like 'CBA';
select ename,sal from emp where ename like '%$%%' escape '$';
select ename,sal from emp where sal in (800,1000);
select ename,sal from emp where sal in 800 or/and ename='KING';
select ename,enumber from emp order by enumber desc;
select ename,enumber from emp order by enumber asc,sal asc;
select ename,sal*12 annual_sal from emp
where ename not like '_A%' and sal > 800
order by sal desc;
select substr (ename,2,3) from emp;
select ename from emp where lower(ename) like '_a%';
select chr(65) from dual;
select ascii('A') from dual;
select round (23.598,2) from dual; 23.60
select round (23.598,-1) from dual; 20
select to_char(sal,'$99,999.9999') from emp;
select to_char(sal,'L0000.0000') from emp;
select to_char(hiredate,'YYYY-MM-DD HH:MI:SS') from emp;
select ename,hiredate from emp where hiredate >to_date('1981-02-13 12:00:00','YYYY-MM-DD HH:MI:SS');
select ename,sal from emp where sal>to_number('$1,250.00','$9,999,99');
select ename,sal*12+nvl(comm,0) from emp;
select max(sal) from emp;
select min(sal) from emp;
select avg(sal) from emp;
select to_char(avg(sal),'9999.99') from emp;
select round(max(sal),2) from emp;
select sum(sal) from emp;
select count(*) from emp where deptno=10;
select count(distinct deptno) from emp;
selcet avg(sal) from emp;
select deptno,avg(sal) from emp group by deptno;
select ename from emp where sal=(select max(sal) from emp);
select deptno,max(sal) from emp group by deptno;
select deptn
Ïà¹ØÎĵµ£º
1¡¢²é¿´Êý¾Ý¿â×Ö·û¼¯
Êý¾Ý¿â·þÎñÆ÷×Ö·û¼¯select * from nls_database_parameters£¬ÆäÀ´Ô´ÓÚprops$£¬ÊDZíʾÊý¾Ý¿âµÄ×Ö·û¼¯¡£
¡¡¡¡
¡¡¡¡¿Í»§¶Ë×Ö·û¼¯»·¾³select * from nls_instance_parameters,ÆäÀ´Ô´ÓÚv$parameter£¬
¡¡¡¡
¡¡¡¡±íʾ¿Í»§¶ËµÄ×Ö·û¼¯µÄÉèÖ㬿ÉÄÜÊDzÎÊýÎļþ£¬»·¾³±äÁ¿»òÕßÊÇ×¢²á±í
¡¡¡¡
¡¡¡¡»á»°×Ö·û¼¯» ......
ÔÚwindow·þÎñÆô¶¯Ê±²¢²»Æô¶¯ÊµÀýµÄÁ½ÖÖ·½·¨:
¡¡¡¡(1)ͨ¹ýoradim startup ²ÎÊýÉ趨,ÈçÏÂ:
¡¡¡¡a.²é¿´oradim°ïÖú
C:Documents and SettingsAdministrator>oradim help
DIM-00002: ÓÐЧµÄÃüÁî°üÀ¨: -DELETE, -EDIT, -NEW, -STARTUP ºÍ -SHUTDOWN
¡¡¡¡ÇëÊäÈëÒÔÏÂÃüÁîÖ®Ò»:
¡¡¡¡Í¨¹ýÖ¸¶¨ÒÔϲÎÊý´´½¨Àý³Ì:
-NEW - ......
--È¡µÃµ±Ìì0ʱ0·Ö0Ãë
select TRUNC(SYSDATE) from dual;
--È¡µÃµ±Ìì23ʱ59·Ö59Ãë(ÔÚµ±Ìì0ʱ0·Ö0ÃëµÄ»ù´¡ÉϼÓ1ÌìºóÔÙ¼õ1Ãë)
SELECT TRUNC(SYSDATE)+1-1/86400 from dual;
--È¡µÃµ±Ç°ÈÕÆÚÊÇÒ»¸öÐÇÆÚÖеĵڼ¸Ìì,×¢Ò⣺ÐÇÆÚÈÕÊǵÚÒ»Ìì
select to_char(sysdate,'D'),to_char(sysdate,'DAY') from dual;
--ÔÚoracleÖÐÈçºÎµÃ ......
ÀûÓÃosÉóºË
µÇ¼oracleʱÔÚWinÖÐʵÏÖ¶ÔosµÄÉóºËÓÐÈçϼ¸²½£º
1¡¢ create os user id
2¡¢ create os group ora_dba(Õâ¸ö×éÖÐÓû§¾ßÓйÜÀíËùÓÐoracle database µÄȨÏÞ),
ora_sid_dba£¨Ö»ÄܶÔÓ¦µ½ÏàÓ¦sidµ ......
ʵ¼ùµÚÒ»½²£º
Ãû´Ê½âÊÍ£º
dataguard£ººÇºÇ ORACLE¸ß¿ÉÓÃÌåϵÖÐÈý¼ÜÂí³µÖ®Ò»£¨RAC¡¢STREAM£©¡£¸ÉÂïÓã¿£¿£¿¾ÍÊÇÒìµØ±¸·Ý¡¢ÈÝÔÖʲôµÄ¡£Ê²Ã´ÔÀí£¿£¿==ÁĹþ¡£
primary:Êý¾ÝĸÌå
standby:Êý¾ÝĸÌåµÄ¿½±´»ò±¸·Ý»ò¿Ë¡£¨Ö»ÄÜ¿Ë9¸ö Ϊʲô ÒªÎÊORACLE Ϊʲô log_archive_dest_n Õâ¸öÄãNµÄÉÏÏÞÊÇ10à¶£©
ʵ¼ùµÚ¶þ¼þ£º
ʵ¼ù¼ì ......