標籤:
oracle空表處理:
1.動態產生給空表分配segment的命令:
SQL>Select ‘alter table ‘||table_name||‘ allocate extent;‘ from user_tables where num_rows=0;
2.在命令視窗右鍵‘標記’,複製產生的命令並執行,斷行符號。
3.匯出資料:
exp tfgps/[email protected] file=D:\ORACLETEMP\TFGPS.DMP log=D:\ORACLETEMP\TFGPS.LOG
4.建立資料表空間和使用者並設定密碼不到期:
select name from v$datafile;
create tablespace NKGPS datafile ‘D:\APP\K2\ORADATA\TFPARAMETER\NKGPS.DBF‘ size 100m autoextend on next 50m maxsize unlimited;
create user tfgps identified by tf default tablespace NKGPS temporary tablespace temp;
grant connect,resource,dba,create table,create view,create trigger,create session,create sequence,create index type,create procedure to tfgps;
ALTER PROFILE DEFAULT LIMIT PASSWORD_LIFE_TIME UNLIMITED;
//修改發生鎖定的登入錯誤次數:
alter profile default limit FAILED_LOGIN_ATTEMPTS unlimited;
切換登入後:ALTER PROFILE DEFAULT LIMIT PASSWORD_LIFE_TIME UNLIMITED;
5.匯入資料:
imp tfgps/[email protected] ignore=y rows=y full=y commit=y buffer=4096000 file=D:\ORACLETEMP\TFGPS.DMP log=D:\ORACLETEMP\TFGPSIMP.LOG
若只匯出空表:
exp tfgps/[email protected] file=D:\ORACLETEMP\TFGPS.DMP log=D:\ORACLETEMP\TFGPS.LOG rows=n;
//create user tablespace, sde,grant and enablegeodatabase
oracle 空表處理