Friday, January 13, 2023

How To Create Database Using DBCA in Silent Mode on Linux – 19C

How To Create Database Using DBCA in Silent Mode on Linux – 19C


Prerequisite :

  • Oracle 19c software already install
  • Oracle Environment variable should be set 
  • create database using dbca 
  • create or update listener.ora ,tnsnames.ora 
  • verify database



Command for database create:
-------------------------------------

  1. Login as oracle user 
  2. execute on terminal 

dbca -silent -createDatabase -templateName General_Purpose.dbc -gdbName ddb -sid ddb -sysPassword Rdx@1234567890 -systemPassword Rdx@1234567890 -createAsContainerDatabase false -emConfiguration NONE -datafileDestination /u01/app/oracle/oradata -storageType FS -characterSet AL32UTF8 -totalMemory 2048 -recoveryAreaDestination /u01/app/oracle/fast_recovery_area -sampleSchema true





[oracle@10.1.1.0~]$
[oracle@10.1.1.0~]$
[oracle@10.1.1.0~]$ dbca -silent -createDatabase -templateName General_Purpose.dbc -gdbName ddb -sid ddb -sysPassword Rdx@1234567890 -systemPassword Rdx@1234567890 -createAsContainerDatabase false -emConfiguration NONE -datafileDestination /u01/app/oracle/oradata -storageType FS -characterSet AL32UTF8 -totalMemory 2048 -recoveryAreaDestination /u01/app/oracle/fast_recovery_area -sampleSchema true
Prepare for db operation
10% complete
Copying database files
40% complete
Creating and starting Oracle instance
42% complete
46% complete
50% complete
54% complete
58% complete
60% complete
Completing Database Creation
66% complete
69% complete
70% complete
Executing Post Configuration Actions
100% complete
Database creation complete. For details check the logfiles at:
 /u01/app/oracle/cfgtoollogs/dbca/ddb.
Database Information:
Global Database Name:ddb
System Identifier(SID):ddb
Look at the log file "/u01/app/oracle/cfgtoollogs/dbca/ddb/ddb.log" for further details.
[oracle@10.1.1.0~]$
[oracle@10.1.1.0~]$



[oracle@10.1.1.0~]$ cat /etc/oratab
#



# This file is used by ORACLE utilities.  It is created by root.sh
# and updated by either Database Configuration Assistant while creating
# a database or ASM Configuration Assistant while creating ASM instance.

# A colon, ':', is used as the field terminator.  A new line terminates
# the entry.  Lines beginning with a pound sign, '#', are comments.
#
# Entries are of the form:
#   $ORACLE_SID:$ORACLE_HOME:<N|Y>:
#
# The first and second fields are the system identifier and home
# directory of the database respectively.  The third field indicates
# to the dbstart utility that the database should , "Y", or should not,
# "N", be brought up at system boot time.
#
# Multiple entries with the same $ORACLE_SID are not allowed.
#
#
ddb:/u01/app/oracle/product/19.0/dbhome1:N
[oracle@10.1.1.0~]$
[oracle@10.1.1.0~]$ . oraenv
ORACLE_SID = [india] ? ddb
The Oracle base remains unchanged with value /u01/app/oracle
[oracle@10.1.1.0~]$
[oracle@10.1.1.0~]$ sqlplus "/as sysdba"

SQL*Plus: Release 19.0.0.0.0 - Production on Fri Jan 13 14:19:03 2023
Version 19.3.0.0.0

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


Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0

SQL> select name ,open_mode,database_role from v$database;

NAME      OPEN_MODE            DATABASE_ROLE
--------- -------------------- ----------------
DDB       READ WRITE           PRIMARY

SQL>

Tuesday, December 27, 2022

setup password less connectivity between two Linux server using ssh-keygen

setup password less connectivity between two Linux server  




-bash-4.2$

-bash-4.2$ ssh-keygen

Generating public/private rsa key pair.

Enter file in which to save the key (/var/lib/pgsql/.ssh/id_rsa):

Created directory '/var/lib/pgsql/.ssh'.

Enter passphrase (empty for no passphrase):

Enter same passphrase again:

Your identification has been saved in /var/lib/pgsql/.ssh/id_rsa.

Your public key has been saved in /var/lib/pgsql/.ssh/id_rsa.pub.

The key fingerprint is:

SHA256:XHvRME2FNaXO6wAHk1wjPpjdzHwAJX6RY7yrvSfm7/g postgres@ip-172-31-86-192.ec2.internal

The key's randomart image is:

+---[RSA 2048]----+

|          ++O+.==|

|         B X=Bo..|

|        o @.Bo+  |

|       . . *.=   |

|        S o o.o  |

|           +.  . |

|           o. .  |

|          . ++.  |

|           o+BE  |

+----[SHA256]-----+

-bash-4.2$

-bash-4.2$

-bash-4.2$

-bash-4.2$
-bash-4.2$
-bash-4.2$ ssh-copy-id postgres@172.31.85.11
/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/var/lib/pgsql/.ssh/id_rsa.pub"
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys
postgres@172.31.85.11's password:

Number of key(s) added: 1

Now try logging into the machine, with:   "ssh 'postgres@172.31.85.11'"
and check to make sure that only the key(s) you wanted were added.

-bash-4.2$



try to test the login :


-bash-4.2$ ssh 172.31.85.11
Last login: Tue Dec 27 10:41:27 2022

       __|  __|_  )
       _|  (     /   Amazon Linux 2 AMI
      ___|\___|___|

https://aws.amazon.com/amazon-linux-2/
-bash-4.2$
-bash-4.2$


Wednesday, November 23, 2022

PostgreSQL : How to verify archive mode is enabled or not

 How to verify archive mode is enabled or not



Login to PostgreSQL database with super privilege 


postgres=#

postgres=# show archive_mode;

 archive_mode

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

 off

(1 row)


postgres=#

Monday, August 29, 2022

How to check terraform version using command line

 

Check terraform version using command line :



PS C:\test_terraform> terraform  version

Terraform v1.2.8

on windows_amd64

+ provider registry.terraform.io/hashicorp/aws v4.22.0

PS C:\test_terraform>

PS C:\test_terraform>