在RedHat5上手动创建数据库

2020年3月17日00:27:14
评论

我们这道在Linux上我们可以通过dbca创建数据库,但是我们也能以命令行的模式创建数据库,下面我们说说他的方法

1,首先查看以下我们要创建的数据库名

[[email protected] ~]$ echo $ORACLE_SID
orcl
如果没有设置可以作如下设置
export ORACLE_SID=orcl

2,首先创建一个实例参数文件(pfile)这里命名为pfileorcl.ora
#vim $ORACLE_HOME/dbs/pfileorcl.ora在里面输入下面内容
db_name=orcl
db_domain=example.com
db_files=1000
processes=600
statistics_level=typical
db_block_size=8192
audit_trail=none
background_dump_dest='/u01/app/admin/orcl/bdump'
core_dump_dest='/u01/app/admin/orcl/adump'
control_files=('/u02/oradata/orcl/control01.ctl',
'/u02/oradata/orcl/control02.ctl','/u02/oradata/orcl/control03.ctl')
sga_target=400M
pga_aggregate_target=400M
db_file_multiblock_read_count=16
log_archive_format='log%t_%s_%r.arc'
optimizer_mode=all_rows
remote_login_passwordfile=none
undo_management=auto
undo_retention=7200

3,创建必要的目录
# mkdir -pv /u01/app/admin/orcl/{adump,bdump,dbump}
mkdir: created directory `/u01/app/admin'
mkdir: created directory `/u01/app/admin/orcl'
mkdir: created directory `/u01/app/admin/orcl/adump'
mkdir: created directory `/u01/app/admin/orcl/bdump'
mkdir: created directory `/u01/app/admin/orcl/dbump'
更改它们的权限
# chmod 775 -Rv /u01/app/admin/
mode of `/u01/app/admin/' changed to 0775 (rwxrwxr-x)
mode of `/u01/app/admin/orcl' changed to 0775 (rwxrwxr-x)
mode of `/u01/app/admin/orcl/adump' changed to 0775 (rwxrwxr-x)
mode of `/u01/app/admin/orcl/bdump' changed to 0775 (rwxrwxr-x)
mode of `/u01/app/admin/orcl/dbump' changed to 0775 (rwxrwxr-x)
更改他们的所属主组
# chown oracle:oinstall -Rv /u01/app/admin/
changed ownership of `/u01/app/admin/orcl/adump' to oracle:oinstall
changed ownership of `/u01/app/admin/orcl/bdump' to oracle:oinstall
changed ownership of `/u01/app/admin/orcl/dbump' to oracle:oinstall
changed ownership of `/u01/app/admin/orcl' to oracle:oinstall
changed ownership of `/u01/app/admin/' to oracle:oinstall
# mkdir /u02/oradata/orcl
# mkdir /u02/oradata/orcl/arch -pv
mkdir: created directory `/u02/oradata/orcl'
# chmod 775 -Rv /u02/oradata/orcl/
mode of `/u02/oradata/orcl/' changed to 0775 (rwxrwxr-x)
mode of `/u02/oradata/orcl/arch' changed to 0775 (rwxrwxr-x)
# chown oracle:oinstall -Rv /u02/oradata/orcl/
changed ownership of `/u02/oradata/orcl/' to oracle:oinstall

企鹅博客
  • 本文由 发表于 2020年3月17日00:27:14
  • 转载请务必保留本文链接:https://www.qieseo.com/148394.html

发表评论