[oracle@db1 ~]$ cd $ORACLE_HOME/dbs
[oracle@db1 dbs]$ orapwd file=orapwPROD password=oracle entries=30
步骤4 创建初始化参数文件
官方文档的参考文件链接为:Oracle参数文件的例子
cd $ORACLE_HOME/dbs
官方的参数文件init.ora例子的具体内容如下:
db_name='ORCL'
memory_target=1G
processes = 150
audit_file_dest='<ORACLE_BASE>/admin/orcl/adump'
audit_trail ='db'
db_block_size=8192
db_domain=''
db_recovery_file_dest='<ORACLE_BASE>/flash_recovery_area'
db_recovery_file_dest_size=2G
diagnostic_dest='<ORACLE_BASE>'
dispatchers='(PROTOCOL=TCP) (SERVICE=ORCLXDB)'
open_cursors=300
remote_login_passwordfile='EXCLUSIVE'
undo_tablespace='UNDOTBS1'
# You may want to ensure that control files are created on separate physical
# devices
control_files = (ora_control1, ora_control2)
compatible ='11.2.0'
db_name='prod'
memory_target=1G
processes = 150
audit_file_dest='/u01/app/admin/prod/adump'
audit_trail ='db'
db_block_size=8192
db_domain=''
db_recovery_file_dest='/u01/app/flash_recovery_area'
db_recovery_file_dest_size=2G
diagnostic_dest='/u01/app'
dispatchers='(PROTOCOL=TCP) (SERVICE=prodXDB)'
open_cursors=300
remote_login_passwordfile='EXCLUSIVE'
undo_tablespace='UNDOTBS1'
# You may want to ensure that control files are created on separate physical
# devices
control_files = (/u01/app/oradata/prod/control01.ctl, /u01/app/oradata/prod/control02.ctl)
compatible ='11.2.0'
步骤5 连接数据库实例
有命令文件,可以通过如下命令连接:
[oracle@db1 dbs]$ sqlplus /nolog
@> connect sys as sysdba
Enter password:
Connected to an idle instance.
SYS@prod>
OS认证登录方式,命令如下:
[oracle@db1 dbs]$ sqlplus /nolog
@> conn /as sysdba
Connected to an idle instance.
SYS@prod>
CREATE TABLESPACE apps_arp LOGGING
DATAFILE '/u01/app/oradata/prod/apps_arp01.dbf'
SIZE 500M REUSE AUTOEXTEND ON NEXT 1280K MAXSIZE UNLIMITED
EXTENT MANAGEMENT LOCAL;
-- create a tablespace for indexes, separate from user tablespace (optional)
CREATE TABLESPACE indx_arp LOGGING
DATAFILE '/u01/app/oradata/prod/indx_arp01.dbf'
SIZE 100M REUSE AUTOEXTEND ON NEXT 1280K MAXSIZE UNLIMITED
EXTENT MANAGEMENT LOCAL;