Showing posts with label Oracle DB General. Show all posts
Showing posts with label Oracle DB General. Show all posts

Sunday, January 31, 2021

Oracle DB Archive log mode enable step

 

Check the database version which database version you work

SQL> select banner from v$version;

 

BANNER

--------------------------------------------------------------------------------

Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production

PL/SQL Release 12.2.0.1.0 - Production

CORE     12.2.0.1.0             Production

TNS for Linux: Version 12.2.0.1.0 - Production

NLSRTL Version 12.2.0.1.0 - Production

Step-2: we can check the given below  command that I have checking archive log mode is open or not. I have write given below command and got the output.

SQL> archive log list

Database log mode                No Archive Mode

Automatic archival                  Disabled

Archive destination                /u01/app/oracle/product/12.2.0.1/db_1/dbs/arch

Oldest online log sequence     46

Current log sequence           48

Step-3: check the archive log destination with write the given below command:

SQL> show parameter DB_RECOVERY_FILE_DEST

 

NAME                                                        TYPE VALUE

------------------------------------ ----------- ------------------------------

db_recovery_file_dest                       string

db_recovery_file_dest_size             big integer 0

Step-4:  We are enable oracle database archive mode  and given below following step need to archive log mode enable and open it. It is also recommended before archive log mode is open , it’s better practice take database image backup .  

SQL> shut immediate

Database closed.

Database dismounted.

ORACLE instance shut down.

Step-5: startup database in mount state mode

SQL> startup mount

ORACLE instance started.

 

Total System Global Area 1509949440 bytes

Fixed Size                                8793016 bytes

Variable Size                        570426440 bytes

Database Buffers               922746880 bytes

Redo Buffers                          7983104 bytes

Database mounted.

Step-6: apply command for enable archive log Mode

SQL> alter database archivelog;

 

Database altered.

Ste-7: Apply command Database in open mode

SQL> alter database open;

 

Database altered.

Step-8: Checking database archivelog mode enable

SQL> archive log list

Database log mode                Archive Mode

Automatic archival                  Enabled

Archive destination                /u01/app/oracle/product/12.2.0.1/db_1/dbs/arch

Oldest online log sequence     46

Next log sequence to archive   48

Current log sequence           48

Thursday, January 28, 2021

Oracle db_name vs oracle_unique_name (RAC , data guard and MAA

 


Names Among MAA

Under Oracle Maximum Availability Architecture (MAA), we might be confused about various kinds of name. Here I try to clarify these names by chart and table.

DB_NAME (Enterprise-wide Name)

You must set this parameter for every instance in order to startup the database. If you didn't assign DB_NAME at installation-time, then

DB_NAME = $ORACLE_SID

DB_UNIQUE_NAME (Site-wide Name)

If you didn't assign DB_UNIQUE_NAME in the parameter file at startup-time, then

DB_UNIQUE_NAME = DB_NAME

If you didn't assign SERVICE_NAMES in the parameter file at startup-time, then

SERVICE_NAMES = DB_UNIQUE_NAME

INSTANCE_NAME (Server-wide Name)

If you didn't assign INSTANCE_NAME in the parameter file at startup-time, then

INSTANCE_NAME = $ORACLE_SID

Naming Scope and Default Values

Parameter Name

Name Scope

Default Value

Level

DB_NAME

Enterprise-wide

= $ORACLE_SID
(Installation-time)

Database

DB_UNIQUE_NAME

Site-wide

= DB_NAME
(Startup-time)

Role

SERVICE_NAMES

Site-wide (or Enterprise-wide)

= DB_UNIQUE_NAME
(Startup-time)

Role (or Database)

INSTANCE_NAME

Server-wide

= $ORACLE_SID
(Startup-time)

Instance

$ORACLE_SID

Server-wide

N/A

Instance

The above featured image illustrates you a hierarchy tree for better understanding on the relationship among names. For more details, you may check DB_NAME and DB_UNIQUE_NAME in Oracle documentation.