Oracle FAQs and Tips

王朝oracle·作者佚名  2006-01-09
宽屏版  字体: |||超大  

在已建好的table上添加primary key

1.建立索引

create index test_idx

on test(id);

2.添加約束

alter table test

add constraint test_pk primary key (id)

using index test_idx;

在SQLPLUS中登陸時出現以下錯誤

ERROR:

ORA-12638: Credential retrieval failed

解決方法:修改sqlnet.ora

如果SQLNET.AUTHENTICATION_SERVICES= (NTS)一行沒有被注釋,則注釋掉

#SQLNET.AUTHENTICATION_SERVICES= (NTS)

反之取消注釋

ALTER SYSTEM SET EVENTS='10231 trace name context forever,level 10' ;

内部事件,设置在全表扫描时跳过损坏的数据块.

查看tablespace的空間使用情況

select a.tablespace_name,

trunc(sum(b.bytes/1024/1024),2) "FREE(M)",

trunc(sum(a.bytes/1024/1024)-sum(b.bytes/1024/1024),2) "USED(M)",

trunc(sum(a.bytes/1024/1024),2) "ALL(M)",

trunc(sum(b.bytes/1024/1024)/sum(a.bytes/1024/1024),2)*100||'%' "Free(%)"

from dba_data_files a

join dba_free_space b

on(a.file_id=b.file_id)

group by a.tablespace_name;

如何指定tnsname.ora的位置

設置環境變量TNS_ADMIN

獲取當前SCN(9i以後)

select dbms_flashback.get_system_change_number from dual;

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
© 2005- 王朝网络 版权所有