Skip to content

Commit

Permalink
Merge pull request oravirt#126 from Rendanic/prprofile
Browse files Browse the repository at this point in the history
oradb-manage-db: added aliases for lsnrctl to dotprofile
  • Loading branch information
oravirt authored Oct 29, 2018
2 parents f305074 + df1169e commit b9cd14f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
4 changes: 4 additions & 0 deletions roles/oradb-manage-db/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,10 @@
- "dbb='cd $ORACLE_BASE'"
- "talert='tail -500f $ORACLE_BASE/diag/rdbms/$ORA_DB_UNQ_NAME/$ORACLE_SID/trace/alert_$ORACLE_SID.log'"
- "lalert='less $ORACLE_BASE/diag/rdbms/$ORA_DB_UNQ_NAME/$ORACLE_SID/trace/alert_$ORACLE_SID.log'"
- "lsnrstart='lsnrctl start $LSNRNAME'"
- "lsnrstop='lsnrctl stop $LSNRNAME'"
- "lsnrstatus='lsnrctl status $LSNRNAME'"
- "lsnrservice='lsnrctl services $LSNRNAME'"

# db_homes_config:
# 12201-base:
Expand Down
8 changes: 8 additions & 0 deletions roles/oradb-manage-db/templates/dotprofile-db.j2
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,14 @@ get_sid=$(ps -ef | grep "ora_pmon_$ORACLE_DBNAME" |grep -v grep | sed 's/^.*pmon
export ORA_DB_UNQ_NAME={% if dbh.oracle_db_unique_name is defined %}{{ dbh.oracle_db_unique_name }}{% else %}{{ dbh.oracle_db_name }}{% endif %}
export NLS_DATE_FORMAT='YYYY-MM-DD HH24:MI:SS'

{# Remove possible old LSNRNAME from environmet
Maybe we cannot set it because it is not defined for this database...
#}
unset LSNRNAME
{% if dbh.listener_name is defined %}
LSNRNAME={{ dbh.listener_name }}
export LSNRNAME
{% endif %}

{# create environemt variables when rman is configured in oracle_databases #}
{% if dbh.rman_jobs is defined %}
Expand Down

0 comments on commit b9cd14f

Please sign in to comment.