Oracle 初始化数据 脚本

#!/bin/ksh
install_dir=`pwd`
echo "Please enter the SID of Database :/c"
read  dbsid
echo "Please enter the password of the [system] user:/c"
read  dbpwd
nohup sqlplus system/$dbpwd@$dbsid >/tmp/db_tablespace.out <<EOF
@oracle_xms_tablespace.sql;
@oracle_xms_user.sql;
exit
EOF
echo "The tablespaces and the users created successful."
echo "Please enter the password of the xms_admin user[ABC123]:/c"
read  xmspwd
nohup sqlplus xms_admin/$xmspwd@$dbsid >/tmp/db_install.out <<EOF
@oracle_xms_tables.sql;
@oracle_xms_synonym.sql;
@oracle_xms_init_data.sql;
SET LINESIZE 500 FEEDBACK OFF TRIMSPOOL ON TERMOUT OFF HEAD OFF PAGESIZE 0 term off
SPOOL /tmp/db_info.txt
SELECT count(*) FROM xms_setup;
select count(*) from xms_setup where type=1;
select count(*) from xms_function;
select count(*) from xms_function_item;
select count(*) from xms_item;
select count(*) from xms_role;
select count(*) from xms_role_function;
select count(*) from xms_user;
select count(*) from xms_user_item;
select count(*) from xms_user_role;
select value from xms_setup where name='SYS_ADMIN';
SPOOL OFF
exit
EOF
echo "##########/n"
echo "DataBase install successful."
echo "##########/n"
echo "Checking the data..."
./check_db.ksh </tmp/db_info.txt
echo "##########/n"
echo "Check database finished."
cd $install_dir
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值