How to turn on Password Protection for Oracle Database Listener Control (LSNRCTL) Command Line Utility

How to turn on Password Protection for Oracle Database Listener Control (LSNRCTL) Command Line Utility



Step 1:- open administrator cmd
Step 2:- C:\lsnrctl
Step 3:- lsnrctl> change_password
Step 4:- lsnrctl> old password : (keep this blank)
Step 5:- lsnrctl> new password : (set your password here)
Step 6:- lsnrctl> retype new password : (retype your password here)
Step 7:- lsnrctl> save_config 


Step 8:- lsnrctl> exit

Step 9:- Open listener.ora file from ORACLE_HOME\NETWORK\ADMIN\
Step 10:- Add this line - LOCAL_OS_AUTHENTICATION_LISTENER = OFF


step 11:- lsnrctl> stop
step 12:- lsnrctl> start <-- this is required to reload the listener.ora file
step 13:- lsnrctl> exit


Step 14:- from administrator cmd open lsnrctl
Step 15:- lsnrctl>stop
The above command will give an error like
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=B-3)(PORT=1521)))
TNS-01169: The listener has not recognized the password
Step 16:- LSNRCTL>set password unisoft <--- your password set above.
Step 17:- lsnrctl>stop <--- now the command works.

CREATION OF VIRTUAL PRIVATE CATALOG ON RMAN

                             creation of virtual private catalog on RMAN.



Step 1:- create 3 machines in OEL 5 OS with oracle 11g r2 and they should be cross ping to each other

Lnx01.oracle.com -----------------à192.168.100.101
Lnx02.oracle.com-----------------à192.168.100.102
Lnx03.oracle.com-----------------à192.168.100.103

Step 2:- Create database by dbca

Lnx01.oracle.com------------à prod1
Lnx02.oracle.com-----------àprod2
Lnx03.oracle.com-----------àrcdb (Recovery catalog for prod1 & prod 2)

Step 3:- Perform the below steps in rcdb database of lnx03.oracle.com server

$export ORACLE_SID=rcdb
$sqlplus / as sysdba
Sql>create tablespace vpc_ts datafile ‘/u01/app/oradata/vpc_ts01.dbf size 100m;
Sql>create user vpc_owner identified by vpc default tablespace vpc_ts quota unlimited on vpc_ts;
Sql>grant recovery_catalog_owner to vpc_owner;
Sql> exit
$rman catalog vpc_owner/vpc
Rman>create catalog;
Rman>exit

Step 4:- Perform the below steps in rcdb database of lnx03.oracle.com server

We need to create 2 more database users in rcdb which will act as virtual user for prod1 & prod2 databases
Sql>create user vpc_prod1 identified by prod1 default tablespace vpc_ts quota unlimited on vpc_ts;
Sql> create user vpc_prod2 identified by prod2 default tablespace vpc_ts quota unlimited on vpc_ts;

Sql>grant recovery_catalog_owner to vpc_prod1,vpc_prod2;
Step 5:- Create listener.ora and password files in prod1 & prod 2 database server.

[oracle@lnx01.oracle.com admin]$ cat listener.ora
LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.100.101)(PORT = 7777))
      #(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
    )
  )
SID_LIST_LISTENER =
   (SID_LIST=
       (SID_DESC=
           (SID_NAME=prod1)
           (ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1)
       )
   )
ADR_BASE_LISTENER = /u01/app/oracle
:wq
$lsnrctl start LISTENER
create password file
$cd $ORACLE_HOME/dbs
$orapwd file=orapwprod1 password=sys force=y

[oracle@lnx02.oracle.com admin]$ cat listener.ora
LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.100.102)(PORT = 7778))
      #(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
    )
  )
SID_LIST_LISTENER =
   (SID_LIST=
       (SID_DESC=
           (SID_NAME=prod2)
           (ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1)
       )
   )
ADR_BASE_LISTENER = /u01/app/oracle
:wq
$lsnrctl start LISTENER
create password file
$cd $ORACLE_HOME/dbs
$orapwd file=orapwprod2 password=sys force=y


Step 6:- Create tnsnames.ora & password file in rcdb(catalog) database side


[oracle@lnx03.oracle.com admin]$ cat tnsnames.ora
# tnsnames.ora Network Configuration File: /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.

TO_PROD1 =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST=192.168.100.101database)(PORT = 7777))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = prod1)
    )
  )

TO_PROD2 =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.100.102)(PORT = 7777))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = prod2)
    )
  )

:wq
$tnsping to_prod1
$tnsping to_prod2

Step 7:-Perform the below task in lnx03.oracle.com
Now register both prod1 & prod2 databases to the recovery catalog using vpc_owner.
$rman catalog vpc_owner/vpc target sys/sys@to_prod1
Rman>register database;
Rman> exit
$rman catalog vpc_owner/vpc target sys/sys@to_prod2
Rman>register database;
Rman>exit

Step 8:- Perform the below task in lnx03.oracle.com
 We need to grant privileges to vpc_prod1 & vpc_prod2 to access rman metadata
$rman catalog vpc_owner/vpc
Rman>grant catalog for database prod1 to vpc_prod1;
Rman>exit
$rman catalog vpc_owner/vpc
Rman>grant catalog for database prod2 to vpc_prod2;
Rman>exit;
Step 9:- Perform the below task in lnx03.oracle.com
We need to connect our target database with the newly created users and create virtual catalog ,sothat they can only access RMAN metadata stored

$rman catalog vpc_prod1/prod1@to_prod1
Rman>create virtual catalog;
Rman> exit;
$ rman catalog vpc_prod2/prod2@to_prod2
Rman>create virtual catalog;
Rman> exit;
$sqlplus vpc_prod1/prod1@to_prod1
Sql>select * from tab;
Sql>select * from rc_database;
Sql>exit
$sqlplus vpc_prod2/prod2@to_prod2
Sql>select * from tab;
Sql>select * from rc_database;
Sql>exit
$sqlplus vpc_owner/vpc
Sql>select * from tab;
Sql>select * from rc_database;

Step 10:- Perform the below steps in lnx01.oracle.com (optional)

We can also grant the user the ability to register new target databases in the recovery catalog .Suppose on lnx01.oracle.com server ,you have one database called orcl1 and you want to register it with your virtual private catalog then you need one more privilege granted to you
$rman catalog vpc_owner/vpc
Rman>grant register database to vpc_prod1;
Rman>exit
$rman target sys/sys@orcl1 catalog vpc_prod1/prod1@to_prod1
Rman> register database;