select

'ALTER TABLE ' || TABLE_NAME || ' ADD ( ' || COLUMN_NAME || '_TMP VARCHAR2(' || DATA_LENGTH || ')); ' ||
'UPDATE ' || TABLE_NAME || ' SET ' || COLUMN_NAME || '_TMP = ' || COLUMN_NAME || '; ' ||
'UPDATE ' || TABLE_NAME || ' SET ' || COLUMN_NAME || ' = NULL; '||
'ALTER TABLE ' || TABLE_NAME || ' MODIFY ( ' || COLUMN_NAME || ' VARCHAR2(' || DATA_LENGTH || ')); ' ||
'UPDATE ' || TABLE_NAME || ' SET ' || COLUMN_NAME || ' = ' || COLUMN_NAME || '_TMP; ' ||
'ALTER TABLE ' || TABLE_NAME || ' DROP COLUMN ' || COLUMN_NAME || '_TMP; ' AS SQL

from all_tab_columns
where data_type like 'NVARCHAR%'
and OWNER = 'LLC'
ORDER BY TABLE_NAME;

에러코드 : 1419

내용 : You do not have the SUPER privilege and binary logging is enabled (You *might* want to use the less safe log_bin_trust_function_creators variable)

대응1 : mysql > SET GLOBAL log_bin_trust_function_creators = ON;

대응2(Google cloud Platform)

콘솔창에서 

gcloud sql instances patch [INSTANCE_NAME] --database-flags log_bin_trust_function_creators=ON 

입력후 엔터

 

 

 
a5m2.mmatsubara.com

+ Recent posts