2012年7月19日星期四

oracle passord file

错误日志:Oracle启动报ORA-01031: insufficient privileges错误!
解决:
C:/Documents and Settings>orapwd file=%ORACLE_HOME%/database/PWD%ORACLE_SID%.ora password=sys entries=5
orapwd
注释:271338.1
1.Ensure REMOTE_LOGIN_PASSWORDFILE=EXCLUSIVE is set in the init.ora for the database
密码文件是有格式的
2.Create a password file:
Unix: $ orapwd file=$ORACLE_HOME/dbs/orapwd$ORACLE_SID password=sys entries=5
Windows: C:/> orapwd file=%ORACLE_HOME%/database/pwd%ORACLE_SID% password= sys entries=5

3. grant sysdba to sys;
4. alter user sys identified by sys; --重新修改下密码

move table/index/lob column/partiton table/partiton index

-- purge recyclebin
purge user_recyclebin ;
-- move table to dest_data
select 'alter table '||segment_name||' move tablespace
dest_data ;' from user_segments where segment_type='TABLE';
-- move index to
dest_data
select 'alter index '||segment_name||' rebuild tablespace dest_data ;' from user_segments where segment_type='INDEX';
-- move lob column
select 'alter table '||table_name||' move lob ('||column_name||') store as (tablespace
dest_data) ;' from user_lobs ;
-- move partition table
select 'alter table '||table_name||' move partition '||partition_name||' tablespace
dest_data ;' from user_tab_partitions ;
-- move partiton index
select 'alter index '||index_name||' rebuild partition '||partition_name||' tablespace
dest_data ;' from user_ind_partitions ;