관리-도구
편집 파일: provision.cpython-38.pyc
U -?�fp � @ s� d dl mZ d dl mZ d dl mZ d dlmZ d dlmZ d dlm Z d dlm Z d dlmZ d d lmZ d d lm Z d dlmZ d dlmZ d d lmZ d dlmZ d dlmZ d dlmZ d dlmZ e �d�dd� �Ze�d�dd� �Zdd� Ze�d�dd� �Ze �d�dd� �Ze�d�dd� �Ze�d�dd � �Zd0d"d#�Ze� Ze�d�d$d%� �Z e�d�d&d'� �Z!e �d�d(d)� �Z"e�d�d*d+� �Z#e�d�d,d-� �Z$e�d�d.d/� �Z%d!S )1� )� create_engine)�exc)�inspect)�url)�configure_follower)� create_db)�#drop_all_schema_objects_post_tables)�"drop_all_schema_objects_pre_tables)�drop_db)�follower_url_from_main)�log)�post_configure_engine)�run_reap_dbs)� set_default_schema_on_connection)� stop_test_class_outside_fixtures)�temp_table_keyword_args)�update_db_opts�oraclec C s� |� � ��}|�d| � |�d| � |�d| � |�d|f � |�d| � |�d| � |�d| � |�d| � |�d | � |�d | � W 5 Q R X d S )Nzcreate user %s identified by xez#create user %s_ts1 identified by xez#create user %s_ts2 identified by xezgrant dba to %sz grant unlimited tablespace to %sz$grant unlimited tablespace to %s_ts1z$grant unlimited tablespace to %s_ts2zgrant create table to %szgrant create table to %s_ts1zgrant create table to %s_ts2)�begin�exec_driver_sql��cfg�eng�ident�conn� r �T/opt/hc_python/lib64/python3.8/site-packages/sqlalchemy/dialects/oracle/provision.py�_oracle_create_db s r c C s d| | _ d| | _d S �N�%s_ts1�%s_ts2)�test_schemaZ test_schema_2)�configr r r r �_oracle_configure_follower/ s r# c C s\ z | � d| � t�d|� W dS tjk rV } zt�d|� W Y �dS d }~X Y nX d S )Nzdrop user %s cascadez Reaped db: %sTzcouldn't drop db: %sF)r r �infor � DatabaseError�warning)r Zdbname�errr r r �_ora_drop_ignore5 s r( c C s t |� t || j� d S �N)�_purge_recyclebinr! �r r r r r �'_ora_drop_all_schema_objects_pre_tables? s r, c C s� |� � ��}|j�|d d d �D ]}|�d|d � �� q|j�|| jd d �D ] }|�d| j� d|d � �� qJt|��� D ]}|�d|� �� qxW 5 Q R X d S )Nz drop synonym Zsynonym_name�.zdrop table )r �dialectZ _get_synonymsr r! r Zget_temp_table_names)r r r ZsynZ tmp_tabler r r �(_ora_drop_all_schema_objects_post_tablesE s ��r/ c C s>