只是想知道是否有任何方法可以保护*nix系统中的环境变量,使得它们无法从任何纯文本文件中读取,但在环境中可用.
我知道我们总是可以使用.bashrc/.bash_profile的文件系统级别权限,但如果要完全隐藏某些变量(如数据库密码)呢?
一种方法是将某种程序/ perl脚本编写为:
有没有其他更好,更明显的方法来实现这一目标?
谢谢!
-Gaurav
我需要基于同一(Oracle)模式中的现有表创建一个表。我不想对新表有任何约束,即使原始表可能有一个或多个。
我尝试使用 来从原始表创建新表column.copy(),但由于某种原因,我无法在数据库中创建新表后删除约束。
def clone_table_approach_1(original_table, connection, metadata):
try:
new_table_name = original_table.name + '_sync'
columns = [c.copy() for c in original_table.columns]
new_table = Table(new_table_name, metadata, quote=False, *columns)
# Create table in database
if not new_table.exists():
new_table.create()
else:
raise Exception("New table already exists")
# Remove constraints from new table if any
for constraint in new_table.constraints:
connection.execute(DropConstraint(constraint))
# Return table handle for newly created table
final_cloned_table = Table(new_table, metadata, quote=False)
return final_cloned_table
except:
# Drop if we did create a new …Run Code Online (Sandbox Code Playgroud)