Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Create database instance silently by DBCA

2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Several Oracle databases of the development environment have been installed in the past two days, of which version 11.2.0.4 and version 12.2.0.1 are also available. Due to the complexity of the network environment, there is no way to install it using a graphical interface, so it can only be installed silently. Http://hbxztc.blog.51cto.com/1587495/1884833, a blog about silently installing database software and creating instances, can refer to those who are interested in installing database software and creating instances. This method is also used in the past two days, but I have seen someone use dbca's silent method to create database instances before. I haven't tried it yet, take advantage of the free time of installation to study it, and make a simple sharing here.

Dbca has two silent ways to install instances: one is to use responseFile, and the other is to use the command line directly. This test is done in the way of responseFile.

Using responseFile naturally requires a responseFile file, which can be found in the response directory under the database package directory and in the $ORACLE_HOME/assistants/dbca/ directory. The file is called dbca.rsp.

Create the process:

1. Copy a dbca.rsp file and modify it to create an instance.

[oracle@rhel6 dbca] $pwd

/ u01/app/oracle/product/11.2/db1/assistants/dbca

[oracle@rhel6 dbca] $cp dbca.rsp / home/oracle

2. Modify the dbca.rsp file you just copied

The parameters in some files are explained here.

RESPONSEFILE_VERSION = "11.2.0" # specify the version number

OPERATION_TYPE = "createDatabase" # specify the action to be done using dbca. Select createDatabase if you want to create an instance, or deleteDatabase if you want to delete an instance.

# to create an instance, you only need to modify the parameters of the instance creation section. If you see the #-- * End of CREATEDATABASE section * *-part, you can say that the configuration is complete.

[CREATEDATABASE]

GDBNAME = "dbs" # Global database name of the database

SID = "dbs" # instance name of the database

SYSPASSWORD = "123456" # specify the sys user password

SYSTEMPASSWORD = "123456" # specify the system user password

DATAFILEDESTINATION = / home/oracle/11201/dbs # specifies the directory where the data files are stored

CHARACTERSET = "ZHS16GBK" # specify the character set

NATIONALCHARACTERSET= "AL16UTF16" # specifies the national character set

DATABASETYPE = "OLTP" # specify the type of instance

AUTOMATICMEMORYMANAGEMENT = "TRUE" # specifies to use automatic memory management

TOTALMEMORY = "800,800" # specifies the amount of memory used, in MB

The above parameters are the parameters used to create a single instance. There are many other parameters in the dbca.rsp file. If you have further requirements, you can modify them.

3. Start creating a database instance

You can create an instance in a few minutes by executing the following command:

[oracle@rhel6 11201] $dbca-silent-responseFile / home/oracle/dbca.rsp

Copying database files

1% complete

3% complete

11% complete

18% complete

26% complete

37% complete

Creating and starting Oracle instance

40% complete

45% complete

50% complete

55% complete

56% complete

60% complete

62% complete

Completing Database Creation

66% complete

70% complete

73% complete

85% complete

96% complete

100% complete

Look at the log file "/ u01/app/oracle/cfgtoollogs/dbca/dbs/dbs1.log" for further details.

4. Check whether the instance is normal.

[oracle@rhel6 11201] $sqlplus / as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on Tue Mar 14 20:55:55 2017

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

Connected to:

Oracle Database 11g Enterprise Edition Release 11.2.0.1.0-64bit Production

With the Partitioning, OLAP, Data Mining and Real Application Testing options

Sys@DBS > select status from v$instance

STATUS

-

OPEN

Sys@DBS > select name from v$datafile

NAME

/ home/oracle/11201/dbs/dbs/system01.dbf

/ home/oracle/11201/dbs/dbs/sysaux01.dbf

/ home/oracle/11201/dbs/dbs/undotbs01.dbf

/ home/oracle/11201/dbs/dbs/users01.dbf

Here's a brief explanation of why it's so fast. From the alert log, you can see the log shown in the following figure.

From the figure above, you can see that the data file was recovered from the copy, not newly created, which also explains why the log in the first line of the instance is "Copying database files".

At this point, we will also talk about the three types of instance creation, as shown below:

You can see from the figure that there are three types of instance creation, in which "General Purpose or Transaction processiong" and "Data Warehose" correspond to OLTP system and data warehouse respectively, and the "Includes Datafiles" after them shows that Yes is restored with a backup of data files when created in these two ways. Finally, modify the character set. The following figure shows the alert log

On the other hand, the "Custom Database" custom mode does not have a corresponding data file to restore, but a newly created data file, so it takes a relatively long time to create an instance in this way, because you need to run a data dictionary.

The above briefly describes the method of creating an instance using responseFile. Another method is to use the command line directly. You can use the dbca-h command to view the command parameters.

[oracle@rhel6 trace] $dbca-hdbca [- silent |-progressOnly |-customCreate] {} | {[[options]]-responseFile} [- continueOnNonFatalErrors] Please refer to the manual for details.You can enter one of the following command:Create a database by specifying the following parameters:-createDatabase-templateName [- cloneTemplate]-gdbName [- PolicyManaged |-adminManaged] [- createServerPool] [- force]-serverPoolName-[cardinality] [- sid] [- sysPassword] [- systemPassword] [- emConfiguration] -dbsnmpPassword-sysmanPassword [- hostUserName-hostUserPassword-backupSchedule] [- smtpServer-emailAddress] [- centralAgent]] [- disableSecurityConfiguration [- datafileDestination |-datafileNames] [- redoLogFileSize] [- recoveryAreaDestination] [- datafileJarLocation] [- storageType]

< FS | ASM >

[- asmsnmpPassword]-diskGroupName-recoveryGroupName [- characterSet] [- nationalCharacterSet] [- registerWithDirService-dirServiceUserName-dirServicePassword -walletPassword] [- listeners] [- variablesFile]] [- variables] [- initParams] [- memoryPercentage] [- automaticMemoryManagement] [- totalMemory] [- databaseType]]

Official document: http://docs.oracle.com/cd/E11882_01/install.112/e47689/app_nonint.htm#LADBI1353

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report