日期:2014-05-16 浏览次数:20442 次
?
?
1. 创建表空间、用户、给用户授权:
create tablespace temptusers datafile 'D:\oracle\product\10.2.0\
oradata\oracl\temptusers.dbf' size 1024m
?
create user e2qoa_v3 identified by "123456"
profile default
default tablespace users
temporary tablespace temptusers
account unlock
?
grant connect to e2qoa_v3
grant create session to e2qoa_v3
grant dba to e2qoa_v3
?
2. 命令行进入sqlplus并查看oracle版本:
sqlplus sys/sys as sysdba
SQL> select banner from sys.v_$version;
3. 查看当前登录的用户:
SQL>show user;
4. 查看所有管理员用户的状态:
SQL>select * from dba_users;
又如:SQL>select account_status from dba_users where username=’E2QOA_V3’;
5. 另外常见命令:
create user XXX identified by 密码;
alter user XXX default tablespace 表空间名 quota unlimited on 表空间名;
alter user XXX temporary tablespace temp;
grant create trigger to XXX ;
grant create session to XXX ;
grant create sequence to XXX ;
grant create synonym to XXX ;
grant create table to XXX ;
grant create view to XXX ;
grant create procedure to XXX ;
grant alter session to XXX ;
grant execute on ctxsys.ctx_ddl to XXX ;
grant dba to XXX ;
6. 查看某个表空间中包含的所有表的名称:
select table_name from dba_tables where tablespace_name='USERS'
或者:
SELECT * FROM DBA_SEGMENTS WHERE TABLESPACE_NAME='TABLESPACE_NAME' AND SEGMENT_TYPE='TABLE'
7. 关于sys用户和system用户的区别:
1)存储的数据重要性不同。所有oracle的数据字典的基表和视图都存