手动建库流程

时间:2022-12-29 08:36:40
1. 修改.bash_profile
oracle_sid=PROD
对象别名可创建
2.创建建库所需文件夹
admin(adump dudmp )
oradata
3.创建密码文件(as sysdba可使用多少个用户登录)
cd $ORACLE_HOME/dbs
orapwd file=orapwPROD entries=30 password=oracle
linux 密码文件的命名为orapw+oracle_sid
windows 密码文件命名为pwd+oracle_sid
 
4.创建并修改参数文件
创建参数
cd /u01/oracle/product/11.2.0/db_1/dbs
[oracle@oracleasm dbs]$ cat init.ora | grep -v ^# | grep -v ^$ >initPROD.ora
 
db_name='PROD'
memory_target=1G
processes = 300
audit_file_dest='/u01/app/oracle/admin/PROD/adump'
audit_trail ='db'
db_block_size=8192
db_domain=''
db_recovery_file_dest='/u01/app/oracle/flash_recovery_area'
db_recovery_file_dest_size=2G
diagnostic_dest='/u01/app/oracle'
dispatchers='(PROTOCOL=TCP) (SERVICE=PRODXDB)'
open_cursors=300
remote_login_passwordfile='EXCLUSIVE'
undo_tablespace='UNDOTBS1'
control_files = (/u01/app/oracle/oradata/PROD/disk1/control01.ctl,/u01/app/oracle/oradata/PROD/disk2/control02.ctl )
compatible ='11.2.0'
 
5. 创建spfile
sqlplus / as sysdba
create spfile from pfile
startup nomount;
 
6.create db创建数据库
CREATE DATABASE PROD
   CONTROLFILE REUSE
   LOGFILE
      GROUP 1 ('/u01/app/oracle/oradata/PROD/disk1/redo01.log') SIZE 50M,
      GROUP 2 ('/u01/app/oracle/oradata/PROD/disk2/redo02.log') SIZE 50M
   MAXLOGFILES 30
   MAXLOGHISTORY 100
   MAXDATAFILES 100
   MAXINSTANCES 2
   ARCHIVELOG
   CHARACTER SET AL32UTF8
   NATIONAL CHARACTER SET AL16UTF16
   DATAFILE 
   '/u01/app/oracle/oradata/PROD/disk1/system01.dbf' size 10m AUTOEXTEND ON NEXT 10M MAXSIZE UNLIMITED
  SYSAUX datafile  '/u01/app/oracle/oradata/PROD/disk1/sysaux01.dbf' size 10m AUTOEXTEND ON NEXT 10M MAXSIZE UNLIMITED
   DEFAULT TEMPORARY TABLESPACE temp
    tempfile '/u01/app/oracle/oradata/PROD/disk1/temp01.dbf' size 10m REUSE
   UNDO TABLESPACE undotbs1
   datafile '/u01/app/oracle/oradata/PROD/disk1/undotbs01.dbf' size 20m REUSE AUTOEXTEND ON MAXSIZE UNLIMITED;
 
 
7.执行脚本 
@?/rdbms/admin/catalog.sql sys
@?/rdbms/admin/catproc.sql sys
@?/sqlplus/admin/pupbld.sql system
@?/sqlplus/admin/help/hlpbld.sql helpus.sql  system