案例:
think = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS=(PROTOCOL = tcp)(HOST= 192.168.227.128)(PORT= 1521) ) ) ) SID_LIST_think = (SID_LIST = (SID_DESC = (GLOBAL_DBNAME = orcl.oracle.com) (SID_NAME = orcl) (ORACLE_HOME = /u01/app/oracle/product/10.2.0/db_1)))
orcl = (DESCRIPTION = (ADDRESS=(PROTOCOL= tcp)(HOST= 192.168.227.128)(PORT= 1521)) (CONNECT_DATA=(SERVICE_NAME= orcl.oracle.com)) )
CREATE DATABASE orcl USER SYS IDENTIFIED BY oracle USER SYSTEM IDENTIFIED BY oracle LOGFILE GROUP 1 ('/u01/app/oracle/oradata/orcl/redo01.log') SIZE 100M, GROUP 2 ('/u01/app/oracle/oradata/orcl/redo02.log') SIZE 100M, GROUP 3 ('/u01/app/oracle/oradata/orcl/redo03.log') SIZE 100M MAXLOGFILES 5 MAXLOGMEMBERS 5 MAXLOGHISTORY 1 MAXDATAFILES 100 MAXINSTANCES 1 CHARACTER SET AL32UTF8 NATIONAL CHARACTER SET AL16UTF16 DATAFILE '/u01/app/oracle/oradata/orcl/system01.dbf' SIZE 600M REUSE EXTENT MANAGEMENT LOCAL SYSAUX DATAFILE '/u01/app/oracle/oradata/orcl/sysaux01.dbf' SIZE 450M REUSE DEFAULT TABLESPACE users DATAFILE '/u01/app/oracle/oradata/orcl/users01.dbf' size 50M REUSE DEFAULT TEMPORARY TABLESPACE temp TEMPFILE '/u01/app/oracle/oradata/orcl/temp01.dbf' SIZE 20M REUSE UNDO TABLESPACE undotbs DATAFILE '/u01/app/oracle/oradata/orcl/undotbs01.dbf' SIZE 200M REUSE AUTOEXTEND ON MAXSIZE UNLIMITED;
[oracle@localhost admin]$ pwd /u01/app/oracle/admin [oracle@localhost admin]$ mkdir -p orcl/{a,b,c,u,dp}dump [oracle@localhost flash_recovery_area]$ pwd /u01/app/oracle/flash_recovery_area [oracle@localhost admin]$ mkdir ORCL [oracle@localhost dbs]$ pwd /u01/app/oracle/product/10.2.0/db_1/dbs [oracle@localhost dbs]$ ls alert_orcl.log hc_orcl.dat hc_think.dat initdw.ora init.ora snapcf_orcl.f
[oracle@localhost dbs]$ orapwd file=orapworcl password=oracle entries=5
[oracle@localhost dbs]$ cp -p init.ora initorcl.ora [oracle@localhost dbs]$ grep -v '^#' initorcl.ora | grep -v '^$' > initorcl.ora.test [oracle@localhost dbs]$ mv initorcl.ora.test initorcl.ora
db_name= orcl db_domain= oracle.com db_files = 100 db_file_multiblock_read_count = 128 processes = 1000 parallel_max_servers = 40 open_cursors= 400 global_names = false control_files = '/u01/app/oracle/oradata/orcl/control01.ctl','/u01/app/oracle/oradata/orcl/control02.ctl','/u01/app/oracle/oradata/orcl/control03.ctl' sga_target = 900m sga_max_size = 900m pga_aggregate_target= 450M db_recovery_file_dest = '/u01/app/oracle/flash_recovery_area' db_recovery_file_dest_size = 2G undo_tablespace= undotbs undo_management= auto undo_retention = 900 log_archive_dest_10='location=use_db_recovery_file_dest'
sqlplus /nolog conn / as sysdba create spfile from pfile; startup @createdb.sql
@?/rdbms/admin/catalog.sql @?/rdbms/admin/catproc.sql @?/rdbms/admin/dbmspool.sql connect system/oracle @?/sqlplus/admin/pupbld.sql
mysql一条create database xx就可以创建一个数据库,但oracle则不行。以上步骤只是个测试版,后续还会把更完善的步骤、和创建过程中相关错误呈上。