redhat 4 上的oracle,sybase,db2 安装 恢复

阅读更多
这几个数据库安装的时候,注意把环境变量设置起来
它们有相应的角本文件如SYBASE.sh,Oracle.sh...

db2:
1. 启动实例(db2inst1):
db2start
2. 停止实例(db2inst1):
db2stop
3. 列出所有实例(db2inst1)
db2ilist
5.列出当前实例:
db2 get instance
4. 察看示例配置文件:
db2 get dbm cfg|more
5. 更新数据库管理器参数信息:
db2 update dbm cfg using para_name para_value
6. 创建数据库:
db2 create db test
7.连接数据库
db2 connect to test

db2set DB2COMM=tcpip     ;; 设置允许 db2 通过 tcpip 方式访问
db2 => update database manager configuration using svcename server1|60000

先以root 安装,然后加数据库,用户 最后导入
imp
------
1 create database demo about chinese charset
2 change user to db2inst1
3 go to /opt/linux_software/db2
4 db2 restore db demo redirect
5 db2 "set tablespace containers for 3 using (file '/home/db2inst1/db2inst1/NODE0000/demoS/TSC1' 9012)"
6 db2 "set tablespace containers for 4 using (file '/home/db2inst1/db2inst1/NODE0000/demoS/TSC2' 3000)"
7 db2 restore db cats continue
-----


oracle:
isql
SQL> startup
SQL> connect sys as sysdba

lsnrctl status

create user demo identified by values 'demo';
grant dba to demo with admin option;
grant unlimited tablespace to demo with admin option;

emctl start dbconsole
   url: http://localhost:1158/em/console/aboutApplication
isqlplusctl start


sybase:
isql -Usa -SLOCALHOST -Pdemo -Hlocalhost

dump database demo to '/export/...../demo.dmp'
   go

创建数据库设备 2G
disk init name='demo_dbdev', physname='/opt/sybase/data/demo_dbdev.dat', vdevno=10,size=1024000
go
disk init name='demo_logdev', physname='/opt/sybase/data/demo_logdev.dat', vdevno=11,size=51200
go
创建数据库DB,其大小为1024M,日志大小为512M
create database demo on demo_dbdev=1024 log on demo_logdev=512
go
alter database demo on demo_dbdev=1024
go
删除设备
sp_dropdevice demo_dbdev
go
sp_dropdevice demo_logdev
go
load database demo from '/opt/software/demo0.dmp'
go
online database demo
go

sp_post_xpload
go

加用户
sp_addlogin demo,demo,@fullname="demo"
grant role sa_role to demo
use demo2
sp_changedbowner demo

sp__helpdb         Database Information
sp__helpdevice         Break down database devices into a nice report







你可能感兴趣的:(Sybase,DB2,RedHat,Oracle,Go)