Oracle手工建库指南
一:设置环境变量 [oracle@orcl ~]$ cat .bash_profile
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
ORACLE_SID=orcl
ORACLE_BASE=/u01/app/oracle
ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1
EDITOR=vim
NLS_LANG=american_america.AL32UTF8
NLS_DATE_FORMAT=YYYY-MM-DD:HH24:MI:SS
PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin:$PATH
export PATH ORACLE_SID ORACLE_BASE ORACLE_HOME EDITOR NLS_LANG NLS_DATE_FORMAT
alias sqlplus='/usr/local/rlwrap/bin/rlwrap sqlplus'
alias rman='/usr/local/rlwrap/bin/rlwrap rman'
二:准备密码文件和初始化参数文件以及创建数据库脚本
[root@orcl ~]# su - oracle
[oracle@orcl ~]$ cd $ORACLE_HOME/dbs
[oracle@orcl dbs]$ orapwd file=orapworcl password=123456 entries=5
*.db_name=orcl
*.db_block_size=8192
*.sga_target=1677721600
*.undo_management='AUTO'
*.control_files = ('/u01/app/oracle/oradata/orcl/control01.ctl','/u01/app/oracle/oradata/orcl/control012ctl','/u01/app/oracle/oradata/orcl/control03.ctl')
*.user_dump_dest='/u01/app/oracle/admin/orcl/udump'
*.background_dump_dest='/u01/app/oracle/admin/orcl/bdump'
*.core_dump_dest='/u01/app/oracle/admin/orcl/cdump'
[oracle@orcl ~]$ cat $ORACLE_HOME/dbs/initorcl.ora
*.db_name=orcl
*.db_block_size=8192
*.db_file_multiblock_read_count=16
*.db_unique_name='orcl'
*.sga_target=167772160
*.undo_management='AUTO'
*.undo_tablespace='UNDOTBS1'
*.open_cursors=300
*.pga_aggregate_target=16777216
*.processes=1500
*.control_files = ('/u01/app/oracle/oradata/orcl/control01.ctl','/u01/app/oracle/oradata/orcl/control012ctl','/u01/app/oracle/oradata/orcl/control03.ctl')
*.user_dump_dest='/u01/app/oracle/admin/orcl/udump'
*.background_dump_dest='/u01/app/oracle/admin/orcl/bdump'
*.audit_file_dest='/u01/app/oracle/admin/orcl/adump'
*.core_dump_dest='/u01/app/oracle/admin/orcl/cdump'
*.db_recovery_file_dest='/u01/app/oracle/flash_recovery_area'
*.db_recovery_file_dest_size=2147483648
[oracle@orcl ~]$ cat create_db.sql
CREATE DATABASE orcl
USER SYS IDENTIFIED BY "123456"
USER SYSTEM IDENTIFIED BY "123456"
LOGFILE
GROUP 1 ('/u01/app/oracle/oradata/orcl/redo01_1.dbf','/u01/app/oracle/oradata/orcl/redo01_2.dbf') SIZE 150M,
GROUP 2 ('/u01/app/oracle/oradata/orcl/redo02_1.dbf','/u01/app/oracle/oradata/orcl/redo02_2.dbf') SIZE 150M,
GROUP 3 ('/u01/app/oracle/oradata/orcl/redo03_1.dbf','/u01/app/oracle/oradata/orcl/redo03_2.dbf') SIZE 150M
MAXLOGFILES 10
MAXLOGMEMBERS 5
MAXLOGHISTORY 1
MAXDATAFILES 100
MAXINSTANCES 1
CHARACTER SET AL32UTF8
NATIONAL CHARACTER SET AL16UTF16
DATAFILE '/u01/app/oracle/oradata/orcl/system01.dbf' SIZE 2000M REUSE EXTENT MANAGEMENT LOCAL
SYSAUX DATAFILE '/u01/app/oracle/oradata/orcl/sysaux01.dbf' SIZE 800M REUSE
DEFAULT TEMPORARY TABLESPACE temp TEMPFILE '/u01/app/oracle/oradata/orcl/temp01.dbf' SIZE 20M REUSE
相关新闻>>
- 发表评论
-
- 最新评论 更多>>