===============hp 1库的创建报告=================================
作者 shenzhixin
为了压测环境需要,创建数据库。因原来库损坏,需要重建。
1.注释/etc/oratab原来的1库信息。
#ncrmdb1:/oracle/app/oracle/product/11.2.0/db:N
2.修改好静默文件,开始创建数据库
wtucdb1[/oracle/ncrmdb1]#dbca -silent -responseFile /oracle/ncrmdb1/dbca.rsp
复制数据库文件
1% 已完成
3% 已完成
11% 已完成
18% 已完成
26% 已完成
37% 已完成
正在创建并启动 Oracle 实例
40% 已完成
45% 已完成
50% 已完成
55% 已完成
56% 已完成
57% 已完成
60% 已完成
62% 已完成
正在进行数据库创建
66% 已完成
70% 已完成
73% 已完成
85% 已完成
96% 已完成
100% 已完成
有关详细信息, 请参阅日志文件 "/oracle/app/oracle/cfgtoollogs/dbca/ncrmdb1/crmdb1.log"。
备注:如果字符集不符合,需更正。
ALTER DATABASE character set INTERNAL_USE ZHS16GBK;
3.创建表空间
CREATE TABLESPACE d_data DATAFILE '/dev/vgdb01/rd_data_ncrmdb1_20g_01',
'/dev/vgdb01/rd_data_ncrmdb1_20g_02',
'/dev/vgdb01/rd_data_ncrmdb1_20g_03',
'/dev/vgdb01/rd_data_ncrmdb1_20g_04',
'/dev/vgdb01/rd_data_ncrmdb1_20g_05',
'/dev/vgdb01/rd_data_ncrmdb1_20g_06',
'/dev/vgdb01/rd_data_ncrmdb1_20g_07',
'/dev/vgdb01/rd_data_ncrmdb1_20g_08',
'/dev/vgdb01/rd_data_ncrmdb1_20g_09',
'/dev/vgdb01/rd_data_ncrmdb1_20g_10',
'/dev/vgdb01/rd_data_ncrmdb1_20g_11',
'/dev/vgdb01/rd_data_ncrmdb1_20g_12',
'/dev/vgdb01/rd_data_ncrmdb1_20g_13',
'/dev/vgdb01/rd_data_ncrmdb1_20g_14',
'/dev/vgdb01/rd_data_ncrmdb1_20g_15',
'/dev/vgdb01/rd_data_ncrmdb1_20g_16',
'/dev/vgdb01/rd_data_ncrmdb1_20g_17',
'/dev/vgdb01/rd_data_ncrmdb1_20g_18',
'/dev/vgdb01/rd_data_ncrmdb1_20g_19',
'/dev/vgdb01/rd_data_ncrmdb1_20g_20',
'/dev/vgdb01/rd_data_ncrmdb1_20g_21',
'/dev/vgdb01/rd_data_ncrmdb1_20g_22',
'/dev/vgdb01/rd_data_ncrmdb1_20g_23',
'/dev/vgdb01/rd_data_ncrmdb1_20g_24',
'/dev/vgdb01/rd_data_ncrmdb1_20g_25',
'/dev/vgdb01/rd_data_ncrmdb1_20g_26',
'/dev/vgdb01/rd_data_ncrmdb1_20g_27',
'/dev/vgdb01/rd_data_ncrmdb1_20g_28',
'/dev/vgdb01/rd_data_ncrmdb1_20g_29',
'/dev/vgdb01/rd_data_ncrmdb1_20g_30'
LOGGING ONLINE PERMANENT BLOCKSIZE 8192
EXTENT MANAGEMENT LOCAL AUTOALLOCATE SEGMENT SPACE MANAGEMENT AUTO ;
CREATE TABLESPACE i_data DATAFILE
'/dev/vgdb01/ri_data_ncrmdb1_20g_01',
'/dev/vgdb01/ri_data_ncrmdb1_20g_02',
'/dev/vgdb01/ri_data_ncrmdb1_20g_03',
'/dev/vgdb01/ri_data_ncrmdb1_20g_04',
'/dev/vgdb01/ri_data_ncrmdb1_20g_05',
'/dev/vgdb01/ri_data_ncrmdb1_20g_06',
'/dev/vgdb01/ri_data_ncrmdb1_20g_07',
'/dev/vgdb01/ri_data_ncrmdb1_20g_08',
'/dev/vgdb01/ri_data_ncrmdb1_20g_09',
'/dev/vgdb01/ri_data_ncrmdb1_20g_10',
'/dev/vgdb01/ri_data_ncrmdb1_20g_11',
'/dev/vgdb01/ri_data_ncrmdb1_20g_12',
'/dev/vgdb01/ri_data_ncrmdb1_20g_13'
LOGGING ONLINE PERMANENT BLOCKSIZE 8192
EXTENT MANAGEMENT LOCAL AUTOALLOCATE SEGMENT SPACE MANAGEMENT AUTO ;
===================
因默认创建的库不太符合要求,需要做些调整
ALTER TABLESPACE UNDOTBS1 ADD DATAFILE '/dev/vgdb01/rundotbs1_20g_01' ;
ALTER TABLESPACE UNDOTBS1 ADD DATAFILE '/dev/vgdb01/rundotbs1_20g_02' ;
alter system set processes=2000 scope = spfile;
ALTER PROFILE DEFAULT LIMIT PASSWORD_LIFE_TIME UNLIMITED;
ALTER TABLESPACE TEMP ADD TEMPFILE '/dev/vgdb01/rtemptbs1_20g_02';
EXECUTE sys.dbms_metadata_util.load_stylesheets;
4.创建用户common,tbcs,icdpub
比如
create user tbcs
identified by ***** default tablespace D_DATA
temporary tablespace TEMP
profile DEFAULT;
-- Grant/Revoke object privileges
-- Grant/Revoke role privileges
grant connect to tbcs;
grant dba to tbcs;
grant exp_full_database to tbcs;
grant imp_full_database to tbcs;
grant resource to tbcs;
-- Grant/Revoke system privileges
grant advisor to tbcs;
grant create any index to tbcs;
grant create any trigger to tbcs;
grant create any view to tbcs;
grant create public database link to tbcs;
grant create synonym to tbcs;
grant create view to tbcs;
grant debug any procedure to tbcs;
grant debug connect session to tbcs;
grant delete any table to tbcs;
grant drop public database link to tbcs;
grant execute any procedure to tbcs;
grant flashback any table to tbcs;
grant insert any table to tbcs;
grant select any dictionary to tbcs;
grant select any sequence to tbcs;
grant select any table to tbcs;
grant unlimited tablespace to tbcs;
grant update any table to tbcs;
5.开始导数据
CREATE DATABASE LINK to_tcrmdb4_tbcs CONNECT TO tbcs IDENTIFIED BY ****USING 'tcrmdb4';
CREATE DATABASE LINK to_tcrmdb4_com CONNECT TO common IDENTIFIED BY **** USING 'tcrmdb4';
CREATE DATABASE LINK to_tcrmdb4_icdpub CONNECT TO icdpub IDENTIFIED BY **** USING 'tcrmdb4';
impdp common/**** directory=common network_link=to_tcrmdb4_com schemas=common job_name=common ignore=y logfile=com.log
impdp tbcs/**** directory=common network_link=to_tcrmdb4_tbcs schema=tbcs logfile=tbcs.log job_name=tbcs ignore=y parallel=3
impdp icdpub/**** directory=common network_link=to_tcrmdb4_icdpub schemas=icdpub job_name=icdpub ignore=y logfile=icd.log parallel=3 &
6.编译对象。
中国移动信息中心cmo shenzx
2015-4-9
本文出自 “沈鲁技术” 博客,谢绝转载!