New Oracle Database method

Source: Internet
Author: User

Three ways to create a new Oracle database:
1. Create a configuration or delete a database by running the Oracle database configuration Assistant (you can also enter DBCA at the command line);
2. Create a database using the command line method
3. Create a configuration or delete a database by running a custom batch script (or Create_oracle_sid.bat (Create_oracle_sid.sql))
Detailed:
1. Create a configuration or delete a database by running the Oracle database configuration Assistant;

It is recommended that the DBA who is unfamiliar with the creation process use this method only by%26#8220 the options, the next%26#8221, the configuration, the creation of the database (recommended retention), or the creation of a database directly;
Advantages: Gui method is easy to use;
Cons: But the creation process is somewhat slow;

2. Create a database using the command line method

Connect/as SYSDBA
STARTUP pfile= ' C:oracleadmininit_testorcl.ora ' nomount;
CREATE DATABASE testorcl datafile '/u02/oracle/testorcl/system01.dbf ' SIZE 100M
LOGFILE GROUP1 ('/u01/oracle/testorcl/redo1a.log ',
'/u02/oracle/testorcl/redo1b.log ') SIZE 500K,
GROUP2 ('/u01/oracle/testorcl/redo1a.log ',
'/u02/oracle/testorcl/redo1b.log ') SIZE 500K
CHARACTER SET zhs16cgb231280;

--Convert the database directly from an out-of-build state to an open state
ALTER DATABASE OPEN;

--delete database (dropping a)
SPOOL C:drop_database. BAT
SELECT ' DEL ' | | NAME Delete database related data file from V$datafile;
SELECT ' DEL ' | | MEMBER Delete Data refactoring log file from V$logfile;
SPOOL OFF;

Advantages: Can be familiar with the creation of instructions, creating principles;
Cons: Simple configuration, requires memorizing command line instruction;

3. Create a custom batch or SQL script (Create_oracle_sid.bat or Create_oracle_sid.sql) by running it
--create_oracle_sid.bat
Set oracle_sid= Oracle_sid.
Del C:oracle8idatabasepwdoracle_sid.ora
C:oracle8ibinoradim-new-sid Oracle_sid. -intpwd Oracle-startmode Manual
-pfile C:oracle8iadminoracle_sidpfileinit.ora
C:ORACLE8IBINSVRMGRL @c:winntprofilesadministratorlboracle_sidrun.sql
C:ORACLE8IBINSVRMGRL @c:winntprofilesadministratorlboracle_sidrun1.sql
C:oracle8ibinoradim-edit-sid Oracle_sid-startmode Auto

--oracle_sidrun.sql
Spool C:oracle8iadminoracle_sidcreatecreatedb
Set echo on
Connect internal/oracle
Startup Nomount Pfile=c:oracle8iadminoracle_sidpfileinit.ora
CREATE DATABASE Oracle_sid
LOGFILE ' C:oracle8ioradataoracle_sidredo01.log ' SIZE 1024K,
' C:oracle8ioradataoracle_sidredo02.log ' SIZE 1024K
Maxlogfiles 32
Maxlogmembers 2
Maxloghistory 1
DataFile ' c:oracle8ioradataoracle_sidsystem01.dbf ' SIZE 50M reuse
Maxdatafiles 254
Maxinstances 1
CHARACTER SET Zht16big5
National CHARACTER SET Zht16big5;
Spool off

--oracle_sidrun1.sql
Spool C:ORACLE8IADMINORACLE_SIDCREATECREATEDB1
Set echo on
Connect internal/oracle
ALTER DATABASE datafile ' c:oracle8ioradataoracle_sidsystem01.dbf ' autoextend on;
CREATE ROLLBACK SEGMENT sysrol tablespace "SYSTEM" STORAGE (INITIAL 100K NEXT 100K);
ALTER ROLLBACK SEGMENT "Sysrol" ONLINE;

Another thing I want to say is that after you create a new global database:

The password for SYS is: change_on_install

The password for system is: Manager

The first servers that are started are:

Oracleorahome90agent

Oracleorahome90tnslistener

Oracleservice (Your database name: For example, the database you created and the SID name: New, this is new)

New Oracle Database method

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.