oracle11g创建用户、表空间、赋权等常用命令

上一篇 / 下一篇  2019-04-24 20:00:39 / 个人分类:oracle

sqlplus / as sysdba
select * from v$tablespace
##查看sid :  show parameter instance

create tablespace data_test datafile 'D:\tablespace\data_1.dbf' size 800M;
create user test1 identified by test123 default tablespace data_test;

grant connect,resource to test1; 
grant create any sequence to test1; 
grant create any table to test1; 
grant delete any table to test1; 
grant insert any table to test1; 
grant select any table to test1; 
grant unlimited tablespace to test1; 
grant execute any procedure to test1; 
grant update any table to test1; 
grant create any view to test1;
grant select on V_$session to test1; 
grant select on V_$sesstat to test1; 
grant select on V_$statname to test1;



修改Oracle游标数

1、查看游标数:show parameter open_cursors;

2、查看当前打开游标数:select count(*) from v$open_cursor;

3、修改Oracle最大游标数:alter system set open_cursors=1000 scope=both;


查看表空间大小(G):

SELECT t.tablespace_name, round(SUM(bytes / (1024 * 1024 * 1024)), 0) ts_size

FROM dba_tablespaces t, dba_data_files d

WHERE t.tablespace_name = d.tablespace_name

GROUP BY t.tablespace_name;


增加表空间

alter tablespace sdt add datafile 'D:\tablespace\data_3.dbf' size 15000M;

-- 查看当前用户下的表
SELECT FROM USER_TABLES
 
-- 查看中所有的表
SELECT FROM DBA_TABLES
 
-- 查看所有表的创建和最后修改时间
SELECT OBJECT_NAME, CREATED, LAST_DDL_TIME from user_objects
 
-- 查看某表的创建和最后修改时间
SELECT CREATED, LAST_DDL_TIME FROM USER_OBJECTS WHERE OBJECT_NAME = '表名';


TAG:

 

评分:0

我来说两句

显示全部

:loveliness: :handshake :victory: :funk: :time: :kiss: :call: :hug: :lol :'( :Q :L ;P :$ :P :o :@ :D :( :)

Open Toolbar