Installing Oracle Database gives you the engine and the tools. It does not give you a database. DBCA creates the files, the containers, and the configuration. This is Oracle Database 19c on Linux, one instance, one container database.
Oracle DBA Lesson 24A — Create a Database with DBCA
Start from the home you mean
An Oracle home is the directory of one installed set of binaries. A server can have more than one. Use the home this database should run from. In a shell already set for that home:
printf '%s\n' "$ORACLE_HOME"
command -v dbca
The first line is the home. The second is the dbca the shell will run. If they are different installations, fix that before you open the wizard.
Help lists the options for this installation. It does not create a database.
"$ORACLE_HOME/bin/dbca" -help
"$ORACLE_HOME/bin/dbca" -createDatabase -help
Use that help when an option was copied from another version. Then start the wizard:
"$ORACLE_HOME/bin/dbca"
The window needs a graphical session, or a remote display that is already working. Run it as the Oracle software owner, on a server where you are allowed to create a database.
Advanced configuration
Choose Create a database, then Advanced configuration. Typical mode hides storage, initialization, and management. Advanced mode shows them.
Pick a template that matches the workload. General Purpose or Transaction Processing is the start for this example. A template is a starting set of values. Read them.
The names and sizes below are the example. Replace them with the plan for your database. They are not a capacity study.
| Setting | Example | What it is |
|---|---|---|
| Global database name | appcdb.example.com |
Database name, with a domain |
| SID | appcdb |
Instance name on this server |
| Container database | Yes | Create a CDB |
| User PDBs | 1, named APPPDB |
The application container |
| Local undo | Enabled | Each container keeps its own undo |
| Database character set | AL32UTF8 |
Encoding for ordinary character data |
| Memory | ASMM, SGA 2048 MB, PGA 1024 MB | Shared memory and process memory targets |
| Storage | File system, Oracle Managed Files | Oracle names the files in the directory you set |
| Data files | /data/oradata |
Where those files go |
| Fast Recovery Area | /recovery/fra, 10240 MB |
Recovery-file destination and its limit |
The name and the containers
The global database name identifies the database. The SID identifies the instance on this server. In this example both use appcdb. They are still different things. An application connects with a service. Do not hand it the SID and call that the PDB service.
Create as Container database builds a CDB. The root and the seed are part of that CDB. The user-PDB count is on top of those two. One user PDB looks like this:
APPCDB
├── CDB$ROOT
├── PDB$SEED
└── APPPDB
CDB$ROOT holds the shared metadata. PDB$SEED is the template for new PDBs. APPPDB is where the application objects go. Zero user PDBs still leaves the root and the seed.
Local undo gives each container its own undo, which is what rollback and consistent reads use. A new 19c CDB from DBCA uses local undo by default. Confirm the box on the summary.
Data files and the recovery area
File system storage means ordinary directories. With Oracle Managed Files, Oracle chooses the filenames inside the directory you set. You still choose that directory, and it still has to have space.
The Fast Recovery Area is where recovery files go: backups, and archived redo when the database produces them. It has a size. Selecting it does not take a backup, and it does not enable ARCHIVELOG.
Check /data/oradata and /recovery/fra for space, permissions, and a name that is not already in use. Two directories are not two disks.
Character set and memory
On Character sets, AL32UTF8 is the database character set. The national character set is a separate setting, for the national character types. Do not treat them as the same choice.
On Memory, this example uses Automatic Shared Memory Management. The SGA is memory the instance shares. The PGA is memory for server processes, including sorts.
2048 MB SGA + 1024 MB PGA target = 3072 MB
That sum is not a cap. A PGA target is not a ceiling. Leave memory for the operating system and for anything else on the host.
Read the other pages too: listener, database options, management, and the administrator accounts. Enter the passwords in the wizard.
Finish writes the database
On Creation Option, Create database has to be selected. The Summary page is the last time you can compare the form with the plan:
- Global name and SID are the new database, not one that already exists.
- The CDB option, the PDB name, the PDB count, and local undo match the plan.
- Character set and memory match the plan.
- Both directories are the ones you meant, and they have room.
Finish starts creation. DBCA writes files. Keep the summary and the creation log.
To run the same creation without the window, use the response-file template from this Oracle home, including the way that home expects the passwords. Do not turn the help text into a create command.
Oracle's pages for this: creating a CDB, DBCA command syntax, advanced container database, multitenant architecture, Oracle Managed Files, Fast Recovery Area, character set, memory.
No comments:
Post a Comment