ITPub博客

首页 > Linux操作系统 > Linux操作系统 > Manually Creating a New Oracle Database

Manually Creating a New Oracle Database

原创 Linux操作系统 作者:annnnna 时间:2009-09-14 10:49:00 0 删除 编辑

Step 1: Decide on Your Instance Identifier (SID)

 

$ export ORACLE_SID=newdb

 

Step 2: Create the Initialization Parameter File

 

Step 3: Creating and Maintaining a Password File (REMOTE_LOGIN_PASSWORDFILE = EXCLUSIVE)

 

$ orapwd FILE=orapwnewdb  PASSWORD=secret ENTRIES=5 

 

Use the V$PWFILE_USERS view to see the users who have been granted SYSDBA or SYSOPER system privileges for a database.

 

Step 4: Connect to the Instance

 

$ sqlplus / as sysdba

 

Step 5: Create a Server Parameter File

 

SQL> STARTUP NOMOUNT pfile=’…/initnewdb.ora’;

 

SQL> create spfile from pfile;

 

SQL> SHUTDOWN IMMEDIATE;

 

Step 6: Start the Instance

 

SQL> STARTUP NOMOUNT;

 

Step 7: Issue the CREATE DATABASE Statement

 

CREATE DATABASE newdb

USER SYS IDENTIFIED BY xxxxx

USER SYSTEM IDENTIFIED BY xxxxx

LOGFILE GROUP 1 ('/bi/ctgbu10/data/redo01.log') SIZE 100M,

GROUP 2 ('/bi/ctgbu10/data/redo02.log') SIZE 100M,

GROUP 3 ('/bi/ctgbu10/data/redo03.log') SIZE 100M

MAXLOGFILES 5

MAXLOGMEMBERS 5

MAXLOGHISTORY 1

MAXDATAFILES 100

MAXINSTANCES 1

CHARACTER SET US7ASCII

NATIONAL CHARACTER SET AL16UTF16

DATAFILE '/bi/ctgbu10/data/system01.dbf' SIZE 500M REUSE

EXTENT MANAGEMENT LOCAL

SYSAUX DATAFILE '/bi/ctgbu10/data/sysaux01.dbf' SIZE 500M REUSE

DEFAULT TEMPORARY TABLESPACE TEMP

TEMPFILE '/bi/ctgbu10/data/temp01.dbf'

SIZE 10000M REUSE

UNDO TABLESPACE undo

DATAFILE '/bi/ctgbu10/data/undo01.dbf'

SIZE 1000M REUSE AUTOEXTEND ON MAXSIZE UNLIMITED;

 

Step 8: Create Additional Tablespaces

 

CREATE TABLESPACE TOPS_IXD_TS001 DATAFILE

'/databases2/bipt/data/tops_ixd_001.dbf' size 3000M AUTOEXTEND ON NEXT 8K MAXSIZE UNLIMITED

LOGGING

ONLINE

PERMANENT

EXTENT MANAGEMENT LOCAL AUTOALLOCATE

BLOCKSIZE 8K

SEGMENT SPACE MANAGEMENT AUTO

FLASHBACK ON;

 

Step 9: Changing the Default Tablespace and the Default Temporary Tablespace

 

Step 10: Run Scripts to Build Data Dictionary Views

 

$ sqlplus / as sysdba

SQL> @/u01/oracle/rdbms/admin/catalog.sql

SQL> @/u01/oracle/rdbms/admin/catproc.sql

SQL> EXIT

 

Step 11: DB Health Checking

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/22473175/viewspace-614594/,如需转载,请注明出处,否则将追究法律责任。

上一篇: 负责
请登录后发表评论 登录
全部评论

注册时间:2009-09-04

  • 博文量
    23
  • 访问量
    12517