|
楼主 |
发表于 2004-5-29 19:41:04
|
显示全部楼层
创建数据库的UNIX SHELL 脚本 [转]
脚本一:newapp1.sh
- #!/bin/sh
- ORACLE_SID=app1
- export ORACLE_SID
- /opt/oracle/product/8.1.7/bin/svrmgrl << EOF
- spool /opt/oracle/product/8.1.7/install/crdb1.log
- connect internal
- startup nomount pfile = /www1/oradata/admin/newapp1/pfile/initapp1.ora
- CREATE DATABASE "app1"
- controlfile reuse
- maxdatafiles 500
- maxinstances 8
- maxlogfiles 32
- character set ZHS16GBK
- national character set ZHS16GBK
- DATAFILE '/oradata/app1/system01.dbf' SIZE 200M
- logfile group 1 ('/opt/oracle/oradata/app1/app1_redo01.log',
- '/oradata/app1/app1_redo01.log') SIZE 20M,
- group 2 ('/opt/oracle/oradata/app1/app1_redo02.log',
- '/oradata/app1/app1_redo02.log') SIZE 20M,
- group 3 ('/opt/oracle/oradata/app1/app1_redo03.log',
- '/oradata/app1/app1_redo03.log') SIZE 20M;
- disconnect
- spool off
- exit
- EOF
复制代码
脚本二:newapp2.sh
脚本三:newapp3.sh
[code]
#!/bin/sh
ORACLE_SID=app1
export ORACLE_SID
/opt/oracle/product/8.1.7/bin/svrmgrl << EOF
spool /opt/oracle/product/8.1.7/install/crdb3.log
connect internal
@/opt/oracle/product/8.1.7/rdbms/admin/catproc.sql;
@/opt/oracle/product/8.1.7/rdbms/admin/caths.sql;
@/opt/oracle/product/8.1.7/rdbms/admin/otrcsvr.sql;
@/opt/oracle/product/8.1.7/rdbms/admin/catexp.sql;
@/opt/oracle/product/8.1.7/rdbms/admin/catdbsyn.sql;
@/opt/oracle/product/8.1.7/rdbms/admin/catdefer.sql;
@/opt/oracle/product/8.1.7/rdbms/admin/catrep.sql;
@/opt/oracle/product/8.1.7/rdbms/admin/dbmspool.sql;
@/opt/oracle/product/8.1.7/rdbms/admin/catparr.sql;
@/opt/oracle/product/8.1.7/rdbms/admin/catblock.sql;
connect system/manager
@/opt/oracle/product/8.1.7/sqlplus/admin/pupbld.sql;
--create the product_profile and user_profile
--CATALOG.SQL, ---加载数据库本身的数据字典视图
--CATPROC.SQL, ---加载PL/SQL使用的PACKAGE
--CATEXP.SQL ---加载EXPORT/IMPORT工具使用的数据字典
disconnect
spool off
exit
EOF
转自: http://www.dbonline.cn/source/oracl...%20database.htm |
|