1. <tt id="5hhch"><source id="5hhch"></source></tt>
    1. <xmp id="5hhch"></xmp>

  2. <xmp id="5hhch"><rt id="5hhch"></rt></xmp>

    <rp id="5hhch"></rp>
        <dfn id="5hhch"></dfn>

      1. oracle數(shù)據(jù)庫(kù)基礎(chǔ)使用方法解析

        時(shí)間:2020-08-16 09:36:49 Oracle認(rèn)證 我要投稿

        oracle數(shù)據(jù)庫(kù)基礎(chǔ)使用方法解析

          Oracle數(shù)據(jù)庫(kù)產(chǎn)品為財(cái)富排行榜上的前1000家公司所采用,許多大型網(wǎng)站也選用了Oracle系統(tǒng)。下面是小編整理的關(guān)于oracle數(shù)據(jù)庫(kù)基礎(chǔ)使用方法解析,希望大家認(rèn)真閱讀!

          基礎(chǔ)概念:

          數(shù)據(jù)庫(kù):存儲(chǔ)數(shù)據(jù)的數(shù)據(jù)庫(kù),Oracle一般只有一個(gè)全局?jǐn)?shù)據(jù)庫(kù) XE,ORCL。

          表空間:是Oracle存儲(chǔ)數(shù)據(jù)的地方,由若干個(gè)數(shù)據(jù)文件組成,*.dbf。

          模式和模式對(duì)象:模式就是用戶,模式對(duì)象是數(shù)據(jù)庫(kù)對(duì)象的集合,比如表、視圖、索引、存儲(chǔ)過程。

          卸載Oracle的注意事項(xiàng):

          0:需要先備份重要數(shù)據(jù)

          1:得合法刪除(通過程序自帶的卸載工具卸載,如360,程序和功能)

          2:卸載完成后,需要手動(dòng)移除安裝文件夾

          3:查看系統(tǒng)服務(wù),如果有Oracle開始的服務(wù),刪除服務(wù)

          打開服務(wù)快捷方式:window+R(services.msc)

          安裝Oracle的注意事項(xiàng):

          1.安裝目錄中不能有中文目錄,最好不要有空格

          2.最好不要安裝到系統(tǒng)盤,怕數(shù)據(jù)丟失

          Oracle:8i/9i-->Oracle10g/11g-->Oracle12C

          版本:

          企業(yè)版 (enterprise Edition)

          個(gè)人版 (Express Edition)

          占用端口號(hào):1521 和 8080 ,tomcat換端口號(hào),否則登錄Oracle數(shù)據(jù)庫(kù)

          SSH:Struts+Spring+Hibernate

          SSI:SpringMVC+Spring+IBatis

          配置x聽器:

          Oracle..Listener

          OracleService

          如何配置x聽器:主機(jī)名和listener里的不一樣

          Oracle的基本概念:

          1.數(shù)據(jù)庫(kù):存儲(chǔ)數(shù)據(jù)的倉(cāng)庫(kù),數(shù)據(jù)一般只有一個(gè)(個(gè)人版XE,企業(yè)版orcl)

          2.用戶(模式 schema):Oracle是通過不同的用戶來區(qū)分?jǐn)?shù)據(jù)庫(kù)對(duì)象

          3.模式(用戶/數(shù)據(jù)庫(kù))對(duì)象:指的是這個(gè)用戶所擁有的表/視圖/索引/過程...

          4.表空間:是Oracle存儲(chǔ)數(shù)據(jù)的地方,一個(gè)表空間對(duì)應(yīng)一個(gè)或者多個(gè)的`數(shù)據(jù)文件*.dbf

          如何登陸Oracle數(shù)據(jù)庫(kù)

          1.pl/sql developer

          sqlplus:

          系統(tǒng)用戶:sys(只能以sysdba,sysoper的身份登陸) system(normal身份)

          登陸/切換用戶的sql命令:conn 用戶/密碼 [as sysdba];

          Oracle 的sql應(yīng)用

          1>查詢不重復(fù)的列值:stuName,stuAge()

          select distinct stuName,stuAge from student;

          select stuName,stuAge from student group by stuName,stuAge having count(1)=1;

          2>如何起別名?(空格 或者 as)如何排序?如何添加條件?

          select stuName as 姓名,stuAge as "年 齡" from student;

          order by 列名 asc | desc;

          where

          3>如何根據(jù)現(xiàn)有表創(chuàng)建一個(gè)新表

          create table 表名

          as

          select * from student[where 1=2];

          創(chuàng)建新表并添加一列

          create table 表名

          as

          select s.*,'T113' as cname from student s;

          常用的sql命令:

          1.show user:顯示當(dāng)前登錄的用戶 中括號(hào)里的超級(jí)管理員才加

          2.conn 用戶名/密碼[as sysdba]:切換用戶,登錄數(shù)據(jù)庫(kù)

          3.desc :描述表結(jié)構(gòu)

          在Oracle中增刪改語句會(huì)自動(dòng)開啟事務(wù),必須提交事務(wù)

          查看表:

          select * from 表名;

          查看表結(jié)構(gòu):

          desc 表名;

          sql語句的分類:4類

          數(shù)據(jù)操縱語音(DML):  select

          事務(wù)控制語音(TCL):commit rollback savepoint

          數(shù)據(jù)定義語音(DDL):create drop alter truncate

          數(shù)據(jù)控制語音(DCL):grant revoke

          在editor中編輯,點(diǎn)擊齒輪運(yùn)行:么事別亂敲回車,check約束可以直接寫,選tables可以直接添加數(shù)據(jù)

          失效后,更改:

          tools-->pre..-->key conf..-->reset to default-->ok

          Oracle常用的數(shù)據(jù)類型有哪些?

          char varchar2 number date lob(blob clob)

          標(biāo)準(zhǔn)日期格式:(1-6月 2016) to_date(2016-6-1,'yyyy-MM-dd')date'2016-6-1'

          或者直接編輯 選擇myobject,tables ,edit data

          分析函數(shù):rank() over (partition by 列名 order by 列名 )

          查詢平均工資大于3000的部門

          /*select * from dept d

          where (select avg(sal) from employee e where e.deptno = d.deptno)>3000;*/

          創(chuàng)建表空間注意事項(xiàng):

          1.數(shù)據(jù)文件不要放在容易看到和刪除的地方(比如桌面,磁盤根目錄)

          2.表空間不能非法刪除,否則數(shù)據(jù)庫(kù)無法啟動(dòng)

          修改表空間大小:

          1.修改數(shù)據(jù)文件大小

          alter database datafile

          'd:datad.dbf'

          resize 10M;

          2.添加數(shù)據(jù)文件

          alter datafile

          'd:datad2.dbf'

          size 5M

          autoextend on;

          3.修改表空間為只讀狀態(tài)

          alter tablespace hello read only;

          alter tablespace hello read write;

          刪除表空間

          space hello

          including contents and datafiles;連帶文件夾和數(shù)據(jù)一同刪除

          創(chuàng)建用戶

          create user zhao

          identified by sa

          default tablespace hello;

          privilege 權(quán)限

          expire:密碼定期過期

          授權(quán):

          系統(tǒng)權(quán)限:

          grant connect,resource to zhao;

          revoke connect,resource from zhao;

          grant create synonym to zhao;

          grant create public synonym to zhao;

          grant select on dept to public;

          對(duì)象權(quán)限:

          grant all on emp to zhao;

          revoke all on emp from zhao;

          創(chuàng)建序列:

          create sequence seq_dept

          start with 50

          increment by 10;

          1.添加數(shù)據(jù)

          into dept(列名) values (seq_dept.nextval);

          2.查看當(dāng)前序列值

          select seq_dept.currval from dual;

          3.drop sequence 名

          創(chuàng)建同義詞:在其他用戶中創(chuàng)建Scott的同義詞;

          create or replace synonym emp for Scott.emp;

          創(chuàng)建公有同義詞:表是誰的誰創(chuàng)建(前提條件,其他用戶得有權(quán)限訪問同義詞對(duì)應(yīng)的對(duì)象)

          create public synonym emp for Scott;

        【oracle數(shù)據(jù)庫(kù)基礎(chǔ)使用方法解析】相關(guān)文章:

        Oracle數(shù)據(jù)庫(kù)DBA基礎(chǔ)試題08-27

        oracle數(shù)據(jù)庫(kù)基礎(chǔ)知識(shí)11-06

        Oracle數(shù)據(jù)庫(kù)基礎(chǔ)知識(shí):SELECT語句11-12

        Oracle數(shù)據(jù)庫(kù)SELECT語句11-02

        Oracle數(shù)據(jù)庫(kù)認(rèn)證層次08-29

        Oracle數(shù)據(jù)庫(kù)開發(fā)技巧08-19

        oracle數(shù)據(jù)庫(kù)基本語句11-06

        Oracle數(shù)據(jù)庫(kù)語句大全11-02

        Oracle數(shù)據(jù)庫(kù)SQLPLUS介紹11-02

        国产高潮无套免费视频_久久九九兔免费精品6_99精品热6080YY久久_国产91久久久久久无码

        1. <tt id="5hhch"><source id="5hhch"></source></tt>
          1. <xmp id="5hhch"></xmp>

        2. <xmp id="5hhch"><rt id="5hhch"></rt></xmp>

          <rp id="5hhch"></rp>
              <dfn id="5hhch"></dfn>