Thursday, 24 December 2015

Bidirectional DML replication in oracle Goldengate

=====> Bidirectional DML replication in oracle Goldengate <=====

=====>Node 1 details

OS details:

[oracle@gg1 ~]$ cat /etc/redhat-release
Red Hat Enterprise Linux Server release 5.4 (Tikanga)
hostname: gg1.example.com

database details:
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
PL/SQL Release 11.2.0.3.0 - Production
CORE 11.2.0.3.0 Production
TNS for Linux: Version 11.2.0.3.0 - Production
NLSRTL Version 11.2.0.3.0 - Production

Database name : Dev1

Goldengate details:

Oracle GoldenGate Command Interpreter for Oracle
Version 11.2.1.0.1 OGGCORE_11.2.1.0.1_PLATFORMS_120423.0230_FBO
Linux, x64, 64bit (optimized), Oracle 11g on Apr 23 2012 08:32:14
Copyright (C) 1995, 2012, Oracle and/or its affiliates. All rights reserved.

====>Node2 details

OS details:

[oracle@gg2 ~]$ cat /etc/redhat-release
Red Hat Enterprise Linux Server release 5.4 (Tikanga)
hostname: gg2.example.com

database details:
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
PL/SQL Release 11.2.0.3.0 - Production
CORE 11.2.0.3.0 Production
TNS for Linux: Version 11.2.0.3.0 - Production
NLSRTL Version 11.2.0.3.0 - Production

Database name : Dev2

Goldengate details:

Oracle GoldenGate Command Interpreter for Oracle
Version 11.2.1.0.1 OGGCORE_11.2.1.0.1_PLATFORMS_120423.0230_FBO
Linux, x64, 64bit (optimized), Oracle 11g on Apr 23 2012 08:32:14
Copyright (C) 1995, 2012, Oracle and/or its affiliates. All rights reserved.

====>TNS configuration both node..

edit tnsname.ora
node 1:
DEV2 =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = gg2.example.com)(PORT = 1522))
)
(CONNECT_DATA =
(SERVICE_NAME = dev2)
)
)
DEV1 =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = gg1.example.com)(PORT = 1522))
)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = dev1)
)
)
node 2:
DEV2 =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = gg2.example.com)(PORT = 1522))
)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = dev2)
)
)
DEV1 =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = gg1.example.com)(PORT = 1522))
)
(CONNECT_DATA =
(SERVICE_NAME = dev1)
)
)

====>On source database

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> SELECT log_mode FROM v$database;
LOG_MODE
------------
ARCHIVELOG

SQL> SELECT force_logging, supplemental_log_data_min FROM v$database;
FOR SUPPLEME
--- --------
NO NO

SQL> ALTER DATABASE ADD SUPPLEMENTAL LOG DATA;
Database altered.

SQL> SELECT force_logging, supplemental_log_data_min FROM v$database;
FOR SUPPLEME
--- --------
NO YES

SQL> ALTER DATABASE FORCE LOGGING;
Database altered.

SQL> SELECT force_logging, supplemental_log_data_min FROM v$database;
FOR SUPPLEME
--- --------
YES YES

SQL> ALTER SYSTEM SWITCH LOGFILE;
System altered.

SQL> CREATE USER ggate IDENTIFIED BY oracle;
User created.

SQL> grant create session to ggate;
Grant succeeded.

SQL> grant dba to ggate;
Grant succeeded.

SQL> alter system set undo_retention=86400 scope=both;
System altered.

SQL> grant flashback any table to ggate;
Grant succeeded.
SQL>

==>On target server

SQL> SELECT log_mode FROM v$database;
LOG_MODE
------------
ARCHIVELOG

SQL> SELECT force_logging, supplemental_log_data_min FROM v$database;
FOR SUPPLEME
--- --------
NO NO

SQL> ALTER DATABASE ADD SUPPLEMENTAL LOG DATA;
Database altered.

SQL> SELECT force_logging, supplemental_log_data_min FROM v$database;
FOR SUPPLEME
--- --------
NO YES
SQL> ALTER DATABASE FORCE LOGGING;
Database altered.

SQL> SELECT force_logging, supplemental_log_data_min FROM v$database;
FOR SUPPLEME
--- --------
YES YES

SQL> ALTER SYSTEM SWITCH LOGFILE;
System altered.

SQL> CREATE USER ggate IDENTIFIED BY ggate;
User created.

SQL> grant create session to ggate;
Grant succeeded.

SQL> grant dba to ggate;
Grant succeeded.

SQL> alter system set undo_retention=86400 scope=both;
System altered.

SQL> grant flashback any table to ggate;
Grant succeeded.

SQL>
====>Source

GGSCI (gg1.example.com) 3> dblogin userid ggate, Password ggate
Successfully logged into database.
GGSCI (gg1.example.com) 4> ADD CHECKPOINTTABLE ggate.OGGCHKPT
GGSCI (gg1.example.com) 5> add trandata scott.dept

=====>target

GGSCI (gg1.example.com) 3> dblogin userid ggate, Password ggate
Successfully logged into database.
GGSCI (gg1.example.com) 4> ADD CHECKPOINTTABLE ggate.OGGCHKPT
GGSCI (gg1.example.com) 5> add trandata scott.dept
Note:creating extract and replicate process on both server.

====>Source

GGSCI (gg1.example.com) 2> edit param mgr
PORT 7809
DYNAMICPORTLIST 7810-7820
PURGEOLDEXTRACTS /u01/app/oracle/product/gg/dirdat/rx*, USECHECKPOINTS, MINKEEPHOURS 2

GGSCI (gg1.example.com) 4> edit param RX1 -----extract process
EXTRACT rx1
USERID ggate, PASSWORD ******
EXTTRAIL /u01/app/oracle/product/gg/dirdat/rx
TABLE scott.dept;

GGSCI (gg1.example.com) 5> edit param DP1 -------datapump process
EXTRACT dp1
USERID ggate, PASSWORD ******
RMTHOST gg2.example.com, MGRPORT 7809
RMTTRAIL /u01/app/oracle/product/gg/dirdat/rt
TABLE scott.dept;

GGSCI (gg1.example.com) 6> edit param REP1 ------replication process
REPLICAT rep1
USERID rx025n, PASSWORD *****
ASSUMETARGETDEFS
DISCARDFILE /u01/app/oracle/product/gg/discards, PURGE
MAP scott.dept, TARGET scott.dept;

GGSCI (gg1.example.com) 7> ADD EXTRACT rx1, TRANLOG, BEGIN NOW

GGSCI (gg1.example.com) 8> ADD EXTTRAIL /u01/app/oracle/product/gg/dirdat/rx, EXTRACT rx1

GGSCI (gg1.example.com) 9> ADD EXTRACT dp1 EXTTRAILSOURCE /u01/app/oracle/product/gg/dirdat/rx

GGSCI (gg1.example.com) 10> ADD RMTTRAIL /u01/app/oracle/product/gg/dirdat/rt, EXTRACT dp1

GGSCI (gg1.example.com) 11> ADD REPLICAT rep1, EXTTRAIL /u01/app/oracle/product/gg/dirdat/rt CHECKPOINTTABLE rx025n.OGGCHKPT
REPLICAT added.

GGSCI (gg1.example.com) 20> Info ExtTrail *
Extract Trail: /u01/app/oracle/product/gg/dirdat/rt
Extract: DP1
Seqno: 3
RBA: 1513
File Size: 100M
Extract Trail: /u01/app/oracle/product/gg/dirdat/rx
Extract: EX1
Seqno: 3
RBA: 1243
File Size: 100M

========>targate

GGSCI (gg2.example.com) 2> edit param mgr
PORT 7809
DYNAMICPORTLIST 7810-7820
PURGEOLDEXTRACTS /u01/app/oracle/product/gg/dirdat/rx*, USECHECKPOINTS, MINKEEPHOURS 2

GGSCI (gg2.example.com) 4> edit param RX1 -----extract process
EXTRACT rx1
USERID ggate, PASSWORD ******
EXTTRAIL /u01/app/oracle/product/gg/dirdat/rx
TABLE scott.dept;

GGSCI (gg2.example.com) 5> edit param DP1 -------datapump process
EXTRACT dp1
USERID ggate, PASSWORD ******
RMTHOST gg2.example.com, MGRPORT 7809
RMTTRAIL /u01/app/oracle/product/gg/dirdat/tx
TABLE scott.dept;

GGSCI (gg2.example.com) 6> edit param REP1 ------replication process
REPLICAT rep1
USERID rx025n, PASSWORD *****
ASSUMETARGETDEFS
DISCARDFILE /u01/app/oracle/product/gg/discards, PURGE
MAP scott.dept, TARGET scott.dept;

