def rman(self): """ retrieves oracle_home + bin + rman binary :return: a Path object """ binary = self.oracle_home / self.bindir / "rman" is_file(binary) is_executable(binary) return binary
def sqlplus(self): """ retrieves oracle_home + bin + sqlplus binary :return: a Path object """ binary = self.oracle_home / self.bindir / "sqlplus" is_file(binary) is_executable(binary) return binary
def opatch(self): """ retrieves oracle_home + OPatch + opatch binary :return: a Path object """ binary = self.oracle_home / self.opatchdir / "opatch" is_file(binary) is_executable(binary) return binary
def opatchauto(self): """ Retrieves oracle_home + OPatch + opatchauto binary. Apparently 11g does not have an opatchauto binary. :return: a Path object """ if self.major_version >= 12: binary = self.oracle_home / self.opatchdir / "opatchauto" is_file(binary) is_executable(binary) return binary else: return None
def oracle_base(self): if self.major_version == VERSIONS[1]: raise OracleHomeError(VERSIONS[:2]) elif self.major_version in VERSIONS[2:]: ohp_xml = ( self.oracle_home / "inventory" / "ContentsXML" / "oraclehomeproperties.xml" ) is_file(ohp_xml) is_readable(ohp_xml) xpath_ohp_xml = get_tree(ohp_xml).xpath( "//ORACLEHOME_INFO/PROPERTY_LIST/PROPERTY" ) oracle_base = [ item.get("VAL") for item in xpath_ohp_xml if item.get("NAME") == "ORACLE_BASE" ][0] is_dir(oracle_base) is_readable(oracle_base) return to_path(oracle_base)
def tab(self, filename: str): is_file(filename) is_readable(filename) self._oratab = to_path(filename)