Oracle FAQs and Tips
2024-08-29 13:28:56
供稿:網友
 
在已建好的table上添加primary key1.建立索引create  index test_idx on test(id);2.添加約束alter table testadd 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 ajoin  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;