GGSCI (gg2.example.com) 7> ADD EXTRACT ex1, TRANLOG, BEGIN NOW
EXTRACT added.

GGSCI (gg2.example.com) 8> ADD EXTTRAIL /u01/app/oracle/product/gg/dirdat/rx, EXTRACT rx1
EXTTRAIL added.

GGSCI (gg2.example.com) 9> ADD EXTRACT dp1 EXTTRAILSOURCE /u01/app/oracle/product/gg/dirdat/rx
EXTRACT added.

GGSCI (gg2.example.com) 10> ADD RMTTRAIL /u01/app/oracle/product/gg/dirdat/tx, EXTRACT dp1
RMTTRAIL added

GGSCI (gg2.example.com) 11> ADD REPLICAT rep1, EXTTRAIL /u01/app/oracle/product/gg/dirdat/tx CHECKPOINTTABLE rx025n.OGGCHKPT
REPLICAT added.

GGSCI (gg2.example.com) 30> Info ExtTrail *
Extract Trail: /u01/app/oracle/product/gg/dirdat/tx
Extract: DP1
Seqno: 0
RBA: 0
File Size: 100M
Extract Trail: /u01/app/oracle/product/gg/dirdat/rx
Extract: EX1
Seqno: 0
RBA: 0
File Size: 100M

======>start gg extract,datapump process on source

- start manager process
- start extract process
- start datapump process

GGSCI (gg1.example.com) 33> start manager
Manager started.

GGSCI (gg1.example.com) 34> start EXTRACT EX1
Sending START request to MANAGER ...
EXTRACT EX1 starting

GGSCI (gg1.example.com) 35> start EXTRACT DP1
Sending START request to MANAGER ...
EXTRACT DP1 starting

GGSCI (gg1.example.com) 36> info all

Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER RUNNING
EXTRACT RUNNING DP1 00:00:00 00:00:10
EXTRACT RUNNING RX1 00:00:00 00:00:03
REPLICAT STOPPED REP1 00:00:00 00:20:17

note: replicate process we will start after target extract and replication process.

======>start gg extract,datapump process on targate

- start manager process
- start extract process
- start datapump process

GGSCI (gg2.example.com) 47> start extract EX1
Sending START request to MANAGER ...
EXTRACT EX1 starting

GGSCI (gg2.example.com) 48> start extract DP1
Sending START request to MANAGER ...
EXTRACT DP1 starting

GGSCI (gg2.example.com) 49> info all
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER RUNNING
EXTRACT RUNNING DP1 00:00:00 00:00:07
EXTRACT RUNNING RX1 00:00:00 00:00:04
REPLICAT STOPPED REP1 00:00:00 00:00:09

note: replicate process we will start after target extract and replication process.

=======>start gg replicate process on target

GGSCI (gg2.example.com) 50> start REPLICAT REP1
Sending START request to MANAGER ...
REPLICAT REP1 starting

GGSCI (gg1.example.com) 52> info all
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER RUNNING
EXTRACT RUNNING DP1 00:00:00 00:00:03
EXTRACT RUNNING RX1 00:00:00 00:00:01
REPLICAT RUNNING REP1 00:00:00 00:00:04

=====>start gg replicate process on source

GGSCI (gg1.example.com) 66> start REPLICAT REP1
Sending START request to MANAGER ...
REPLICAT REP1 starting

GGSCI (gg1.example.com) 67> info all
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER RUNNING
EXTRACT RUNNING DP1 00:00:00 00:00:07
EXTRACT RUNNING RX1 00:00:00 00:00:04
REPLICAT RUNNING REP1 00:00:00 00:00:09

======>inserting one row in source database

SQL> select instance_name from v$instance;
INSTANCE_NAME
----------------
dev1

SQL> conn scott
Enter password:
Connected.

SQL> show user
USER is "SCOTT"

SQL> set lines 220

SQL> select * from dept;

DEPTNO DNAME LOC
---------- -------------- -------------
10 ACCOUNTING NEW YORK
20 RESEARCH DALLAS
30 SALES CHICAGO
40 OPERATIONS BOSTON

SQL> insert into dept values(66,'marketing','new york');
1 row created.

SQL> commit;
Commit complete.

SQL> select * from dept;
DEPTNO DNAME LOC
---------- -------------- -------------
10 ACCOUNTING NEW YORK
20 RESEARCH DALLAS
30 SALES CHICAGO
40 OPERATIONS BOSTON
66 marketing new york

SQL>

GGSCI (gg1.example.com) 2> stats EXTRACT RX1

Sending STATS request to EXTRACT RX1 ...
Start of Statistics at 2015-12-25 01:41:36.
Output to /u01/app/oracle/product/gg/dirdat/rx:
Extracting from SCOTT.DEPT to SCOTT.DEPT:
*** Total statistics since 2015-12-25 00:29:16 ***
Total inserts 1.00
Total updates 0.00
Total deletes 1.00
Total discards 0.00
Total operations 2.00
*** Daily statistics since 2015-12-25 00:29:16 ***
Total inserts 1.00
Total updates 0.00
Total deletes 1.00
Total discards 0.00
Total operations 2.00
*** Hourly statistics since 2015-12-25 01:00:00 ***
Total inserts 1.00
Total updates 0.00
Total deletes 0.00
Total discards 0.00
Total operations 1.00
*** Latest statistics since 2015-12-25 00:29:16 ***
Total inserts 1.00
Total updates 0.00
Total deletes 1.00
Total discards 0.00
Total operations 2.00
End of Statistics.

=======>checking on target side

GGSCI (gg2.example.com) 51> stats REPLICAT REP1

Sending STATS request to REPLICAT REP1 ...
Start of Statistics at 2015-12-25 01:42:22.
Replicating from SCOTT.DEPT to SCOTT.DEPT:
*** Total statistics since 2015-12-25 00:29:17 ***
Total inserts 1.00
Total updates 0.00
Total deletes 1.00
Total discards 0.00
Total operations 2.00
*** Daily statistics since 2015-12-25 00:29:17 ***
Total inserts 1.00
Total updates 0.00
Total deletes 1.00
Total discards 0.00
Total operations 2.00
*** Hourly statistics since 2015-12-25 01:00:00 ***
Total inserts 1.00
Total updates 0.00
Total deletes 0.00
Total discards 0.00
Total operations 1.00
*** Latest statistics since 2015-12-25 00:29:17 ***
Total inserts 1.00
Total updates 0.00
Total deletes 1.00
Total discards 0.00
Total operations 2.00
End of Statistics.

SQL> select instance_name from v$instance;
INSTANCE_NAME
----------------
dev2

SQL> conn scott
Enter password:
Connected.

SQL> set lines 220
SQL> select * from dept;
DEPTNO DNAME LOC
---------- -------------- -------------
10 ACCOUNTING NEW YORK
20 RESEARCH DALLAS
30 SALES CHICAGO
40 OPERATIONS BOSTON
66 marketing new york

SQL>

===>Now inserting value in target database.

SQL> select instance_name from v$instance;
INSTANCE_NAME
----------------
dev2

SQL> conn scott
Enter password:
Connected.

SQL> select * from dept;

DEPTNO DNAME LOC
---------- -------------- -------------
10 ACCOUNTING NEW YORK
20 RESEARCH DALLAS
30 SALES CHICAGO
40 OPERATIONS BOSTON
66 marketing new york

SQL> insert into dept values(68,'testing','perth');
1 row created.

SQL> commit;

Commit complete.

SQL> select * from dept;
DEPTNO DNAME LOC
---------- -------------- -------------
68 testing perth
10 ACCOUNTING NEW YORK
20 RESEARCH DALLAS
30 SALES CHICAGO
40 OPERATIONS BOSTON
66 marketing new york
6 rows selected.

====>checking gg process

GGSCI (gg2.example.com) 2> stats RX1

Sending STATS request to EXTRACT RX1 ...
Start of Statistics at 2015-12-25 03:34:11.
Output to /u01/app/oracle/product/gg/dirdat/rx:
Extracting from SCOTT.DEPT to SCOTT.DEPT:

*** Total statistics since 2015-12-25 03:33:58 ***
Total inserts 1.00
Total updates 0.00
Total deletes 0.00
Total discards 0.00
Total operations 1.00
*** Daily statistics since 2015-12-25 03:33:58 ***
Total inserts 1.00
Total updates 0.00
Total deletes 0.00
Total discards 0.00
Total operations 1.00
*** Hourly statistics since 2015-12-25 03:33:58 ***
Total inserts 1.00
Total updates 0.00
Total deletes 0.00
Total discards 0.00
Total operations 1.00
*** Latest statistics since 2015-12-25 03:33:58 ***
Total inserts 1.00
Total updates 0.00
Total deletes 0.00
Total discards 0.00
Total operations 1.00
End of Statistics.

