Oacle 사용 안내

5321 단어 Oacle
3      :
		sys        	 change_on_install           		[as sysdba]
		system  	 manage			        
		scott          tiger			       



  oracle:
		sqlplus / as sysdba
		
    :
		lsnrctl start
		
        :
		oradim -startup -sid orcl
		
SQL> show user;			//      

SQL> create user lisi identified by lisi;		//      

SQL> grant create session to lisi;			//         

SQL> sqlplus lisi/lisi					//          

SQL> grant unlimited tablespace  to lisi			//          

SQL> grant create table to lisi;				//         

SQL> create table mytable (id int);		//   

SQL> insert into mytable values (1);		//    

SQL> select * from mytable;			//    

SQL> drop table mytable				//   


SQL> revoke create table from lisi;     	//         

SQL> select * from user_sys_privs;     //            

SQL>revoke unlimited tablespace from lisi;		//           


 sys      

sqlplus / as sysdba

alter user scott Identified by tiger;

oracle 9
      
         
E:\oracle\ora92\database\pwdora9i.ora;
orapwd file=E:\oracle\ora92\database\pwdora9i.ora password=sys entries=10;

select * from v$pwfile_users;

oracle 10+
      
         
E:\oracle\ora92\database\PWDorcl.ora;
orapwd file=E:\oracle\ora92\database\PWDorcl.ora  password=sys  entries=10;

select * from v$pwfile_users;

    
           。

show user;              

create role myrole;			      

grant create session to myrloe;			     session  

grant create table to myrole;				          

create user zhangsan identified by zhangesan;		      

grant myrole to zhangsan;		        

sqlplus zhangsan/zhangsan		    

drop role myrole;			    

grant unlimited tablespace to myrole;		       ,        ,       

     

show user:		      

select * from user_sys_privs                

grant alter any table to lisi;      sys       

grant alter any table to wangwu;		           

grant alter any table to lisi with admin option; 		//            

grant alter any table to wangwu with admin option; 		//          

create table A(id int);			// sys      A

grant select On A to lisi;		//           ,         

grant select On A to lisi with grant option;			//           

grant select on sys.A to wangwu with grant option;;			//          。

         

SQL> create user wanwu identified by wangwu

SQL> grant create session to wangwu;

SQL> sqlplus wangwu/wangwu

SQL> grant create table,unlimited tablespace to wangwu;

SQL> create table mytab(id int);

SQL> insert into mytab values(2);

 lisi  wangwu   ,    
SQL> select * from wangwu.mytab;

 sys    wangwu   ,  ,     
SQL> select * from wangwu.mytab;
SQL> select * from wangwu.mytab;

 lisi    wangwu  
SQL> grant select on mytab to lisi;		//         

SQL> grant insert on mytab to lisi;		//         

SQL> commit;		//        

SQL> grant all on mytab ot lisi;		//              

SQL> revoke all on mytab from lisi;    //            



SQL> disconn

SQL> conn wangwu/wangwu

SQL> commit:    //          

SQL> alter table mytab add name varchar(50);

SQL> insert into mytab values(1,'zhang');

SQL> insert into mytab values(2,'li');

SQL> insert into mytab values(3,'wang');

SQL> commit;

SQL> grant update(name) on mytab to lisi;    	//       name    

SQL> grant insert(id) on mytab to lisi;			//       id    

SQL> update wangwu.mytab set name='lihuoming' where id=1;


      

1.         :
		scott(          )
		conn scott/tiger
		
		manager(      )
		conn system/manager
		
		sys(             )
		conn sys/change_on _install as sysdba
		
         :
		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;

좋은 웹페이지 즐겨찾기