SELECT TABLE_USED_PAGES('模式名', '表名') * PARA_VALUE / 1024 / 1024 "USER_USED_SPACE(MB)"
FROM V$DM_INI
WHERE PARA_NAME LIKE 'GLOBAL_PAGE_SIZE';
select 'drop table SYSDBA."'
|| A .TABLE_NAME
||' ;'
FROM DBA_TABLES A WHERE OWNER='SYSDBA';
select * from dba_tables where TABLE_NAME='表名';
select TABLE_NAME from dba_tables where owner='SYSDBA';
select username, ACCOUNT_STATUS from dba_users ;
select grantee,granted_role from dba_role_privs where grantee='用户名';
select grantee,privilege from dba_sys_privs where grantee='角色名';
select * from v$dm_ini where "V$DM_INI".PARA_NAME='COMPATIBLE_MODE';
查询结果为0,表示不兼容;
2:部分兼容 ORACLE,
3:部 分兼容 MS SQL SERVER,
4:部分兼容 MYSQL
见上一条,如果修改为部分兼容 MYSQL;
sp_set_para_value(2,'COMPATIBLE_MODE',4);
见上一条,如果修改为部分兼容 ORACLE;
sp_set_para_value(2,'COMPATIBLE_MODE',2);
修改以后重启数据库实例服务生效;
修改PRODUCT_VENDOR为对应的表名
select
column_name
FROM
dba_ind_columns
where
index_name in
(
select
index_name
from
dba_indexes
where
table_name ='PRODUCT_VENDOR'
and uniqueness = 'UNIQUE'
);
DBMS_STATS.GATHER_SCHEMA_STATS(
'模式名',
100,
FALSE,
'FOR ALL COLUMNS SIZE AUTO');
SP_TAB_STAT_INIT('模式名','表名');
或者
DBMS_STATS.GATHER_TABLE_STATS('模式名','表名',NULL,100,TRUE,'FOR ALL COLUMNS SIZE AUTO')
STAT 100 ON 表名(列名);
sp_col_stat_init('模式名','表名','列名');
sp_tab_col_stat_init('模式名','表名');
select datediff(ss,sysdate,last_send_time) a,
SF_GET_SESSION_SQL(SESS_ID) ,--获取完整sql
sess_id ,
sess_seq ,
sql_text ,
state ,
seq_no ,
user_name ,
trx_id ,
create_time,
clnt_ip
from
v$sessions
where state='ACTIVE' and sess_id != sessid
order by a;
select * from v$lock where blocked=1;
select * from v$trxwait;
select timestampdiff(ss,LAST_RECV_TIME,sysdate),sf_get_session_sql(sess_id),*
from SYS."V$SESSIONS"
where sess_id<>sessid
order by 6 asc,1 desc;
select
dh.trx_id ,
sh.sess_id,
wm_concat(top_sql_text)
from
V$DEADLOCK_HISTORY dh,
V$SQL_HISTORY sh
where
dh.trx_id =sh.trx_id
and dh.sess_id=sh.sess_id
group by
dh.trx_id,
sh.sess_id
SP_INIT_JOB_SYS(1);
sp_load_lic_info();
SELECT sf_get_unicode_flag()
结果为1,表示字符集为utf-8;
结果为0,表示字符集为gbk;
select sf_get_case_sensitive_flag()
结果为1,表示大小写敏感;
结果为0,表示大小写不敏感;
select sf_get_length_in_char()
结果为1,表示以字符为单位;
结果为0,表示以字节为单位;
SF_ARCHIVELOG_DELETE_BEFORE_TIME(SYSDATE - 15);
select
a.ID as 用户ID,
b.name as 用户名,
CONN_IDLE_TIME as 用户会话的最大空闲时间,
FAILED_NUM as 用户登录失败次数限制,
SESS_PER_USER,
LOCK_TIME as 用户口令锁定时间
from
SYSUSERS a,sysobjects b
where a.id=b.id
欢迎关注达梦云适配中心;