GGSCI (gg2.example.com) 3> stats DP1

Sending STATS request to EXTRACT DP1 ...
Start of Statistics at 2015-12-25 03:34:19.
Output to /u01/app/oracle/product/gg/dirdat/tx:
Extracting from SCOTT.DEPT to SCOTT.DEPT:

*** Total statistics since 2015-12-25 03:34:00 ***
Total inserts 1.00
Total updates 0.00
Total deletes 0.00
Total discards 0.00
Total operations 1.00
*** Daily statistics since 2015-12-25 03:34:00 ***
Total inserts 1.00
Total updates 0.00
Total deletes 0.00
Total discards 0.00
Total operations 1.00
*** Hourly statistics since 2015-12-25 03:34:00 ***
Total inserts 1.00
Total updates 0.00
Total deletes 0.00
Total discards 0.00
Total operations 1.00
*** Latest statistics since 2015-12-25 03:34:00 ***
Total inserts 1.00
Total updates 0.00
Total deletes 0.00
Total discards 0.00
Total operations 1.00
End of Statistics.

====>checking gg process on source

GGSCI (gg1.example.com) 7> stats REP1
Sending STATS request to REPLICAT REP1 ...
Start of Statistics at 2015-12-25 03:42:02.
Replicating from SCOTT.DEPT to SCOTT.DEPT:
*** Total statistics since 2015-12-25 03:41:48 ***
Total inserts 1.00
Total updates 0.00
Total deletes 0.00
Total discards 0.00
Total operations 1.00
*** Daily statistics since 2015-12-25 03:41:48 ***
Total inserts 1.00
Total updates 0.00
Total deletes 0.00
Total discards 0.00
Total operations 1.00
*** Hourly statistics since 2015-12-25 03:41:48 ***
Total inserts 1.00
Total updates 0.00
Total deletes 0.00
Total discards 0.00
Total operations 1.00
*** Latest statistics since 2015-12-25 03:41:48 ***
Total inserts 1.00
Total updates 0.00
Total deletes 0.00
Total discards 0.00
Total operations 1.00
End of Statistics.

==>database validation

SQL> conn /as sysdba
Connected.

SQL> select instance_name from v$instance;
INSTANCE_NAME
----------------
dev1

SQL> select * from dept;
DEPTNO DNAME LOC
---------- -------------- -------------
66 marketing new york
68 testing perth
10 ACCOUNTING NEW YORK
20 RESEARCH DALLAS
30 SALES CHICAGO
40 OPERATIONS BOSTON
6 rows selected.
                                                         ******END****

Sunday, 6 December 2015

12c Golden gate installation steps.

:=  12c Golden gate installation for 11g Database.

Operating system details:
[oracle@localhost ~]$ cat /etc/redhat-release
Red Hat Enterprise Linux Server release 6.4 (Santiago)

Database version details:
SQL> select * from v$version;
BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
PL/SQL Release 11.2.0.3.0 - Production
CORE    11.2.0.3.0      Production
TNS for Linux: Version 11.2.0.3.0 - Production
NLSRTL Version 11.2.0.3.0 - Production

Golden gate version details:
Oracle GoldenGate Command Interpreter for Oracle
Version 12.2.0.1.0 OGGCORE_12.2.0.1.0_PLATFORMS_151101.1925.2_FBO
Linux, x64, 64bit (optimized), Oracle 11g on Nov 11 2015 01:38:14
Operating system character set identified as UTF-8.
Copyright (C) 1995, 2015, Oracle and/or its affiliates. All rights reserved.

1)Create directory structure and user for goleden gate.
[gg_user@localhost ~]$ mkdir –p /u01/app/oracle/product/12.1.0.1/db_1/11.2.0/db_1
[gg_user@localhost ~]$ mkdir –p /u01/app/gg_user/product/12.1.2/oggcore_1

2)Got to golden gate s/w folder 

[gg_user@localhost Disk1]$ ls -ltr
total 16
drwxr-xr-x.  4 gg_user oinstall 4096 Nov 11 21:05 install
drwxr-xr-x. 11 gg_user oinstall 4096 Nov 11 21:05 stage
-rwxr-xr-x.  1 gg_user oinstall  918 Nov 11 21:05 runInstaller
drwxrwxr-x.  2 gg_user oinstall 4096 Nov 11 21:05 response

[gg_user@localhost Disk1]$ ./runInstaller




Note:  To install Oracle Golden Gate 12c for 11g database, select Oracle GoldenGate for Oracle Database 11g.  If you select oracle database 11g option, the installation will be valid but will not start against an 11g database due to shared libraries: libnnz11.so file and libclntsh.so.11.1.
Solution:
[gg_user@localhost oggcore_1]$ ln -s /u01/app/oracle/product/12.1.0.1/db_1/11.2.0/db_1/lib/libnnz11.so libnnz11.so
[gg_user@localhost oggcore_1]$ ln -s /u01/app/oracle/product/12.1.0.1/db_1/11.2.0/db_1/lib/libclntsh.so.11.1 libclntsh.so.11.1







[gg_user@localhost]$cd /u01/app/gg_user/product/12.1.2/oggcore_1

[gg_user@localhost oggcore_1]$ ./ggsci

Oracle GoldenGate Command Interpreter for Oracle
Version 12.2.0.1.0 OGGCORE_12.2.0.1.0_PLATFORMS_151101.1925.2_FBO
Linux, x64, 64bit (optimized), Oracle 11g on Nov 11 2015 01:38:14
Operating system character set identified as UTF-8.
Copyright (C) 1995, 2015, Oracle and/or its affiliates. All rights reserved.


GGSCI (localhost.localdomain) 1> info all
Program     Status      Group       Lag at Chkpt  Time Since Chkpt
MANAGER     RUNNING
GGSCI (localhost.localdomain) 2>

                                                ********END*********









Thursday, 26 November 2015

Create Dummy database using rman 0 level backup


Server details

Node 1:
[oracle@target backup]$ cat /etc/redhat-release
Red Hat Enterprise Linux Server release 5.4 (Tikanga)

Node 2:
[oracle@source backup]$ cat /etc/redhat-release
Red Hat Enterprise Linux Server release 5.4 (Tikanga)


1) Take 0 level backup of source database

[oracle@source]$ mkdir /u01/app/backup/

[oracle@source]$ cd /u01/app/backup/

[oracle@source backup]$ rman target /

Recovery Manager: Release 11.2.0.3.0 - Production on Fri Nov 27 02:50:21 2015

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

connected to target database: DB11G (DBID=366062519)

RMAN>


RMAN> RUN
2> {
3> configure controlfile autobackup on;
4> set command id to 'ORCLOnlineBackupFull';
5> ALLOCATE CHANNEL c1 DEVICE TYPE disk;
6> ALLOCATE CHANNEL c2 DEVICE TYPE disk;
7> backup AS COMPRESSED BACKUPSET full database tag ORCL_FULL format '/u01/app/backup/%d_%T_%s_%p_FULL' ;
8> sql 'alter system archive log current';
9> backup tag ORCL_ARCHIVE format '/u01/app/backup/%d_%T_%s_%p_ARCHIVE' archivelog all delete all input ;
10> backup tag ORCL_CONTROL current controlfile format '/u01/app/backup/%d_%T_%s_%p_CONTROL';
11> backup tag spfile_pfile spfile format '/u01/app/backup/%d_%T_%s_%p_spfile';
12> release channel c1;
13> release channel c2;
14> }

using target database control file instead of recovery catalog
old RMAN configuration parameters:
CONFIGURE CONTROLFILE AUTOBACKUP ON;
new RMAN configuration parameters:
CONFIGURE CONTROLFILE AUTOBACKUP ON;
new RMAN configuration parameters are successfully stored

executing command: SET COMMAND ID

allocated channel: c1
channel c1: SID=33 device type=DISK

allocated channel: c2
channel c2: SID=41 device type=DISK

