Preface it is not enough to install the Oracle software. We still need to create a database on it before we can learn Oracle normally. Next we will take a look at how to create a database for Oracle configuration Assistant (DatabaseConfigurationAss)
Preface it is not enough to install the Oracle software. We still need to create a database on it before we can learn Oracle normally. Next we will take a look at how to create a database for Oracle configuration Assistant (DatabaseConfigurationAss)
Preface
It is not enough to install the Oracle software. We still need to create a database on it before learning Oracle normally. Let's take a look at how to create a database.
Oracle Configuration Assistant (DBCA) is a very convenient Database creation tool provided by Oracle. Let's take a look at using DBCA to create a Database.
Create a database
[Oracle @ ebs ~] $ Dbca
Execute the dbca command under the Oracle account to bring up the welcome page
After the welcome page appears, click Next to continue
Select the database creation option and click Next to continue
Select the database type as needed and click Next to continue
Enter the global database name and ORACLE_SID name (Note: In single instance mode, the global database name must be consistent with the ORACLE_SID name), and click Next to continue
Do not configure the OEM Enterprise Manager temporarily. Click Next to continue
Create passwords for sys and system users as needed (remember). In the exercise environment, the uniform management password oracle is used here. Click Next to continue.
For convenience, use OMF to manage tablespaces and click Next to continue
Enable the quick flash back area, follow the default configuration, and click Next to continue
The example scheme is added in the exercise mode, so that some sample objects and libraries will exist in the database we created for our learning and use. Click Next to continue.
Because 11g adopts the latest Automatic Memory Management Mechanism (more advanced than 10g SGA automatic management), the default 40% is usually used.
If the process is complete, you can do 200 exercises.
After determining the character set, click Next to continue.
This can be changed based on actual needs. The database in DBCA is used by default. Click Next to continue.
Select create database and click Finish.
After confirming that all the content in the abstract is correct, click OK to start creating the database.
Now, the Oracle database has been created. Click the exit button to close the page.
Log on to the console and check that the database is created properly.
Configure Database
[Oracle @ ebs ~] $ Dbca
Execute the dbca command under the Oracle account to bring up the welcome page
After the welcome page appears, click Next to continue
Select the database configuration option, Hong Kong server, and click Next to continue
Select the database we just created and click Next to continue
Select configure OEM and click Next to continue
Select the Oracle Label Security Option and click Next to continue
Add a password for the DBSNMP and SYSMAN accounts, and use oracle again. Click Next to continue.
Confirm the connection mode of the dedicated server (now basically dedicated server connections). Click Finish.
Configure the PL/SQL Develop tool
PL/SQL Develop is a very useful integrated client application tool. After PL/SQL Develop is installed, you must install the client program locally and set the Client Connection Program, you can use PL/SQL Develop to connect to a remote database.
Install the Oracle client
Download and decompress the Windows client program, go to the client installation directory, and double-click the setup icon.
Select the Administrator type in the installation type and click Next to continue
Select Simplified Chinese and English in the product language, and click Next to continue
Determine the Oracle base Directory (ORACLE_BASE) and Oracle software location (ORACLE_HOME) based on actual needs, and click Next to continue
There will be some minor problems in the prerequisite check, because we didn't set the parameter. Ignore it all and click Next to continue.
Click Finish to start installation.
After the installation is complete, click Close to close the page
Configure PL/SQL Develop
The installation directory of the client has a network/admin directory, which corresponds to the same directory structure on the server. ora) download a copy to this directory
Start the PL/SQL Develop tool and find that it can be connected.
After determining the user name and password for the connection and the database to be connected, click OK.
Create an SQL window and execute a query statement. If the Hong Kong server is rented, you can see the result. OK. Then, our PL/SQL has been officially connected to the remote database.
Preface
In the production environment, the database server is often not installed with X-Windows or has no image interface. In this case, we need to use a manual script to create a database, therefore, writing database creation scripts is a basic technology required by Oracle DBAs.
Prerequisites
Create the folder shown in to store various required files and scripts
Configure the password file
[Oracle @ ebs dbs] $ orapwd file = orapwprod password = oracle entries = 20
Run the preceding command in the dbs directory of ORACLE_HOME to generate a password file. The file name format is orapwSID, And the password is the password of the sys user, entries is the maximum value allowed to connect to sys users (0 by default, that is, unlimited)
Compile the initialization parameter file
[Oracle @ ebs dbs] $ vi initprod. ora
Run the preceding command in the dbs directory of ORACLE_HOME to write the initialization parameter file.
Shows the file content.
Compile a database creation script
[Oracle @ ebs dbs] $ vi/home/oracle/scripts/createDB. SQL
Run the preceding command to compile the database creation script.
Shows the script content.
Configure scripts
After writing the database creation script, you also need to write some configuration scripts. After creating the database using the database creation script, you also need to run these configuration scripts to make the database work normally.
[Oracle @ ebs dbs] $ vi/home/oracle/scripts/alterDB. SQL
Shows the configuration script content.
Create a database
After all preparations are ready, let's start to create a database. Let's take a look at it.
Run the following commands to create a database:
As shown in, the database creation is OK.
Run the preceding command to run the configuration script.
SQL> @? /Sqlplus/admin/pupbld. SQL
SQL> @? /Sqlplus/admin/help/hlpbld. SQL helpus
After the execution is complete, log on to the database using the system user and execute the preceding two commands. Now the database is fully created and available.
Create an example Scheme
Create two temporary tablespaces and add them to the temporary tablespace group.
After the temporary tablespace group is created, the script for creating the example scheme is executed.
Configure Automatic startup script
We can use some configuration scripts to enable and disable Oracle automatically. Let's take a look.
[Root @ ebs ~] # Vi/etc/oratab
Write the above file and configure the two lines of code to enable the instance to start
[Root @ ebs ~] # Vi/etc/rc. d/init. d/oracle
Run the preceding command to write a self-starting script.
Shows the script content. After writing the script, do not forget to add execution permissions for it.
In this way, start OK.
Load it to the startup service, so that Oracle will automatically start each boot.
This article is from the "happy life of cats and bears" blog. Please keep this source