最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

Oracle數(shù)據(jù)庫遷移方案

 更新時間:2016年11月27日 14:21:38   作者:BeyondYourself  
這篇文章主要介紹了Oracle數(shù)據(jù)庫遷移方案的相關(guān)資料,非常不錯,具有參考借鑒價值,需要的朋友可以參考下

1 在數(shù)據(jù)遷移時,用戶首先有權(quán)限修改數(shù)據(jù)庫,并且進(jìn)行表空間創(chuàng)建、刪除等權(quán)利

例如:

select * from dba_tab_privs where grantee='SCOT'; ---查看SCOTT權(quán)限(sys用戶登錄)

顯示結(jié)果為:

select * from dba_role_privs where grantee='SCOT'; --查看SCOTT角色

顯示結(jié)果為:

(1) 如果用戶被鎖定通過以下語句來解鎖表

alter user scott account unlock; --解鎖表

(2) 授予用戶權(quán)限

grant connect to scott; --連接數(shù)據(jù)庫權(quán)限
grant resource to scott; --授予創(chuàng)建表等基本權(quán)限
grant dba to scott; --授予DBA權(quán)限

2 建立表空間

嚴(yán)格意義上在先執(zhí)行如下命令而不是直接開始建立表空間

drop tablespace 表空間名稱;

然后開始創(chuàng)建表空間

create tablespace xx_bp;
datafile 'F:\app\xx_bp.ora' --表空間的本地位置
size 50M
autoextend on next 1M;

附:datafile 為表空間對應(yīng)的數(shù)據(jù)文件,后面跟隨數(shù)據(jù)文件的路徑及數(shù)據(jù)文件名

size 為數(shù)據(jù)文件的初始大小

autoextend on 表示數(shù)據(jù)隨著數(shù)據(jù)量的增加自動擴(kuò)大
一般在創(chuàng)建表的時候會創(chuàng)建多個表空間用來存放各種數(shù)據(jù),比如我們一般會創(chuàng)建歷史表空間(HS)、索引表空間等。另外先建立表空間,然后建立用戶時指向此表空間,否則oracle會默認(rèn)將用戶指向sys表空間

3 創(chuàng)建用戶

create user 用戶名 indentified by 密碼 tablespace xx_bp,xx_hs,xx_indx;

附: identified by 為創(chuàng)建用戶密碼的關(guān)鍵字,后面跟隨的是用戶密碼

4 對數(shù)據(jù)庫的用戶進(jìn)行授權(quán)

grant connect,resource to 用戶名

將connect 和resource 角色授予用戶

查看當(dāng)前用戶有哪些角色

select * from user_role_privs;

5 建立數(shù)據(jù)結(jié)構(gòu)、存儲過程、視圖、序列

(1)創(chuàng)建表

create table XX.BP_OPER_DETAIL_TB
(
task_id VARCHAR2(50) not null,
flow_id NUMBER(19) not null,
task_no VARCHAR2(50) not null,
flow_node VARCHAR2(4) not null,
workitemid NUMBER(19) not null,
trans_id VARCHAR2(10) not null,
trans_no CHAR(6) not null,
vouch_group VARCHAR2(10) not null,
teller_no VARCHAR2(15) default '',
user_no VARCHAR2(15) not null,
organ_no VARCHAR2(10) not null,
areacode VARCHAR2(5) default '',
create_time CHAR(14) not null,
checkout_time CHAR(14) not null,
checkin_time CHAR(14) default '',
suspend_time CHAR(14) default '',
resume_time CHAR(14) default '',
trans_time INTEGER default 0,
release_time INTEGER default 0,
state INTEGER not null,
result VARCHAR2(10) default '',
reason VARCHAR2(512) default ''
)
tablespace XX_BP pctfree 10 initrans 1 maxtrans 255 storage
(
initial 64K next 8K minextents 1 maxextents unlimited
);

創(chuàng)建索引約束調(diào)節(jié)等

alter table XX.BP_OPER_DETAIL_TB add constraint BP_OPER_DETAIL_PK primary key
(
TASK_ID, WORKITEMID, FLOW_NODE
)
using index tablespace XX_BP pctfree 10 initrans 2 maxtrans 255 storage
(
initial 64K next 1M minextents 1 maxextents unlimited
);

6 導(dǎo)入數(shù)據(jù)

insert into SM_FIELD_PARENT_TB (field_id, parent_field, last_modi_date)
values ('VH0007', 'VH0000', '20160420074707');
insert into SM_FIELD_PARENT_TB (field_id, parent_field, last_modi_date)
values ('VH0008', 'VH0000', '20160420074729');
insert into SM_FIELD_PARENT_TB (field_id, parent_field, last_modi_date)
values ('VH0010', 'VH0000', '20160420074818');
insert into SM_FIELD_PARENT_TB (field_id, parent_field, last_modi_date)
values ('VH0012', 'VH0000', '20160420074914');
insert into SM_FIELD_PARENT_TB (field_id, parent_field, last_modi_date)
values ('VH0016', 'VH0000', '20160420075055');
insert into SM_FIELD_PARENT_TB (field_id, parent_field, last_modi_date)
values ('VH0017', 'VH0000', '20160420075129');
insert into SM_FIELD_PARENT_TB (field_id, parent_field, last_modi_date)
values ('VH0021', 'VH0000', '20160420075305');
commit;

最后重新登陸數(shù)據(jù)庫,驗證新增的遷移數(shù)據(jù)庫

相關(guān)文章

最新評論

乐昌市| 隆化县| 宁波市| 隆德县| 渝北区| 永靖县| 彰武县| 中宁县| 乐昌市| 张家口市| 贵溪市| 准格尔旗| 铁力市| 武胜县| 东安县| 门头沟区| 蓬溪县| 崇信县| 灵宝市| 海安县| 麻城市| 台东县| 翼城县| 西和县| 耒阳市| 红河县| 黄梅县| 齐河县| 道孚县| 舟曲县| 浙江省| 昌宁县| 朝阳区| 瓮安县| 新乡市| 新民市| 湖南省| 安化县| 兴义市| 昌平区| 珠海市|