Starting backup at 27-NOV-15
channel c1: starting compressed full datafile backup set
channel c1: specifying datafile(s) in backup set
input datafile file number=00001 name=/u01/app/oracle/oradata/DB11G/system01.dbf
input datafile file number=00005 name=/u01/app/oracle/oradata/DB11G/example01.db
channel c1: starting piece 1 at 27-NOV-15
channel c2: starting compressed full datafile backup set
channel c2: specifying datafile(s) in backup set
input datafile file number=00002 name=/u01/app/oracle/oradata/DB11G/sysaux01.dbf
input datafile file number=00003 name=/u01/app/oracle/oradata/DB11G/undotbs01.db
input datafile file number=00004 name=/u01/app/oracle/oradata/DB11G/users01.dbf
channel c2: starting piece 1 at 27-NOV-15
channel c2: finished piece 1 at 27-NOV-15
piece handle=/u01/app/backup/DB11G_20151127_37_1_FULL tag=ORCL_FULL comment=NONE
channel c2: backup set complete, elapsed time: 00:00:46
channel c1: finished piece 1 at 27-NOV-15
piece handle=/u01/app/backup/DB11G_20151127_36_1_FULL tag=ORCL_FULL comment=NONE
channel c1: backup set complete, elapsed time: 00:00:56
Finished backup at 27-NOV-15

Starting Control File and SPFILE Autobackup at 27-NOV-15
piece handle=/u01/app/oracle/product/11.2.0/db_1/dbs/c-366062519-20151127-00 comment=NONE
Finished Control File and SPFILE Autobackup at 27-NOV-15

sql statement: alter system archive log current

Starting backup at 27-NOV-15
current log archived
channel c1: starting archived log backup set
channel c1: specifying archived log(s) in backup set
input archived log thread=1 sequence=11 RECID=9 STAMP=896841558
channel c1: starting piece 1 at 27-NOV-15
channel c2: starting archived log backup set
channel c2: specifying archived log(s) in backup set
input archived log thread=1 sequence=12 RECID=10 STAMP=896842340
input archived log thread=1 sequence=13 RECID=11 STAMP=896842340
channel c2: starting piece 1 at 27-NOV-15
channel c1: finished piece 1 at 27-NOV-15
piece handle=/u01/app/backup/DB11G_20151127_39_1_ARCHIVE tag=ORCL_ARCHIVE comment=NONE
channel c1: backup set complete, elapsed time: 00:00:01
channel c1: deleting archived log(s)
archived log file name=/u01/archive/1_11_896392954.dbf RECID=9 STAMP=896841558
channel c2: finished piece 1 at 27-NOV-15
piece handle=/u01/app/backup/DB11G_20151127_40_1_ARCHIVE tag=ORCL_ARCHIVE comment=NONE
channel c2: backup set complete, elapsed time: 00:00:01
channel c2: deleting archived log(s)
archived log file name=/u01/archive/1_12_896392954.dbf RECID=10 STAMP=896842340
archived log file name=/u01/archive/1_13_896392954.dbf RECID=11 STAMP=896842340
Finished backup at 27-NOV-15

Starting backup at 27-NOV-15
channel c1: starting full datafile backup set
channel c1: specifying datafile(s) in backup set
including current control file in backup set
channel c1: starting piece 1 at 27-NOV-15
channel c1: finished piece 1 at 27-NOV-15
piece handle=/u01/app/backup/DB11G_20151127_41_1_CONTROL tag=ORCL_CONTROL comment=NONE
channel c1: backup set complete, elapsed time: 00:00:01
Finished backup at 27-NOV-15

Starting backup at 27-NOV-15
channel c1: starting full datafile backup set
channel c1: specifying datafile(s) in backup set
including current SPFILE in backup set
channel c1: starting piece 1 at 27-NOV-15
channel c1: finished piece 1 at 27-NOV-15
piece handle=/u01/app/backup/DB11G_20151127_42_1_spfile tag=SPFILE_PFILE comment=NONE
channel c1: backup set complete, elapsed time: 00:00:01
Finished backup at 27-NOV-15

Starting Control File and SPFILE Autobackup at 27-NOV-15
piece handle=/u01/app/oracle/product/11.2.0/db_1/dbs/c-366062519-20151127-01 comment=NONE
Finished Control File and SPFILE Autobackup at 27-NOV-15

released channel: c1

released channel: c2

2) Create same backup location on target database server and transfer all backup file to same location.


[oracle@target ~]$ mkdir /u01/app/backup/

[oracle@source backup]$ ls -ltr
total 303000
-rw-r----- 1 oracle oinstall  76931072 Nov 27 02:52 DB11G_20151127_37_1_FULL
-rw-r----- 1 oracle oinstall 212533248 Nov 27 02:52 DB11G_20151127_36_1_FULL
-rw-r----- 1 oracle oinstall   2514432 Nov 27 02:52 DB11G_20151127_40_1_ARCHIVE
-rw-r----- 1 oracle oinstall   8061440 Nov 27 02:52 DB11G_20151127_39_1_ARCHIVE
-rw-r----- 1 oracle oinstall   9797632 Nov 27 02:52 DB11G_20151127_41_1_CONTROL
-rw-r----- 1 oracle oinstall     98304 Nov 27 02:52 DB11G_20151127_42_1_spfile


[oracle@source backup]$ scp * oracle@target:/u01/app/backup/
The authenticity of host 'target (192.168.223.130)' can't be established.
RSA key fingerprint is 87:f6:a9:cc:0d:63:8c:40:6d:ee:17:2f:05:dd:ac:ad.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'target,192.168.223.130' (RSA) to the list of known hosts.
oracle@target's password:
DB11G_20151127_36_1_FULL                                                                                     100%  203MB  50.7MB/s   00:04
DB11G_20151127_37_1_FULL                                                                                     100%   73MB  36.7MB/s   00:02
DB11G_20151127_39_1_ARCHIVE                                                                                  100% 7873KB   7.7MB/s   00:01
DB11G_20151127_40_1_ARCHIVE                                                                                  100% 2456KB   2.4MB/s   00:00
DB11G_20151127_41_1_CONTROL                                                                                  100% 9568KB   9.3MB/s   00:00
DB11G_20151127_42_1_spfile                                                                                   100%   96KB  96.0KB/s   00:00

[oracle@target ~]$ cd /u01/app/backup/
[oracle@target backup]$ ls -ltr
total 303000
-rw-r----- 1 oracle oinstall 212533248 Nov 26 16:41 DB11G_20151127_36_1_FULL
-rw-r----- 1 oracle oinstall  76931072 Nov 26 16:41 DB11G_20151127_37_1_FULL
-rw-r----- 1 oracle oinstall   9797632 Nov 26 16:41 DB11G_20151127_41_1_CONTROL
-rw-r----- 1 oracle oinstall   2514432 Nov 26 16:41 DB11G_20151127_40_1_ARCHIVE
-rw-r----- 1 oracle oinstall   8061440 Nov 26 16:41 DB11G_20151127_39_1_ARCHIVE
-rw-r----- 1 oracle oinstall     98304 Nov 26 16:41 DB11G_20151127_42_1_spfile
[oracle@target backup]$

3) Create structure on target database same as source database.

[oracle@target oracle]$ mkdir -p /u01/app/oracle/oradata/DB11G
[oracle@source DB11G]$ mkdir -p /u01/app/oracle/admin/DB11G/dpdump
[oracle@source DB11G]$ mkdir -p /u01/app/oracle/admin/DB11G/pfile
[oracle@source DB11G]$ mkdir -p /u01/app/oracle/admin/DB11G/adump
[oracle@source DB11G]$

4) Restore spfile,contofile,database using rman (on target database).

[oracle@target dbs]$ rman target /

Recovery Manager: Release 11.2.0.3.0 - Production on Thu Nov 26 17:25:00 2015

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

connected to target database (not started)

RMAN> startup nomount

startup failed: ORA-01078: failure in processing system parameters
LRM-00109: could not open parameter file '/u01/app/oracle/product/11.2.0/db_1/dbs/initDB11G.ora'

starting Oracle instance without parameter file for retrieval of spfile
Oracle instance started

Total System Global Area     158662656 bytes

Fixed Size                     2226456 bytes
Variable Size                 92276456 bytes
Database Buffers              58720256 bytes
Redo Buffers                   5439488 bytes

RMAN> restore spfile from '/u01/app/backup/DB11G_20151127_42_1_spfile';

Starting restore at 26-NOV-15
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=18 device type=DISK

channel ORA_DISK_1: restoring spfile from AUTOBACKUP /u01/app/backup/DB11G_20151127_42_1_spfile
channel ORA_DISK_1: SPFILE restore from AUTOBACKUP complete
Finished restore at 26-NOV-15

RMAN> shutdown immediate;

Oracle instance shut down

RMAN>exit

[oracle@target dbs]$ sqlplus

SQL*Plus: Release 11.2.0.3.0 Production on Thu Nov 26 17:51:36 2015

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

Enter user-name: /as sysdba

SQL> create pfile from spfile;

File created.

SQL> startup nomount pfile='/u01/app/oracle/product/11.2.0/db_1/dbs/initDB11G.ora';
ORACLE instance started.

