linux的oracle怎么建库,linux下oracle手工建库过程

5268f80b9b1e01f982625ef6fac83ca1.png

1、创建目录

$ORACLE_BASE/admin/

$ORACLE_BASE/oradata

$ORACLE_BASE/flash_recovery_area

2、建初始化参数文件

cd   $ORACLE_HOME/dbs

db_name=orcl

memory_target=1G

processes = 150

audit_file_dest=‘/oracle/app/product/admin/orcl/adump‘

audit_trail =‘db‘

db_block_size=8192

db_domain=‘‘

db_recovery_file_dest=‘/oracle/app/product/flash_recovery_area‘

db_recovery_file_dest_size=2G

diagnostic_dest=‘/oracle/app/product‘

dispatchers=‘(PROTOCOL=TCP) (SERVICE=ORCLXDB)‘

open_cursors=300

remote_login_passwordfile=‘EXCLUSIVE‘

undo_tablespace=‘UNDOTBS1‘

control_files = (/oracle/app/product/oradata/ora_control1,/oracle/app/product/oradata/ora_control2,/oracle/app/product/oradata/ora_control3)

compatible =‘11.2.0‘

undo_management=AUTO

3、创建密码文件

orapwd file=$ORACLE_HOME/dbs/orapworcl password=oracle force=y

4、建库

a、创建spfile

$ sqlplus ‘/as sysdba‘

SQL> create spfile from pfile; (会自动读取pfile:$ORACLE_HOME/dbs/init$ORACLE_SID.ora)

b、启动到nomount状态创数据库------期间自动创建控制文件

SQL> startup nomount;

SQL> @/home/oracle/createdb.sql-------------------创建数据库

创看脚本

create database orcl CONTROLFILE REUSE

MAXINSTANCES 8 MAXDATAFILES 2000

MAXLOGHISTORY 2 MAXLOGFILES 64 MAXLOGMEMBERS 5

character set ZHS16GBK national character set AL16UTF16

logfile group 1 (‘/oracle/app/product/oradata/orcl/redo1.log‘) size 50M reuse,

group 2 (‘/oracle/app/product/oradata/orcl/redo2.log‘) size 50M reuse,

group 3 (‘/oracle/app/product/oradata/orcl/redo3.log‘) size 50M reuse

datafile ‘/oracle/app/product/oradata/orcl/system.dbf‘ size 1024M reuse autoextend on next 100M maxsize unlimited extent management local

sysaux datafile ‘/oracle/app/product/oradata/orcl/sysaux.dbf‘ size 1024M autoextend on next 100M maxsize unlimited

default temporary tablespace temp tempfile ‘/oracle/app/product/oradata/orcl/temp01.dbf‘ size 100M reuse autoextend on next 10M maxsize unlimited

undo tablespace undotbs1 datafile ‘/oracle/app/product/oradata/orcl/undotbs1.dbf‘ size 100M reuse autoextend on next 10M maxsize unlimited

USER SYS IDENTIFIED BY "oracle" USER SYSTEM IDENTIFIED BY "oracle";

c、运行数据字典脚本,其中catalog和catproc是必需的,其它可选: (运行时间比较长)

SQL> spool /opt/oradata/cat_testdb.log

SQL> @?/rdbms/admin/catalog.sql----------------(建数据字典视图)-----------------------必须

SQL> @?/rdbms/admin/catproc.sql-----------(建存储过程包)-----------------------------------必须

SQL> @?/rdbms/admin/catblock.sql -----------(建锁相关的几个视图)

SQL> @?/rdbms/admin/catoctk.sql ----------(建密码工具包dbms_crypto_toolkit)

SQL> @?/rdbms/admin/owminst.plb---------------(建工作空间管理相关对象,如dmbs_wm)

SQL> spool off

d、 新建sqlplus属性和帮助、USERS表空间

SQL> connect system/oracle

SQL> @?/sqlplus/admin/pupbld.sql

SQL> @?/sqlplus/admin/help/hlpbld.sql helpus.sql

SQL> connect /as sysdba

SQL> CREATE TABLESPACE USERS LOGGING DATAFILE ‘/oracle/app/product/oradata/orcl/users01.dbf‘ SIZE 1024M REUSE AUTOEXTEND ON NEXT 100m MAXSIZE UNLIMITED EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO;

SQL> ALTER DATABASE DEFAULT TABLESPACE USERS;

SQL> execute utl_recomp.recomp_serial();

配置网络listener  sqlnet.ora  tnsname.ora

建立和配置EM(省略此步骤):

SQL> @?/sysman/admin/emdrep/sql/emreposcre /oracle/product/10.2 SYSMAN oracle TEMP ON;

SQL> alter user SYSMAN identified by "sysman" account unlock;

SQL> alter user DBSNMP identified by "dbsnmp" account unlock;

SQL> host emca -config dbcontrol db -silent -DB_UNIQUE_NAME ypyhtb -PORT 1521 -EM_HOME /oracle/product/10.2/bin -LISTENER LISTENER -SERVICE_NAME ypythb.LK -SYS_PWD "oracle" -SID ypythb -ORACLE_HOME /oracle/product/10.2 -DBSNMP_PWD "dbsnmp" -HOST "172.19.201.184" -LISTENER_OH /oracle/product/10.2 -LOG_FILE /oradata/ypythb/emConfig.log -SYSMAN_PWD "sysman";

本文出自 “11300506” 博客,请务必保留此出处http://11310506.blog.51cto.com/11300506/1961543

linux下oracle手工建库过程

标签:linux下oracle手工建库过程

1428d0e076c3959ab11d28a39bc84fab.png

5268f80b9b1e01f982625ef6fac83ca1.png

本条技术文章来源于互联网,如果无意侵犯您的权益请点击此处反馈版权投诉

本文系统来源:http://11310506.blog.51cto.com/11300506/1961543

参与评论 您还未登录,请先 登录 后发表或查看评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
©️2022 CSDN 皮肤主题:1024 设计师:我叫白小胖 返回首页
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、C币套餐、付费专栏及课程。

余额充值