我的操作系统环境如下:
点击(此处)折叠或打开
[root@gg ~]# lsb_release -a
LSB Version: :base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch
Distributor ID: RedHatEnterpriseServer
Description: Red Hat Enterprise Linux Server release 6.6 (Santiago)
Release: 6.6
Codename: Santiago
我创建了wbg这个用户,来装数据库
需要jdk
点击(此处)折叠或打开
[wbg@gg software]$ java -version
java version "1.7.0_65"
OpenJDK Runtime Environment (rhel-2.5.1.2.el6_5-x86_64 u65-b17)
OpenJDK 64-Bit Server VM (build 24.65-b04, mixed mode)
提前安装一些包,下面的是从history里面,粘贴出来的
点击(此处)折叠或打开
265 yum -y install gcc-*
266 yum -y install gcc-c++*
267 yum -y install libgcc*
268 yum -y install libstdc*
269 yum -y install libstdc++-devel*
270 yum -y install compat-libstdc++*
271 yum -y install libaio*
272 yum -y install libaio-devel*
修改内核参数
[root@gg yum.repos.d]# echo "10000 32000 10000 10000" > /proc/sys/kernel/sem
/proc/sys/kernel/shmall 设置为2097152
[root@ggyum.repos.d]# echo 1073741824 > /proc/sys/kernel/shmmax //这个要给内存的一半
/proc/sys/kernel/shmmni 设置为4096
/proc/sys/fs/file-max 设置为6815744
[root@ggyum.repos.d]# echo "1024 65000" > /proc/sys/net/ipv4/ip_local_port_range
编辑wbg的.bash_profile,加入如下内容,和Oracle的env是很类似的
点击(此处)折叠或打开
export UP_HOME=/home/wbg/UPDB/updb6
export UP_SID=wbg
export LD_LIBRARY_PATH=$UP_HOME/lib:$UP_HOME/client/lib
export PATH=$PATH:$UP_HOME/bin:$UP_HOME/client/bin
安装软件,只是解压而已,比oracle简单很多
点击(此处)折叠或打开
[wbg@gg UPDB]$ tar -zxvf updb6-bin-FS02-linux64-110345-opt-20150911182108-tested.tar.gz
[wbg@gg UPDB]$ pwd
/home/wbg/UPDB
把license.xml放在$UP_HOME/license这个目录下
软件安装,彻底完成
==============================================
开始手动建库了
用脚本来生成一些配置文件
点击(此处)折叠或打开
[wbg@gg license]$ cd $UP_HOME/config
[wbg@gg config]$ pwd
/home/wbg/UPDB/updb6/config
[wbg@gg config]$ ./gen_tip.sh //手动建库的第一个脚本
Using UP_SID "wbg"
/home/wbg/UPDB/updb6/config/wbg.tip generated //等同于oracle的pfile
/home/wbg/UPDB/updb6/config/psm_commands generated
/home/wbg/UPDB/updb6/client/config/updsn.tbr generated. //等同于oracle的tnsnames.ora
Running client/config/gen_esql_cfg.sh
Done.
启动实例,检查进程
点击(此处)折叠或打开
[wbg@gg config]$ upboot nomount
Listener port = 8629
UPDB 6
UpRight Corporation Copyright (c) 2012. All rights reserved.
UPDB instance started up (NOMOUNT mode).
[wbg@gg config]$ ps -ef|grep upsvr
wbg 2924 1 3 12:20 pts/0 00:00:00 upsvr -t nomount -SVR_SID wbg
wbg 2926 2924 0 12:20 pts/0 00:00:00 upsvr_TBMP -t nomount -SVR_SID wbg
wbg 2927 2924 0 12:20 pts/0 00:00:00 upsvr_WP000 -t nomount -SVR_SID wbg
wbg 2928 2924 0 12:20 pts/0 00:00:00 upsvr_WP001 -t nomount -SVR_SID wbg
wbg 2929 2924 0 12:20 pts/0 00:00:00 upsvr_DBWR -t nomount -SVR_SID wbg
wbg 2930 2924 0 12:20 pts/0 00:00:00 upsvr_RECO -t nomount -SVR_SID wbg
wbg 2983 2791 0 12:20 pts/0 00:00:00 grep upsvr
使用脚本,创建数据库的
点击(此处)折叠或打开
[wbg@gg config]$ upsql sys/updb
upSQL 6
UpRight Corporation Copyright (c) 2012. All rights reserved.
Connected to UPDB.
SQL>
create database "wbg"
user sys identified by updb maxinstances 8 maxdatafiles 100 character set MSWIN949 logfile group 1 'log001.log'
size 100M,
group 2 'log002.log'
size 100M,
group 3 'log003.log'
size 100M
maxloggroups 255 maxlogmembers 8 noarchivelog
datafile 'system001.dtf'
size 100M autoextend on next 100M maxsize unlimited
default temporary tablespace TEMP
tempfile 'temp001.dtf'
size 100M autoextend on next 100M maxsize unlimited extent management local autoallocate
undo tablespace UNDO
datafile 'undo001.dtf'
size 100M autoextend on next 100M maxsize unlimited
extent management local autoallocate;
重启数据库
点击(此处)折叠或打开
[wbg@gg config]$ upboot
Listener port = 8629
UPDB 6
UpRight Corporation Copyright (c) 2012. All rights reserved.
UPDB instance started up (NORMAL mode).
在oracle手动建库之后,会跑3个脚本,这里,kdb也是一样的
点击(此处)折叠或打开
[wbg@gg config]$ cd $UP_HOME/scripts
[wbg@gg scripts]$ pwd
/home/wbg/UPDB/updb6/scripts
[wbg@gg scripts]$ ./system.sh
Enter SYS password:
Enter SYSCAT password:
Dropping agent table...
Creating the role DBA...
Create default system users & roles?(Y/N):
Y
Creating system users & roles...
Creating example users...
Creating virtual tables(1)...
................
Create system tables related to profile?(Y/N):
Y
................
Register dbms_stats job to Job Scheduler?(Y/N):
Y
..................
Create TPR tables?(Y/N):
Y
...................
Done.
For details, check /home/wbg/UPDB/updb6/instance/wbg/log/system_init.log.
手动建库,完成了
完成之后,查看一下
点击(此处)折叠或打开
[wbg@gg config]$ cd $UP_HOME/scripts
[wbg@gg scripts]$ pwd
/home/wbg/UPDB/updb6/scripts
[wbg@gg scripts]$ ./system.sh
Enter SYS password:
Enter SYSCAT password:
Dropping agent table...
Creating the role DBA...
Create default system users & roles?(Y/N):
Y
Creating system users & roles...
Creating example users...
Creating virtual tables(1)...
................
Create system tables related to profile?(Y/N):
Y
................
Register dbms_stats job to Job Scheduler?(Y/N):
Y
..................
Create TPR tables?(Y/N):
Y
...................
Done.
For details, check /home/wbg/UPDB/updb6/instance/wbg/log/system_init.log.
完成之后,查看一下
[wbg@gg scripts]$ upsql sys/updb
upSQL 6
UpRight Corporation Copyright (c) 2012. All rights reserved.
Connected to UPDB.
SQL> select status from v$instance;
STATUS
----------------
NORMAL
1 row selected.
SQL> select name from v$datafile;
NAME
--------------------------------------------------------------------------------
/home/wbg/UPDB/updb6/database/wbg/system001.dtf
/home/wbg/UPDB/updb6/database/wbg/undo001.dtf
/home/wbg/UPDB/updb6/database/wbg/usr001.dtf
/home/wbg/UPDB/updb6/database/wbg/tpr_ts.dtf
4 rows selected.
SQL> select member from v$logfile;
MEMBER
--------------------------------------------------------------------------------
/home/wbg/UPDB/updb6/database/wbg/log001.log
/home/wbg/UPDB/updb6/database/wbg/log002.log
/home/wbg/UPDB/updb6/database/wbg/log003.log
3 rows selected.
该有的都有了,状态也可以了,就这样吧
额。。。赓赓。。。