- 浏览: 7778 次
文章分类
最新评论
back002
alter table user enable row movement;
scp /home/daisy/full.tar.gz root@172.19.2.75:/home/root
netstat -an | grep XXX,
useradd -u 2017 -d /home/username -g cab -s /usr/bin/csh -m cabtimer
评论
11 楼
leocat
2012-07-16
SQL> SET ARRAYSIZE 10000
SQL> SET COPYCOMMIT 10000
SQL> SET COPYTYPECHECK OFF
SQL> SET LONG 1000000
COPY FROM username/password@ora11g_old TO username/password@ora11g replace t USING SELECT * FROM t;
COPY FROM username/password@ora11g_old TO username/password@ora11g create t USING SELECT * FROM t ;
SQL> SET COPYCOMMIT 10000
SQL> SET COPYTYPECHECK OFF
SQL> SET LONG 1000000
COPY FROM username/password@ora11g_old TO username/password@ora11g replace t USING SELECT * FROM t;
COPY FROM username/password@ora11g_old TO username/password@ora11g create t USING SELECT * FROM t ;
10 楼
leocat
2012-07-16
exp username/password@ora11g file=data_bak.dmp tables=table1,table2,table3 buffer=40960000 feedback=10000 statistics=none;
imp username/password@ora11g file=data_bak.dmp fromuser=username touser=username buffer=409600000 commit=y ignore=y feedback=10000;
create directory DPDATA as '/home/oracle/dp'
grant read, write on directory dpdata to username;
expdp username/password@ora11g schemas=username DIRECTORY=DPDATA dumpfile=data.dmp parallel=4
impdp username/password@ora11g schemas=username DIRECTORY=DPDATA dumpfile=data.dmp parallel=4 TABLE_EXISTS_ACTION=REPLACE
imp username/password@ora11g file=data_bak.dmp fromuser=username touser=username buffer=409600000 commit=y ignore=y feedback=10000;
create directory DPDATA as '/home/oracle/dp'
grant read, write on directory dpdata to username;
expdp username/password@ora11g schemas=username DIRECTORY=DPDATA dumpfile=data.dmp parallel=4
impdp username/password@ora11g schemas=username DIRECTORY=DPDATA dumpfile=data.dmp parallel=4 TABLE_EXISTS_ACTION=REPLACE
9 楼
leocat
2012-07-13
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
public class SetOpt
{
// 交集
public List intersect(List ls, List ls2)
{
List list = new ArrayList(Arrays.asList(new Object[ls.size()]));
Collections.copy(list, ls);
list.retainAll(ls2);
return list;
}
// 并集
public List union(List ls, List ls2)
{
List list = new ArrayList(Arrays.asList(new Object[ls.size()]));
Collections.copy(list, ls);
list.addAll(ls2);
return list;
}
// 差集
public List diff(List ls, List ls2)
{
List list = new ArrayList(Arrays.asList(new Object[ls.size()]));
Collections.copy(list, ls);
list.removeAll(ls2);
return list;
}
public String testIn2(String string)
{
StringBuffer strBuff = new StringBuffer(string.length());
for (int i = string.length() - 1; i >= 0; i--)
{
strBuff.append(string.charAt(i));
}
return strBuff.toString();
}
public static synchronized void getInstance()
{
}
public static void main(String[] args)
{
SetOpt opt = new SetOpt();
List l1 = new ArrayList();
l1.add(1);
l1.add(2);
l1.add(3);
l1.add(4);
List l2 = new ArrayList();
l2.add(3);
l2.add(4);
l2.add(5);
l2.add(6);
List intersectList = opt.intersect(l1, l2);
System.out.println("交集:");
for (int i = 0; i < intersectList.size(); i++)
{
System.out.print(intersectList.get(i) + " ");
}
System.out.println();
List unionList = opt.union(l1, l2);
System.out.println("并集:");
for (int i = 0; i < unionList.size(); i++)
{
System.out.print(unionList.get(i) + " ");
}
System.out.println();
List diffList = opt.diff(l1, l2);
System.out.println("差集:");
for (int i = 0; i < diffList.size(); i++)
{
System.out.print(diffList.get(i) + " ");
}
System.out.println();
}
}
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
public class SetOpt
{
// 交集
public List intersect(List ls, List ls2)
{
List list = new ArrayList(Arrays.asList(new Object[ls.size()]));
Collections.copy(list, ls);
list.retainAll(ls2);
return list;
}
// 并集
public List union(List ls, List ls2)
{
List list = new ArrayList(Arrays.asList(new Object[ls.size()]));
Collections.copy(list, ls);
list.addAll(ls2);
return list;
}
// 差集
public List diff(List ls, List ls2)
{
List list = new ArrayList(Arrays.asList(new Object[ls.size()]));
Collections.copy(list, ls);
list.removeAll(ls2);
return list;
}
public String testIn2(String string)
{
StringBuffer strBuff = new StringBuffer(string.length());
for (int i = string.length() - 1; i >= 0; i--)
{
strBuff.append(string.charAt(i));
}
return strBuff.toString();
}
public static synchronized void getInstance()
{
}
public static void main(String[] args)
{
SetOpt opt = new SetOpt();
List l1 = new ArrayList();
l1.add(1);
l1.add(2);
l1.add(3);
l1.add(4);
List l2 = new ArrayList();
l2.add(3);
l2.add(4);
l2.add(5);
l2.add(6);
List intersectList = opt.intersect(l1, l2);
System.out.println("交集:");
for (int i = 0; i < intersectList.size(); i++)
{
System.out.print(intersectList.get(i) + " ");
}
System.out.println();
List unionList = opt.union(l1, l2);
System.out.println("并集:");
for (int i = 0; i < unionList.size(); i++)
{
System.out.print(unionList.get(i) + " ");
}
System.out.println();
List diffList = opt.diff(l1, l2);
System.out.println("差集:");
for (int i = 0; i < diffList.size(); i++)
{
System.out.print(diffList.get(i) + " ");
}
System.out.println();
}
}
8 楼
leocat
2012-07-12
create table ContactNumber as (
select /*+ PARALLEL(tt,8) */ distinct contact_id,
get_primary_mobile(contact_id) as primarymobile,
get_alter_mobiles(contact_id) as alternatemobiles,
get_format_primary_mobile(contact_id) as frmtprimarymobile,
get_format_alter_mobiles(contact_id) as frmtalternatemobiles
from phones@bmsuite tt
);
create index IX_CTNUMBER_CONTACT_ID on CONTACTNUMBER (CONTACT_ID)
tablespace TBS_CABSLAVE_INDEX;
update cab_t_contact_slv ctc set ctc.primarymobile = (select PrimaryMobile from ContactNumber cn where ctc.contactid = cn.contact_id);
update cab_t_contact_slv ctc set ctc.alternatemobiles = (select AlternateMobiles from ContactNumber cn where ctc.contactid = cn.contact_id);
update cab_t_contact_slv ctc set ctc.frmtprimarymobile = (select FrmtPrimaryMobile from ContactNumber cn where ctc.contactid = cn.contact_id);
update cab_t_contact_slv ctc set ctc.frmtalternatemobiles = (select FrmtAlternateMobiles from ContactNumber cn where ctc.contactid = cn.contact_id);
Insert into cab_t_userdatastatistic_slv (USERID, TOTALCONTACTS, TOTALCONTACTLISTS, TOTALFRIENDS, TOTALAPPLICATIONS, ADDRBOOKVERSION, CONTACTSVERSION, CONTACTLISTSVERSION) select userid,0,0,0,0,to_char(sysdate,'YYYYMMDD')||'-00001',to_char(sysdate,'YYYYMMDD')||'-00001',to_char(sysdate,'YYYYMMDD')||'-00001' from cab_t_user@cabmaster;
update cab_t_userdatastatistic_slv ctu set ctu.totalcontacts = (select count(1) from cab_t_contact_slv cts where cts.userid = ctu.userid);
commit;
drop function get_alter_mobiles;
drop function get_primary_mobile;
drop function get_format_alter_mobiles;
drop function get_format_primary_mobile;
drop table ContactNumber;
commit;
select /*+ PARALLEL(tt,8) */ distinct contact_id,
get_primary_mobile(contact_id) as primarymobile,
get_alter_mobiles(contact_id) as alternatemobiles,
get_format_primary_mobile(contact_id) as frmtprimarymobile,
get_format_alter_mobiles(contact_id) as frmtalternatemobiles
from phones@bmsuite tt
);
create index IX_CTNUMBER_CONTACT_ID on CONTACTNUMBER (CONTACT_ID)
tablespace TBS_CABSLAVE_INDEX;
update cab_t_contact_slv ctc set ctc.primarymobile = (select PrimaryMobile from ContactNumber cn where ctc.contactid = cn.contact_id);
update cab_t_contact_slv ctc set ctc.alternatemobiles = (select AlternateMobiles from ContactNumber cn where ctc.contactid = cn.contact_id);
update cab_t_contact_slv ctc set ctc.frmtprimarymobile = (select FrmtPrimaryMobile from ContactNumber cn where ctc.contactid = cn.contact_id);
update cab_t_contact_slv ctc set ctc.frmtalternatemobiles = (select FrmtAlternateMobiles from ContactNumber cn where ctc.contactid = cn.contact_id);
Insert into cab_t_userdatastatistic_slv (USERID, TOTALCONTACTS, TOTALCONTACTLISTS, TOTALFRIENDS, TOTALAPPLICATIONS, ADDRBOOKVERSION, CONTACTSVERSION, CONTACTLISTSVERSION) select userid,0,0,0,0,to_char(sysdate,'YYYYMMDD')||'-00001',to_char(sysdate,'YYYYMMDD')||'-00001',to_char(sysdate,'YYYYMMDD')||'-00001' from cab_t_user@cabmaster;
update cab_t_userdatastatistic_slv ctu set ctu.totalcontacts = (select count(1) from cab_t_contact_slv cts where cts.userid = ctu.userid);
commit;
drop function get_alter_mobiles;
drop function get_primary_mobile;
drop function get_format_alter_mobiles;
drop function get_format_primary_mobile;
drop table ContactNumber;
commit;
7 楼
leocat
2012-07-12
create or replace function get_format_alter_mobiles(p_contactid in varchar2) return varchar2 is
result varchar2(1024);
v_count integer;
begin
select count(1) into v_count from phones@bmsuite where is_primary = 0 and contact_id= p_contactid;
if(v_count >0) then
select replace(wm_concat('+' || "NUMBER"), ',', chr(1)) into result
from (select "NUMBER"
from (select "NUMBER"
from phones@bmsuite
where contact_id = p_contactid
and is_primary = 0
order by updated_at desc)
where rownum < 6);
else
result := '';
end if;
return(Result);
end get_format_alter_mobiles;
/
create or replace function get_format_primary_mobile(p_contactid in varchar2) return varchar2 is
result varchar2(255);
v_count integer;
begin
select count(1) into v_count from phones@bmsuite where is_primary = 1 and contact_id= p_contactid;
if (v_count >0) then
select '+'||"NUMBER" into result
from phones@bmsuite
where contact_id = p_contactid
and updated_at = (select max(updated_at)
from phones@bmsuite
where contact_id = p_contactid
and is_primary = 1)
and rownum < 2;
else
result := '';
end if;
return(Result);
end get_format_primary_mobile;
/
result varchar2(1024);
v_count integer;
begin
select count(1) into v_count from phones@bmsuite where is_primary = 0 and contact_id= p_contactid;
if(v_count >0) then
select replace(wm_concat('+' || "NUMBER"), ',', chr(1)) into result
from (select "NUMBER"
from (select "NUMBER"
from phones@bmsuite
where contact_id = p_contactid
and is_primary = 0
order by updated_at desc)
where rownum < 6);
else
result := '';
end if;
return(Result);
end get_format_alter_mobiles;
/
create or replace function get_format_primary_mobile(p_contactid in varchar2) return varchar2 is
result varchar2(255);
v_count integer;
begin
select count(1) into v_count from phones@bmsuite where is_primary = 1 and contact_id= p_contactid;
if (v_count >0) then
select '+'||"NUMBER" into result
from phones@bmsuite
where contact_id = p_contactid
and updated_at = (select max(updated_at)
from phones@bmsuite
where contact_id = p_contactid
and is_primary = 1)
and rownum < 2;
else
result := '';
end if;
return(Result);
end get_format_primary_mobile;
/
6 楼
leocat
2012-07-12
create or replace procedure init_table
as
v_count integer;
begin
select count(*) into v_count from user_tables where table_name = upper('contactnumber');
if v_count > 0 then
execute immediate 'drop table contactnumber';
end if;
end;
/
execute init_table();
/
drop procedure init_table;
create or replace function get_alter_mobiles(p_contactid in varchar2) return varchar2 is
result varchar2(1024);
v_count integer;
begin
select count(1) into v_count from phones@bmsuite where is_primary = 0 and contact_id= p_contactid;
if(v_count >0) then
select replace(wm_concat("NUMBER"), ',', chr(1)) into result
from (select "NUMBER"
from (select "NUMBER"
from phones@bmsuite
where contact_id = p_contactid
and is_primary = 0
order by updated_at desc)
where rownum < 6);
else
result := '';
end if;
return(Result);
end get_alter_mobiles;
/
create or replace function get_primary_mobile(p_contactid in varchar2) return varchar2 is
result varchar2(255);
v_count integer;
begin
select count(1) into v_count from phones@bmsuite where is_primary = 1 and contact_id= p_contactid;
if (v_count >0) then
select "NUMBER" into result
from phones@bmsuite
where contact_id = p_contactid
and updated_at = (select max(updated_at)
from phones@bmsuite
where contact_id = p_contactid
and is_primary = 1)
and rownum < 2;
else
result := '';
end if;
return(Result);
end get_primary_mobile;
/
as
v_count integer;
begin
select count(*) into v_count from user_tables where table_name = upper('contactnumber');
if v_count > 0 then
execute immediate 'drop table contactnumber';
end if;
end;
/
execute init_table();
/
drop procedure init_table;
create or replace function get_alter_mobiles(p_contactid in varchar2) return varchar2 is
result varchar2(1024);
v_count integer;
begin
select count(1) into v_count from phones@bmsuite where is_primary = 0 and contact_id= p_contactid;
if(v_count >0) then
select replace(wm_concat("NUMBER"), ',', chr(1)) into result
from (select "NUMBER"
from (select "NUMBER"
from phones@bmsuite
where contact_id = p_contactid
and is_primary = 0
order by updated_at desc)
where rownum < 6);
else
result := '';
end if;
return(Result);
end get_alter_mobiles;
/
create or replace function get_primary_mobile(p_contactid in varchar2) return varchar2 is
result varchar2(255);
v_count integer;
begin
select count(1) into v_count from phones@bmsuite where is_primary = 1 and contact_id= p_contactid;
if (v_count >0) then
select "NUMBER" into result
from phones@bmsuite
where contact_id = p_contactid
and updated_at = (select max(updated_at)
from phones@bmsuite
where contact_id = p_contactid
and is_primary = 1)
and rownum < 2;
else
result := '';
end if;
return(Result);
end get_primary_mobile;
/
5 楼
leocat
2012-07-12
alter sequence CAB_S_CONTACTID increment by 149999 nocache;
select CAB_S_CONTACTID.nextval from dual;
alter sequence CAB_S_CONTACTID increment by 1 nocache;
declare
LastValue integer;
begin
loop
select CAB_S_CONTACTID.currval into LastValue from dual;
exit when LastValue >= 200000 - 1;
select CAB_S_CONTACTID.nextval into LastValue from dual;
end loop;
end;
/
alter sequence CAB_S_CONTACTID increment by 1 cache 50000;
alter sequence CAB_S_CONTACTLISTID increment by 198899 nocache;
select CAB_S_CONTACTLISTID.nextval from dual;
alter sequence CAB_S_CONTACTLISTID increment by 1 nocache;
declare
LastValue integer;
begin
loop
select CAB_S_CONTACTLISTID.currval into LastValue from dual;
exit when LastValue >= 200000 - 1;
select CAB_S_CONTACTLISTID.nextval into LastValue from dual;
end loop;
end;
/
alter sequence CAB_S_CONTACTLISTID increment by 1 cache 1000;
alter sequence CAB_S_USERID increment by 195999 nocache;
select CAB_S_USERID.nextval from dual;
alter sequence CAB_S_USERID increment by 1 nocache;
declare
LastValue integer;
begin
loop
select CAB_S_USERID.currval into LastValue from dual;
exit when LastValue >= 200000 - 1;
select CAB_S_USERID.nextval into LastValue from dual;
end loop;
end;
/
alter sequence CAB_S_USERID increment by 1 cache 1000;
select CAB_S_CONTACTID.nextval from dual;
alter sequence CAB_S_CONTACTID increment by 1 nocache;
declare
LastValue integer;
begin
loop
select CAB_S_CONTACTID.currval into LastValue from dual;
exit when LastValue >= 200000 - 1;
select CAB_S_CONTACTID.nextval into LastValue from dual;
end loop;
end;
/
alter sequence CAB_S_CONTACTID increment by 1 cache 50000;
alter sequence CAB_S_CONTACTLISTID increment by 198899 nocache;
select CAB_S_CONTACTLISTID.nextval from dual;
alter sequence CAB_S_CONTACTLISTID increment by 1 nocache;
declare
LastValue integer;
begin
loop
select CAB_S_CONTACTLISTID.currval into LastValue from dual;
exit when LastValue >= 200000 - 1;
select CAB_S_CONTACTLISTID.nextval into LastValue from dual;
end loop;
end;
/
alter sequence CAB_S_CONTACTLISTID increment by 1 cache 1000;
alter sequence CAB_S_USERID increment by 195999 nocache;
select CAB_S_USERID.nextval from dual;
alter sequence CAB_S_USERID increment by 1 nocache;
declare
LastValue integer;
begin
loop
select CAB_S_USERID.currval into LastValue from dual;
exit when LastValue >= 200000 - 1;
select CAB_S_USERID.nextval into LastValue from dual;
end loop;
end;
/
alter sequence CAB_S_USERID increment by 1 cache 1000;
4 楼
leocat
2012-07-12
alter table cab_t_user drop constraint PK_USER;
alter table cab_t_user rename to cab_t_user_bak;
create table cab_t_user
(
USERID VARCHAR2(32) not null,
BMSuiteUserID VARCHAR2(28) not null,
Account VARCHAR2(128) not null,
SipURI VARCHAR2(128),
PrimaryMobile VARCHAR2(21),
Status number(1) not null,
RegisterTime TIMESTAMP not null,
LastUpdateTime TIMESTAMP not null,
LastChangeTime TIMESTAMP,
OldPrimaryMobile VARCHAR2(32),
UnregisterTime TIMESTAMP,
DataDeleteDate DATE,
ConflictStrategy number(1) not null,
Email varchar2(64) null,
UserType Integer not null,
LastUserDigStartTime TIMESTAMP default to_timeStamp('2000-01-01 01:00:00.000','YYYY-MM-DD HH:MI:SSXFF PM'),
HomeLocation VARCHAR2(5),
CountryCode VARCHAR2(5)
)partition by hash(userid)(
partition user_data_1 tablespace tbs_cabmaster_data,
partition user_data_2 tablespace tbs_cabmaster_data,
partition user_data_3 tablespace tbs_cabmaster_data,
partition user_data_4 tablespace tbs_cabmaster_data,
partition user_data_5 tablespace tbs_cabmaster_data,
)TABLESPACE tbs_cabmaster_data;
alter table cab_t_user nologging;
insert /*+ APPEND */ into cab_t_user(USERID,BMSuiteUserID,Account,SipURI,PrimaryMobile,Status,RegisterTime,LastUpdateTime,LastChangeTime,OldPrimaryMobile,UnregisterTime,DataDeleteDate,ConflictStrategy,Email,UserType,LastUserDigStartTime)
select USERID,BMSuiteUserID,Account,SipURI,PrimaryMobile,Status,RegisterTime,LastUpdateTime,LastChangeTime,OldPrimaryMobile,UnregisterTime,DataDeleteDate,ConflictStrategy,Email,UserType,LastUserDigStartTime from cab_t_user_bak;
alter table cab_t_user add constraint PK_USER primary key (USERID) USING INDEX local TABLESPACE tbs_cabmaster_index;
alter table cab_t_user logging;
alter table cab_t_profilephoto drop constraint PK_CAB_T_PROFILEPHOTO;
alter table cab_t_profilephoto add partition profilephoto_data_3 tablespace tbs_cabmaster_data;
alter table cab_t_profilephoto add partition profilephoto_data_4 tablespace tbs_cabmaster_data;
alter table cab_t_profilephoto add partition profilephoto_data_5 tablespace tbs_cabmaster_data;
alter table cab_t_profilephoto add constraint PK_CAB_T_PROFILEPHOTO primary key (USERID) USING INDEX local TABLESPACE tbs_cabmaster_index;
create index IX_PROFILE_PrimaryEMAIL on cab_t_profile (PrimaryEmail ASC) TABLESPACE tbs_cabmaster_index;
create index IX_PROFILEACCOUNT_ACCOUNTNAME on cab_t_profileaccount (AccountName ASC) TABLESPACE tbs_cabmaster_index;
create index IX_PROFILEACCOUNT on cab_t_profileaccount(USERID ASC,SrvType ASC,IsPrimaryFlag ASC) local TABLESPACE tbs_cabmaster_index;
create index IX_PROFILESC_USERID on cab_t_profileschool(USERID ASC) local TABLESPACE tbs_cabmaster_index;
commit;
alter table cab_t_user rename to cab_t_user_bak;
create table cab_t_user
(
USERID VARCHAR2(32) not null,
BMSuiteUserID VARCHAR2(28) not null,
Account VARCHAR2(128) not null,
SipURI VARCHAR2(128),
PrimaryMobile VARCHAR2(21),
Status number(1) not null,
RegisterTime TIMESTAMP not null,
LastUpdateTime TIMESTAMP not null,
LastChangeTime TIMESTAMP,
OldPrimaryMobile VARCHAR2(32),
UnregisterTime TIMESTAMP,
DataDeleteDate DATE,
ConflictStrategy number(1) not null,
Email varchar2(64) null,
UserType Integer not null,
LastUserDigStartTime TIMESTAMP default to_timeStamp('2000-01-01 01:00:00.000','YYYY-MM-DD HH:MI:SSXFF PM'),
HomeLocation VARCHAR2(5),
CountryCode VARCHAR2(5)
)partition by hash(userid)(
partition user_data_1 tablespace tbs_cabmaster_data,
partition user_data_2 tablespace tbs_cabmaster_data,
partition user_data_3 tablespace tbs_cabmaster_data,
partition user_data_4 tablespace tbs_cabmaster_data,
partition user_data_5 tablespace tbs_cabmaster_data,
)TABLESPACE tbs_cabmaster_data;
alter table cab_t_user nologging;
insert /*+ APPEND */ into cab_t_user(USERID,BMSuiteUserID,Account,SipURI,PrimaryMobile,Status,RegisterTime,LastUpdateTime,LastChangeTime,OldPrimaryMobile,UnregisterTime,DataDeleteDate,ConflictStrategy,Email,UserType,LastUserDigStartTime)
select USERID,BMSuiteUserID,Account,SipURI,PrimaryMobile,Status,RegisterTime,LastUpdateTime,LastChangeTime,OldPrimaryMobile,UnregisterTime,DataDeleteDate,ConflictStrategy,Email,UserType,LastUserDigStartTime from cab_t_user_bak;
alter table cab_t_user add constraint PK_USER primary key (USERID) USING INDEX local TABLESPACE tbs_cabmaster_index;
alter table cab_t_user logging;
alter table cab_t_profilephoto drop constraint PK_CAB_T_PROFILEPHOTO;
alter table cab_t_profilephoto add partition profilephoto_data_3 tablespace tbs_cabmaster_data;
alter table cab_t_profilephoto add partition profilephoto_data_4 tablespace tbs_cabmaster_data;
alter table cab_t_profilephoto add partition profilephoto_data_5 tablespace tbs_cabmaster_data;
alter table cab_t_profilephoto add constraint PK_CAB_T_PROFILEPHOTO primary key (USERID) USING INDEX local TABLESPACE tbs_cabmaster_index;
create index IX_PROFILE_PrimaryEMAIL on cab_t_profile (PrimaryEmail ASC) TABLESPACE tbs_cabmaster_index;
create index IX_PROFILEACCOUNT_ACCOUNTNAME on cab_t_profileaccount (AccountName ASC) TABLESPACE tbs_cabmaster_index;
create index IX_PROFILEACCOUNT on cab_t_profileaccount(USERID ASC,SrvType ASC,IsPrimaryFlag ASC) local TABLESPACE tbs_cabmaster_index;
create index IX_PROFILESC_USERID on cab_t_profileschool(USERID ASC) local TABLESPACE tbs_cabmaster_index;
commit;
3 楼
leocat
2012-07-12
create or replace procedure init_index
as
v_count integer;
begin
select count(*) into v_count from all_ind_columns where table_name = upper('cab_t_user') and index_name = upper('IX_USER_SipURI');
if v_count > 0 then
execute immediate 'drop index IX_USER_SipURI';
end if;
select count(*) into v_count from all_ind_columns where table_name = upper('cab_t_user') and index_name = upper('IX_USER_LastUpdateTime');
if v_count > 0 then
execute immediate 'drop index IX_USER_LastUpdateTime';
end if;
end;
/
execute init_index();
/
drop procedure init_index;
alter table cab_t_profileschool rename to cab_t_profileschool_bak;
create table cab_t_profileschool
(
USERID VARCHAR2(32) not null,
School VARCHAR2(64) not null,
Major VARCHAR2(128),
Batch VARCHAR2(32),
LastUpdateTime TIMESTAMP not null
)partition by hash(userid)(
partition profileschool_data_1 tablespace tbs_cabmaster_data,
partition profileschool_data_2 tablespace tbs_cabmaster_data,
partition profileschool_data_3 tablespace tbs_cabmaster_data,
)TABLESPACE tbs_cabmaster_data;
alter table cab_t_profileschool nologging;
insert /*+ APPEND */ into cab_t_profileschool(USERID,School,Major,Batch,LastUpdateTime)
select USERID,School,Major,Batch,LastUpdateTime from cab_t_profileschool_bak;
alter table cab_t_profileschool logging;
as
v_count integer;
begin
select count(*) into v_count from all_ind_columns where table_name = upper('cab_t_user') and index_name = upper('IX_USER_SipURI');
if v_count > 0 then
execute immediate 'drop index IX_USER_SipURI';
end if;
select count(*) into v_count from all_ind_columns where table_name = upper('cab_t_user') and index_name = upper('IX_USER_LastUpdateTime');
if v_count > 0 then
execute immediate 'drop index IX_USER_LastUpdateTime';
end if;
end;
/
execute init_index();
/
drop procedure init_index;
alter table cab_t_profileschool rename to cab_t_profileschool_bak;
create table cab_t_profileschool
(
USERID VARCHAR2(32) not null,
School VARCHAR2(64) not null,
Major VARCHAR2(128),
Batch VARCHAR2(32),
LastUpdateTime TIMESTAMP not null
)partition by hash(userid)(
partition profileschool_data_1 tablespace tbs_cabmaster_data,
partition profileschool_data_2 tablespace tbs_cabmaster_data,
partition profileschool_data_3 tablespace tbs_cabmaster_data,
)TABLESPACE tbs_cabmaster_data;
alter table cab_t_profileschool nologging;
insert /*+ APPEND */ into cab_t_profileschool(USERID,School,Major,Batch,LastUpdateTime)
select USERID,School,Major,Batch,LastUpdateTime from cab_t_profileschool_bak;
alter table cab_t_profileschool logging;
2 楼
leocat
2012-07-12
#!/bin/bash
export LANG=en_US.UTF-8
export NLS_LANG=AMERICAN_AMERICA.AL32UTF8
dbname=$3
username=$1
userpwd=$2
parameterNum=$#
oracleport=1521
echo "$dbname"
echo "$#"
echo "---------------------------------"
echo "database name = : $dbname"
echo "user's name = $username"
echo "user's password = $userpwd"
echo "---------------------------------"
validate()
{
if [ $parameterNum -ne 3 ]
then
echo "parameter error";
exit 1;
fi
}
validate
sqlplus $username/$userpwd@$dbname <<EOF
spool update.cabmaster.log
@rollbackTable.sql;
prompt "rollbackTable.sql success..."
spool off
exit ;
EOF
export LANG=en_US.UTF-8
export NLS_LANG=AMERICAN_AMERICA.AL32UTF8
dbname=$3
username=$1
userpwd=$2
parameterNum=$#
oracleport=1521
echo "$dbname"
echo "$#"
echo "---------------------------------"
echo "database name = : $dbname"
echo "user's name = $username"
echo "user's password = $userpwd"
echo "---------------------------------"
validate()
{
if [ $parameterNum -ne 3 ]
then
echo "parameter error";
exit 1;
fi
}
validate
sqlplus $username/$userpwd@$dbname <<EOF
spool update.cabmaster.log
@rollbackTable.sql;
prompt "rollbackTable.sql success..."
spool off
exit ;
EOF
1 楼
leocat
2012-07-12
#!/bin/bash
export LANG=en_US.UTF-8
export NLS_LANG=AMERICAN_AMERICA.AL32UTF8
dbname=$3
username=$1
userpwd=$2
parameterNum=$#
oracleport=1521
echo "$dbname"
echo "$#"
echo "---------------------------------"
echo "database name = : $dbname"
echo "user's name = $username"
echo "user's password = $userpwd"
echo "---------------------------------"
validate()
{
if [ $parameterNum -ne 3 ]
then
echo "parameter error";
exit 1;
fi
}
validate
sqlplus $username/$userpwd@$dbname <<EOF
spool update.cabmaster.log
WHENEVER SQLERROR EXIT 1
@cab_maindb_tables.sql
prompt "cab_maindb_tables.sql success..."
spool off
exit ;
EOF
export LANG=en_US.UTF-8
export NLS_LANG=AMERICAN_AMERICA.AL32UTF8
dbname=$3
username=$1
userpwd=$2
parameterNum=$#
oracleport=1521
echo "$dbname"
echo "$#"
echo "---------------------------------"
echo "database name = : $dbname"
echo "user's name = $username"
echo "user's password = $userpwd"
echo "---------------------------------"
validate()
{
if [ $parameterNum -ne 3 ]
then
echo "parameter error";
exit 1;
fi
}
validate
sqlplus $username/$userpwd@$dbname <<EOF
spool update.cabmaster.log
WHENEVER SQLERROR EXIT 1
@cab_maindb_tables.sql
prompt "cab_maindb_tables.sql success..."
spool off
exit ;
EOF
相关推荐
【办公空间3D模型】是3D设计领域中一种重要的资源,主要用于模拟真实世界的办公环境,为设计师提供直观的设计参考和展示工具。这种模型通常包含了详细的几何形状、纹理、材质和光照信息,使得设计师能够在虚拟环境中...
综上所述,微云游戏引擎文档002详细介绍了系统事件的处理机制,包括事件的派发、各类事件处理器的实现、坐标系转换、点击测试以及Back键和动作跟踪的处理策略,为开发者构建交互丰富、响应迅速的游戏界面提供了坚实...
Imaging - Front-to-Back = /- .002” (50 μm) Lamination - layer-to-layer registration = /- .004” (100 μm) Drill - Drill tolerance = /- .003” (75 μm) Total Tolerance = .009” (225 μm) Advanced...
在实验报告中,讨论了单周期CPU的实现方法,包括指令的fetch、decode、execute、memory access和write back等阶段。 4. 测试单周期CPU的方法:为了测试单周期CPU的正确性,需要设计测试用例,包括算术运算、逻辑...
选择菜单中的Geometry>Add visible,或者双击模型树区的,定义模型中所需要的8个变量:lam=3、dis=2.5、len=lam/2、rad=1、seg_len=(lam/15)/1.2、segrad=0.002、tri_len=(lam/6.3)/1.2、f_len=0.99*seg_len。...
对于`getSensorDividedByType`函数,其测试用例`BACK_001_API_002`旨在确认当`groupId`不存在时返回空哈希表,存在时返回包含按类型分组的传感器列表的`Map, List<Sensor>>`。同样,我们需要测试各种边界情况,如`...
在传统的MIPS多周期CPU设计中,指令执行通常分为五个阶段:取指(Fetch)、解码(Decode)、执行(Execute)、访存(Memory)和写回(Write Back)。每个阶段都在一个独立的时钟周期内完成,以形成流水线,使得在...
4. 清理注册表:使用注册表编辑器(regedit)删除与MySQL相关的键,包括HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001, ControlSet002和CurrentControlSet中的MySQL项。 5. 清理应用数据:删除所有用户文件夹下的...
* GoBack的不是背后的数据进行排序 * 错误UPRO名为/使用列表错误忘记报名IMS * 空间不足 * 区域太小 S0C5-COBOL开关改变 * 定义错误 S0C6-错误的系统上运行 * ##DB2,而不是BMP * 程序将不会关闭打开的文件 * ...
2. 动词短语:如"try to say","hold my nose","take it back"。 3. 描述物品特性的词汇:如"strange smell","green silk"。 4. 非谓语动词:"knowing what Zip's first present was","trying to clean a spot"。...
实验结果显示,特定的磨削参数组合下,如vs=20 m/s,vf=27 m/min,ap=0.005 mm时,表面偏斜度最小,而当vs=29 m/s,vf=23 m/min,ap=0.002 mm时,表面峰度最小。 接下来,作者引入了BP(Back Propagation)神经网络...
void addStudent(const std::string& studentID) { students.push_back(studentID); } void removeStudent(const std::string& studentID) { students.erase(std::remove(students.begin(), students.end(), ...
欢迎来到诺丁山大门 您可以使用此网站收听在线音频或将其下载为.zip文件。 教程 主题1 [A2早在美国](/ NHG-T1 / 002_Th1_TB_A2_Back_in the_USA.mp3) 主题2 主题3 主题4 主题5 主题6
5. **写回结果(Write Back Result):**将处理结果写回到指定的位置。 **测试程序、数据及运行结果:** - **测试内容:**立即数寻址、直接寻址 - **测试指令(或程序):**`MOV #5678H, 0010H` - **机器码:**`...
DELETE FROM xsxxb WHERE xh IN ('002', '004'); DELETE FROM xsxxb; ``` #### 三、统计函数与转换函数 **1. 统计函数** - **AVG**:计算平均值,忽略NULL值。 - **COUNT**:计算行数,可选择是否包含NULL值。...
在本案例中,我们旨在通过使用BP(Back Propagation)算法来实现一个简单的二元“异或”(XOR)逻辑门的功能。BP算法是神经网络训练中最常用的一种方法,它基于梯度下降法来调整网络中的权重参数,使得网络输出能够...
BP(Back Propagation)神经网络是一种多层前馈网络,并且具有反向传播算法来进行学习的一种典型人工神经网络模型。在机器学习领域,BP神经网络被广泛应用于模式识别、分类、预测等任务中。本文将详细介绍如何使用...
- STX(002):正文开始,用于数据包的分隔。 - ETX(003):正文结束,标记数据包的结尾。 - EOT(004):传输结束,告知接收端传输已完成。 - ENQ(005):询问,请求响应。 - ACK(006):承认,接收端接收...
它有悠久的历史, Dating back to 1993, when the Wuqiao County Government and Hong Kong China Travel Service jointly invested in the construction of the "Wuqiao Acrobatic World", which has become a ...