oracle中一些常用sql语句

1:将表中数据复制插入到本表中的语句,由于有主键的话,主键列不能复制,会造成主键冲突的问题,所以要建序列,用序列插主键。

 insert into tablename select to_char(SEQ.NEXTVAL), number1, char1, date1, timestamp1, varch2, number2, char2, date2, timestamp2 from tablename 



2:查询所有用过的sql语句

select * from v$sql where sql_text like '%puttable%'


3:查询数据库的字符集
select * from V$nls_Parameters



oracle 性能调优问题

SELECT NAME,VALUE
FROM v$parameter
WHERE NAME IN
('sga_max_size','db_cache_size',
'shared_pool_size','shared_pool_reserved_size','large_pool_size','java_pool_size',
'db_block_size','db_block_buffers','log_buffer','sort_area_size','sort_area_retained_size',
'hash_area_size','sessions','open_cursors'
)ORDER BY NAME;

查看sga的大小
select sum(value)/1024/1024 "total sga md" from v$sga

show sga

你可能感兴趣的:(oracle,sql,cache)