Create tablespace
create tablespace rec_catalog
datafile ‘/data/oradata/CDBRCAT/rec_catalog.dbf’
size 10M autoextend on
extent management local uniform size 1M;
Here I have provided steps for creating database Manually with installation of differnt optional components. Before creating an oracle database, Make sure oracle database software is installed. REFER – Steps to install oracle 12c software. Lets say we will create a database named DBATEAM. First, create a profile with a correct environment. Create a new user. In the database server host, we need to connect to the database using sqlplus in order to create a new user for the pluggable database. In this case, my container database called cdb1 and the pluggable database is called pdb1. How to Install Oracle Database 19c on CentOS 8. Login as oracle user and then execute this command. Creating a database can also erase information in an existing database and create a new database with the same name and physical structure. Creating a database includes the following operations: creating new datafiles or erasing data that existed in previous datafiles. In case you want to create an Oracle Database, without the GUI (dbca), use the following simple steps: 1. First set the enviroment for the oracle user.
alter session set “_ORACLE_SCRIPT”=true;
Create user
create user rcat identified by randompassword
default tablespace rec_catalog
quota unlimited on rec_catalog;
Grant Privileges
grant recovery_catalog_owner to rcat;
select privilege from dba_sys_privs where grantee = ‘RECOVERY_CATALOG_OWNER’;
PRIVILEGE
—————————————-
CREATE TABLE
ALTER SESSION
CREATE VIEW
CREATE TYPE
CREATE SYNONYM
CREATE CLUSTER
CREATE TRIGGER
CREATE SESSION
CREATE PROCEDURE
CREATE DATABASE LINK
CREATE SEQUENCE
connect to the Catalog
Create an entry in TNS names CDBRCAT
rman target / catalog rcat@CDBRCAT
Create Database Sqlplus Oracle 11g
Recovery Manager: Release 12.2.0.1.0 – Production on Fri Aug 10 10:19:12 2018
Copyright (c) 1982, 2017, Oracle and/or its affiliates. All rights reserved.
connected to target database: CDBRCAT (DBID=1512138245)
recovery catalog database Password:
connected to recovery catalog database
Create RMAN Catalog
RMAN> create catalog tablespace rec_catalog;
recovery catalog created
Register the current database
RMAN> register database;
database registered in recovery catalog
starting full resync of recovery catalog
full resync complete
Verify if Database is registered in RMAN Catalog
sqlplus rcat@CDBRCAT
SQL*Plus: Release 12.2.0.1.0 Production on Fri Aug 10 10:31:20 2018
Copyright (c) 1982, 2016, Oracle. All rights reserved.
Enter password:
Last Successful login time: Fri Aug 10 2018 10:26:06 -04:00
Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 – 64bit Production
SQL> select * from rc_database;
DB_KEY DBINC_KEY DBID NAME RESETLOGS_CHANGE# RESETLOGS
———- ———- ———- ——– —————– ———
FINAL_CHANGE#
————-
1 2 1512138245 CDBRCAT 6766569 20-JUN-18
- SQL Tutorial
- Advanced SQL
- SQL Useful Resources
- Selected Reading
The SQL CREATE DATABASE statement is used to create a new SQL database.
Syntax
The basic syntax of this CREATE DATABASE statement is as follows −
Always the database name should be unique within the RDBMS.
Example
If you want to create a new database <testDB>, then the CREATE DATABASE statement would be as shown below −
Create Database Statement Sqlplus
Make sure you have the admin privilege before creating any database. Once a database is created, you can check it in the list of databases as follows −