Manually creating Oracle database procedures under Linux

Source: Internet
Author: User

Today found an Oracle test library of the set of incorrect character sets, the original character set is UTF-8, the correct character set should be ZHS16GBK, because UTF-8 is a ZHS16GBK superset, can not modify, can only rebuild the database, fortunately the test library has no data.

Although you can create a database with DBCA, I personally prefer to create a database manually, the main steps are as follows (database version 11.2):

1. Set Oracle_sid

The default oracle_sid is ORCL, and I personally strongly recommend a unique and meaningful name, such as **TESTDB,**PRODDB, to be executed under an Oracle User:

Export Oracle_sid=lxdbtest

2. Reconstruction of Pfile

Rebuild Pfile (Initoracle_sid.ora, in this case, Initlxdbtest.ora) under the $oracle_home/dbs directory, except for the following three parameters, which can be set without setting (using default values):

Db_name=lxdbtest  
control_files= '/home/oracle/app/oradata/lxdbtest/control01.ctl ', '/home/oracle/app/oradata /

lxdbtest/control02.ctl ', '/home/oracle/app/oradata/lxdbtest/control03.ctl '  
memory_target=2g

For security purposes, control files must be specified in multiple copies, on the production library, to separate them on separate physical disks, which are placed on the same disk because they are test libraries.

3. Start instance to Nomount state

With Pfile, you can start the instance to the Nomount state:

$ sqlplus/as sysdba  
      
sql*plus:release 11.2.0.1.0 Production on Thu June 21:01:16 2013  
      
Copyright (c) 1982, 2009 , Oracle.  All rights reserved.  
      
Connected to a idle instance.  
      
sql> startup Nomount  
ORACLE instance started.  
      
Total System Global area 2137886720 bytes  
Fixed Size                  2215064 bytes  
Variable Size            1224737640 bytes  
Database buffers          905969664 bytes  
Redo buffers                4964352 bytes  
sql>

4. Execute CREATE DATABASE statement

 CREATE DATABASE lxdbtest LOGFILE GROUP 1 ('/home/oracle/app/oradata/lxdbtest/redo01a.log ', '/data/oradata/lxdb Test/redo01b.log ') SIZE 100M BLOCKSIZE, GROUP 2 ('/home/oracle/app/oradata/lxdbtest/redo02a.log ', '/da Ta/oradata/lxdbtest/redo02b.log ') SIZE 100M BLOCKSIZE, GROUP 3 ('/home/oracle/app/oradata/lxdbtest/re Do03a.log ', '/data/oradata/lxdbtest/redo03b.log ') SIZE 100M BLOCKSIZE maxlogfiles 5 maxlogmembers 5 MA Xloghistory 1 maxdatafiles CHARACTER set ZHS16GBK national CHARACTER SET al16utf16 EXTENT manageme  NT local datafile '/home/oracle/app/oradata/lxdbtest/system01.dbf ' SIZE 2048M reuse autoextend off Sysaux DATAFILE '/home/oracle/app/oradata/lxdbtest/sysaux01.dbf ' SIZE 2048M reuse autoextend off DEFAULT tablespace users DA Tafile '/home/oracle/app/oradata/lxdbtest/users01.dbf ' SIZE 2048M reuse autoextend off DEFAULT temporary TABLESPA CE Temptbs TempfILE '/home/oracle/app/oradata/lxdbtest/temp01.dbf ' SIZE 2048M reuse autoextend off UNDO tablespace Undotbs DataFile '/home/oracle/app/oradata/lxdbtest/undotbs01.dbf ' SIZE 2048M reuse autoextend off; 

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.