Delete primary key (the primary key value for the Vertica database is not unique):
SELECT analyze_constraints (' Fb_s.c_log ');
Locate the key name, and then:
ALTER TABLE fb_s.c_log DROP CONSTRAINT c_primary
SELECT analyze_constraints (' Fb_s.user_info ');
ALTER TABLE fb_s.user_info DROP CONSTRAINT c_primary;
Build users and schemas:
CREATE user fb_s_sql identified by ' password ';
CREATE SCHEMA Fb_s_sql;
gives permission:
GRANT all on SCHEMA fb_s_sql to Fb_s_sql;
GRANT all on SCHEMA fb_s to Fb_s_sql;
GRANT All on TABLE fb_s_sql.sqllog to Fb_s_sql;
Build table:
CREATE table Fb_s.c_log (
uid int not NULL,
Cash int,
Gold int,
level int,
Rtime dat ETime,
Tid varchar (m),
Act varchar,
Item varchar (+),
value int,
value2 int,
time datetime);
CREATE TABLE fb_s.new_c_log (
uid integer PRIMARY KEY not NULL,
Cash integer,
Gold integer,
leve L Integer,
rtime datetime,
tid varchar,
Act varchar,
ITEM varchar,
value integer,
value2 integer,
time datetime not NULL
)
PARTITION by EXTRACT Time) *100 + EXTRACT (month from time); The
is followed by the Time field partition
to add and modify fields:
ALTER TABLE fb_s.c_logadd COLUMN value2 integer default 0;
Alter TABLE Fb_s.c_log alter COLUMN duration SET DEFAULT 0;
Alter TABLE Fb_s.c_log alter COLUMN MESG SET DEFAULT ';
Guide data between two tables:
INSERT INTO Fb_s.c_log (uid,cash,gold,level,rtime,tid,act,item,value,value2,time)
( SELECT * from Fb_s.c_logbak); Data between
Two libraries:
Exporting in Source Library:
vsql-d topcity-u dbadmin-w password-f ', '-at-o fs_user_info.csv-c ' Sele CT * from Fb_s.user_info; "The
vsql-d topcity-u dbadmin-w password-f ', '-at-o fs_c_log.csv-c" select * from F B_s.c_log
Destination Gallery import:
COPY fb_s.user_info from '/opt/fs_user_info.csv ' exceptions '/tmp/exp.log ' DELIMITER ', ';
COPY fb_s.c_log from '/opt/fs_c_log.csv ' exceptions '/tmp/exp.log ' DELIMITER ', ';
Ps:
Does it feel like the great God has nothing to do, want to worship God's email to zhe-jiang.he@hp.com.
Give me a vote on HP's Tomorrow star, Oh, kiss!