Total System Global Area  839282688 bytes
Fixed Size                  2233000 bytes
Variable Size             520097112 bytes
Database Buffers          314572800 bytes
Redo Buffers                2379776 bytes
SQL> exit

[oracle@target admin]$ echo $ORACLE_SID
DB11G
[oracle@target admin]$ rman target /

Recovery Manager: Release 11.2.0.3.0 - Production on Thu Nov 26 17:52:32 2015

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

connected to target database: DB11G (not mounted)

RMAN> restore controlfile from '/u01/app/backup/DB11G_20151127_41_1_CONTROL';

Starting restore at 26-NOV-15
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=20 device type=DISK

channel ORA_DISK_1: restoring control file
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
output file name=/u01/app/oracle/oradata/DB11G/control01.ctl
output file name=/u01/app/oracle/oradata/DB11G/control02.ctl
Finished restore at 26-NOV-15

RMAN> alter database mount;

database mounted
released channel: ORA_DISK_1

RMAN> restore database;

Starting restore at 26-NOV-15
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=20 device type=DISK

channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00002 to /u01/app/oracle/oradata/DB11G/sysaux01.dbf
channel ORA_DISK_1: restoring datafile 00003 to /u01/app/oracle/oradata/DB11G/undotbs01.dbf
channel ORA_DISK_1: restoring datafile 00004 to /u01/app/oracle/oradata/DB11G/users01.dbf
channel ORA_DISK_1: reading from backup piece /u01/app/backup/DB11G_20151127_37_1_FULL
channel ORA_DISK_1: piece handle=/u01/app/backup/DB11G_20151127_37_1_FULL tag=ORCL_FULL
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:25
channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00001 to /u01/app/oracle/oradata/DB11G/system01.dbf
channel ORA_DISK_1: restoring datafile 00005 to /u01/app/oracle/oradata/DB11G/example01.dbf
channel ORA_DISK_1: reading from backup piece /u01/app/backup/DB11G_20151127_36_1_FULL
channel ORA_DISK_1: piece handle=/u01/app/backup/DB11G_20151127_36_1_FULL tag=ORCL_FULL
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:47
Finished restore at 26-NOV-15

RMAN> recover database;

Starting recover at 26-NOV-15
using channel ORA_DISK_1

starting media recovery

channel ORA_DISK_1: starting archived log restore to default destination
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=12
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=13
channel ORA_DISK_1: reading from backup piece /u01/app/backup/DB11G_20151127_40_1_ARCHIVE
channel ORA_DISK_1: piece handle=/u01/app/backup/DB11G_20151127_40_1_ARCHIVE tag=ORCL_ARCHIVE
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
archived log file name=/u01/archive/1_12_896392954.dbf thread=1 sequence=12
archived log file name=/u01/archive/1_13_896392954.dbf thread=1 sequence=13
unable to find archived log
archived log thread=1 sequence=14
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 11/26/2015 17:56:57
RMAN-06054: media recovery requesting unknown archived log for thread 1 with sequence 14 and starting SCN of 1075281

RMAN> alter database open RESETLOGS;

database opened

RMAN> shutdown immediate;

database closed
database dismounted
Oracle instance shut down

RMAN> exit

[oracle@target dbs]$ sqlplus

SQL*Plus: Release 11.2.0.3.0 Production on Thu Nov 26 17:59:24 2015

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

Enter user-name: /as sysdba
Connected to an idle instance.

SQL> startup pfile='/u01/app/oracle/product/11.2.0/db_1/dbs/initDB11G.ora';
ORACLE instance started.

Total System Global Area  839282688 bytes
Fixed Size                  2233000 bytes
Variable Size             520097112 bytes
Database Buffers          314572800 bytes
Redo Buffers                2379776 bytes
Database mounted.
Database opened.
SQL> create spfile from pfile;

File created.

SQL> startup force;
ORACLE instance started.

Total System Global Area  839282688 bytes
Fixed Size                  2233000 bytes
Variable Size             520097112 bytes
Database Buffers          314572800 bytes
Redo Buffers                2379776 bytes
Database mounted.
Database opened.
SQL> select name from v$database;

NAME
---------
DB11G

SQL>


                                                             *****END*****


Saturday, 7 November 2015

Container and Pluggable database backup command in oracle database 12c.

1) Backup container database plus pluggable database.

-> connect rman with sys user.

[oracle@cdb1 dbs]$ rman target=/
Recovery Manager: Release 12.1.0.2.0 - Production on Sun Oct 18 05:20:11 2015
Copyright (c) 1982, 2014, Oracle and/or its affiliates. All rights reserved.
connected to target database: ORCL (DBID=1413747592)

RMAN> BACKUP DATABASE PLUS ARCHIVELOG;
Starting backup at 18-OCT-15
current log archived
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=52 device type=DISK
channel ORA_DISK_1: starting archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=10 RECID=1 STAMP=893395257
channel ORA_DISK_1: starting piece 1 at 18-OCT-15
channel ORA_DISK_1: finished piece 1 at 18-OCT-15
piece handle=/u01/app/oracle/fast_recovery_area/ORCL/backupset/2015_10_18/o1_mf_annnn_TAG20151018T052058_c25qq26k_.bkp tag=TAG20151018T052058 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 18-OCT-15
Starting backup at 18-OCT-15
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00001 name=/u01/app/oracle/oradata/orcl/system01.dbf
input datafile file number=00003 name=/u01/app/oracle/oradata/orcl/sysaux01.dbf
input datafile file number=00004 name=/u01/app/oracle/oradata/orcl/undotbs01.dbf
input datafile file number=00006 name=/u01/app/oracle/oradata/orcl/users01.dbf
channel ORA_DISK_1: starting piece 1 at 18-OCT-15
channel ORA_DISK_1: finished piece 1 at 18-OCT-15
piece handle=/u01/app/oracle/fast_recovery_area/ORCL/backupset/2015_10_18/o1_mf_nnndf_TAG20151018T052059_c25qq3j0_.bkp tag=TAG20151018T052059 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:35
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00009 name=/u01/app/oracle/oradata/orcl/pdb1/sysaux01.dbf
input datafile file number=00008 name=/u01/app/oracle/oradata/orcl/pdb1/system01.dbf
channel ORA_DISK_1: starting piece 1 at 18-OCT-15
channel ORA_DISK_1: finished piece 1 at 18-OCT-15
piece handle=/u01/app/oracle/fast_recovery_area/ORCL/1BA9531D0DD53B0EE05348304B74C6C7/backupset/2015_10_18/o1_mf_nnndf_TAG20151018T052059_c25qr711_.bkp tag=TAG20151018T052059 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:16
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00007 name=/u01/app/oracle/oradata/orcl/pdbseed/sysaux01.dbf
input datafile file number=00005 name=/u01/app/oracle/oradata/orcl/pdbseed/system01.dbf
channel ORA_DISK_1: starting piece 1 at 18-OCT-15
channel ORA_DISK_1: finished piece 1 at 18-OCT-15
piece handle=/u01/app/oracle/fast_recovery_area/ORCL/1BA927A157F92B65E05348304B740CF8/backupset/2015_10_18/o1_mf_nnndf_TAG20151018T052059_c25qrp62_.bkp tag=TAG20151018T052059 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:15
Finished backup at 18-OCT-15
Starting backup at 18-OCT-15
current log archived
using channel ORA_DISK_1
channel ORA_DISK_1: starting archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=11 RECID=2 STAMP=893395325
channel ORA_DISK_1: starting piece 1 at 18-OCT-15
channel ORA_DISK_1: finished piece 1 at 18-OCT-15
piece handle=/u01/app/oracle/fast_recovery_area/ORCL/backupset/2015_10_18/o1_mf_annnn_TAG20151018T052205_c25qs5pm_.bkp tag=TAG20151018T052205 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 18-OCT-15
Starting Control File Autobackup at 18-OCT-15
piece handle=/u01/app/oracle/fast_recovery_area/ORCL/autobackup/2015_10_18/o1_mf_n_893395326_c25qs7b9_.bkp comment=NONE
Finished Control File Autobackup at 18-OCT-15

2) Backup only container database.

