oracle 手动创建数据库

before creating
  1,define the purpose of the database
  2,define the type of the database
  3,outline the type of the database
  4,choose the database name
optimal flexible architecture


prepare the database
  1,choose a unique instance and database name
  2,choose a database character set
  3,set operating system variables
  4,create the initialization parameter file
  5,start the instance in nomount stage
  6,create and execute the create database command
  7,run scripts to generate the data dictionary and accomplish post-creation steps
  8,create aditional tablespaces as needed


step of create db
Step 1: Decide on Your Instance Identifier (SID)
  An instance is made up of the system global area (SGA) and the background processes of an Oracle Database. Decide on a unique Oracle system identifier (SID) for your instance and set the ORACLE_SID environment variable accordingly. This identifier is used to distinguish this instance from other Oracle Database instances that you may create later and run concurrently on your system.


Step 2: Establish the Database Administrator Authentication Method
  当创建了环境变量时用. ./zxntagl.env 执行,注意要先打一个点


Step 3: Create the Initialization Parameter File注意:在建库时必须确保每个路径都存在。
  创建口令文件:orapwd file=orapwzxntagl password=xionglang entries=10
  创建参数文件:
zxntagl.__db_cache_size=134217728
zxntagl.__java_pool_size=4194304
zxntagl.__large_pool_size=4194304
zxntagl.__shared_pool_size=58720256
zxntagl.__streams_pool_size=0
*.audit_file_dest='/u01/oracle/admin/zxntagl/adump'
*.background_dump_dest='/u01/oracle/admin/zxntagl/bdump'
*.compatible='10.2.0.1.0'
*.control_files='/u01/oracle/oradata/zxntagl/control01.ctl','/u01/oracle/oradata/zxntagl/control02.ctl','/u01/oracle/oradata/zxntagl/control03.ctl'
*.core_dump_dest='/u01/oracle/admin/zxntagl/cdump'
*.db_block_size=8192
*.db_domain=''
*.db_file_multiblock_read_count=8
*.db_name='zxntagl'
*.db_recovery_file_dest='/u01/oracle/flash_recovery_area'
*.db_recovery_file_dest_size=2147483648
*.dispatchers='(PROTOCOL=TCP) (SERVICE=zxntaglXDB)'
*.job_queue_processes=10
*.log_archive_format='log%t_%s_%r.arch'
*.open_cursors=300
*.pga_aggregate_target=68157440
*.processes=150
*.remote_login_passwordfile='EXCLUSIVE'
*.sga_target=205520896
*.undo_management='AUTO'
*.undo_tablespace='UNDOTBS1'
*.user_dump_dest='/u01/oracle/admin/zxntagl/udump'


Step 4: Connect to the Instance
  conn /as sysdba 


Step 5: Create a Server Parameter File (Recommended)
  
  创建spfile:create spfile from pfile;


Step 6: Start the Instance
  startup nomount
 
Step 7: Issue the CREATE DATABASE Statement
spool db.log;
CREATE DATABASE zxntagl
   USER SYS IDENTIFIED BY xionglang
   USER SYSTEM IDENTIFIED BY xionglang
   LOGFILE GROUP 1 ('/u01/oracle/oradata/zxntagl/redo01.log') SIZE 50M,
           GROUP 2 ('/u01/oracle/oradata/zxntagl/redo02.log') SIZE 50M,
           GROUP 3 ('/u01/oracle/oradata/zxntagl/redo03.log') SIZE 50M
   MAXLOGFILES 5
   MAXLOGMEMBERS 5
   MAXLOGHISTORY 1
   MAXDATAFILES 100
   MAXINSTANCES 1
   CHARACTER SET UTF8
   NATIONAL CHARACTER SET AL16UTF16
   DATAFILE '/u01/oracle/oradata/zxntagl/system01.dbf' SIZE 300M
   EXTENT MANAGEMENT LOCAL
   SYSAUX DATAFILE '/u01/oracle/oradata/zxntagl/sysaux01.dbf' SIZE 300M
   DEFAULT TEMPORARY TABLESPACE tempts1
      TEMPFILE '/u01/oracle/oradata/zxntagl/temp01.dbf'
      SIZE 20M
   UNDO TABLESPACE undotbs1
      DATAFILE '/u01/oracle/oradata/zxntagl/undotbs01.dbf'
      SIZE 200M  AUTOEXTEND ON MAXSIZE UNLIMITED;
spool off


Step 8: Create Additional Tablespaces
  create tablespace tb_zxntagl logging
     datafile '/u01/oracle/oradata/zxntagl/tb_zxntagl.dbf'
     size 100m autoextend on next 1280k maxsize unlimited
     extent management local;


Step 9: Run Scripts to Build Data Dictionary Views
  sql>spool log1.log
  sql>@/u01/oracle/10g/rdbms/admin/catalog.sql
  sql>spool log2.log
  sql>@/u01/oracle/10g/rdbms/admin/catproc.sql


Step 10: Run Scripts to Install Additional Options (Optional)
Step 11: Back Up the Database.







  
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值