To create an Oracle instance manually

Source: Internet
Author: User
Tags dba sqlplus lenovo

Steps to build a library manually

Step 1:specify an Instance Identifier (SID) (specifies an identifier SID for an instance)
Step 2:ensure that the Required environment Variables is set (confirm setting of environment variable)
Step 3:choose A Database Administrator authentication method (determines the authentication methods of the DBA)
Step 4:create The initialization Parameter file (create initialization parameter files information)
Step 5: (Windows only) Create a Instance
Step 6:connect to the Instance (connection instance)
Step 7:create a Server Parameter File (Create SPFile)
Step 8:start The Instance (launch instance)
Step 9:issue The CREATE DATABASE Statement (the statement that created database)
Step 10:create Additional tablespaces (create additional tablespace)
Step 11:run Scripts to Build data Dictionary Views (run script to create database dictionary view)
Step: (Optional) Run Scripts to Install Additional Options
Step 13:back up the Database.
Step: (Optional) Enable Automatic Instance Startup


Step 1:specify an Instance Identifier (SID) (specifies an identifier SID for an instance)
Export Oracle_sid=lenovo
Echo $ORACLE _sid


Mkdir-p/u01/app/oracle/admin/lenovo/adump
Orapwd file= "/u01/app/oracle/product/11.2.0/dbhome_1/dbs/orapwlenovo" Password=oracle entries=30
Step 2:ensure that the Required environment Variables is set (confirm setting of environment variable)
[Email protected] lenovo]$ mkdir datafile
[Email protected] lenovo]$ mkdir Redolog
[Email protected] lenovo]$ pwd
/u01/app/oracle/oradata/lenovo
[email protected] ~]$ cat. Bash_profile
#. Bash_profile

# Get the aliases and functions
If [-f ~/.BASHRC]; Then
. ~/.bashrc
Fi

# User specific environment and startup programs

Path= $PATH: $HOME/bin

Export PATH

#Oracle Settings
Export Tmp=/tmp
Export Tmpdir=/tmp
Export Oracle_base=/u01/app/oracle
Export Oracle_home= $ORACLE _base/product/11.2.0/db_1
Export Oracle_sid=lenovo
Export Oracle_term=xterm
Export Path=/usr/sbin: $PATH
Export path= $ORACLE _home/bin: $PATH
Export Ld_library_path= $ORACLE _home/lib:/lib:/usr/lib:/usr/local/lib:/usr/x11r6/lib/
Export classpath= $ORACLE _home/jre: $ORACLE _home/jlib: $ORACLE _home/rdbms/jlib
Export Nls_lang=american_america. Zhs16gbk
Export Lang=c
Umask 022


Alias date= ' Date +%y-%m-%d%t%a%t%t '

Step 3:choose A Database Administrator authentication method (determines the authentication methods of the DBA)
[Email protected] bin]$ pwd
/u01/app/oracle/product/11.2.0/db_1/bin
[Email protected] bin]$ orapwd File=orapwdlenovo password=oracle entries=30

Step 4:create The initialization Parameter file (create initialization parameter files information)
[email protected] dbs]$ cat Initlenovo.ora
Db_name= ' LENOVO '
memory_target=808m
Control_files = ('/u01/app/oracle/oradata/lenovo/controlfile/control01.ctl ')

Step 6:connect to the Instance (connection instance)
[Email protected] dbs]$ echo $ORACLE _sid
Lenovo
[Email protected] dbs]$ Sqlplus/as SYSDBA

Sql*plus:release 11.2.0.4.0 Production on Tue Nov 1 19:28:17 2016

Copyright (c) 1982, Oracle. All rights reserved.

Connected to an idle instance.

Sql>

Step 7:create a Server Parameter File (Create SPFile)
Sql> create SPFile from pfile= '/u01/app/oracle/product/11.2.0/db_1/dbs/initlenovo.ora ';

Step 8:start The Instance (launch instance)
Sql> Startup Nomount
ORACLE instance started.

Total System Global area 843456512 bytes
Fixed Size 2257920 bytes
Variable Size 494930944 bytes
Database buffers 343932928 bytes
Redo buffers 2334720 bytes

Step 9:issue The CREATE DATABASE Statement (the statement that created database)
Create_db.sql

CREATE DATABASE Lenovo
USER SYS identified by Oracle
USER SYSTEM identified by Oracle
LOGFILE GROUP 1 ('/u01/app/oracle/oradata/lenovo/redolog/redo01a.log ') SIZE 100M BLOCKSIZE 512,
GROUP 2 ('/u01/app/oracle/oradata/lenovo/redolog/redo02a.log ') SIZE 100M BLOCKSIZE 512,
GROUP 3 ('/u01/app/oracle/oradata/lenovo/redolog/redo03a.log ') SIZE 100M BLOCKSIZE 512
Maxlogfiles 5
Maxlogmembers 5
Maxloghistory 1
Maxdatafiles 100
CHARACTER SET Al32utf8
National CHARACTER SET AL16UTF16
EXTENT MANAGEMENT LOCAL
DataFile '/u01/app/oracle/oradata/lenovo/datafile/system01.dbf ' SIZE 325M reuse
Sysaux datafile '/u01/app/oracle/oradata/lenovo/datafile/sysaux01.dbf ' SIZE 325M reuse
DEFAULT tablespace Users
DataFile '/u01/app/oracle/oradata/lenovo/datafile/users01.dbf '
SIZE 50M Reuse autoextend on MAXSIZE UNLIMITED
DEFAULT Temporary tablespace tempts1
Tempfile '/u01/app/oracle/oradata/lenovo/datafile/temp01.dbf '
SIZE 20M Reuse
UNDO tablespace UNDOTBS1
DataFile '/u01/app/oracle/oradata/lenovo/datafile/undotbs01.dbf '
SIZE 100M Reuse autoextend on MAXSIZE UNLIMITED;

Sql> @/home/oracle/create_db.sql

Database created.

Step 10:create Additional tablespaces (create additional tablespace)
Sql>create tablespace zstest datafile '/u01/app/oracle/oradata/lenovo/datafile/test01.dbf ' SIZE 50M EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO;
Sql> select Open_mode from V$database;

Open_mode
----------------------------------------
READ WRITE

Step 11:run Scripts to Build data Dictionary Views (run script to create database dictionary view)
SYSDBA user executes the following script
@?/rdbms/admin/catalog.sql
@?/rdbms/admin/catproc.sql
@?/rdbms/admin/utlrp.sql

The system user executes the following script
@?/sqlplus/admin/pupbld.sql

To create an Oracle instance manually

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.