RMAN> BACKUP DATABASE ROOT plus archivelog;
Starting backup at 18-OCT-15
current log archived
using channel ORA_DISK_1
channel ORA_DISK_1: starting archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=10 RECID=1 STAMP=893395257
input archived log thread=1 sequence=11 RECID=2 STAMP=893395325
input archived log thread=1 sequence=12 RECID=3 STAMP=893395548
channel ORA_DISK_1: starting piece 1 at 18-OCT-15
channel ORA_DISK_1: finished piece 1 at 18-OCT-15
piece handle=/u01/app/oracle/fast_recovery_area/ORCL/backupset/2015_10_18/o1_mf_annnn_TAG20151018T052548_c25r04nz_.bkp tag=TAG20151018T052548 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 18-OCT-15
Starting backup at 18-OCT-15
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00001 name=/u01/app/oracle/oradata/orcl/system01.dbf
input datafile file number=00003 name=/u01/app/oracle/oradata/orcl/sysaux01.dbf
input datafile file number=00004 name=/u01/app/oracle/oradata/orcl/undotbs01.dbf
input datafile file number=00006 name=/u01/app/oracle/oradata/orcl/users01.dbf
channel ORA_DISK_1: starting piece 1 at 18-OCT-15
channel ORA_DISK_1: finished piece 1 at 18-OCT-15
piece handle=/u01/app/oracle/fast_recovery_area/ORCL/backupset/2015_10_18/o1_mf_nnndf_TAG20151018T052549_c25r05xs_.bkp tag=TAG20151018T052549 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:35
Finished backup at 18-OCT-15
Starting backup at 18-OCT-15
current log archived
using channel ORA_DISK_1
channel ORA_DISK_1: starting archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=13 RECID=4 STAMP=893395585
channel ORA_DISK_1: starting piece 1 at 18-OCT-15
channel ORA_DISK_1: finished piece 1 at 18-OCT-15
piece handle=/u01/app/oracle/fast_recovery_area/ORCL/backupset/2015_10_18/o1_mf_annnn_TAG20151018T052625_c25r19gf_.bkp tag=TAG20151018T052625 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 18-OCT-15
Starting Control File Autobackup at 18-OCT-15
piece handle=/u01/app/oracle/fast_recovery_area/ORCL/autobackup/2015_10_18/o1_mf_n_893395586_c25r1btk_.bkp comment=NONE
Finished Control File Autobackup at 18-OCT-15

3) Backup only pluggable database.

I have only one pluggable database pdb1.

SQL> select con_id,name from v$containers;
CON_ID NAME
---------- ------------------------------
1 CDB$ROOT
2 PDB$SEED
3 PDB1
RMAN> BACKUP PLUGGABLE DATABASE pdb1;
Starting backup at 18-OCT-15
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00009 name=/u01/app/oracle/oradata/orcl/pdb1/sysaux01.dbf
input datafile file number=00008 name=/u01/app/oracle/oradata/orcl/pdb1/system01.dbf
channel ORA_DISK_1: starting piece 1 at 18-OCT-15
channel ORA_DISK_1: finished piece 1 at 18-OCT-15
piece handle=/u01/app/oracle/fast_recovery_area/ORCL/1BA9531D0DD53B0EE05348304B74C6C7/backupset/2015_10_18/o1_mf_nnndf_TAG20151018T053410_c25rhv5z_.bkp tag=TAG20151018T053410 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:15
Finished backup at 18-OCT-15
Starting Control File Autobackup at 18-OCT-15
piece handle=/u01/app/oracle/fast_recovery_area/ORCL/autobackup/2015_10_18/o1_mf_n_893396066_c25rjbgf_.bkp comment=NONE
Finished Control File Autobackup at 18-OCT-15

---> backup pluggable database using pluggable database.

