午夜国产狂喷潮在线观看|国产AⅤ精品一区二区久久|中文字幕AV中文字幕|国产看片高清在线

    八個(gè)學(xué)習(xí)點(diǎn)幫助你全面認(rèn)識(shí)Oracle數(shù)據(jù)庫
    來源:易賢網(wǎng) 閱讀:1031 次 日期:2015-03-20 13:44:18
    溫馨提示:易賢網(wǎng)小編為您整理了“八個(gè)學(xué)習(xí)點(diǎn)幫助你全面認(rèn)識(shí)Oracle數(shù)據(jù)庫”,方便廣大網(wǎng)友查閱!

    TableSpace

    表空間:

    一個(gè)表空間對(duì)應(yīng)多個(gè)數(shù)據(jù)文件(物理的dbf文件)

    用語法方式創(chuàng)建tablespace,用sysdba登陸:

    --創(chuàng)建表空間mytabs,大小為10MB:

    create tablespace mytabs datafile

    'C:oracleoradatamydbmytabs1.dbf' size 10M;

    alter user zgl default tablespace mytabs;

    --把tabs做為zgl的默認(rèn)表空間。

    grant unlimited tablespace to zgl;

    --將操作表空間的權(quán)限給zgl。

    Exception

    示例:

    create or replace procedure

    pro_test_exception(vid in varchar2) is

    userName varchar2(30);

    begin

    select name into userName from t_user where id=vid;

    dbms_output.put_line(userName);

    exception

    when no_data_found then

    dbms_output.put_line('沒有查到數(shù)據(jù)!');

    when too_many_rows then

    dbms_output.put_line('返回了多行數(shù)據(jù)!');

    end pro_test_exception;

    安全管理

    以下語句以sysdba登陸:

    用戶授權(quán):

    alter user zgl account lock;--鎖定帳號(hào)。

    alter user zgl identified by zgl11;--修改用戶密碼。

    alter user zgl account unlock;--解除帳號(hào)鎖定。

    alter user zgl default tablespace tt;--修改用戶zgl的默認(rèn)表空間為tt。

    create user qqq identified by qqq123 default tablespace tt;--創(chuàng)建用戶。

    grant connect to qqq;--給qqq授予connect權(quán)限。

    grant execute on zgl.proc01 to test;--將過程zgl.proc01授予用戶test。

    grant create user to zgl;--給zgl授予創(chuàng)建用戶的權(quán)限。

    revoke create user from zgl;--解除zgl創(chuàng)建用戶的權(quán)限。

    角色授權(quán):

    create role myrole;--創(chuàng)建角色myrole

    grant connect to myrole;--給myrole授予connect權(quán)限

    grant select on zgl.t_user to myrole;--把查詢zgl.t_user的權(quán)限授予myrole

    grant myrole to test;--把角色myrole授予test用戶

    概要文件(配置文件):

    全局設(shè)置,可以在概要文件中設(shè)置登陸次數(shù),如超過這次數(shù)就鎖定用戶。

    Synonym

    創(chuàng)建同義詞示例:

    create public synonym xxx for myuser.t_user

    create synonym t_user for myuser.t_user

    select * from dba_synonyms where table_name='T_USER'

    跨數(shù)據(jù)庫查詢

    create database link dblinkzgl

    connect to myuser identified by a using 'mydb'

    Select * From

    course示例

    示例1:

    create or replace procedure pro_test_cursor is

    userRow t_user%rowtype;

    cursor userRows is

    select * from t_user;

    begin

    for userRow in userRows loop

    dbms_output.put_line

    (userRow.Id||','||userRow.Name||','||userRows%rowcount);

    end loop;

    end pro_test_cursor;

    示例2:

    create or replace procedure

    pro_test_cursor_oneRow(vid in number) is

    userRow t_user%rowtype;

    cursor userCur is

    select * from t_user where id=vid;

    begin

    open userCur;

    fetch userCur into userRow;

    if userCur%FOUND then

    dbms_output.put_line

    (userRow.id||','||userRow.Name);

    end if;

    close userCur;

    end pro_test_cursor_oneRow;

    record示例

    create or replace

    procedure pro_test_record(vid in varchar2) is

    type userRow is record(

    id t_user.id%type,

    name t_user.name%type

    );

    realRow userRow;

    begin

    select id,name into

    realRow from t_user where id=vid;

    dbms_output.put_line

    (realRow.id||','||realRow.name);

    end pro_test_record;

    rowtype示例

    create or replace procedure

    pro_test_rowType(vid in varchar2) is

    userRow t_user%Rowtype;

    begin

    select * into userRow from t_user where id=vid;

    dbms_output.put_line

    (userRow.id||','||userRow.name);

    end pro_test_rowType;

    更多信息請(qǐng)查看IT技術(shù)專欄

    更多信息請(qǐng)查看數(shù)據(jù)庫
    由于各方面情況的不斷調(diào)整與變化,易賢網(wǎng)提供的所有考試信息和咨詢回復(fù)僅供參考,敬請(qǐng)考生以權(quán)威部門公布的正式信息和咨詢?yōu)闇?zhǔn)!

    2025國考·省考課程試聽報(bào)名

    • 報(bào)班類型
    • 姓名
    • 手機(jī)號(hào)
    • 驗(yàn)證碼
    關(guān)于我們 | 聯(lián)系我們 | 人才招聘 | 網(wǎng)站聲明 | 網(wǎng)站幫助 | 非正式的簡(jiǎn)要咨詢 | 簡(jiǎn)要咨詢須知 | 新媒體/短視頻平臺(tái) | 手機(jī)站點(diǎn) | 投訴建議
    工業(yè)和信息化部備案號(hào):滇ICP備2023014141號(hào)-1 云南省教育廳備案號(hào):云教ICP備0901021 滇公網(wǎng)安備53010202001879號(hào) 人力資源服務(wù)許可證:(云)人服證字(2023)第0102001523號(hào)
    云南網(wǎng)警備案專用圖標(biāo)
    聯(lián)系電話:0871-65099533/13759567129 獲取招聘考試信息及咨詢關(guān)注公眾號(hào):hfpxwx
    咨詢QQ:1093837350(9:00—18:00)版權(quán)所有:易賢網(wǎng)
    云南網(wǎng)警報(bào)警專用圖標(biāo)