Hacked By AnonymousFox

Current Path : /opt/cloudlinux/venv/lib64/python3.11/site-packages/sqlalchemy/dialects/oracle/__pycache__/
Upload File :
Current File : //opt/cloudlinux/venv/lib64/python3.11/site-packages/sqlalchemy/dialects/oracle/__pycache__/provision.cpython-311.pyc

�

�܋f���~�ddlmZddlmZddlmZddlmZddlmZddlm	Z	ddlm
Z
ddlmZdd	lmZdd
lm
Z
ddlmZddlmZdd
lmZejd��d���Zejd��d���Zd�Ze	jd��d���Zejd��d���Zejd��d���Ze��Zejd��d���Ze
jd��d���Ze
jd��d���Zejd��d���ZdS)�)�
create_engine)�exc)�url)�configure_follower)�	create_db)�drop_db)�follower_url_from_main)�log)�post_configure_engine)�run_reap_dbs)�stop_test_class)�temp_table_keyword_args)�update_db_opts�oraclec��|���5}|�d|z��|�d|z��|�d|z��|�d|����|�d|z��|�d|z��|�d|z��ddd��dS#1swxYwYdS)Nzcreate user %s identified by xez#create user %s_ts1 identified by xez#create user %s_ts2 identified by xez
grant dba to z grant unlimited tablespace to %sz$grant unlimited tablespace to %s_ts1z$grant unlimited tablespace to %s_ts2)�connect�execute��cfg�eng�ident�conns    �w/builddir/build/BUILD/cloudlinux-venv-1.0.6/venv/lib64/python3.11/site-packages/sqlalchemy/dialects/oracle/provision.py�_oracle_create_dbrs/��


�����E�$����6��>�?�?�?����:�U�B�C�C�C����:�U�B�C�C�C�����%�%�1�2�2�2����7�%�?�@�@�@����;�e�C�D�D�D����;�e�C�D�D�D�E�E�E�E�E�E�E�E�E�E�E�E����E�E�E�E�E�Es�B)C�C�Cc�.�d|z|_d|z|_dS�N�%s_ts1�%s_ts2)�test_schema�
test_schema_2)�configrs  r�_oracle_configure_followerr"s"��!�E�)�F��#�e�+�F����c���	|�d|z��tjd|��dS#tj$r }tjd|��Yd}~dSd}~wwxYw)Nzdrop user %s cascadez
Reaped db: %sTzcouldn't drop db: %sF)rr
�infor�
DatabaseError�warning)r�dbname�errs   r�_ora_drop_ignorer*%sx������+�f�4�5�5�5����&�)�)�)��t���������*�C�0�0�0��u�u�u�u�u��������s�-1�A �A�A c���|���5}t||��t|d|z��t|d|z��ddd��dS#1swxYwYdSr)rr*rs    r�_oracle_drop_dbr,/s���	�����1�$�	��u�%�%�%���x�%�/�0�0�0���x�%�/�0�0�0�1�1�1�1�1�1�1�1�1�1�1�1����1�1�1�1�1�1s�7A�A� Ac��dS�N�)�db_url�db_optss  r�_oracle_update_db_optsr2<s���Dr#c�.�|���5}|�d��ddd��n#1swxYwYtD]2}	|j}d|_||_�#|jjj$rY�/wxYwt���dS)z�run magic command to get rid of identity sequences

    # https://floo.bar/2019/11/29/drop-the-underlying-sequence-of-an-identity-column/

    zpurge recyclebinN�)�beginr�
_all_conns�
stmtcachesize�dialect�dbapi�InterfaceError�clear)r!�db�clsr�cx_oracle_conn�scs      rr
r
As���
�����)�t����'�(�(�(�)�)�)�)�)�)�)�)�)�)�)����)�)�)�)�%�.�.��	.��-�B�
,-�N�(�+-�N�(�(���z��.�	�	�	��D�	�����������s�7�;�;�A"�"A9�8A9c�P�ddlm}|�|d��d���}dS)Nr4)�event�checkoutc�:�t�|��dSr.)r6�add)�	dbapi_con�
con_record�	con_proxys   rrBz/_oracle_post_configure_engine.<locals>.checkoutbs�����y�!�!�!�!�!r#)�
sqlalchemyrA�listens_for)r�engine�follower_identrArBs     r�_oracle_post_configure_enginerL^sH�� � � � � � �
���v�z�*�*�"�"�+�*�"�"�"r#c���tjd|��t|��}|���5}tjdd�|����|�d��}d�|D��}t
��}|D]�}|�d��s|�d��r�-||vrS|�|��d|z|vr|�d|z��d	|z|vr|�d	|z����d
x}}	t|d��D]\}	}
t||
��r|dz
}�tjd||	��ddd��dS#1swxYwYdS)
Nzdb reaper connecting to %rzidentifiers in file: %sz, z�select u.username from all_users u where username like 'TEST_%' and not exists (select username from v$session where username=u.username)c�:�h|]\}|�����Sr/)�lower)�.0�usernames  r�	<setcomp>z#_reap_oracle_dbs.<locals>.<setcomp>ts$��A�A�A�+�8�X�^�^�%�%�A�A�Ar#�_ts1�_ts2rrr4�z-Dropped %d out of %d stale databases detected)r
r%rr�joinr�set�endswithrD�	enumerater*)r�identsrr�to_reap�	all_names�to_drop�name�dropped�totalrQs           r�_reap_oracle_dbsrags����H�
)�3�/�/�/�
��
�
�C�	�����
�$���*�D�I�I�f�,=�,=�>�>�>��,�,�
8�
�
��
B�A��A�A�A�	��%�%���	1�	1�D��}�}�V�$�$�
1��
�
�f�(=�(=�
1���������D�!�!�!��d�?�i�/�/��K�K��4��0�0�0��d�?�i�/�/��K�K��4��0�0�0�����%�(��!�4�4�	�	�O�E�8���h�/�/�
��1������;�W�e�	
�	
�	
�3
�
�
�
�
�
�
�
�
�
�
�
����
�
�
�
�
�
s�D$E*�*E.�1E.c�J�tj|��}||_d|_|S)N�xe)�sa_url�make_urlrQ�password)rrs  r�_oracle_follower_url_from_mainrg�s$��
�/�#�
�
�C��C�L��C�L��Jr#c��dgdd�S)NzGLOBAL TEMPORARYz
PRESERVE ROWS)�prefixes�oracle_on_commitr/)rrs  r�_oracle_temp_table_keyword_argsrk�s��(�(�+���r#N)�rrrJrrd�testing.provisionrrrr	r
rrr
rr�for_dbrr"r*r,r2rWr6rLrargrkr/r#r�<module>ros���������������#�#�#�#�#�#�3�3�3�3�3�3�*�*�*�*�*�*�(�(�(�(�(�(�7�7�7�7�7�7�$�$�$�$�$�$�6�6�6�6�6�6�-�-�-�-�-�-�0�0�0�0�0�0�8�8�8�8�8�8�/�/�/�/�/�/����(���E�E���E����8�$�$�,�,�%�$�,�
���������	1�	1���	1����x� � �	�	�!� �	�����!�!���"�!��2�S�U�U�
����h�'�'�"�"�(�'�"����X���
�
���
�B���x�(�(���)�(�� ����)�)���*�)���r#

Hacked By AnonymousFox1.0, Coded By AnonymousFox