Oacle 사용 총화

20550 단어 Oacle
3      :
          oracle 9  :
sys change_on_install
[as sysdba]
system manage
scott tiger ,
       oracle 10  :
     sys system      ,scott     ,      ,scott     。

     sqlplus lisi/lisi     
disconn;   ( )
conn lisi
/lisi; ( )
commit; , 、 、 , ,
                       ,      。
     

        sys    :
create user lisi identified by lisi;


:( DDL )
       :
grant create session to lisi;       ,
grant create table to lisi;        ,
grant unlimited tablespace to lisi;   ,
                    CRUD  

         :
revoke create session from lisi;
revoke create table from lisi;
revoke unlimited tablespace from lisi;

               (  sys         ):
grant create session to public;
grant create any talbe to public;


set linesize 400
select * from user_sys_privs


( DML ):
grant select on mytab to lisi;     lisi
grant all on mytab to lisi; 、 、 、 、 、 lisi

revoke select on mytab from list; lisi
revoke all on mytab from lisi;     lisi

select * from user_tab_privs;    

( 、 ):
grant update(name) on mytab to lisi;    name lisi
grant insert(id) on mytab to lisi; id lisi

select * from user_col_privs;     

: 。

ddl
----
dml----
dcl----
dml commit , ;
          commit,                 ,       (    DML  ),
             ;           。commit         。



grant alter any table to lisi with admin option; 
      : oracle 10 ,  sys    alter any table lisilisi         wang,
        sys  lisi alter any table   ,wang alter any table      。

grant select On A to lisi with grant option;
      : oracle 10 ,  sys    select On A  lisi,lisi         wang,
        sys  lisi select On A   ,wang          。 



create role myrole;
grant create session to myrole;
     grant create table to myrole;
drop role myrole;
           unlimited tablespace          ,         ,          。


create table create any table
[alter table] alter any table  
[drop table] drop any table
create
any table , 。
     
create any table , 。


, 。


   / ( window , )
sys
scott


linux oracle
lsnrctl start
sqlplus sys
/oracle as sysdba
startup


window oracle
lsnrctl start         
oradim
-startup -sid orcl

     ★     scott,    ,       。
     1. sys   sqlplus / as sysdba; ,        ,
          sqlplus sys/sys as sysdba;    
     2.  sql   alter user scott identified by tiger; 
          ,  。
             sys,     SYSDBA,               (SYSOPER         ),
          sqlplus / as sysdba     ,          ,    window     ,
                   ora_dba    ,       。
           ,       ->      -> ->ora_dba,   window       ,
                sqlplus / as sysdba      。
      ★ , sqlplus sys/sys as sysdba , ,
              ,      sys   ,          :
     1.  PWDorcl.ora
          C:\oracle\product\10.2.0\db_1\database\ ,    PWDorcl.ora  。
     2.        PWDorcl.ora
          ,  
     orapwd file=C:\oracle\product\10.2.0\db_1\database\PWDorcl.ora password=sys entries=10
          ,sys       sys 。
          ,  。file PWDorcl.ora     ,password  sys   ,entries     
 
 
      
         
         :
        create user     identified by   
        default tableSpace    
        Temporary TableSpace    
        Quota   [ K | M ] | Limited | unlimited  on    
         
          :
        create user abc
        identified by 123
        default tablespace Users
        Temporary tablespace Temp
        Quota 50M on Users
         
         
    :
                --  alter user     account lock
              --    alter user     account unlock
                 --  alter user     password expire(         )
         
    :
        drop user     [CasCade]
        CasCade          
         
          :
        drop user abc cascade;
sqlplus sys/sys as sysdba;
SQL> create user zhang identified by zhang default tablespace users 
temporary tablespace temp quota 100M on users;
SQL> create role myrole;
SQL> grant create session to myrole;
SQL> grant create table to myrole;
SQL> grant myrole to zhang;
 
 
sqlplus zhang/zhang
SQL> create table teacher(id int,name varchar(10));
SQL> show user;

  
편집기 불 러 오 는 중...

좋은 웹페이지 즐겨찾기