[oracle@cdb1 dbs]$ rman target=sys/*****@pdb1

Recovery Manager: Release 12.1.0.2.0 - Production on Sun Oct 18 05:36:30 2015
Copyright (c) 1982, 2014, Oracle and/or its affiliates. All rights reserved.
connected to target database: ORCL (DBID=1413747592, not open)

RMAN> backup database;

Starting backup at 18-OCT-15
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=1 device type=DISK
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00009 name=/u01/app/oracle/oradata/orcl/pdb1/sysaux01.dbf
input datafile file number=00008 name=/u01/app/oracle/oradata/orcl/pdb1/system01.dbf
channel ORA_DISK_1: starting piece 1 at 18-OCT-15
channel ORA_DISK_1: finished piece 1 at 18-OCT-15
piece handle=/u01/app/oracle/fast_recovery_area/ORCL/1BA9531D0DD53B0EE05348304B74C6C7/backupset
/2015_10_18/o1_mf_nnndf_TAG20151018T053658_c25ro2c4_.bkp tag=TAG20151018T053658 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:15
Finished backup at 18-OCT-15
Starting Control File Autobackup at 18-OCT-15
piece handle=/u01/app/oracle/fast_recovery_area/ORCL/autobackup/2015_10_18/o1_mf_n_893396233_c25roksn_.bkp comment=NONE
Finished Control File Autobackup at 18-OCT-15

4) Backup pluggable database tablespace.

RMAN> backup tablespace sysaux,system;

Starting backup at 18-OCT-15
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00009 name=/u01/app/oracle/oradata/orcl/pdb1/sysaux01.dbf
input datafile file number=00008 name=/u01/app/oracle/oradata/orcl/pdb1/system01.dbf
channel ORA_DISK_1: starting piece 1 at 18-OCT-15
channel ORA_DISK_1: finished piece 1 at 18-OCT-15
piece handle=/u01/app/oracle/fast_recovery_area/ORCL/1BA9531D0DD53B0EE05348304B74C6C7/backupset/2015_10_18/o1_mf_nnndf_TAG20151018T053829_c25rqxkt_.bkp tag=TAG20151018T053829 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:15
Finished backup at 18-OCT-15
Starting Control File Autobackup at 18-OCT-15
piece handle=/u01/app/oracle/fast_recovery_area/ORCL/autobackup/2015_10_18/o1_mf_n_893396324_c25rrdt4_.bkp comment=NONE
Finished Control File Autobackup at 18-OCT-15

5) Backup pluggable database datafiles;

SQL> select CON_ID,FILE# from v$datafile;
CON_ID FILE#
---------- ----------
1 1
1 3
1 4
2 5
1 6
2 7
3 8
3 9
8 rows selected.

SQL> select con_id,name from v$containers;
CON_ID NAME
---------- ------------------------------
1 CDB$ROOT
2 PDB$SEED
3 PDB1

-> pdb1 database contain only two files 8 and 9;

RMAN> backup datafile 8,9;

Starting backup at 18-OCT-15
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=1 device type=DISK
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00009 name=/u01/app/oracle/oradata/orcl/pdb1/sysaux01.dbf
input datafile file number=00008 name=/u01/app/oracle/oradata/orcl/pdb1/system01.dbf
channel ORA_DISK_1: starting piece 1 at 18-OCT-15
channel ORA_DISK_1: finished piece 1 at 18-OCT-15
piece handle=/u01/app/oracle/fast_recovery_area/ORCL/1BA9531D0DD53B0EE05348304B74C6C7/backupset/2015_10_18/o1_mf_nnndf_TAG20151018T055231_c25sl7wh_.bkp tag=TAG20151018T055231 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:15
Finished backup at 18-OCT-15
Starting Control File Autobackup at 18-OCT-15
piece handle=/u01/app/oracle/fast_recovery_area/ORCL/autobackup/2015_10_18/o1_mf_n_893397166_c25slq4j_.bkp comment=NONE
Finished Control File Autobackup at 18-OCT-15

                                                      *******END********

Thursday, 10 September 2015

Remote Connection to Pluggable Database 12c

Database details

SQL> select  banner from  v$version;

BANNER
--------------------------------------------------------------------------------
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
PL/SQL Release 12.1.0.2.0 - Production
CORE    12.1.0.2.0      Production
TNS for Linux: Version 12.1.0.2.0 - Production
NLSRTL Version 12.1.0.2.0 - Production

SQL>


pluggable database list 

SQL> select con_id, name from v$containers;

    CON_ID NAME
---------- ------------------------------
         1 CDB$ROOT
         2 PDB$SEED
         3 PDB1

=> I have only one pluggable database PDB1


1) create user(local user) in pluggable database

SQL> show con_id

CON_ID
------------------------------
1
SQL> show user
USER is "SYS"

SQL>  alter pluggable database pdb1 open;

Pluggable database altered.


SQL> alter session set container=pdb1;

Session altered.

SQL> show con_id

CON_ID
------------------------------
3
SQL> show user
USER is "SYS"


SQL> create user local_scott
  2  identified by tiger
  3  CONTAINER=CURRENT;

User created.

SQL> grant connect,resource to local_scott;

Grant succeeded.

2) edit listener file listener.ora (add plugglabe database entry)

/u01/app/oracle/product/12.1.0.2/db_1/network/admin   ---file location

[oracle@cdb1 admin]$ cat listener.ora
# listener.ora Network Configuration File: /u01/app/oracle/product/12.1.0.2/db_1/network/admin/listener.ora
# Generated by Oracle configuration tools.

SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (GLOBAL_DBNAME = cdb1)
      (ORACLE_HOME = /u01/app/oracle/product/12.1.0.2/db_1)
      (SID_NAME = cdb1)
    )
  )
(SID_LIST =
    (SID_DESC =
      (GLOBAL_DBNAME = orcl)
      (ORACLE_HOME = /u01/app/oracle/product/12.1.0.2/db_1)
      (SID_NAME = orcl)
    )
  )
(SID_LIST =
    (SID_DESC =
      (SID_NAME = PDB1)
      (ORACLE_HOME = /u01/app/oracle/product/12.1.0.2/db_1)
    )
)
LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = cdb1.example.com)(PORT = 1521))
    )
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
    )
  )

ADR_BASE_LISTENER = /u01/app/oracle

3)Edit tnsfile  file tnsnames.ora  (add pluggable database entry)

# tnsnames.ora Network Configuration File: /u01/app/oracle/product/12.1.0.2/db_1/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.

CDB1 =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = cdb1.example.com)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = cdb1)
    )
  )

ORCL =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = cdb1.example.com)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = orcl)
    )
  )
PDB1 =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = cdb1.example.com)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = PDB1)
    )
  )

4) check test conectivity

[oracle@cdb1 admin]$ tnsping pdb1

TNS Ping Utility for Linux: Version 12.1.0.2.0 - Production on 11-SEP-2015 06:59:41

Copyright (c) 1997, 2014, Oracle.  All rights reserved.

Used parameter files:


Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = cdb1.example.com)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = PDB1)))
OK (10 msec)

5) connect pluggable database using local user (local_scott)

[oracle@cdb1 admin]$ sqlplus local_scott/tiger@pdb1

SQL*Plus: Release 12.1.0.2.0 Production on Fri Sep 11 07:04:56 2015

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

Last Successful login time: Fri Sep 11 2015 07:04:39 +05:30

Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options

SQL> show con_id

CON_ID
------------------------------
3
SQL> show user;
USER is "LOCAL_SCOTT"
SQL>




















Friday, 24 July 2015

Silent installation of database in 12C

----open folder where you unzip the database software


[oracle@cdb1 ~]$ cd /u01/app/database/
[oracle@cdb1 database]$ ls -ltr
total 36
-rwxr-xr-x.  1 oracle oinstall  500 Feb  7  2013 welcome.html
-rwxr-xr-x.  1 oracle oinstall 8533 Jul  7  2014 runInstaller
drwxr-xr-x.  2 oracle oinstall 4096 Jul  7  2014 rpm
drwxrwxr-x.  2 oracle oinstall 4096 Jul  7  2014 sshsetup
drwxr-xr-x. 14 oracle oinstall 4096 Jul  7  2014 stage
drwxr-xr-x.  4 oracle oinstall 4096 Jul 24 04:20 install
drwxrwxr-x.  2 oracle oinstall 4096 Jul 25 05:48 response

[oracle@cdb1 database]$cd response

[oracle@cdb1 response]$ ls -ltr
total 216
-rwxrwxr-x. 1 oracle oinstall  6038 Jan 24  2014 netca.rsp
-rw-r--r--. 1 oracle oinstall 25036 Jul 24 04:30 RM.rsp
-rw-rw-r--. 1 oracle oinstall 25233 Jul 24 06:09 db_install.rsp
-rwxr-xr-x. 1 oracle oinstall 74822 Jul 25 05:03 rmdbcarsp
-rwxrwxr-x. 1 oracle oinstall 74797 Jul 25 05:48 dbca.rsp

-----for safety make one duplicate copy of original file.

[oracle@cdb1 response]$ cp dbca.rsp rmdbca.rsp
[oracle@cdb1 response]$ ls -ltr
total 292
-rwxrwxr-x. 1 oracle oinstall  6038 Jan 24  2014 netca.rsp
-rw-r--r--. 1 oracle oinstall 25036 Jul 24 04:30 RM.rsp
-rw-rw-r--. 1 oracle oinstall 25233 Jul 24 06:09 db_install.rsp
-rwxr-xr-x. 1 oracle oinstall 74822 Jul 25 05:03 rmdbcarsp
-rwxrwxr-x. 1 oracle oinstall 74797 Jul 25 05:48 dbca.rsp
-rwxr-xr-x. 1 oracle oinstall 74797 Jul 25 06:14 rmdbca.rsp

[oracle@cdb1 response]$

-------edite dbca.rsp file

[oracle@cdb1 response]$ vi dbca.rsp

---------change below parameter in dbca file

RESPONSEFILE_VERSION = "12.1.0"
OPERATION_TYPE = "createDatabase"
GDBNAME = orcl
SID = orcl
CREATEASCONTAINERDATABASE =true
PDBNAME =pdb1
PDBADMINPASSWORD = "Admin"
TEMPLATENAME = "General_Purpose.dbc"
SYSPASSWORD = "Admin"
SYSTEMPASSWORD = "Admin"
SOURCEDB = "orcl.example.com:1521:orcl"
SYSDBAUSERNAME = "sys"
TEMPLATENAME = "My Copy TEMPLATE"

Note:- comment all other unnecessary parameter


[oracle@cdb1 response]$ dbca -silent -responseFile 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
46% complete
47% complete
52% complete
57% complete
58% complete
59% complete
62% complete
Completing Database Creation
66% complete
70% complete
74% complete
85% complete
96% complete
100% complete
Look at the log file "/u01/app/oracle/cfgtoollogs/dbca/orcl/orcl.log" for further details.

[oracle@cdb1 response]$

[oracle@cdb1 response]$ cat /etc/oratab | grep orcl

orcl:/u01/app/oracle/product/12.1.0.2/db_1:N

[oracle@cdb1 response]$ sqlplus

SQL*Plus: Release 12.1.0.2.0 Production on Sat Jul 25 06:03:01 2015

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

Enter user-name: /as sysdba

Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options

SQL> select instance_name from v$instance;

INSTANCE_NAME
----------------
orcl

SQL> SELECT name, open_mode
FROM   v$pdbs
ORDER BY name;

NAME                           OPEN_MODE
------------------------------ ----------
PDB$SEED                       READ ONLY

SQL> CREATE PLUGGABLE DATABASE pdb1 ADMIN USER pdb_adm IDENTIFIED BY Admin
  FILE_NAME_CONVERT=('/u01/app/oracle/oradata/orcl/pdbseed','/u01/app/oracle/oradata/orcl/pdb1/');  2

Pluggable database created.

SQL> COLUMN pdb_name FORMAT A20
SQL> SELECT pdb_name, status
FROM   dba_pdbs
ORDER BY pdb_name;

PDB_NAME             STATUS
-------------------- ---------
PDB$SEED             NORMAL
PDB1                       NEW

SQL> ALTER PLUGGABLE DATABASE pdb1 OPEN READ WRITE;

Pluggable database altered.

SQL> SELECT name, open_mode
FROM   v$pdbs
ORDER BY name;

NAME                           OPEN_MODE
------------------------------ ----------
PDB$SEED                       READ ONLY
PDB1                           READ WRITE

SQL>

                          ----------------END-------------------------

Friday, 17 July 2015

Create 12c database manually using database creation script.


--->OS version:

[root@O12c pfile]# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 5.4 (Tikanga)
[root@O12c pfile]#

--->Database version:

[oracle@O12c ~]$ sqlplus
SQL*Plus: Release 12.1.0.1.0 Production on Sat Jul 18 07:35:10 2015
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Enter user-name: /as sysdba
Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options

--->Create following directory on server and give permission to oracle user and oinstall group.

[root@O12c cdb1]#mkdir -p /u01/app/oracle/admin/orcl/dpdump
[root@O12c cdb1]#mkdir -p /u01/app/oracle/admin/orcl/adump
[root@O12c cdb1]#mkdir -p /u01/app/oracle/admin/orcl/pfile
[root@O12c cdb1]#mkdir -p /u01/app/oracle/oradata/orcl/controlfile
[root@O12c cdb1]#mkdir -p/u01/app/oracle/fast_recovery_area/orcl/controlfile/
[root@O12c cdb1]#chomd 775 /u01/app/oracle/
[root@O12c cdb1]#chown oracle:oinstall /u01/app/oracle/

--->Create pfile(init_orcl.ora) in pfile directory

[root@O12c cdb1]$ cd /u01/app/oracle/admin/orcl/pfile
[root@O12c pfile]$ vi init_orcl.ora
##############################################################################
# Copyright (c) 1991, 2013 by Oracle Corporation
##############################################################################
###########################################
# Cache and I/O
###########################################
db_block_size=8192
###########################################
# Cursors and Library Cache
###########################################
open_cursors=300
###########################################
# Database Identification
###########################################
db_domain=""
db_name="orcl"
###########################################
# File Configuration
###########################################
db_create_file_dest="/u01/app/oracle/oradata"
db_recovery_file_dest="/u01/app/oracle/fast_recovery_area"
db_recovery_file_dest_size=4800m
###########################################
# Miscellaneous
###########################################
compatible=12.1.0.0.0
diagnostic_dest=/u01/app/oracle
###########################################
# Processes and Sessions
###########################################
processes=300
###########################################
# SGA Memory
###########################################
sga_target=1269m
###########################################
# Security and Auditing
###########################################
audit_file_dest="/u01/app/oracle/admin/orcl/adump"
audit_trail=db
remote_login_passwordfile=EXCLUSIVE
###########################################
# Shared Server
###########################################
dispatchers="(PROTOCOL=TCP) (SERVICE=cdb1XDB)"
###########################################
# Sort, Hash Joins, Bitmap Indexes
###########################################
pga_aggregate_target=423m
###########################################
# System Managed Undo and Rollback Segments
###########################################
undo_tablespace=UNDOTBS1
control_files=("/u01/app/oracle/oradata/orcl/controlfile/o1_mf_bsmgyw36_.ctl",
"/u01/app/oracle/fast_recovery_area/orcl/controlfile/o1_mf_bsmgyw7v_.ctl")

--->Set ORACLE_SID variable

[oracle@O12c dbs]$ export ORACLE_SID=orcl
[oracle@O12c dbs]$ echo $ORACLE_SID
orcl
[oracle@O12c dbs]$

--->Create password file

[oracle@O12c dbs]$orapwd file=/u01/app/oracle/product/12.1.0.2/db_1/dbs/orapworcl password=Admin entries=10
[oracle@O12c dbs]$ cd /u01/app/oracle/product/12.1.0.2/db_1/dbs
[oracle@O12c dbs]$ ls -ltr
total 32
-rw-r--r-- 1 oracle oinstall 2992 Feb 3 2012 init.ora
-rw-rw---- 1 oracle oinstall 1544 Jul 6 04:48 hc_cdb1.dat
-rw-r----- 1 oracle oinstall 24 Jul 6 04:48 lkCDB1
-rw-r----- 1 oracle oinstall 7680 Jul 6 04:51 orapwcdb1
-rw-r----- 1 oracle oinstall 3584 Jul 18 07:30 spfilecdb1.ora
-rw-r----- 1 oracle oinstall 7680 Jul 18 08:41 orapworcl

-->Login to database

[oracle@O12c dbs]$ sqlplus
SQL*Plus: Release 12.1.0.1.0 Production on Sat Jul 18 08:46:42 2015
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Enter user-name: /as sysdba
Connected to an idle instance.
SQL> create spfile from pfile='/u01/app/oracle/admin/orcl/pfile/init_orcl.ora';
File created.
SQL> startup nomount;
ORACLE instance started.
Total System Global Area 1336176640 bytes
Fixed Size 2288104 bytes
Variable Size 469763608 bytes
Database Buffers 855638016 bytes
Redo Buffers 8486912 bytes

SQL>@DBcreation.sql;
Database created.

-------->/*Create database script (DBcreation.sql)..
[root@O12c ~]# cd /u01/app/oracle/product/12.1.0.2/db_1/dbs
[root@O12c dbs]# vi DBcreation.sql
CREATE DATABASE orcl
USER SYS IDENTIFIED BY sys_password
USER SYSTEM IDENTIFIED BY system_password
LOGFILE GROUP 1 ('/u01/app/oracle/oradata/orcl/redo01a.log','/u01/app/oracle/oradata/orcl/redo01b.log') SIZE 100M BLOCKSIZE 512,
GROUP 2 ('/u01/app/oracle/oradata/orcl/redo02a.log','/u01/app/oracle/oradata/orcl/redo02b.log') SIZE 100M BLOCKSIZE 512,
GROUP 3 ('/u01/app/oracle/oradata/orcl/redo03a.log','/u01/app/oracle/oradata/orcl/redo03b.log') SIZE 100M BLOCKSIZE 512
MAXLOGHISTORY 1
MAXLOGFILES 16
MAXLOGMEMBERS 3
MAXDATAFILES 1024
CHARACTER SET AL32UTF8
NATIONAL CHARACTER SET AL16UTF16
EXTENT MANAGEMENT LOCAL
DATAFILE '/u01/app/oracle/oradata/orcl/system01.dbf'
SIZE 700M REUSE AUTOEXTEND ON NEXT 10240K MAXSIZE UNLIMITED
SYSAUX DATAFILE '/u01/app/oracle/oradata/orcl/sysaux01.dbf'
SIZE 550M REUSE AUTOEXTEND ON NEXT 10240K MAXSIZE UNLIMITED
DEFAULT TABLESPACE users
DATAFILE '/u01/app/oracle/oradata/orcl/users01.dbf'
SIZE 500M REUSE AUTOEXTEND ON MAXSIZE UNLIMITED
DEFAULT TEMPORARY TABLESPACE tempts1
TEMPFILE '/u01/app/oracle/oradata/orcl/temp01.dbf'
SIZE 20M REUSE AUTOEXTEND ON NEXT 640K MAXSIZE UNLIMITED
UNDO TABLESPACE UNDOTBS1
DATAFILE '/u01/app/oracle/oradata/orcl/undotbs01.dbf'
SIZE 200M REUSE AUTOEXTEND ON NEXT 5120K MAXSIZE UNLIMITED
USER_DATA TABLESPACE usertbs
DATAFILE '/u01/app/oracle/oradata/orcl/usertbs01.dbf'
SIZE 200M REUSE AUTOEXTEND ON MAXSIZE UNLIMITED; */<-----------------------

