示例#1
0
 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
示例#2
0
 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
示例#3
0
 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
示例#4
0
 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
示例#5
0
 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)
示例#6
0
 def tab(self, filename: str):
     is_file(filename)
     is_readable(filename)
     self._oratab = to_path(filename)