---> Run below script for build database scripts

SQL>@/u01/app/oracle/product/12.1.0.2/db_1/rdbms/admin/catalog.sql;
(Creates the views of the data dictionary tables, the dynamic performance views,
And public synonyms for many of the views. Grants PUBLIC access to the synonyms)

SQL>@/u01/app/oracle/product/12.1.0.2/db_1/rdbms/admin/catproc.sql;
(Runs all scripts required for or used with PL/SQL.)

SQL> alter user system
2 identified by manager;
User altered.
SQL> alter user system account unlock;
User altered.
SQL>conn system/manager
Connected.
SQL>
SQL>@/u01/app/oracle/product/12.1.0.2/db_1/sqlplus/admin/pupbld.sql;
(Required for SQL*Plus. Enables SQL*Plus to disable commands by user.)

---> Bounce the database

SQL> startup force;
ORACLE instance started.
Total System Global Area 1336176640 bytes
Fixed Size 2288104 bytes
Variable Size 469763608 bytes
Database Buffers 855638016 bytes
Redo Buffers 8486912 bytes
Database mounted.
Database opened.
SQL> select name from v$database;
NAME
---------
ORCL
1 row selected.
SQL> select file_name from dba_data_files;
FILE_NAME
--------------------------------------------------------------------------------
/u01/app/oracle/oradata/orcl/system01.dbf
/u01/app/oracle/oradata/orcl/sysaux01.dbf
/u01/app/oracle/oradata/orcl/undotbs01.dbf
/u01/app/oracle/oradata/orcl/users01.dbf
/u01/app/oracle/oradata/orcl/usertbs01.dbf
5 rows selected.

-->Create extra tablespace..

SQL>CREATE TABLESPACE apps_tbs LOGGING
DATAFILE '/u01/app/oracle/oradata/orcl/apps01.dbf'
SIZE 500M REUSE AUTOEXTEND ON NEXT 1280K MAXSIZE UNLIMITED
EXTENT MANAGEMENT LOCAL;
Tablespace created.

-- Create a tablespace for indexes, separate from user tablespace (optional)
SQL> CREATE TABLESPACE indx_tbs LOGGING
DATAFILE '/u01/app/oracle/oradata/orcl/indx01.dbf'
SIZE 100M REUSE AUTOEXTEND ON NEXT 1280K MAXSIZE UNLIMITED
EXTENT MANAGEMENT LOCAL;
Tablespace created.
SQL> select NAME from v$tablespace;
NAME
------------------------------
SYSTEM
SYSAUX
UNDOTBS1
TEMPTS1
USERS
USERTBS
APPS_TBS
INDX_TBS
8 rows selected.
SQL>
Note:- database is a simple database not container database

Login to the database as user C##GGUSER failed because of error Error while trying to retrieve text for error ORA-01804.

 Error :  2026-09-19 11:28:18  ERROR   OGG-00303  Unable to connect to database using user C##GGUSER@CDB. Ensure that the necessary privileg...